%不变矩
f=imread('Original_Padded.tif');
subplot(3,2,1),imshow(f);title('原图像');
fp=padarray(f,[84,84],'both');%填充图像
subplot(3,2,2),imshow(fp);title('经填充后的图像');
fhs=f(1:2:end,1:2:end);%获得半打图像
fhsp=padarray(fhs,[184 184],'both');%填充图像
subplot(3,2,3),imshow(fhsp);title('半大图像');
fm=fliplr(f);%镜像图像
fmp=padarray(fm,[84 84],'both');%填充图像
subplot(3,2,4),imshow(fmp);title('镜像图像');
fr2=imrotate(f,2,'bilinear');%线性插值旋转图像
fr2p=padarray(fr2,[76 76],'both');%填充图像
subplot(3,2,5),imshow(fr2p);title('旋转2°的图像');
fr45=imrotate(f,45,'bilinear');%旋转图像
subplot(3,2,6),imshow(fr45);title('旋转45°的图像');
%获得5幅图像的7个不变矩
phiorig=abs(log(invmoments(f)))
phihalf=abs(log(invmoments(fhs)))
phimirror=abs(log(invmoments(fm)))
phirots2=abs(log(invmoments(fr2)))
phirot45=abs(log(invmoments(fr45)))
不变矩
最新推荐文章于 2022-11-14 20:53:52 发布