Skip to content

AlignMTB

Computational photographyclassOpenCV 5.0.0
import { AlignMTB } from '@banou/opencv-wasm'

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

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

This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations.

It is invariant to exposure, so exposure values and camera response are not necessary.

In this implementation new image regions are filled with zeros.

For more information see [GW03] .

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.

process

AlignMTB.process: Aligns images

process(src: MatVector, dst: MatVector, times: Mat, response: Mat): void;
src

vector of input images

dst

vector of aligned images

times

vector of exposure time values for each image

response

256x1 matrix with inverse camera response function for each pixel value, it should have the same number of channels as images.

process1

Short version of process, that doesn't take extra arguments.

process1(src: MatVector, dst: MatVector): void;
src

vector of input images

dst

vector of aligned images

calculateShift

Calculates shift between two images, i. e. how to shift the second image to correspond it with the first.

calculateShift(img0: Mat, img1: Mat): Point;
img0

first image

img1

second image

Returns

The Point result.

shiftMat

Helper function, that shift Mat filling new regions with zeros.

shiftMat(src: Mat, dst: Mat, shift: Point): void;
src

input image

dst

Output destination, filled by the native operation. result image

shift

shift value

computeBitmaps

Computes median threshold and exclude bitmaps of given image.

computeBitmaps(img: Mat, tb: Mat, eb: Mat): void;
img

input image

tb

Output destination, filled by the native operation. median threshold bitmap

eb

Output destination, filled by the native operation. exclude bitmap

getMaxBits

Return the max bits configured on this AlignMTB object.

getMaxBits(): number;
Returns

The number result.

setMaxBits

Set the max bits used by this AlignMTB object.

setMaxBits(max_bits: number): void;
max_bits

max bits argument (number).

getExcludeRange

Return the exclude range configured on this AlignMTB object.

getExcludeRange(): number;
Returns

The number result.

setExcludeRange

Set the exclude range used by this AlignMTB object.

setExcludeRange(exclude_range: number): void;
exclude_range

exclude range argument (number).

getCut

Return the cut configured on this AlignMTB object.

getCut(): boolean;
Returns

The boolean result.

setCut

Set the cut used by this AlignMTB object.

setCut(value: boolean): void;
value

value argument (boolean).

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.