寻找两个框架之间的转换 [英] Finding transformation between two frames

查看:82
本文介绍了寻找两个框架之间的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从视频提要中获得了两个连续的帧,并且使用FAST算法对这两个关键点进行检测.我使用平方差和的方法(SSD)来匹配关键点.
所以基本上我已经在两个框架之间匹配了关键点.现在,我要根据匹配的关键点集计算两个帧之间的仿射变换(比例+旋转+平移).
我知道如何从一对两点计算仿射变换.
我的问题是,如何计算超过两三个点?我知道我必须使用最小中位数平方法,但是我是该领域的新手,所以我不知道如何使用它.
有人可以详细解释一下吗,或者提供一个有用的链接来简单地完成此操作吗?

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?

推荐答案

您可以使用函数findHomography如果您提供的所有点匹配都是良好匹配,则可以保留参数method的默认值(即值0).然后将使用最小二乘法.

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.

但是,如果您从SSD关键点匹配中获得了点匹配,则真实匹配中可能会出现一些错误的匹配.因此,使用诸如RANSAC或Least Medians之类的可靠方法,您将获得更好的结果.

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.

请注意,此findHomography函数返回透视变换(即完整的3x3矩阵).如果您确实要进行仿射变换(2x3矩阵),则必须实现最小二乘(请参阅此帖子).

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.

这篇关于寻找两个框架之间的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆