MATLAB代码计算两个图像的水平和垂直偏移量
这是我的代码。接下来我该怎么办?如何计算两个图像的水平和垂直偏移量? (i3和i4是移位的图像)
I1 = imread('cameraman.tif');
I3 = I1(65:196, 65:196);
I4 = I1(75:206,65:196);
F3 = fft2(I3);
F4 = fft2(I4);
FF = conj(F3).* F4;
Is = ifft2(FF);
figure, mesh(fftshift(Is))
Here is my code. What should I do next? How can I calculate horizontal and vertical offset amount of two images? (I3 and I4 are shifted images)
I1 = imread('cameraman.tif');
I3 = I1(65:196, 65:196);
I4 = I1(75:206,65:196);
F3 = fft2(I3);
F4 = fft2(I4);
FF = conj(F3).* F4;
Is = ifft2(FF);
figure, mesh(fftshift(Is))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您尝试使用
fft
有效地实现互相关时,要获得一些直觉,最好在空间域中进行。基本上,跨相关性与2D支撑的原点相对的位置是2个图像之间的移位。
While you tried to implement cross correlation efficiently using
fft
, to gain some intuition it would be better to do it in spatial domain.Basically the location of the peak of the cross correlation relatively to the origin of the 2D support is the shift between the 2 images.