hexiao0275 / S2ADet

[TGRS 2023] The official repo for the paper "Object Detection in Hyperspectral Image via Unified Spectral-Spatial Feature Aggregation".
GNU Affero General Public License v3.0
27 stars 6 forks source link

How to process the raw data? #4

Closed lzm2275965881 closed 6 months ago

lzm2275965881 commented 11 months ago

Why the raw data's shape is 2048×1024×3 (e.g. 0001.png),How can I get the hyperspectral shape like: 512×256×16. In other words, I want to transfer the 0001.png to 0001.tiff, I want to get the image that have 16 channels. How can I get it?😂

hexiao0275 commented 11 months ago

Hello!

SA images select 3 bands using the method described in reference [51], and then map them using color mapping to generate an RGB image without the need for an actual RGB image. If you have experience with using ENVI software to read hyperspectral image data, you might better understand this process; I couldn't find the code for the preprocessing part due to changing my computer. However, the preprocessing process is quite simple. I chose the two simplest methods, such as the ONR algorithm, which are available on GitHub. You can explore other methods; the results will probably be better (lol).

lzm2275965881 commented 11 months ago

Hello!

SA images select 3 bands using the method described in reference [51], and then map them using color mapping to generate an RGB image without the need for an actual RGB image. If you have experience with using ENVI software to read hyperspectral image data, you might better understand this process; I couldn't find the code for the preprocessing part due to changing my computer. However, the preprocessing process is quite simple. I chose the two simplest methods, such as the ONR algorithm, which are available on GitHub. You can explore other methods; the results will probably be better (lol).

Thanks for your answer. But I still have some question. The raw_his_data.zip contains 2308 .png files. Do every single png file represent a whole hyperspectral image (contains 16 spectrum bands) ? Do a single SE images select 3 bands from a single png file? I have used the HOD_1 data set that have 96 bands to do some experiments. So forgive me if I'm confused that your data isn't formatted the same way it is :)

eqwrqwrqr commented 10 months ago

没有在github找到ONR算法代码

eqwrqwrqr commented 10 months ago

想要预处理代码

hexiao0275 commented 10 months ago

想要预处理代码 See it

  1. I uploaded the code sa_se_image_generate.zip for data preprocessing, for the sake of experimental fairness, the bandselect method (ONR) used is a parameter-free method, link to the paper in reference [51]: https://github.com/tanmlh/Optimal- Neighboring-Reconstruction-for-Hyperspectral-Band-Selection;
  2. There are many ways to do principal component analysis, I used one of the simplest methods available on github, you can look for other methods, the probability of results may be better .
hexiao0275 commented 10 months ago

Hello! SA images select 3 bands using the method described in reference [51], and then map them using color mapping to generate an RGB image without the need for an actual RGB image. If you have experience with using ENVI software to read hyperspectral image data, you might better understand this process; I couldn't find the code for the preprocessing part due to changing my computer. However, the preprocessing process is quite simple. I chose the two simplest methods, such as the ONR algorithm, which are available on GitHub. You can explore other methods; the results will probably be better (lol).

Thanks for your answer. But I still have some question. The raw_his_data.zip contains 2308 .png files. Do every single png file represent a whole hyperspectral image (contains 16 spectrum bands) ? Do a single SE images select 3 bands from a single png file? I have used the HOD_1 data set that have 96 bands to do some experiments. So forgive me if I'm confused that your data isn't formatted the same way it is :)

Your understanding is correct, each png file represents an entire hyperspectral image (containing 16 spectral bands), and the individual SE images are selected from the bands with 3 bands as input.

EmmaVanPuyenbr commented 7 months ago

So do I understand it correctly that you read in the hypercube with 16 wavebands and then create an RGB image with ONR and a IR image or SE image with 3 bands using PCA? Because in the dataset.py you use two times cv2.imread?

hexiao0275 commented 6 months ago

So do I understand it correctly that you read in the hypercube with 16 wavebands and then create an RGB image with ONR and a IR image or SE image with 3 bands using PCA? Because in the dataset.py you use two times cv2.imread?

Yes, your understanding is accurate.