如何判断单应性矩阵是否可以接受? [英] How can you tell if a homography matrix is acceptable or not?
问题描述
当使用OpenCV的 findHomography
函数估计两组点之间的单应性时,从不同的图像,你有时会得到一个坏的单应性由于离群值在你的输入点,即使你使用RANSAC或LMEDS。
// opencv java示例:
Mat H = Calib3d.findHomography ,dst_points,Calib3d.RANSAC,10);
如何判断产生的3x3单应性矩阵是否可以接受?
我在Stackoverflow和Google找到了一个答案,无法找到它。
我发现这篇文章,但对我来说有点神秘:
1-拍摄一张图片的点并使用计算的单应性重新投影。
//对于一个3D点,这将是投影
px'= H * px;
py'= H * py;
pz'= H * pz;
2-计算欧氏距离。
对于一点,a href =http://en.wikipedia.org/wiki/Reprojection_error =nofollow noreferrer>重新投影错误。 p是投影点,q是真实点。
3-建立决定重投影错误是否可以接受的阈值。 b
例如,大于一个像素的错误对于许多跟踪应用程序是不可接受的。
When using OpenCV's findHomography
function to estimate an homography between two sets of points, from different images, you will sometimes get a bad homography due to outliers within your input points, even if you use RANSAC or LMEDS.
// opencv java example:
Mat H = Calib3d.findHomography( src_points, dst_points, Calib3d.RANSAC, 10 );
How can you tell if the resulting 3x3 homography matrix is acceptable or not?
I have looked for an answer to this here in Stackoverflow and in Google and was unable to find it.
I found this article, but it is a bit cryptic to me:
"The geometric error for homographies"
The best way to tell if the homography is acceptable is.
1- Take the points of one image and reproject them using the computed homography.
//for one 3D point, this would be the projection
px' = H * px;
py' = H * py;
pz' = H * pz;
2- Calculate the euclidean distance between the reprojected points and the real points in the image.
Reprojection error for one point. p is the projected point and q is the real point.
3- Establish a treshold that decides if the reprojection error is acceptable.
For example, an error greater than one pixel wouldn't be acceptable for many tracking applications.
这篇关于如何判断单应性矩阵是否可以接受?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!