Skip to content

getAffineTransform

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

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

Calculates an affine transform from three pairs of the corresponding points.

The function calculates the 2 \times 3 matrix of an affine transform so that:

\begin{bmatrix} x'_i \\ y'_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}

where

dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2

See: warpAffine, transform

getAffineTransform(src: Mat, dst: Mat): Mat;
src

Coordinates of triangle vertices in the source image.

dst

Coordinates of the corresponding triangle vertices in the destination image.

Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

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.