getPerspectiveTransform
import { getPerspectiveTransform } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calculates a perspective transform from four pairs of the corresponding points.
The function calculates the 3 \times 3 matrix of a perspective transform so that:
\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_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,3
See: findHomography, warpPerspective, perspectiveTransform
getPerspectiveTransform(src: Mat, dst: Mat, solveMethod: number): Mat;2 available overloads
getPerspectiveTransform(src: Mat, dst: Mat): Mat;getPerspectiveTransform(src: Mat, dst: Mat, solveMethod: number): Mat;srcCoordinates of quadrangle vertices in the source image.
dstCoordinates of the corresponding quadrangle vertices in the destination image.
solveMethodmethod passed to cv::solve (#DecompTypes)
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.