findHomography, getPerspectiveTransform, & getAffineTransform

前端 未结 5 939
情话喂你
情话喂你 2020-12-23 11:35

This question is on the OpenCV functions findHomography, getPerspectiveTransform & getAffineTransform

  1. What is the

5条回答
  •  梦毁少年i
    2020-12-23 12:28

    Q #1: Right, the findHomography tries to find the best transform between two sets of points. It uses something smarter than least squares, called RANSAC, which has the ability to reject outliers - if at least 50% + 1 of your data points are OK, RANSAC will do its best to find them, and build a reliable transform.

    The getPerspectiveTransform has a lot of useful reasons to stay - it is the base for findHomography, and it is useful in many situations where you only have 4 points, and you know they are the correct ones. The findHomography is usually used with sets of points detected automatically - you can find many of them, but with low confidence. getPerspectiveTransform is good when you kn ow for sure 4 corners - like manual marking, or automatic detection of a rectangle.

    Q #2 There is no equivalent for affine transforms. You can use findHomography, because affine transforms are a subset of homographies.

提交回复
热议问题