Reading a RAW file from a hyperspectral camera using ENVI information

66 vues (au cours des 30 derniers jours)
Henk-Jan Ramaker
Henk-Jan Ramaker le 10 Juin 2021
I have captured and stored data that comes from a hyperspectral camera. This results in 2 files:
''example_file.raw''
''example_file.hdr''
I use the function read_envihdr to load ''example_file.hdr'':
example_file.hdr
>> read_envihdr('example_file.hdr')
ans =
struct with fields:
CONTENT: 'ENVI'
file_type: 'ENVI Standard'
sensor_type: 'MONARCH'
wavelength_units: 'nm'
data_type: 12
interleave: 'BSQ'
byte_order: 0
bit_depth: 10
header_offset: 0
wavelength: {10×1 cell}
gain: {10×1 cell}
exposure_time: {10×1 cell}
exposure_type: '{↵radiometric-calibration↵}'
default_bands: {[713]}
lines: 1024
samples: 1280
bands: 10
size: [1024 1280 10]
machine: 'ieee-le'
iscomplex: 0
format: 'uint16'
>>
Now, I don't have much experience reading hyperspectral data. But what I understand so far is that the ENVI standard is more or less required (or at least very handy) to load the *.raw file. Can anybody give me a hint how to proceed further to read the *.raw file now that I have the ENVI standard information available?

Réponses (1)

Subhadeep Koley
Subhadeep Koley le 11 Juin 2021
You can use the enviinfo(__) function to read metadata from your ENVI header file (.hdr file), and then you can use multibandread(_) to read the binary .raw file.
% Read ENVI header file
info = enviinfo('example_file.hdr');
% Read the .raw data file
data = multibandread('example_file.raw',[info.Height, info.Width, info.Bands],...
info.DataType, info.HeaderOffset, info.Interleave, info.ByteOrder);
NOTE: The above mentioned fetures (e.g. enviinfo(_)) come under Image Processing Toolbox's Hyperspectral Imaging Library support package, and can be downloaded from here.
For more information on Hyperspectral Imaging Library see the documentation.
  2 commentaires
Emma Stewart
Emma Stewart le 5 Mai 2022
@Subhadeep Koley why this file is not readable with above code? this code is not working here
The HSI file size is bigger than 5 MB (Matlab attachment limit), so i have uploaded the file on drive Link to access image file: https://drive.google.com/drive/folders/1GTSkQMog4EvffH_geeKJun0oX6BCh5zo?usp=sharing
any idea thanks a ton
Emma
sravan kumar sikhakolli
sravan kumar sikhakolli le 27 Déc 2022
i am still not able to read this together

Connectez-vous pour commenter.

Catégories

En savoir plus sur Hyperspectral Image Processing dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by