Skip to content

reg_Map

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

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

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

Base class for modelling a Map between two images.

The class is only used to define the common interface for any possible map.

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.

warp

Warps image to a new coordinate frame. The calculation is img2(x)=img1(T^{-1}(x)), as we have to apply the inverse transformation to the points to move them to were the values of img2 are.

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

Original image

img2

Output destination, filled by the native operation. Warped image

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

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.