ShapeTransformer
import { ShapeTransformer } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.
Abstract base class for shape transformation algorithms.
Constructors and members
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
estimateTransformation
Estimate the transformation parameters of the current transformer algorithm, based on point matches.
estimateTransformation(transformingShape: Mat, targetShape: Mat, matches: DMatchVector): void;transformingShapeContour defining first shape.
targetShapeContour defining second shape (Target).
matchesStandard vector of Matches between points.
applyTransformation
Apply a transformation, given a pre-estimated transformation parameters.
applyTransformation(input: Mat, output: Mat): number;2 available overloads
applyTransformation(input: Mat): number;applyTransformation(input: Mat, output: Mat): number;inputContour (set of points) to apply the transformation.
outputOutput destination, filled by the native operation. Output contour.
The number result.
warpImage
Apply a transformation, given a pre-estimated transformation parameters, to an Image.
warpImage(transformingImage: Mat, output: Mat, flags: number, borderMode: number, borderValue: Scalar): void;4 available overloads
warpImage(transformingImage: Mat, output: Mat): void;warpImage(transformingImage: Mat, output: Mat, flags: number): void;warpImage(transformingImage: Mat, output: Mat, flags: number, borderMode: number): void;warpImage(transformingImage: Mat, output: Mat, flags: number, borderMode: number, borderValue: Scalar): void;transformingImageInput image.
outputOutput destination, filled by the native operation. Output image.
flagsImage interpolation method.
borderModeborder style.
borderValueborder value.
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.