How to create an average spectrum from several points in hyperspectral image

1 vue (au cours des 30 derniers jours)
hyperfool
hyperfool le 9 Juin 2014
I am doing analysis of hyperspectral images, and I want to make a plot of an average spectrum from my image. I have data from several points (ideally I want 20 points), and want to calculate the average spectrum. I use impoint and getPosition to store coordinates, like this:
s1 = impoint;
s1_pos = floor(getPosition(s1));
s2 = impoint;
s2_pos = floor(getPosition(s2));
s3 = impoint;
s3_pos = floor(getPosition(s3));
and then I get the spectrums from each point like this:
d1 = squeeze(img(:,s1_pos(1),s1_pos(2)));
d2 = squeeze(img(:,s2_pos(1),s2_pos(2)));
d3 = squeeze(img(:,s3_pos(1),s3_pos(2)));
This is all reflectance data and I want to plot it against wavelength.

Réponses (1)

Image Analyst
Image Analyst le 9 Juin 2014
So what's the problem? Just sum up, divide by 3 and call plot().
meanSpectrum = (d1+d2+d3)/3;
plot(meanSpectrum);

Catégories

En savoir plus sur Hyperspectral Image Processing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by