spectral plot of hyperspectral image

1 次查看(过去 30 天)
ALINA
ALINA 2014-1-22
回答: Parth Parikh 2022-11-30
Hi sir, This is the code i wrote X=multibandread('EO1H1460512012064110KZ_L1T.dat',[3481,1091,155],'int16',0,'bil','ieee-le',{'Band','Direct',[54,29,16]}); S=decorrstretch(X); spectrum=S(2000,500,:); band=size(spectrum); band=band(3); for n=0:(band-1) x(n+1)=(n*5)+1; y(n+1)=spectrum(1,1,n+1); end plot(x,y) xlabel('band no.'); ylabel('reflectance');
But sir,can you help me with this code so that i get a proper spectral plot.

回答(1 个)

Parth Parikh
Parth Parikh 2022-11-30
Hi Alina,
I guess you would like to extract the spectral information from the hyperspectral data at location [2000,500]. In that case you should use multibandread something like this:
X=multibandread('EO1H1460512012064110KZ_L1T.dat',[3481,1091,155],'int16',0,'bil','ieee-le',{'Band','Direct',[1:155]});
S=decorrstretch(X);
spectrum=squeeze(S(2000,500,:));
plot(spectrum);
Simpler way I would suggest is:
hcube = hypercube('EO1H1460512012064110KZ_L1T.dat');
S = decorrstretch(hcube.DataCube);
spectrum = squeeze(S(2000,500,:));
plot(spectrum);
For more details take a look at this documentation: Read hyperspectral data - MATLAB (mathworks.com)
Hope it helps !

类别

Help CenterFile Exchange 中查找有关 Hyperspectral Image Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by