Skip to content

fisheye_undistortPoints

geometryfunctionOpenCV 5.0.0
import { fisheye_undistortPoints } from '@banou/opencv-wasm'

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

ARGUMENTSdistorted, undistorted, K, D
FUNCTIONfisheye_undistortPoints
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Undistorts 2D points using fisheye camera model

This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints. The fisheye model is suitable for wide-angle cameras.

The function transforms points from the distorted fisheye image to undistorted coordinates, optionally applying a rectification transformation (R) and projecting to a new image plane (P).

Note: Coordinate Systems:

  • Input (distorted): Points are expected in pixel coordinates of the distorted fisheye image, i.e., coordinates measured in pixels from the top-left corner of the image.
  • Output (undistorted): The coordinate system depends on parameter P:
    • If P is provided (not empty): Output points are in pixel coordinates of the rectified/undistorted image plane, using the camera matrix P.
    • If P is empty or identity: Output points are in normalized camera coordinates (normalized image coordinates), which are dimensionless coordinates in the camera's focal plane, independent of intrinsic parameters.

Note: Fisheye vs. Standard Model: Use this function (#cv::fisheye::undistortPoints) for fisheye cameras (wide-angle lenses). For standard pinhole cameras, use #undistortPoints instead. The fisheye model uses a different distortion parameterization (4 coefficients) compared to the standard model (4-14 coefficients).

fisheye_undistortPoints(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, R: Mat, P: Mat, criteria: TermCriteria): void;
4 available overloads
fisheye_undistortPoints(distorted: Mat, undistorted: Mat, K: Mat, D: Mat): void;
fisheye_undistortPoints(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, R: Mat): void;
fisheye_undistortPoints(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, R: Mat, P: Mat): void;
fisheye_undistortPoints(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, R: Mat, P: Mat, criteria: TermCriteria): void;
distorted

Array of distorted point coordinates in pixel coordinates of the fisheye image, 1xN/Nx1 2-channel (or vector<Point2f> ), where N is the number of points in the view.

undistorted

Output destination, filled by the native operation. Output array of undistorted image points, 1xN/Nx1 2-channel, or vector<Point2f> . The coordinate system depends on parameter P (see above).

K

Camera intrinsic matrix \cameramatrix{K} of the fisheye camera.

D

Input vector of fisheye distortion coefficients \distcoeffsfisheye (must contain exactly 4 coefficients).

R

Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 1-channel or 1x1 3-channel. If empty, the identity transformation is used.

P

New camera intrinsic matrix (3x3) or new projection matrix (3x4). If empty or identity, output will be in normalized camera coordinates.

criteria

Termination criteria for the iterative undistortion algorithm.

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.