我有一个6波段的多光谱图像。多光谱图像的Píxel循环
imagen1=imread('re_2008.tif')
size2=size(imagen1);
nrow= size2(1);
ncol= size2(2);
nband= size2(3);
我想要做的就是让他们的价值每一个波段的每一个像素(在相同的位置),做插值,并与位于其他波长的新的价值,取代它。如果我向你展示代码,也许你会更了解我。
imagen3_2 = zeros(nrow, ncol, nband);
var1= [1 2 3 4 5 6]'; %'
for row=1:nrow;
for column=1:ncol;
for band=1:nband;
v = imagen1(nrow(1),nband(2),:); v = v(:);
t= 0:100;
interplan= interp1(var1, v, t,'cubic');
y5 = interplan(5); % I get the value of the interpolation on this position
y12 = interplan(12);
y20 = interplan(20);
y50 = interplan(50);
y80 = interplan(80);
y90 = interplan(90);
imagen3_2(:,:,1)= (y5); % and I replace it
imagen3_2(:,:,2)= (y12);
imagen3_2(:,:,3)= (y20);
imagen3_2(:,:,4)= (y50);
imagen3_2(:,:,5)= (y80);
imagen3_2(:,:,6)= (y90);
end
end
end
我得到与结果相同的值,而不是每个像素。
由于提前,
你又帮了我很多谢,非常感谢你! :) – user1578688 2013-02-13 09:20:57