Skip to content

ShapeTransformer

shapeclassOpenCV 5.0.0
import { ShapeTransformer } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSShapeTransformer
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

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;
Returns

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;
transformingShape

Contour defining first shape.

targetShape

Contour defining second shape (Target).

matches

Standard 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;
input

Contour (set of points) to apply the transformation.

output

Output destination, filled by the native operation. Output contour.

Returns

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;
transformingImage

Input image.

output

Output destination, filled by the native operation. Output image.

flags

Image interpolation method.

borderMode

border style.

borderValue

border 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.