calibrateCameraRO
import { calibrateCameraRO } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
This function is an extension of #calibrateCamera with the method of releasing object which was proposed in [strobl2011iccv]. In many common cases with inaccurate, unmeasured, roughly planar targets (calibration plates), this method can dramatically improve the precision of the estimated camera parameters. Both the object-releasing method and standard method are supported by this function. Use the parameter iFixedPoint for method selection. In the internal implementation, #calibrateCamera is a wrapper for this function.
See: calibrateCamera, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
calibrateCameraRO(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size, iFixedPoint: number, cameraMatrix: Mat, distCoeffs: Mat, rvecs: MatVector, tvecs: MatVector, newObjPoints: Mat, flags: number, criteria: TermCriteria): number;3 available overloads
calibrateCameraRO(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size, iFixedPoint: number, cameraMatrix: Mat, distCoeffs: Mat, rvecs: MatVector, tvecs: MatVector, newObjPoints: Mat): number;calibrateCameraRO(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size, iFixedPoint: number, cameraMatrix: Mat, distCoeffs: Mat, rvecs: MatVector, tvecs: MatVector, newObjPoints: Mat, flags: number): number;calibrateCameraRO(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size, iFixedPoint: number, cameraMatrix: Mat, distCoeffs: Mat, rvecs: MatVector, tvecs: MatVector, newObjPoints: Mat, flags: number, criteria: TermCriteria): number;objectPointsVector of vectors of calibration pattern points in the calibration pattern coordinate space. See #calibrateCamera for details. If the method of releasing object to be used, the identical calibration board must be used in each view and it must be fully visible, and all objectPoints[i] must be the same and all points should be roughly close to a plane. The calibration target has to be rigid, or at least static if the camera (rather than the calibration target) is shifted for grabbing images.
imagePointsVector of vectors of the projections of calibration pattern points. See #calibrateCamera for details.
imageSizeSize of the image used only to initialize the intrinsic camera matrix.
iFixedPointThe index of the 3D object point in objectPoints[0] to be fixed. It also acts as a switch for calibration method selection. If object-releasing method to be used, pass in the parameter in the range of [1, objectPoints[0].size()-2], otherwise a value out of this range will make standard calibration method selected. Usually the top-right corner point of the calibration board grid is recommended to be fixed when object-releasing method being utilized. According to [strobl2011iccv], two other points are also fixed. In this implementation, objectPoints[0].front and objectPoints[0].back.z are used. With object-releasing method, accurate rvecs, tvecs and newObjPoints are only possible if coordinates of these three fixed points are accurate enough.
cameraMatrixInput/output value, modified by the native operation. Output 3x3 floating-point camera matrix. See #calibrateCamera for details.
distCoeffsInput/output value, modified by the native operation. Output vector of distortion coefficients. See #calibrateCamera for details.
rvecsOutput destination, filled by the native operation. Output vector of rotation vectors estimated for each pattern view. See #calibrateCamera for details.
tvecsOutput destination, filled by the native operation. Output vector of translation vectors estimated for each pattern view.
newObjPointsOutput destination, filled by the native operation. The updated output vector of calibration pattern points. The coordinates might be scaled based on three fixed points. The returned coordinates are accurate only if the above mentioned three fixed points are accurate. If not needed, noArray() can be passed in. This parameter is ignored with standard calibration method.
flagsDifferent flags that may be zero or a combination of some predefined values. See #calibrateCamera for details. If the method of releasing object is used, the calibration time may be much longer. CALIB_USE_QR or CALIB_USE_LU could be used for faster calibration with potentially less precise and less stable in some rare cases.
criteriaTermination criteria for the iterative optimization algorithm.
the overall RMS re-projection error.
The function estimates the intrinsic camera parameters and extrinsic parameters for each of the views. The object-releasing extension follows [strobl2011iccv] and uses the same optimization core as #calibrateCamera. See #calibrateCamera for other detailed explanations.
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.