Merge pull request #25423 from LuukvandenBent:CalibrateHandEyeDatatypeFix

Calibrate hand eye datatype fix #25423

Fix for issue https://github.com/opencv/opencv/issues/25421.

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
LuukvandenBent 2024-04-22 10:12:29 +02:00 committed by GitHub
parent 3f8b56ec49
commit ae85e516c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -722,7 +722,11 @@ void calibrateHandEye(InputArrayOfArrays R_gripper2base, InputArrayOfArrays t_gr
if(R_gripper2base_[i].size() == Size(3, 3)) if(R_gripper2base_[i].size() == Size(3, 3))
R_gripper2base_[i].convertTo(R, CV_64F); R_gripper2base_[i].convertTo(R, CV_64F);
else else
Rodrigues(R_gripper2base_[i], R); {
cv::Mat R_temp;
Rodrigues(R_gripper2base_[i], R_temp);
R_temp.convertTo(R, CV_64F);
}
Mat t = m(Rect(3, 0, 1, 3)); Mat t = m(Rect(3, 0, 1, 3));
t_gripper2base_[i].convertTo(t, CV_64F); t_gripper2base_[i].convertTo(t, CV_64F);
@ -740,7 +744,11 @@ void calibrateHandEye(InputArrayOfArrays R_gripper2base, InputArrayOfArrays t_gr
if(R_target2cam_[i].size() == Size(3, 3)) if(R_target2cam_[i].size() == Size(3, 3))
R_target2cam_[i].convertTo(R, CV_64F); R_target2cam_[i].convertTo(R, CV_64F);
else else
Rodrigues(R_target2cam_[i], R); {
cv::Mat R_temp;
Rodrigues(R_target2cam_[i], R_temp);
R_temp.convertTo(R, CV_64F);
}
Mat t = m(Rect(3, 0, 1, 3)); Mat t = m(Rect(3, 0, 1, 3));
t_target2cam_[i].convertTo(t, CV_64F); t_target2cam_[i].convertTo(t, CV_64F);
@ -920,7 +928,9 @@ void calibrateRobotWorldHandEye(InputArrayOfArrays R_world2cam, InputArrayOfArra
} }
else else
{ {
Rodrigues(rot, R); cv::Mat R_temp;
Rodrigues(rot, R_temp);
R_temp.convertTo(R, CV_64F);
R_base2gripper_.push_back(R); R_base2gripper_.push_back(R);
} }
Mat tvec = t_base2gripper_tmp[i]; Mat tvec = t_base2gripper_tmp[i];
@ -938,7 +948,9 @@ void calibrateRobotWorldHandEye(InputArrayOfArrays R_world2cam, InputArrayOfArra
} }
else else
{ {
Rodrigues(rot, R); cv::Mat R_temp;
Rodrigues(rot, R_temp);
R_temp.convertTo(R, CV_64F);
R_world2cam_.push_back(R); R_world2cam_.push_back(R);
} }
Mat tvec = t_world2cam_tmp[i]; Mat tvec = t_world2cam_tmp[i];