Table of Contents

Class Feature2D

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

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

public class Feature2D : Algorithm, IDisposable, ICvPtrHolder
Inheritance
Feature2D
Implements
Derived
Inherited Members

Constructors

Feature2D()

protected Feature2D()

Properties

DefaultNorm

public virtual int DefaultNorm { get; }

Property Value

int

DescriptorSize

public virtual int DescriptorSize { get; }

Property Value

int

DescriptorType

public virtual int DescriptorType { get; }

Property Value

int

Methods

Compute(InputArray, ref KeyPoint[], OutputArray)

Compute the descriptors for a set of keypoints in an image.

public virtual void Compute(InputArray image, ref KeyPoint[] keypoints, OutputArray descriptors)

Parameters

image InputArray

The image.

keypoints KeyPoint[]

The input keypoints. Keypoints for which a descriptor cannot be computed are removed.

descriptors OutputArray

Computed descriptors. Row i is the descriptor for KeyPoint i.

Compute(IEnumerable<Mat>, ref KeyPoint[][], IEnumerable<Mat>)

Compute the descriptors for a keypoints collection detected in image collection.

public virtual void Compute(IEnumerable<Mat> images, ref KeyPoint[][] keypoints, IEnumerable<Mat> descriptors)

Parameters

images IEnumerable<Mat>

Image collection.

keypoints KeyPoint[][]

Input keypoints collection. keypoints[i] is keypoints detected in images[i]. Keypoints for which a descriptor cannot be computed are removed.

descriptors IEnumerable<Mat>

Descriptor collection. descriptors[i] are descriptors computed for set keypoints[i].

Detect(InputArray, Mat?)

Detect keypoints in an image.

public KeyPoint[] Detect(InputArray image, Mat? mask = null)

Parameters

image InputArray

The image.

mask Mat

Mask specifying where to look for keypoints (optional). Must be a char matrix with non-zero values in the region of interest.

Returns

KeyPoint[]

The detected keypoints.

Detect(Mat, Mat?)

Detect keypoints in an image.

public KeyPoint[] Detect(Mat image, Mat? mask = null)

Parameters

image Mat

The image.

mask Mat

Mask specifying where to look for keypoints (optional). Must be a char matrix with non-zero values in the region of interest.

Returns

KeyPoint[]

The detected keypoints.

Detect(IEnumerable<Mat>, IEnumerable<Mat>?)

Detect keypoints in an image set.

public KeyPoint[][] Detect(IEnumerable<Mat> images, IEnumerable<Mat>? masks = null)

Parameters

images IEnumerable<Mat>

Image collection.

masks IEnumerable<Mat>

Masks for image set. masks[i] is a mask for images[i].

Returns

KeyPoint[][]

Collection of keypoints detected in an input images. keypoints[i] is a set of keypoints detected in an images[i].

DetectAndCompute(InputArray, InputArray?, out KeyPoint[], OutputArray, bool)

Detects keypoints and computes the descriptors

public virtual void DetectAndCompute(InputArray image, InputArray? mask, out KeyPoint[] keypoints, OutputArray descriptors, bool useProvidedKeypoints = false)

Parameters

image InputArray
mask InputArray
keypoints KeyPoint[]
descriptors OutputArray
useProvidedKeypoints bool

Empty()

Return true if detector object is empty

public virtual bool Empty()

Returns

bool

GetDefaultName()

public override string GetDefaultName()

Returns

string

Read(string)

public void Read(string fileName)

Parameters

fileName string

Write(string)

public void Write(string fileName)

Parameters

fileName string