【问题标题】:Matlab - how to calculate image pixels shiftMatlab - 如何计算图像像素偏移
【发布时间】:2022-01-07 23:31:24
【问题描述】:

在 Matlab 中,我有两张相似的图像,但一张与另一张相比有像素偏移。如何计算轴 x 和 y 的偏移量(像素数量)?

Image Center

Image Shift

【问题讨论】:

  • 找到二维卷积的最大值可能是最简单的方法。

标签: matlab image-processing matrix image-registration


【解决方案1】:

一般问题称为图像配准。您可以使用互相关来查找亚像素图像配准,例如通过文件交换上的函数dftregistration

通过指定上采样参数10来注册0.1像素内的两个图像A和B

A=(imread("img1.png"));
B=(imread("img2.png"));

upsamplingfactor = 10;
output  = dftregistration(fft2(A),fft2(B),upsamplingfactor );
disp(output),

0.2584    0.0000   75.5000  -85.5000

我们得到的图像偏移了 y=75.5 和 x=-85.5 像素,不确定性为 0.258 像素。如果您之前处理图像以通过应用阈值或模糊来减少噪点,这会变得更准确)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-31
    • 2012-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-20
    相关资源
    最近更新 更多