getPerspectiveTransform()与findHomography()与 HomographyBasedEstimator()

转自:https://blog.csdn.net/dellme99/article/details/50033295

getPerspectiveTransform()和findHomography()

都用于计算单应性矩阵,即解一个线性方程组。由于单应矩阵有8个未知数(3*3,其中第9个数为1),所以至少需要4个点(每个点-x,y,提供2个约束方程)。

getPerspectiveTransform用的是SVD分解,getPerspectiveTransform只会拿前4个点去计算,getPerspectiveTransform()比较简单粗暴。
findHomography则会拿一堆点(>=4)去计算(其是不断从一堆点中重复拿出4个点去计算出一个结果,再采用一些优化算法RANSAC/LMEDS去筛选出最优解)。

焦距计算(K矩阵)

K矩阵有[焦距, ppx(图片的宽),ppy(图片的高),aspect(宽高比)]等计算出来的。 这里焦距需要计算。

焦距计算从单应性矩阵里面计算出来,一个H矩阵计算出两个焦距。单应性矩阵由配对的内点计算出来。

HomographyBasedEstimator::estimate() =>

estimateFocal(features, pairwise_matches,focals);

R矩阵计算

根据匹配的内点对两个K矩阵和内点对的H矩阵计算出R矩阵

findHomography()与 HomographyBasedEstimator()

来自stackoverflow的答案:
he main difference between both functions is that findHomography, as the name says, is used to find an homography, and HomographyBasesEstimator uses an already existing homographies to calculate the rotation of the cameras.

I mean, HomographyBasesEstimator doesn’t find the homographies, it use them to do the**computation of camera motion and all the other camera parameters **such as focal lengths and optical centers.

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值