gapi_warpPerspective
import { gapi_warpPerspective } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Applies a perspective transformation to an image.
The function warpPerspective transforms the source image using the specified matrix:
\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
\frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )
when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place.
See: warpAffine, resize, remap, getRectSubPix, perspectiveTransform
gapi_warpPerspective(src: GMat, M: Mat, dsize: Size, flags: number, borderMode: number, borderValue: Scalar): GMat;4 available overloads
gapi_warpPerspective(src: GMat, M: Mat, dsize: Size): GMat;gapi_warpPerspective(src: GMat, M: Mat, dsize: Size, flags: number): GMat;gapi_warpPerspective(src: GMat, M: Mat, dsize: Size, flags: number, borderMode: number): GMat;gapi_warpPerspective(src: GMat, M: Mat, dsize: Size, flags: number, borderMode: number, borderValue: Scalar): GMat;srcinput image.
M3\times 3transformation matrix.dsizesize of the output image.
flagscombination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
\texttt{dst}\rightarrow\texttt{src}).borderModepixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).
borderValuevalue used in case of a constant border; by default, it equals 0.
The GMat 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.