Skip to content

xfeatures2d_SURF

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

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

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

Class for extracting Speeded Up Robust Features from an image [Bay06] .

The algorithm parameters:

  • member int extended
    • 0 means that the basic descriptors (64 elements each) shall be computed
    • 1 means that the extended descriptors (128 elements each) shall be computed
  • member int upright
    • 0 means that detector computes orientation of each feature.
    • 1 means that the orientation is not computed (which is much, much faster). For example, if you match images from a stereo pair, or do image stitching, the matched features likely have very similar angles, and you can speed up feature extraction by setting upright=1.
  • member double hessianThreshold Threshold for the keypoint detector. Only features, whose hessian is larger than hessianThreshold are retained by the detector. Therefore, the larger the value, the less keypoints you will get. A good default value could be from 300 to 500, depending from the image contrast.
  • member int nOctaves The number of a gaussian pyramid octaves that the detector uses. It is set to 4 by default. If you want to get very large features, use the larger value. If you want just small features, decrease it.
  • member int nOctaveLayers The number of images within each octave of a gaussian pyramid. It is set to 2 by default.

Note: - An example using the SURF feature detector can be found at opencv_source_code/samples/cpp/generic_descriptor_match.cpp - Another example using the SURF feature detector, extractor and matcher can be found at opencv_source_code/samples/cpp/matcher_simple.cpp

Constructors and members

static create

Create an owned xfeatures2d_SURF instance with the supplied configuration.

Class for extracting Speeded Up Robust Features from an image [Bay06] .

create(hessianThreshold: number, nOctaves: number, nOctaveLayers: number, extended: boolean, upright: boolean): xfeatures2d_SURF | null;
6 available overloads
create(): xfeatures2d_SURF | null;
create(hessianThreshold: number): xfeatures2d_SURF | null;
create(hessianThreshold: number, nOctaves: number): xfeatures2d_SURF | null;
create(hessianThreshold: number, nOctaves: number, nOctaveLayers: number): xfeatures2d_SURF | null;
create(hessianThreshold: number, nOctaves: number, nOctaveLayers: number, extended: boolean): xfeatures2d_SURF | null;
create(hessianThreshold: number, nOctaves: number, nOctaveLayers: number, extended: boolean, upright: boolean): xfeatures2d_SURF | null;
hessianThreshold

Threshold for hessian keypoint detector used in SURF.

nOctaves

Number of pyramid octaves the keypoint detector will use.

nOctaveLayers

Number of octave layers within each octave.

extended

Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors).

upright

Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation).

Returns

The xfeatures2d_SURF | 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.

setHessianThreshold

Set the hessian threshold used by this xfeatures2d_SURF object.

setHessianThreshold(hessianThreshold: number): void;
hessianThreshold

hessian threshold argument (number).

getHessianThreshold

Return the hessian threshold configured on this xfeatures2d_SURF object.

getHessianThreshold(): number;
Returns

The number result.

setNOctaves

Set the noctaves used by this xfeatures2d_SURF object.

setNOctaves(nOctaves: number): void;
nOctaves

n octaves argument (number).

getNOctaves

Return the noctaves configured on this xfeatures2d_SURF object.

getNOctaves(): number;
Returns

The number result.

setNOctaveLayers

Set the noctave layers used by this xfeatures2d_SURF object.

setNOctaveLayers(nOctaveLayers: number): void;
nOctaveLayers

n octave layers argument (number).

getNOctaveLayers

Return the noctave layers configured on this xfeatures2d_SURF object.

getNOctaveLayers(): number;
Returns

The number result.

setExtended

Set the extended used by this xfeatures2d_SURF object.

setExtended(extended: boolean): void;
extended

extended argument (boolean).

getExtended

Return the extended configured on this xfeatures2d_SURF object.

getExtended(): boolean;
Returns

The boolean result.

setUpright

Set the upright used by this xfeatures2d_SURF object.

setUpright(upright: boolean): void;
upright

upright argument (boolean).

getUpright

Return the upright configured on this xfeatures2d_SURF object.

getUpright(): boolean;
Returns

The boolean result.

getDefaultName

Return the default name configured on this xfeatures2d_SURF 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.