How to take the mean of hyperspectral image of size (1312*959*31) and plot its spectrum in matlab 7.0 after masking the specific part ?
Show older comments
S=load('Daylight_Scene_06.mat');
image1=S.tensor;
image1=S.tensor(:,:,1); %S.tensor(:,:,k) k wavelengths
imshow(image1);
%BW=roipoly;
BW = roipoly(image1);
r=zeros(1312,959);
for i=1:1312;
for j=1:959;
if BW(i,j)==1
r(i,j)=image1(i,j);
%r2(i,j)=image2(i,j);
end
end
end
imshow(r);
image2=S.tensor;
image2=S.tensor(:,:,2); %S.tensor(:,:,k) k wavelengths
imshow(image2);
%BW=roipoly;
BW = roipoly(image2);
r1=zeros(1312,959);
for i=1:1312;
for j=1:959;
if BW(i,j)==1
r1(i,j)=image2(i,j);
%r2(i,j)=image2(i,j);
end
end
end
imshow(r1);
Accepted Answer
More Answers (0)
Categories
Find more on Lidar Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!