Skip to content

Fix incorrect rvec and tvec when using useExtrinsicGuess - #1585

Merged
shimat merged 1 commit into
shimat:masterfrom
Jcparkyn:fix-useExtrinsicGuess
Jul 8, 2023
Merged

shimat merged 1 commit into
shimat:masterfrom
Jcparkyn:fix-useExtrinsicGuess

Conversation

@Jcparkyn

Copy link
Copy Markdown
Contributor

Fixes #1556.

I also updated the test to use inputs that reproduce the issue (for many inputs, SolvePnP will still converge when the initial rvec and tvec are wrong). With the updated test and no change to calib3d.h, the rvec and tvec outputs are clearly wrong. With the fix (or without useExtrinsicGuess) they are correct.

SolvePnPRansac has a similar issue, but I didn't fix it here because:

  • The API uses out parameters for rvec and tvec, so modifying them would be a breaking change.
  • Because these are out parameters, it's obvious that useExtrinsicGuess won't work, so it's much less likely to confuse users than the normal solvePnP version.

@shimat

shimat commented Jul 8, 2023

Copy link
Copy Markdown
Owner

Sorry for the late reply. Thank you!

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

Labels

bug Confirmed defect in OpenCvSharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SolvePnP with useExtrinsicGuess is broken when using IEnumberable overload

2 participants