Skip to content
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

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

AleksandrPanov
Copy link
Contributor

@AleksandrPanov AleksandrPanov commented Jan 13, 2023

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

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@AleksandrPanov AleksandrPanov force-pushed the remove_duplication_from_aruco branch 2 times, most recently from f467f0a to 4b7d030 Compare January 13, 2023 09:12
@AleksandrPanov AleksandrPanov marked this pull request as ready for review January 16, 2023 00:10
@asmorkalov asmorkalov self-requested a review January 18, 2023 14:38
// 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);
Copy link
Contributor

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.

Copy link
Contributor Author

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;

Copy link
Contributor

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.

Copy link
Contributor Author

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;
    }

@asmorkalov asmorkalov self-assigned this Jan 23, 2023
@asmorkalov asmorkalov merged commit 529131e into opencv:4.x Jan 26, 2023
@alalek alalek mentioned this pull request Jan 28, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
@rurban
Copy link

rurban commented Mar 28, 2024

This caused a regression in interpolateCornersCharuco, which does not detect the markers anymore.
There need to be more testcases added, we can contribute some from https://github.com/SpexAI/calibpy/
See SpexAI/calibpy#2

@asmorkalov
Copy link
Contributor

@AleksandrPanov could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants