spectralpython / spectral

Python module for hyperspectral image processing
MIT License
563 stars 138 forks source link

.bin format for ENVI files #134

Closed remivanbel closed 2 years ago

remivanbel commented 2 years ago

Would it be possible to include '.bin' extension to the ´KNOWN_EXTS`? (https://github.com/spectralpython/spectral/blob/2606503b51771af0a708fc2977981e0db9ba5de8/spectral/io/envi.py#L45)

I think this would allow using open_image() for reading the files from following dataset: https://cloud.cs.uni-tuebingen.de/index.php/s/nWKxxtN5wM9fz5E?path=%2F

The current solution as given by the authors of this dataset is: https://github.com/cogsys-tuebingen/deephs_fruit/blob/master/core/spectral_io.py

tboggs commented 2 years ago

I can add that to the list of known extensions. But in the mean time, you should be able to open the images like this:

img = spectral.envi.open('some-image.hdr', image='some-image.bin')
remivanbel commented 2 years ago

Thanks!