|
哎,不好好学习matlab的后果很严重啊。弄了个20个波段的图像,想分析OIF指数,网上看到了一个代码,但是怎么运行都不行。不知道是什么回事。希望各位大哥大姐可以帮帮小妹!!叩谢叩谢!!
clear;
multBand = imread('nj.tif');
% 组合数
n = 3;
% 波段数
band = size(multBand);
combin = combntns(1:band(3),n);
sizeCombin = size(combin);
OIF = zeros(sizeCombin(1),sizeCombin(2)+1);
OIF(:,1:end-1) = combin;
for row = 1:sizeCombin(1)
bands = multBand(:,:,combin(row,:));
STDS = 0;
for b = 1:n
STDS = STDS + std2(bands(:,:,b));
end
CORRS = 0;
for b1=1:n
for b2=2:n
if b2>b1
CORRS = CORRS + abs(corr2(bands(:,:,b1),bands(:,:,b2)));
end
end
end
bandOIF = STDS/CORRS;
OIF(row,end) = bandOIF;
end
% s = size(multBand);
% n = s(3);
% bandinfo = zeros(n,3);
% for b = 1:n
% band = multBand(:,:,b);
% bandinfo(b,:) = [b max(band(:)) min(band(:))];
% end
希望知道怎么在matlab2010中运行的大侠们可以联系我!!!!469430545!!!
|
|