fisheye_undistortPoints
import { fisheye_undistortPoints } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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 parameterP:- If
Pis provided (not empty): Output points are in pixel coordinates of the rectified/undistorted image plane, using the camera matrixP. - If
Pis 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.
- If
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;distortedArray 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.
undistortedOutput 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).
KCamera intrinsic matrix
\cameramatrix{K}of the fisheye camera.DInput vector of fisheye distortion coefficients
\distcoeffsfisheye(must contain exactly 4 coefficients).RRectification 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.
PNew camera intrinsic matrix (3x3) or new projection matrix (3x4). If empty or identity, output will be in normalized camera coordinates.
criteriaTermination 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.