From: megha bhatt on
I have a Hyperspectral image with dimension (5001, 257,64), It means 5001 samples, 257 lines and 64 bands. I want to create a ROI from the image and want to find the mean spectrum from this ROI. I have approached as below:
imshow(img.rad(:,:,50),'Border','tight','DisplayRange',[img.mindrange,img.maxdrange],'XData', img.xlims,'YData',img.ylims);
axis on
axis xy
h_img = imfreehand(gca);
BW = createMask(h_img);
[row,col] = find(BW==1);
Now I have the row and columns indexes which are within the mask but now I am not getting how to get mean spectra.

Thanks,
Megha
From: megha bhatt on
"megha bhatt" <mubhatt19(a)yahoo.co.in> wrote in message <htuh9l$omc$1(a)fred.mathworks.com>...
> I have a Hyperspectral image with dimension (5001, 257,64), It means 5001 samples, 257 lines and 64 bands. I want to create a ROI from the image and want to find the mean spectrum from this ROI. I have approached as below:
> imshow(img.rad(:,:,50),'Border','tight','DisplayRange',[img.mindrange,img.maxdrange],'XData', img.xlims,'YData',img.ylims);
> axis on
> axis xy
> h_img = imfreehand(gca);
> BW = createMask(h_img);
> [row,col] = find(BW==1);
> Now I have the row and columns indexes which are within the mask but now I am not getting how to get mean spectra.
>
> Thanks,
> Megha

I am still waiting for your suggestions and help....
From: ImageAnalyst on
Just get a logical image of your ROI and get the mean of each band -
that's one way to do it

for k = 1:64
bandKImage = fullSpectralImage(:,:,k);
meanOfBandK(k) = mean(bandKImage(logicalMask));
end