フィルターのクリア

how to write the code for dividing pixel values of an image with the mean pixel value?

3 ビュー (過去 30 日間)
ALINA
ALINA 2014 年 2 月 3 日
コメント済み: ALINA 2014 年 2 月 3 日
Hello Sir, This is the code i have written.I have the global mean of the entire image(hyperspectral image).How can i write the code to divide each pixel of the image with the global mean value.
X=multibandread('subset.dat',[215,151,155],'int16',0,'bil','ieee-le,{'Band','Range',[1 5 151]});
S=decorrstretch(X);
spectrum=S(100,50,:);
band=size(spectrum);
band=band(3);
for n=0:(band-1)
x(n+1)=(n*5)+1;
y(n+1)=spectrum(1,1,n+1);
end
plot(x,y);
xlabel('band no.');
ylabel('reflectance');
mean_band=zeros(155,1);
for i=1:155
mean_band(i,1)=mean(mean(i));
end
global_mean=mean(mean_band)

回答 (1 件)

Jan
Jan 2014 年 2 月 3 日
To scale each pixel vector in hyperspectral image X with the global data mean simply do
X = X ./ mean( X(:) );

カテゴリ

Help Center および File ExchangeHyperspectral Image Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by