Skip to content

Feature2D

Features and matchingclassOpenCV 5.0.0
import { Feature2D } from '@banou/opencv-wasm'

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

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

Base Classes *********************************** Abstract base class for 2D image feature detectors and descriptor extractors

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.

detect

Detects keypoints in an image (first variant) or image set (second variant).

detect(image: Mat, keypoints: KeyPointVector, mask: Mat): void;
2 available overloads
detect(image: Mat, keypoints: KeyPointVector): void;
detect(image: Mat, keypoints: KeyPointVector, mask: Mat): void;
image

Image.

keypoints

Output destination, filled by the native operation. The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] .

mask

Mask specifying where to look for keypoints (optional). It must be a 8-bit integer matrix with non-zero values in the region of interest.

detect1

Detects keypoints in an image (first variant) or image set (second variant).

detect1(images: MatVector, keypoints: KeyPointVectorVector, masks: MatVector): void;
2 available overloads
detect1(images: MatVector, keypoints: KeyPointVectorVector): void;
detect1(images: MatVector, keypoints: KeyPointVectorVector, masks: MatVector): void;
images

Image set.

keypoints

Output destination, filled by the native operation. The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] .

masks

Masks for each input image specifying where to look for keypoints (optional). masks[i] is a mask for images[i].

compute

Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).

compute(image: Mat, keypoints: KeyPointVector, descriptors: Mat): void;
image

Image.

keypoints

Input/output value, modified by the native operation. Input collection of keypoints. Keypoints for which a descriptor cannot be computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint with several dominant orientations (for each orientation).

descriptors

Output destination, filled by the native operation. Computed descriptors. In the second variant of the method descriptors[i] are descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the descriptor for keypoint j-th keypoint.

compute1

Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).

compute1(images: MatVector, keypoints: KeyPointVectorVector, descriptors: MatVector): void;
images

Image set.

keypoints

Input/output value, modified by the native operation. Input collection of keypoints. Keypoints for which a descriptor cannot be computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint with several dominant orientations (for each orientation).

descriptors

Output destination, filled by the native operation. Computed descriptors. In the second variant of the method descriptors[i] are descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the descriptor for keypoint j-th keypoint.

detectAndCompute

Detects keypoints and computes the descriptors

detectAndCompute(image: Mat, mask: Mat, keypoints: KeyPointVector, descriptors: Mat, useProvidedKeypoints: boolean): void;
2 available overloads
detectAndCompute(image: Mat, mask: Mat, keypoints: KeyPointVector, descriptors: Mat): void;
detectAndCompute(image: Mat, mask: Mat, keypoints: KeyPointVector, descriptors: Mat, useProvidedKeypoints: boolean): void;
image

image argument (Mat).

mask

mask argument (Mat).

keypoints

Output destination, filled by the native operation. keypoints argument (KeyPointVector).

descriptors

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

useProvidedKeypoints

use provided keypoints argument (boolean).

descriptorSize

Return the number of elements in one descriptor produced by this feature algorithm.

descriptorSize(): number;
Returns

The number result.

descriptorType

Return the OpenCV element type of the descriptor matrix produced by this algorithm.

descriptorType(): number;
Returns

The number result.

defaultNorm

Return the distance norm recommended for matching this algorithm's descriptors.

defaultNorm(): number;
Returns

The number result.

write

Stores algorithm parameters in a file storage

write(fileName: EmbindString): void;
fileName

file name argument (EmbindString).

write1

see corresponding cv::Algorithm method

write1(fs: FileStorage, name: EmbindString): void;
fs

fs argument (FileStorage).

name

name argument (EmbindString).

read

see corresponding cv::Algorithm method

read(fileName: EmbindString): void;
fileName

file name argument (EmbindString).

read1

see corresponding cv::Algorithm method

read1(arg1: FileNode): void;
arg1

arg1 argument (FileNode).

empty

Return true if detector object is empty

empty(): boolean;
Returns

The boolean result.

getDefaultName

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

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.