How to create an average spectrum from several points in hyperspectral image
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposte (1)
Image Analyst
il 9 Giu 2014
So what's the problem? Just sum up, divide by 3 and call plot().
meanSpectrum = (d1+d2+d3)/3;
plot(meanSpectrum);
0 Commenti
Vedere anche
Categorie
Scopri di più su Hyperspectral Image Processing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!