Skip to content

reg_MapAffine

regclassOpenCV 5.0.0
import { reg_MapAffine } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSreg_MapAffine
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 reg_Map.

Defines an affine transformation

Constructors and members

static new

Default constructor builds an identity map

new(linTr: Mat, shift: Mat): reg_MapAffine;
2 available overloads
new(): reg_MapAffine;
new(linTr: Mat, shift: Mat): reg_MapAffine;
linTr

Linear part of the affine transformation

shift

Displacement part of the affine transformation

Returns

The reg_MapAffine result.

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.

inverseWarp

Warps image to a new coordinate frame. The calculation is img2(x)=img1(T(x)), so in fact this is the inverse warping as we are taking the value of img1 with the forward transformation of the points.

inverseWarp(img1: Mat, img2: Mat): void;
img1

Original image

img2

Output destination, filled by the native operation. Warped image

inverseMap

Calculates the inverse map

inverseMap(): reg_Map | null;
Returns

Inverse map

compose

Changes the map composing the current transformation with the one provided in the call. The order is first the current transformation, then the input argument.

compose(map: reg_Map | null): void;
map

Transformation to compose with.

scale

Scales the map by a given factor as if the coordinates system is expanded/compressed by that factor.

scale(factor: number): void;
factor

Expansion if bigger than one, compression if smaller than one

getLinTr

Return linear part of the affine transformation

getLinTr(linTr: Mat): void;
linTr

Output destination, filled by the native operation. lin tr argument (Mat).

getShift

Return displacement part of the affine transformation

getShift(shift: Mat): void;
shift

Output destination, filled by the native operation. shift argument (Mat).

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.