Finding transformation between two frames

冷暖自知 提交于 2019-12-21 21:35:35

问题


I have two consecutive frames from a video feed and I detect the keypoints using the FAST algorithm for both of them. I match the keypoints using the sum of squared difference's method (SSD).
So basically I have matched keypoints between the two frames. Now I want to calculate the affine transformation (scale + rotation + translation ) between the two frames from the set of matched keypoints.
I know how to calculate affine transformation from a pair of two points.
My question is how can we calculate it for more than two or three points? I know I have to use least median square method but I'm new to this field so I don't know how to use it.
Can someone please explain this in detail or provide a useful link that does this in a simple way?


回答1:


You could use function findHomography, doc for that purpose.

If all the point matches you are providing are good matches, you can keep the default value for parameter method (i.e. value 0). The least square method will then be used.

However, if you obtained the point matches from SSD keypoint matches, you will likely have some wrong matches among the true matches. Hence, you will obtain better results using a robust method such as RANSAC or Least Medians.

Note that this findHomography function returns a perspective transform (i.e. full 3x3 matrix). If you really want an affine transform (2x3 matrix), you will have to implement the least squares (have a look at this post) or RANSAC (see this post) yourself.



来源:https://stackoverflow.com/questions/25255049/finding-transformation-between-two-frames

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