Ask Your Question

Does findHomography use DLT with SVD when there are more than 4 points?

asked 2012-10-02 06:10:43 -0600

yes123 gravatar image

updated 2012-10-02 12:49:34 -0600

Information taken from here:


Basically it says when there are more than 4 points the set of equations Ah = 0 is over-determined and we need to

  • minimizing residuals with Least Square


  • adopt the so called singular value decomosition

OpenCV with findHomography which strategy adopts when there are more than 4 points?

Ps. I know RANSAC is used to choose inliner/outlier, but what happens when inliner are more than 4 points? the system is over-determinated with more than 4 points

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-10-02 09:25:40 -0600

Ben gravatar image

updated 2012-10-02 22:11:20 -0600

findHomography() uses RANSAC to compute a transformation matrix. It iteratively picks 4 random point pairs to compute a homography, then tests, how good it is (classifying other point pairs as inliers/outliers) and chooses the homography with the most inliers. This way it is very robust to outliers (false matches) whereas using all matches for computation would falsify the transformation.


Ok, here a sort of pseudo code to explain the RANSAC algorithm.

Let's say you have a list of point pairs matchlist, which represent matches between a source and a destination image. Now RANSAC does something like:

Homography bestH = null
while (termination criteria not fulfilled)
    randomly choose 4 matches from matchlist
    compute homography H from those 4 matches (-> not overdeterminated)

    numInliers = 0
    foreach (match m in matchlist)
        if (m is inlier) numInliers += 1

    if (numInliers > minNumInliers) 
        if (H better than bestH) bestH = H  // H has more inliers than bestH

This is a very simple version, the OpenCV RANSAC algorithm probably is more complex. Termination criteria typically are

  • maximum number of iterations -> give up, if you don't find a good homography after x iterations

  • minimum quality of the best homography -> don't unnecessarily perform further iterations, if you already found a good enough homography

I hope, this little example helps for better understanding.

edit flag offensive delete link more


So basically RANSAC always returns only 4 points to calc the homography? If it returns more points the system is over-determinated

yes123 gravatar imageyes123 ( 2012-10-02 12:44:07 -0600 )edit

How about Least-Median of Squares? Isn't it a way to solve a over-determined linear system?

stetro gravatar imagestetro ( 2013-06-26 07:42:18 -0600 )edit

Question Tools

1 follower


Asked: 2012-10-02 06:10:43 -0600

Seen: 2,524 times

Last updated: Oct 02 '12