MATLAB代码计算两个图像的水平和垂直偏移量

发布于 2025-01-30 10:34:50 字数 427 浏览 3 评论 0原文

这是我的代码。接下来我该怎么办?如何计算两个图像的水平和垂直偏移量? (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))

and here is my output
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风苍溪 2025-02-06 10:34:50

当您尝试使用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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文