让img1
和img2
代表两个尺寸相同的图像;并令 v = (tx,ty)
为表示 img1
向 img2
移动(平移)的向量。
如何使用 interp2()
将 img2
扭曲到 img1
?
最佳答案
定义为其定义图像的网格
>> sz = size(img1);
>> [y x] = ndgrid( 1:sz(1), 1:sz(2) );
使用网格定义插值
>> timg2 = interp( x, y, img2, x + tx, y + ty );
附注,
您可能需要查看 tformarray
来执行相同的操作。
关于image - Matlab图像插值interp2(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8841766/