使用单应性快速提取补丁
假设您有一个与两个不同图像 Ir 和 I 中描绘的平面相关的单应性 H。Ir 是参考图像,其中平面与图像平面平行(并且实际上占据整个图像)。 I 是运行时图像(在任意视点拍摄的平面照片)。设 H 为:
p = Hp',其中 p 是 Ir 中的点,p' 是 I 中的对应点。
假设有两个点 p1=(x1,y) 和 p2=(x2,y),其中 x1 < x2,相对于图像 Ir。请注意,它们属于同一行(公共 y)。设H'=H^(-1)。使用 H',您可以计算以下点在 I 中的对应点:(x1,y),(x1+1,y),...,(x2,y)。
问题是:有没有办法避免矩阵向量乘法来计算所有这些点?我想到的最简单的方法是使用单应性来计算 p1 和 p2 的对应点(称它们为 p1' 和 p2')。为了获得其他的(即:(x1+1,y), (x1+2,y),...,(x2-1, y)),在图像 I 中线性插值 p1' 和 p2'。
但是由于 Ir 和 I 之间存在射影变换,我认为这种方法相当不精确。
还有其他想法吗?这个问题与以下事实有关:我需要一种计算有效的方法来在实时软件中提取 Ir 中 p 点周围的大量(小)补丁(大约 10x10 像素)。
谢谢。
诗。 也许我使用小补丁的事实会使使用线性插值成为一种合适的方法?
Suppose you have an homography H relating a planar surface depicted in two different images, Ir and I. Ir is the reference image, where the planar surface is parallel to the image plane (and practically occupy the entire image). I is a run-time image (a photo of the planar surface taken at an arbitrary viewpoint). Let H be such that:
p = Hp', where p is a point in Ir and p' is the corresponding point in I.
Suppose you have two points p1=(x1,y) and p2=(x2,y), with x1 < x2, relative to the image Ir. Note that they belong to the same row (common y). Let H'=H^(-1). Using H', you can compute the corresponding points in I of the following points: (x1,y),(x1+1,y),...,(x2,y).
The question is: is there a way to avoid the matrix-vector multiplication to compute all those points? The easiest way that comes to me is to use the homography to compute the corresponding point of p1 and p2 (call them p1' and p2'). To obtain the others (that is: (x1+1,y), (x1+2,y),...,(x2-1, y)), linear interpolate p1' and p2' in the image I.
But since there is a projective transformation between Ir and I, i think that this method is quite imprecise.
Any other idea? This question is relative to the fact that i need a computational efficient way to extract a lot of (small) patches (of around 10x10 pixels) around a point p in Ir in a real-time software.
Thank you.
Ps.
Maybe the fact that i am using smal patches would make using linear interpolation a suitable approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有一个投影变换,不幸的是,在这种类型的变换下长度比率不是不变的。
我的建议:探索交叉比率,因为它在投影变换下是不变的。我认为对于每 3 个点,您可以获得“更便宜”的第 4 个点,避免矩阵向量计算并使用交叉比。但我还没有把所有的东西都写在纸上来验证交叉比替代方案是否比矩阵向量乘法“计算成本更便宜”。
You have a projective transform and, unfortunately, ratio of lengths are not invariant under this type of transformation.
My suggestion: explore the cross ratio because it is invariant under projective transformations. I think that for each 3 points you can get a "cheaper" 4th, avoiding the matrix-vector computation and using the cross ratio instead. But I have not put all the stuff in paper to verify if the cross ratio alternative is that much "computationally cheaper" than the matrix-vector multiplication.