How to create an average spectrum from several points in hyperspectral image
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Image Analyst
2014년 6월 9일
So what's the problem? Just sum up, divide by 3 and call plot().
meanSpectrum = (d1+d2+d3)/3;
plot(meanSpectrum);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Hyperspectral Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!