- Notifications
You must be signed in to change notification settings - Fork5.9k
remove charuco duplication#3420
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
remove charuco duplication#3420
Uh oh!
There was an error while loading.Please reload this page.
Conversation
f467f0a to4b7d030Compare4b7d030 to10c188cComparemodules/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 tofc0af69Comparefc0af69 to1f713fbComparerurban commentedMar 28, 2024
This caused a regression in interpolateCornersCharuco, which does not detect the markers anymore. |
asmorkalov commentedMar 28, 2024
@AleksandrPanov could you take a look? |
Uh oh!
There was an error while loading.Please reload this page.
Removed charuco duplication after move aruco to main repo.
Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.