Skip to content

xfeatures2d_LATCH

xfeatures2dclassOpenCV 5.0.0
import { xfeatures2d_LATCH } from '@banou/opencv-wasm'

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

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

LATCH Descriptor latch Class for computing the LATCH descriptor. If you find this code useful, please add a reference to the following paper in your work: Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015

LATCH is a binary descriptor based on learned comparisons of triplets of image patches. bytes is the size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1 rotationInvariance - whether or not the descriptor should compansate for orientation changes. half_ssd_size - the size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x then the half_ssd_size should be (7-1)/2 = 3. sigma - sigma value for GaussianBlur smoothing of the source image. Source image will be used without smoothing in case sigma value is 0.

Note: the descriptor can be coupled with any keypoint extractor. The only demand is that if you use set rotationInvariance = True then you will have to use an extractor which estimates the patch orientation (in degrees). Examples for such extractors are ORB and SIFT.

Note: a complete example can be found under /samples/cpp/tutorial_code/xfeatures2D/latch_match.cpp

Constructors and members

static create

Create an owned xfeatures2d_LATCH instance with the supplied configuration.

LATCH Descriptor latch Class for computing the LATCH descriptor. If you find this code useful, please add a reference to the following paper in your work: Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015

create(bytes: number, rotationInvariance: boolean, half_ssd_size: number, sigma: number): xfeatures2d_LATCH | null;
5 available overloads
create(): xfeatures2d_LATCH | null;
create(bytes: number): xfeatures2d_LATCH | null;
create(bytes: number, rotationInvariance: boolean): xfeatures2d_LATCH | null;
create(bytes: number, rotationInvariance: boolean, half_ssd_size: number): xfeatures2d_LATCH | null;
create(bytes: number, rotationInvariance: boolean, half_ssd_size: number, sigma: number): xfeatures2d_LATCH | null;
bytes

bytes argument (number).

rotationInvariance

rotation invariance argument (boolean).

half_ssd_size

half ssd size argument (number).

sigma

sigma argument (number).

Returns

The xfeatures2d_LATCH | null 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.

setBytes

Set the bytes used by this xfeatures2d_LATCH object.

setBytes(bytes: number): void;
bytes

bytes argument (number).

getBytes

Return the bytes configured on this xfeatures2d_LATCH object.

getBytes(): number;
Returns

The number result.

setRotationInvariance

Set the rotation invariance used by this xfeatures2d_LATCH object.

setRotationInvariance(rotationInvariance: boolean): void;
rotationInvariance

rotation invariance argument (boolean).

getRotationInvariance

Return the rotation invariance configured on this xfeatures2d_LATCH object.

getRotationInvariance(): boolean;
Returns

The boolean result.

setHalfSSDsize

Set the half ssdsize used by this xfeatures2d_LATCH object.

setHalfSSDsize(half_ssd_size: number): void;
half_ssd_size

half ssd size argument (number).

getHalfSSDsize

Return the half ssdsize configured on this xfeatures2d_LATCH object.

getHalfSSDsize(): number;
Returns

The number result.

setSigma

Set the sigma used by this xfeatures2d_LATCH object.

setSigma(sigma: number): void;
sigma

sigma argument (number).

getSigma

Return the sigma configured on this xfeatures2d_LATCH object.

getSigma(): number;
Returns

The number result.

getDefaultName

Return the default name configured on this xfeatures2d_LATCH object.

getDefaultName(): string;
Returns

The string result.

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.