How can you tell if a homography matrix is acceptable or not?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 19:05:51

问题


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"


回答1:


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.



来源:https://stackoverflow.com/questions/11053099/how-can-you-tell-if-a-homography-matrix-is-acceptable-or-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!