Reading a RAW file from a hyperspectral camera using ENVI information

66 visualizaciones (últimos 30 días)
I have captured and stored data that comes from a hyperspectral camera. This results in 2 files:
I use the function read_envihdr to load ''example_file.hdr'':
>> read_envihdr('example_file.hdr')
ans =
struct with fields:
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?

Respuestas (1)

Subhadeep Koley
Subhadeep Koley el 11 de Jun. de 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 comentarios
Emma Stewart
Emma Stewart el 5 de Mayo de 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:
any idea thanks a ton

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by