registerCamerasExtended
import { registerCamerasExtended } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calibrates a camera pair set up. This function finds the extrinsic parameters between the two cameras.
See: calibrateCamera, stereoCalibrate
registerCamerasExtended(objectPoints1: MatVector, objectPoints2: MatVector, imagePoints1: MatVector, imagePoints2: MatVector, cameraMatrix1: Mat, distCoeffs1: Mat, cameraModel1: number, cameraMatrix2: Mat, distCoeffs2: Mat, cameraModel2: number, R: Mat, T: Mat, E: Mat, F: Mat, rvecs: MatVector, tvecs: MatVector, perViewErrors: Mat, flags: number, criteria: TermCriteria): number;3 available overloads
registerCamerasExtended(objectPoints1: MatVector, objectPoints2: MatVector, imagePoints1: MatVector, imagePoints2: MatVector, cameraMatrix1: Mat, distCoeffs1: Mat, cameraModel1: number, cameraMatrix2: Mat, distCoeffs2: Mat, cameraModel2: number, R: Mat, T: Mat, E: Mat, F: Mat, rvecs: MatVector, tvecs: MatVector, perViewErrors: Mat): number;registerCamerasExtended(objectPoints1: MatVector, objectPoints2: MatVector, imagePoints1: MatVector, imagePoints2: MatVector, cameraMatrix1: Mat, distCoeffs1: Mat, cameraModel1: number, cameraMatrix2: Mat, distCoeffs2: Mat, cameraModel2: number, R: Mat, T: Mat, E: Mat, F: Mat, rvecs: MatVector, tvecs: MatVector, perViewErrors: Mat, flags: number): number;registerCamerasExtended(objectPoints1: MatVector, objectPoints2: MatVector, imagePoints1: MatVector, imagePoints2: MatVector, cameraMatrix1: Mat, distCoeffs1: Mat, cameraModel1: number, cameraMatrix2: Mat, distCoeffs2: Mat, cameraModel2: number, R: Mat, T: Mat, E: Mat, F: Mat, rvecs: MatVector, tvecs: MatVector, perViewErrors: Mat, flags: number, criteria: TermCriteria): number;objectPoints1Vector of vectors of the calibration pattern points for camera 1. A similar structure as objectPoints in
calibrateCameraand for each pattern view, both cameras do not need to see the same object points. objectPoints1.size(), imagePoints1.size() nees to be equal,as well as objectPoints1[i].size(), imagePoints1[i].size() need to be equal for each i.objectPoints2Vector of vectors of the calibration pattern points for camera 2. A similar structure as objectPoints1. objectPoints2.size(), and imagePoints2.size() nees to be equal, as well as objectPoints2[i].size(), imagePoints2[i].size() need to be equal for each i. However, objectPoints1[i].size() and objectPoints2[i].size() are not required to be equal.
imagePoints1Vector of vectors of the projections of the calibration pattern points, observed by the first camera. The same structure as in
calibrateCamera.imagePoints2Vector of vectors of the projections of the calibration pattern points, observed by the second camera. The same structure as in
calibrateCamera.cameraMatrix1Input/output camera intrinsic matrix for the first camera, the same as in
calibrateCamera.Furthermore, for the stereo case, additional flags may be used, see below.distCoeffs1Input/output vector of distortion coefficients, the same as in
calibrateCamera.cameraModel1Flag reflecting the type of model for camera 1 (pinhole / fisheye):
CALIB_MODEL_PINHOLEpinhole camera modelCALIB_MODEL_FISHEYEfisheye camera model
cameraMatrix2Input/output second camera intrinsic matrix for the second camera. See description for cameraMatrix1.
distCoeffs2Input/output lens distortion coefficients for the second camera. See description for distCoeffs1.
cameraModel2Flag reflecting the type of model for camera 2 (pinhole / fisheye). See description for cameraModel1.
RInput/output value, modified by the native operation. Output rotation matrix. Together with the translation vector T, this matrix brings points given in the first camera's coordinate system to points in the second camera's coordinate system. In more technical terms, the tuple of R and T performs a change of basis from the first camera's coordinate system to the second camera's coordinate system. Due to its duality, this tuple is equivalent to the position of the first camera with respect to the second camera coordinate system.
TInput/output value, modified by the native operation. Output translation vector, see description above.
EOutput destination, filled by the native operation. Output essential matrix.
FOutput destination, filled by the native operation. Output fundamental matrix.
rvecsOutput destination, filled by the native operation. Output vector of rotation vectors (
Rodrigues) estimated for each pattern view in the coordinate system of the first camera of the stereo pair (e.g. std::vectorcv::Mat). More in detail, each i-th rotation vector together with the corresponding i-th translation vector (see the next output parameter description) brings the calibration pattern from the object coordinate space (in which object points are specified) to the camera coordinate space of the first camera of the stereo pair. In more technical terms, the tuple of the i-th rotation and translation vector performs a change of basis from object coordinate space to the camera coordinate space of the first camera of the stereo pair.tvecsOutput destination, filled by the native operation. Output vector of translation vectors estimated for each pattern view, see parameter description of previous output parameter ( rvecs ).
perViewErrorsOutput destination, filled by the native operation. Output vector of the RMS re-projection error estimated for each pattern view.
flagsDifferent flags that may be zero or a combination of the following values:
CALIB_USE_EXTRINSIC_GUESSR and T contain valid initial values that are optimized further.
criteriaTermination criteria for the iterative optimization algorithm.
The function estimates the transformation between two cameras similar to stereo pair calibration. The principle follows closely to
stereoCalibrate.To understand the problem of estimating the relative pose between a camera pair, please refer to the description there. The difference for this function is that, camera intrinsics are not optimized and two cameras are not required to have overlapping fields of view as long as they are observing the same calibration target and the absolute positions of each object point are known.
The above illustration shows an example where such a case may become relevant.
Additionally, it supports a camera pair with the mixed model (pinhole / fisheye).
Similarly to #calibrateCamera, the function minimizes the total re-projection error for all the
points in all the available views from both cameras.
the final value of the re-projection error.
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.