Can I use the outputs of estimateWorldCameraPose to construct a cameraMatrix?

5 次查看(过去 30 天)
I am doing visual odometry and I use a stereo camera setup to triangulate world points.
I match these points with points in a subsequent image, and then I want to use estimateWorldCameraPose to estimate the camera pose in a world coordinate system.
This function returns the parameters worldOrientation and worldLocation, which I want to use to construct the cameraMatrix for my next triangulation to get the world coordinates of the points.
My question is: Can I use these parameters directly for the cameraMatrix-function?
This would be the code:
[worldOrientation, worldLocation] = estimateWorldCameraPose(imagePoints, worldPoints, intrinsics);
camMatrix1 = cameraMatrix(intrinsics, worldOrientation, worldLocation);
camMatrix2 = cameraMatrix(intrinsics, worldOrientation, worldLocation + [baseline, 0, 0]);
worldPoints = triangulate(matchedPointsLeft, matchedPointsRight, camMatrix1, camMatrix2);
Thank you!

回答(1 个)

Matt J
Matt J 2020-9-4
Yes, you can.
  1 个评论
Robin Pape
Robin Pape 2020-9-4
编辑:Robin Pape 2020-9-4
Thank you.
I thought so, too, but the results I am getting are not plausible.
However, if I do it this way:
orientation = worldOrientation';
translation = -worldLocation * worldOrientation';
camMatrix1 = cameraMatrix(intrinsics, orientation, translation);
camMatrix2 = cameraMatrix(intrinsics, orientation, translation + [baseline, 0, 0] * worldOrientation');
The results are completely plausible. I tried this, because the documentation of cameraMatrix suggested something like this, with relative location and orientation though. Multiplying the translation with the rotation matrix kind of makes sense, as this probably makes sure the coordinates of the new points are still correct after a rotation of the camera...?
Could you maybe explain further to me what is happening here?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by