Skip to content

initCameraMatrix2D

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

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

ARGUMENTSobjectPoints, imagePoints, imageSize, aspectRatio
FUNCTIONinitCameraMatrix2D
RETURN TYPEMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Finds an initial camera intrinsic matrix from 3D-2D point correspondences.

initCameraMatrix2D(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size, aspectRatio: number): Mat;
2 available overloads
initCameraMatrix2D(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size): Mat;
initCameraMatrix2D(objectPoints: MatVector, imagePoints: MatVector, imageSize: Size, aspectRatio: number): Mat;
objectPoints

Vector of vectors of the calibration pattern points in the calibration pattern coordinate space. In the old interface all the per-view vectors are concatenated. See #calibrateCamera for details.

imagePoints

Vector of vectors of the projections of the calibration pattern points. In the old interface all the per-view vectors are concatenated.

imageSize

Image size in pixels used to initialize the principal point.

aspectRatio

If it is zero or negative, both f_x and f_y are estimated independently. Otherwise, f_x = f_y \cdot \texttt{aspectRatio} .

The function estimates and returns an initial camera intrinsic matrix for the camera calibration process. Currently, the function only supports planar calibration patterns, which are patterns where each object point has z-coordinate =0.

Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

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.