calibrateMultiviewExtended
import { calibrateMultiviewExtended } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;objPointsCalibration pattern object points. Expected shape: NUM_FRAMES x NUM_POINTS x 3. Supported data type: CV_32F.
imagePointsDetected 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.)).
imageSizeImages resolution array for each camera.
detectionMaskPattern 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.
modelsindicates 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.
KsInput/output value, modified by the native operation. Estimated floating-point camera intrinsic matrix. Output size: NUM_CAMERAS x 3 x 3.
distortionsInput/output value, modified by the native operation. Distortion coefficients. Output size: NUM_CAMERAS x NUM_PARAMS.
RsInput/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.
TsInput/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.
initializationPairsOutput destination, filled by the native operation. Pairs with camera indices that were used for initial pairwise stereo calibration.
rvecs0Output 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.tvecs0Output 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).
perFrameErrorsOutput destination, filled by the native operation. RMSE value for each visible frame, (-1 for non-visible). Output size: NUM_CAMERAS x NUM_FRAMES.
flagsForIntrinsicsFlags used for each camera intrinsics calibration. Use per-camera call and the
useIntrinsicsGuessflag to get custom intrinsics calibration for each camera.flagsCommon multiview calibration flags. cv::CALIB_USE_INTRINSIC_GUESS and cv::CALIB_USE_EXTRINSIC_GUESS are supported. See
CALIB_USE_INTRINSIC_GUESSand otherCALIB_constants. Expected shape: NUM_CAMERAS x 1. Supported data type: CV_32S.criteriaTermination criteria for the iterative optimization algorithm.
Output size: (NUM_CAMERAS-1) x 2.
tutorial_multiview_camera_calibrationprovides 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
The above illustration shows an example setting for multiview camera calibration.For each frame, suppose the absolute camera pose for camera
iisR_i, t_i, and the relative camera pose between cameraiand camerajisR_{ij}, t_{ij}. SupposeR_1, t_1, andR_{1i}for anyi\not=1are known, then its pose can be calculated byR_i = R_{1i} R_1t_i = R_{1i} t_1 + t_{1i}Since the relative pose between two cameras can be calculated by
R_{ij} = R_j R_i^\topt_{ij} = -R_{ij} t_i + R_jThis implies that any other relative pose of the form
R_{ij}, i\not=1is 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.
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.