Skip to content

Fix Cv2.RecoverPose - #1856

Merged
shimat merged 1 commit into
mainfrom
fix_RecoverPose
Apr 3, 2026
Merged

Fix Cv2.RecoverPose #1856
shimat merged 1 commit into
mainfrom
fix_RecoverPose

Conversation

@shimat

@shimat shimat commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Fix #1410

--

This pull request introduces an important fix to the RecoverPose interop signature and adds a new test to verify the triangulated points output. The changes ensure that the function signature matches the expected parameter order and that the triangulated points output is properly tested.

Interop signature fix:

  • Updated the argument order in the calib3d_recoverPose_InputArray3 function declaration in calib3d.h to match the correct parameter order, specifically moving distanceTresh after R and t.

Testing improvements:

  • Added a new test method RecoverPoseWithTriangulatedPoints in Calib3dTest.cs to verify that the RecoverPose function correctly outputs triangulated points, addressing a specific GitHub issue and increasing test coverage for this functionality.

Summary by CodeRabbit

  • Breaking Changes

    • Updated parameter ordering in the camera pose recovery function. Code using this function may require adjustment.
  • Tests

    • Added test coverage for pose recovery operations with triangulated points output verification.

@shimat shimat self-assigned this Apr 2, 2026
@shimat shimat added the bug Confirmed defect in OpenCvSharp label Apr 2, 2026
@shimat
shimat marked this pull request as ready for review April 3, 2026 00:35
@shimat
shimat merged commit ee2a308 into main Apr 3, 2026
9 of 10 checks passed
@shimat
shimat deleted the fix_RecoverPose branch April 3, 2026 00:36
@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88ec8f7b-0e55-422a-8a1c-1b80d3d9ce00

📥 Commits

Reviewing files that changed from the base of the PR and between bd2842f and f160aff.

📒 Files selected for processing (2)
  • src/OpenCvSharpExtern/calib3d.h
  • test/OpenCvSharp.Tests/calib3d/Calib3dTest.cs

📝 Walkthrough

Walkthrough

The changes fix the Cv2.RecoverPose wrapper function by reordering parameters in the C++ extern declaration to match the correct OpenCV API signature, resolving an AccessViolationException. A new test validates the corrected functionality.

Changes

Cohort / File(s) Summary
C++ Wrapper Signature Fix
src/OpenCvSharpExtern/calib3d.h
Parameter distanceTresh repositioned from position 5 (after cameraMatrix) to position 7 (after t) in calib3d_recoverPose_InputArray3, aligning with the correct OpenCV function signature.
Test Coverage
test/OpenCvSharp.Tests/calib3d/Calib3dTest.cs
Added RecoverPoseWithTriangulatedPoints() test method that verifies Cv2.RecoverPose successfully computes pose recovery with triangulated points output, asserting non-zero inlier count and non-empty result matrices.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_RecoverPose

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Cv2.RecoverPose (triangulatedPoints overload) throws AccessViolationException

1 participant