Skip to content

calibrateMultiviewExtended

Calibration and geometryfunctionOpenCV 5.0.0
import { calibrateMultiviewExtended } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSobjPoints, imagePoints, imageSize, detectionMask
FUNCTIONcalibrateMultiviewExtended
RETURN TYPEnumber
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Estimates intrinsics and extrinsics (camera pose) for multi-camera system a.k.a multiview calibration.

See: findChessboardCorners, findCirclesGrid, calibrateCamera, fisheye::calibrate, registerCameras

calibrateMultiviewExtended(objPoints: MatVector, imagePoints: std__vector_cv__MatVector, imageSize: SizeVector, detectionMask: Mat, models: Mat, Ks: MatVector, distortions: MatVector, Rs: MatVector, Ts: MatVector, initializationPairs: Mat, rvecs0: MatVector, tvecs0: MatVector, perFrameErrors: Mat, flagsForIntrinsics: Mat, flags: number, criteria: TermCriteria): number;
4 available overloads
calibrateMultiviewExtended(objPoints: MatVector, imagePoints: std__vector_cv__MatVector, imageSize: SizeVector, detectionMask: Mat, models: Mat, Ks: MatVector, distortions: MatVector, Rs: MatVector, Ts: MatVector, initializationPairs: Mat, rvecs0: MatVector, tvecs0: MatVector, perFrameErrors: Mat): number;
calibrateMultiviewExtended(objPoints: MatVector, imagePoints: std__vector_cv__MatVector, imageSize: SizeVector, detectionMask: Mat, models: Mat, Ks: MatVector, distortions: MatVector, Rs: MatVector, Ts: MatVector, initializationPairs: Mat, rvecs0: MatVector, tvecs0: MatVector, perFrameErrors: Mat, flagsForIntrinsics: Mat): number;
calibrateMultiviewExtended(objPoints: MatVector, imagePoints: std__vector_cv__MatVector, imageSize: SizeVector, detectionMask: Mat, models: Mat, Ks: MatVector, distortions: MatVector, Rs: MatVector, Ts: MatVector, initializationPairs: Mat, rvecs0: MatVector, tvecs0: MatVector, perFrameErrors: Mat, flagsForIntrinsics: Mat, flags: number): number;
calibrateMultiviewExtended(objPoints: MatVector, imagePoints: std__vector_cv__MatVector, imageSize: SizeVector, detectionMask: Mat, models: Mat, Ks: MatVector, distortions: MatVector, Rs: MatVector, Ts: MatVector, initializationPairs: Mat, rvecs0: MatVector, tvecs0: MatVector, perFrameErrors: Mat, flagsForIntrinsics: Mat, flags: number, criteria: TermCriteria): number;
objPoints

Calibration pattern object points. Expected shape: NUM_FRAMES x NUM_POINTS x 3. Supported data type: CV_32F.

imagePoints

Detected pattern points on camera images. Expected shape: NUM_CAMERAS x NUM_FRAMES x NUM_POINTS x 2. This function supports partial observation of the calibration pattern. To enable this, set the unobserved image points to be invalid points (eg. (-1., -1.)).

imageSize

Images resolution array for each camera.

detectionMask

Pattern detection mask. Each value defines if i-camera observes the calibration pattern in j-th frame. Expected size: NUM_CAMERAS x NUM_FRAMES. Expected type: CV_8U.

models

indicates camera models for each camera: cv::CALIB_MODEL_PINHOLE or cv::CALIB_MODEL_PINHOLE. Current implementation does not support mix of different camera models. Expected type: CV_8U.

Ks

Input/output value, modified by the native operation. Estimated floating-point camera intrinsic matrix. Output size: NUM_CAMERAS x 3 x 3.

distortions

Input/output value, modified by the native operation. Distortion coefficients. Output size: NUM_CAMERAS x NUM_PARAMS.

Rs

Input/output value, modified by the native operation. Rotation vectors relative to camera 0, where Rs[0] = 0. Output size: NUM_CAMERAS x 3 x 3.

Ts

Input/output value, modified by the native operation. Estimated translation vectors relative to camera 0, where Ts[0] = 0. Output size: NUM_CAMERAS x 3 x 1.

initializationPairs

Output destination, filled by the native operation. Pairs with camera indices that were used for initial pairwise stereo calibration.

rvecs0

Output destination, filled by the native operation. Estimated rotation vectors for camera 0. Output size: NUM_FRAMES x 3 x 1 (may contain null Mat, if the frame is not valid). See Rodrigues.

tvecs0

Output destination, filled by the native operation. Translation vectors for camera 0. Output size: NUM_FRAMES x 3 x 1. (may contain null Mat, if the frame is not valid).

perFrameErrors

Output destination, filled by the native operation. RMSE value for each visible frame, (-1 for non-visible). Output size: NUM_CAMERAS x NUM_FRAMES.

flagsForIntrinsics

Flags used for each camera intrinsics calibration. Use per-camera call and the useIntrinsicsGuess flag to get custom intrinsics calibration for each camera.

flags

Common multiview calibration flags. cv::CALIB_USE_INTRINSIC_GUESS and cv::CALIB_USE_EXTRINSIC_GUESS are supported. See CALIB_USE_INTRINSIC_GUESS and other CALIB_ constants. Expected shape: NUM_CAMERAS x 1. Supported data type: CV_32S.

criteria

Termination criteria for the iterative optimization algorithm.

Output size: (NUM_CAMERAS-1) x 2.

tutorial_multiview_camera_calibration provides a detailed tutorial of using this function. Please refer to it for more information.

Multiview calibration usually requires several cameras to observe the same calibration pattern simultaneously. The fundamental assumption is that relative camera poses are fixed, and then for each frame, only the absolute camera pose for a single camera is needed to fix the camera pose for the multiple cameras

multiview calibration The above illustration shows an example setting for multiview camera calibration.

For each frame, suppose the absolute camera pose for camera i is R_i, t_i, and the relative camera pose between camera i and camera j is R_{ij}, t_{ij}. Suppose R_1, t_1, and R_{1i} for any i\not=1 are known, then its pose can be calculated by

R_i = R_{1i} R_1
t_i = R_{1i} t_1 + t_{1i}

Since the relative pose between two cameras can be calculated by

R_{ij} = R_j R_i^\top 
t_{ij} = -R_{ij} t_i + R_j 

This implies that any other relative pose of the form R_{ij}, i\not=1 is redundant. Given this, the total number of poses to determine is (NUM_CAMERAS-1) and NUM_FRAMES. This serves as the foundation of this function.

Similarly to #calibrateCamera, the function minimizes the total re-projection error for all the points in all the available views from all cameras.

Returns

Overall RMS re-projection error over detectionMask.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.