Finding most suitable Rotation and Translation from Homography decomposition

99封情书 提交于 2019-12-01 01:18:46

I used the function 'filterHomographyDecompByVisibleRefpoints' by Vaesper. You can check the code here.

You just need to input the Rotation matrix, normals obtained from decomposeHomographyMat and the point correspondences used to obtain the homograpy matrix. The above function will return 2 possible solutions. You can see more on this idea in the answer by Ebya here.

After getting the 2 possible solutions, you will have to somehow make some checks depending on your case in order to find the right solution. Since I used identity matrix for camera matrix, the translation values obtained are in pixels and will need to be scaled using some external sensor. In my case, the distance between the camera and planar object is fixed in the z-axis, therefore, I just calculated what 1 pixel represents in world units.

And is the resultant translation is a scaled value, which can be used directly, unlike the Essential Matrix decomposition case?

Alas, no.

The reference for the OpenCV implemenations, Malis & Vargas, says this on p.8:

Notice that the translation is estimated up to a positive scalar factor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!