Reputation: 119
I have two world coordinate systems, such as coorA
, coorB
. Each system has 4 points (3D points with xyz), and both in right-hand coordinate system.
I have tried it with cv::svd
, but the result wasn't right. I want to calculate the rotation and translation matrix from coorA
to coorB
. How do I do that?
Upvotes: 2
Views: 2161
Reputation: 1458
Your system is over-defined, therefore you should use a method that minimizes an error measure. A good solution is Umeyama's method.
Judging from your tags, you prefer a solution within OpenCV, but there you would need to implement such method yourself. You seem to be using C++, the easiest solution is probably to use the Eigen math header libraries and its function Eigen::umeyama. OpenCV can do data conversions to Eigen.
Upvotes: 3