Finding most suitable Rotation and Translation from Homography decomposition

后端 未结 2 1522
隐瞒了意图╮
隐瞒了意图╮ 2021-01-07 01:58

I\'m trying to find the rotation and translation from Homography function. First I compute the corresponding feature points and using findHomography() I compute

2条回答
  •  一整个雨季
    2021-01-07 02:48

    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.

提交回复
热议问题