单应性矩阵和仿射变换_仿射变换透射变换单应性矩阵

答:使用perspectiveTransform()。

findHomography 函数是求两幅图像的单应性矩阵,它是一个3*3的矩阵,但这里的单应性矩阵和3D重建中的单应性矩阵(透视矩阵3*4)是不一样的。之前一直混淆了两者的区别。

这里求两幅图像的单应性矩阵,只是利用多元方程组初步求解出H矩阵,然后利用迭代最小化反投影误差的方式进一步精确计算出H。H=(h11,h12,h13; h21,h22,h23; h31,h32,h33)

C++:

Mat

findHomography

(

InputArray

srcPoints

, InputArray

dstPoints

, int

method

=0, double

ransacReprojThreshold

=3, OutputArray

mask

=noArray()

) ?

Parameters:

srcPoints – Coordinates of the points in the original plane, a matrix of the type CV_32FC2 orvector .

dstPoints – Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or avector .

method –

Method used to computed a homography matrix. The following methods are possible:

0 - a regular method using all the points

CV_RANSAC - RANSAC-based robust method

CV_LMEDS - Least-Median robust method

ransacReprojThreshold –

Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only). That is, if

then the point  is considered an outlier. If srcPoints and dstPoints are measured in pixels, it usually makes sense to set this parameter somewhere in the range of 1 to 10.

mask – Optional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.

代码移植,菜鸟请教:

1.此函数具体是怎样求解方程的呢?单应性矩阵有8个独立元素:H = h00 h01 h02      手动计算前两行元素与函数输出结

h10 h11 h12

h20 h21  1

果接近,但h20和h21只能得到比例且比例与所选点坐标有关,感觉解不唯一,请问大神可以告知这两个元素是怎样确定的吗?

2.找不到cvFindHomography()源码,能告诉从哪里能获得吗?或者直接发给我就更好啦!谢!

最近学习有关findhomography的调用,请问经过RANSAC挑选适合的特征点后,

是用什么方法求出八个参数? (Levenberg-Marquardt? gradient descent? 还是其他方法)

405fb6f69545262c185e579873917e04.png

1be05c62e565d06134ff4cd70778fe8a.png

02edcd5e680f08844ed3232e1ceba874.png

4f6a60c1611ea671feac64073685cd44.png

89e3cc0d4946f77243aa675b8083045f.png

1、src_points,dst_points为N×2或者N×3的矩阵,N×2表示点是以像素坐标表示。N×3表示以齐次坐标表示。

2、homography,为3*3大小的矩阵,用来存储输出的结果。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值