OpenCV version: 4.8.1
OS: Windows 11
Compiler: MSVC 2022
Detailed description
When calling calibrateHandEye function the inputs are required to be in format vector Mat (3x3) rotation matrices or (3x1) rotation vectors (Rodrigues) according to the docs. Internally these are transformed into homogeneous transforms of type CV_64F. When input is of format (3x1)/Rodrigues the Rodrigues function is used to convert to (3x3) rotation matrix. However, this function supports both CV_32F and CV_64F inputs and does not recast. This results in the fact that the resulting (3x3) rotation matrix is not in CV_64F format when input is CV_32F, which results in the function not working correctly.
std::vector<Mat> Hg;
Hg.reserve(R_gripper2base_.size());
for (size_t i = 0; i < R_gripper2base_.size(); i++)
{
Mat m = Mat::eye(4, 4, CV_64FC1);
Mat R = m(Rect(0, 0, 3, 3));
if(R_gripper2base_[i].size() == Size(3, 3))
R_gripper2base_[i].convertTo(R, CV_64F);
else
Rodrigues(R_gripper2base_[i], R);
Mat t = m(Rect(3, 0, 1, 3));
t_gripper2base_[i].convertTo(t, CV_64F);
Hg.push_back(m);
}
System Information
OpenCV version: 4.8.1 OS: Windows 11 Compiler: MSVC 2022
Detailed description
When calling calibrateHandEye function the inputs are required to be in format vector Mat (3x3) rotation matrices or (3x1) rotation vectors (Rodrigues) according to the docs. Internally these are transformed into homogeneous transforms of type CV_64F. When input is of format (3x1)/Rodrigues the Rodrigues function is used to convert to (3x3) rotation matrix. However, this function supports both CV_32F and CV_64F inputs and does not recast. This results in the fact that the resulting (3x3) rotation matrix is not in CV_64F format when input is CV_32F, which results in the function not working correctly.
Steps to reproduce
output:
Issue submission checklist