在Opencv中仅使用平移,旋转和缩放计算单应性 [英] Calculate a Homography with only Translation, Rotation and Scale in Opencv

查看:311
本文介绍了在Opencv中仅使用平移,旋转和缩放计算单应性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实有两组点,我想找到它们之间的最佳变换. 在OpenCV中,您具有以下功能:

I do have two sets of points and I want to find the best transformation between them. In OpenCV, you have the following function:

Mat H = Calib3d.findHomography(src_points, dest_points);

,使用RANSAC返回3x3同形矩阵.我现在的问题是,我只需要平移和旋转(可能还有缩放),不需要仿射和透视.

that returns you a 3x3 Homography matrix, using RANSAC. My problem is now, that I only need translation and rotation (& maybe scale), I don't need affine and perspective.

问题是,我的点仅以2D表示.

The thing is, my points are only in 2D.

(1)是否有计算单应性但自由度较小的函数?

(1) Is there a function to compute something like a homography but with less degrees of freedom?

(2)如果不存在,是否可以从3x3单应矩阵提取仅进行平移和旋转的3x3矩阵?

(2) If there is none, is it possible to extract a 3x3 matrix that does only translation and rotation from the 3x3 homography matrix?

在此先感谢您的帮助!

伊萨

推荐答案

OpenCV

OpenCV estimateRigidTransform function is exactly what you need: it returns Translation, Rotation and Scale (use false value for fullAffine flag). And it DOES use RANSAC (see source code to be sure of it).

这篇关于在Opencv中仅使用平移,旋转和缩放计算单应性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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