fisheye_undistortImage
import { fisheye_undistortImage } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Transforms an image to compensate for fisheye lens distortion.
fisheye_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, Knew: Mat, new_size: Size): void;3 available overloads
fisheye_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat): void;fisheye_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, Knew: Mat): void;fisheye_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, Knew: Mat, new_size: Size): void;distortedimage with fisheye lens distortion.
undistortedOutput destination, filled by the native operation. Output image with compensated fisheye lens distortion.
KCamera intrinsic matrix
cameramatrix{K}.DInput vector of distortion coefficients
\distcoeffsfisheye.KnewCamera intrinsic matrix of the distorted image. By default, it is the identity matrix but you may additionally scale and shift the result by using a different matrix.
new_sizethe new size
The function transforms an image to compensate radial and tangential lens distortion.
The function is simply a combination of #cv::fisheye::initUndistortRectifyMap (with unity R ) and remap (with bilinear interpolation). See the former function for details of the transformation being performed.
See below the results of undistortImage.
- a) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3, k_4, k_5, k_6) of distortion were optimized under calibration)
- b) result of #cv::fisheye::undistortImage of fisheye camera model (all possible coefficients (k_1, k_2, k_3, k_4) of fisheye distortion were optimized under calibration)
- c) original image was captured with fisheye lens
Pictures a) and b) almost the same. But if we consider points of image located far from the center of image, we can notice that on image a) these points are distorted.

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.