[英]How to use warpPerspective for a single coordinate of Mat
I successfully found the homography matrix between 2 images using: 我使用以下方法成功找到了2张图像之间的单应矩阵:
Mat H = findHomography(mpts_2, mpts_1, RANSAC, 1, outlier_mask);
Now, with the given Mat HI wan't to find the transformation for the four corner points of an image. 现在,对于给定的Mat HI,您将无法找到图像四个角点的变换。 So how can I get the transformation for these points using warpPerspective()?!?
那么如何使用warpPerspective()获得这些点的转换?! Or do I have to use the transform() function?
还是我必须使用transform()函数?
I need the transformation of this points to get the intersection of the warped image with the original image. 我需要对这些点进行转换,以获取变形图像与原始图像的交集。 Thanks in advance for you efforts...
预先感谢您的努力...
I think you are interested in perspectiveTransform(...)
. 我认为您对
perspectiveTransform(...)
感兴趣。 It is analogous to warpPerspective(...)
only it operates on vectors, not on an entire image. 它类似于
warpPerspective(...)
仅对矢量warpPerspective(...)
,而不对整个图像warpPerspective(...)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.