使用透视变换(a )。
findHomography函数是求解两个图像的单应性矩阵,是3*3的矩阵,但这里的单应性矩阵与3D重构中的单应性矩阵[透视矩阵3*4不同。 以前把两者的区别混淆了。
这里求两个图像的单应性矩阵,只是用多元方程组初步求出h矩阵,用迭代使逆投影误差最小化,从而更准确地计算h。 h=(h11、h12、h13; h21、h22、h23; h31、h32、h33 )
C :
马特
findHomography
(
输入阵列
src点
,输入阵列
dst点
、int
方法
=0,双精度
ransacReprojThreshold
=3,输出阵列
标记
=否阵列() )
)?
Parameters:
src pointscoordinatesofthepointsintheoriginalplane,amatrixofthetypecv _ 32fc2or vector。
dst pointscoordinatesofthepointsinthetargetplane,amatrixofthetypecv _ 32fc2ora vector。
方法
methodusedtocomputedahomographymatrix.thefollowingmethodsarepossible 3360
0-aregularmethodusingallthepoints
cv _ ran sac-ran sac-basedrobustmethod
cv _ l meds-least-medianrobustmethod
ransacreprojthreshold
maximumallowedreprojectionerrortotreatapointpairasaninlier (usedintheransacmethodonly ).That is,if
thenthepointisconsideredanoutlier.ifsrcpointsanddstpointsaremeasuredinpixels,itusuallymakessensetosethisparametersometersomewhersomewhererethethereredomewher
mask可选aloutputmasksetbyarobustmethod (cv _ ransacorcv _ l meds ).notethattheinputmaskvaluesareignored。
代码移植,请告诉我私人:
1 .这个函数具体怎么解方程呢? 同构矩阵有八个独立的元素。 H=h00 h01 h02手动计算前两行元素和函数的输出结
h10 h11 h12
h20 h211
虽然接近,但是h20和h21只能得到比例,比例和选择的点坐标有关,感觉解不唯一,大神能告诉我这两个要素是怎么确定的吗?
cvFindHomography (找不到源代码。 能告诉我从哪里可以买到吗? 要是直接发给我就好了! 谢谢你!
我最近在学习如何调用findhomography。 在RANSAC中选择适当的特征点后,
用什么方法求出8个参数? (Levenberg-Marquardt? 梯度事件? 还是其他方法)
1、src_points、dst_points是N2或N3的矩阵,N2表示点由像素坐标表示。 N3用同次坐标表示。
2、用homography、3*3大小的矩阵,保存输出的结果。