Skip to content

fisheye_calibrate

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

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

ARGUMENTSobjectPoints, imagePoints, image_size, K
FUNCTIONfisheye_calibrate
RETURN TYPEnumber
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Performs camera calibration

fisheye_calibrate(objectPoints: MatVector, imagePoints: MatVector, image_size: Size, K: Mat, D: Mat, rvecs: MatVector, tvecs: MatVector, flags: number, criteria: TermCriteria): number;
3 available overloads
fisheye_calibrate(objectPoints: MatVector, imagePoints: MatVector, image_size: Size, K: Mat, D: Mat, rvecs: MatVector, tvecs: MatVector): number;
fisheye_calibrate(objectPoints: MatVector, imagePoints: MatVector, image_size: Size, K: Mat, D: Mat, rvecs: MatVector, tvecs: MatVector, flags: number): number;
fisheye_calibrate(objectPoints: MatVector, imagePoints: MatVector, image_size: Size, K: Mat, D: Mat, rvecs: MatVector, tvecs: MatVector, flags: number, criteria: TermCriteria): number;
objectPoints

vector of vectors of calibration pattern points in the calibration pattern coordinate space.

imagePoints

vector of vectors of the projections of calibration pattern points. imagePoints.size() and objectPoints.size() and imagePoints[i].size() must be equal to objectPoints[i].size() for each i.

image_size

Size of the image used only to initialize the camera intrinsic matrix.

K

Input/output value, modified by the native operation. Output 3x3 floating-point camera intrinsic matrix \cameramatrix{A} . If cv::CALIB_USE_INTRINSIC_GUESS is specified, some or all of fx, fy, cx, cy must be initialized before calling the function.

D

Input/output value, modified by the native operation. Output vector of distortion coefficients \distcoeffsfisheye.

rvecs

Output destination, filled by the native operation. Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view. That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the calibration pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. M -1).

tvecs

Output destination, filled by the native operation. Output vector of translation vectors estimated for each pattern view.

flags

Different flags that may be zero or a combination of the following values:

  • cv::CALIB_USE_INTRINSIC_GUESS cameraMatrix contains valid initial values of fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image center ( imageSize is used), and focal distances are computed in a least-squares fashion.
  • cv::CALIB_RECOMPUTE_EXTRINSIC Extrinsic will be recomputed after each iteration of intrinsic optimization.
  • cv::CALIB_CHECK_COND The functions will check validity of condition number.
  • cv::CALIB_FIX_SKEW Skew coefficient (alpha) is set to zero and stay zero.
  • cv::CALIB_FIX_K1,..., cv::CALIB_FIX_K4 Selected distortion coefficients are set to zeros and stay zero.
  • cv::CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global optimization. It stays at the center or at a different location specified when cv::CALIB_USE_INTRINSIC_GUESS is set too.
  • cv::CALIB_FIX_FOCAL_LENGTH The focal length is not changed during the global optimization. It is the max(width,height)/\pi or the provided f_x, f_y when cv::CALIB_USE_INTRINSIC_GUESS is set too.
criteria

Termination criteria for the iterative optimization algorithm.

Returns

The number result.

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.