Reading a RAW file from a hyperspectral camera using ENVI information

조회 수: 21 (최근 30일)
Henk-Jan Ramaker
Henk-Jan Ramaker 2021년 6월 10일
댓글: sravan kumar sikhakolli 2022년 12월 27일
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?

답변 (1개)

Subhadeep Koley
Subhadeep Koley 2021년 6월 11일
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
Emma Stewart
Emma Stewart 2022년 5월 5일
@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 2022년 12월 27일
i am still not able to read this together

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Display Point Clouds에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by