Table of Contents

Class SURF

Namespace
OpenCvSharp.XFeatures2D
Assembly
OpenCvSharp.dll

Class for extracting Speeded Up Robust Features from an image.

public class SURF : Feature2D, IDisposable, ICvPtrHolder
Inheritance
SURF
Implements
Inherited Members

Constructors

SURF(nint)

Creates instance by raw pointer cv::SURF*

protected SURF(nint p)

Parameters

p nint

Properties

Extended

false means that the basic descriptors (64 elements each) shall be computed. true means that the extended descriptors (128 elements each) shall be computed

public bool Extended { get; set; }

Property Value

bool

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.

public double HessianThreshold { get; set; }

Property Value

double

NOctaveLayers

The number of images within each octave of a gaussian pyramid. It is set to 2 by default.

public int NOctaveLayers { get; set; }

Property Value

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.

public int NOctaves { get; set; }

Property Value

int

Upright

false means that detector computes orientation of each feature. true 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=true.

public bool Upright { get; set; }

Property Value

bool

Methods

Create(double, int, int, bool, bool)

The SURF constructor.

public static SURF Create(double hessianThreshold, int nOctaves = 4, int nOctaveLayers = 2, bool extended = true, bool upright = false)

Parameters

hessianThreshold double

Only features with keypoint.hessian larger than that are extracted.

nOctaves int

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.

nOctaveLayers int

The number of images within each octave of a gaussian pyramid. It is set to 2 by default.

extended bool

false means basic descriptors (64 elements each), true means extended descriptors (128 elements each)

upright bool

false means that detector computes orientation of each feature. true means that the orientation is not computed (which is much, much faster).

Returns

SURF

DisposeManaged()

Releases managed resources

protected override void DisposeManaged()