Skip to content

omnidir_undistortImage

ccalibfunctionOpenCV 5.0.0
import { omnidir_undistortImage } from '@banou/opencv-wasm'

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

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

Undistort omnidirectional images to perspective images

omnidir_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, xi: Mat, flags: number, Knew: Mat, new_size: Size, R: Mat): void;
4 available overloads
omnidir_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, xi: Mat, flags: number): void;
omnidir_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, xi: Mat, flags: number, Knew: Mat): void;
omnidir_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, xi: Mat, flags: number, Knew: Mat, new_size: Size): void;
omnidir_undistortImage(distorted: Mat, undistorted: Mat, K: Mat, D: Mat, xi: Mat, flags: number, Knew: Mat, new_size: Size, R: Mat): void;
distorted

The input omnidirectional image.

undistorted

Output destination, filled by the native operation. The output undistorted image.

K

Camera matrix K = \vecthreethree{f_x}{s}{c_x}{0}{f_y}{c_y}{0}{0}{_1}.

D

Input vector of distortion coefficients (k_1, k_2, p_1, p_2).

xi

The parameter xi for CMei's model.

flags

Flags indicates the rectification type, RECTIFY_PERSPECTIVE, RECTIFY_CYLINDRICAL, RECTIFY_LONGLATI and RECTIFY_STEREOGRAPHIC

Knew

Camera matrix of the distorted image. If it is not assigned, it is just K.

new_size

The new image size. By default, it is the size of distorted.

R

Rotation matrix between the input and output images. By default, it is identity matrix.

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.