Add multi-view camera calibration: registerCameras and calibrateMultiview - #1936
Merged
Merged
Conversation
…view Wraps the OpenCV 5 multi-view calibration functions (the major new feature in the calib module): - Cv2.RegisterCameras: registers a pair of cameras (mixed pinhole/fisheye models allowed), estimating their relative pose R/T plus E/F and per-view errors. - Cv2.CalibrateMultiview: estimates per-camera intrinsics (Ks, distortions) and extrinsics (Rs, Ts relative to camera 0) for a multi-camera rig from a flat per-camera/per-frame set of detected pattern points, with a detection mask for partial observations. - CameraModel enum (Pinhole / Fisheye). Native: new calib_multiview.h. The jagged per-camera/per-frame imagePoints are marshaled as a flat Mat array plus per-camera frame counts; the InputOutputArrayOfArrays outputs use VectorOfMat. Tests: a synthetic 2-camera rig (relative pose = identity rotation + X translation) drives both functions end-to-end -- RegisterCameras recovers an X-dominant translation with low RMS, and CalibrateMultiview returns per-camera Ks/distortions/Rs/Ts. The managed doc notes the required NUM_POINTS x 3 / x 2 single-channel CV_32F point layout (a 3-channel layout crashes the native algorithm). Full Calib3D suite green (31 passed). Refs #1924. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wraps the OpenCV 5 multi-view camera calibration functions — one of the headline new features of the calib module (from #1924).
API
Cv2.RegisterCameras— registers a pair of cameras (the two may use different camera models, pinhole/fisheye), estimating their relative poseR/Tplus the essential/fundamental matrices and per-view errors. Returns the overall RMS.Cv2.CalibrateMultiview— estimates per-camera intrinsics (Ks,distortions) and extrinsics (Rs,Ts, relative to camera 0) for a multi-camera rig from per-camera/per-frame detected pattern points, with a detection mask for partial observations. Returns the overall RMS.CameraModelenum (Pinhole/Fisheye).Native bridge
calib_multiview.h. The jagged per-camera/per-frameimagePoints(vector<vector<Mat>>) is marshaled as a flatMat[]plus a per-camera frame-count array; theInputOutputArrayOfArraysoutputs useVectorOfMat.Test
MultiviewCalibrationTestbuilds a synthetic 2-camera rig whose relative pose is identity rotation + a pure X translation (so camera 1's view is camera 0's view with the baseline applied):RegisterCamerasrecovers an X-dominant translation with low RMS.CalibrateMultiviewreturns per-cameraKs/distortions/Rs/Ts(2 each).Rebuilt
OpenCvSharpExternlocally; full Calib3D suite green (31 passed).Refs #1924.
🤖 Generated with Claude Code