xfeatures2d_SURF
import { xfeatures2d_SURF } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;hessianThresholdThreshold for hessian keypoint detector used in SURF.
nOctavesNumber of pyramid octaves the keypoint detector will use.
nOctaveLayersNumber of octave layers within each octave.
extendedExtended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors).
uprightUp-right or rotated features flag (true - do not compute orientation of features; false - compute orientation).
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;The this result.
setHessianThreshold
Set the hessian threshold used by this xfeatures2d_SURF object.
setHessianThreshold(hessianThreshold: number): void;hessianThresholdhessian threshold argument (number).
getHessianThreshold
Return the hessian threshold configured on this xfeatures2d_SURF object.
getHessianThreshold(): number;The number result.
setNOctaves
Set the noctaves used by this xfeatures2d_SURF object.
setNOctaves(nOctaves: number): void;nOctavesn octaves argument (number).
getNOctaves
Return the noctaves configured on this xfeatures2d_SURF object.
getNOctaves(): number;The number result.
setNOctaveLayers
Set the noctave layers used by this xfeatures2d_SURF object.
setNOctaveLayers(nOctaveLayers: number): void;nOctaveLayersn octave layers argument (number).
getNOctaveLayers
Return the noctave layers configured on this xfeatures2d_SURF object.
getNOctaveLayers(): number;The number result.
setExtended
Set the extended used by this xfeatures2d_SURF object.
setExtended(extended: boolean): void;extendedextended argument (boolean).
getExtended
Return the extended configured on this xfeatures2d_SURF object.
getExtended(): boolean;The boolean result.
setUpright
Set the upright used by this xfeatures2d_SURF object.
setUpright(upright: boolean): void;uprightupright argument (boolean).
getUpright
Return the upright configured on this xfeatures2d_SURF object.
getUpright(): boolean;The boolean result.
getDefaultName
Return the default name configured on this xfeatures2d_SURF object.
getDefaultName(): string;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.