-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove charuco duplication #3420
remove charuco duplication #3420
Conversation
f467f0a
to
4b7d030
Compare
4b7d030
to
10c188c
Compare
modules/aruco/src/aruco.cpp
Outdated
// get object and image points for the solvePnP function | ||
Mat objPoints, imgPoints; | ||
board->matchImagePoints(charucoCorners, charucoIds, objPoints, imgPoints); | ||
solvePnP(objPoints, imgPoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solvePnP throws exception, if there are no enough points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added points check:
if(charucoIds.getMat().total() < 4) return false;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to add try-catch block and return false in case of exception. The function did not throw exceptions before and should not do it after the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add try catch:
try {
solvePnP(objPoints, imgPoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess);
}
catch (const cv::Exception& e) {
CV_LOG_WARNING(NULL, "estimatePoseCharucoBoard: " << std::endl << e.what());
return false;
}
10c188c
to
fc0af69
Compare
fc0af69
to
1f713fb
Compare
This caused a regression in interpolateCornersCharuco, which does not detect the markers anymore. |
@AleksandrPanov could you take a look? |
Removed charuco duplication after move aruco to main repo.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.