Class cv::Feature2D#

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

Collaboration diagram for cv::Feature2D:

Public Member Functions#

Public Member Functions inherited from cv::Algorithm

Return

Name

Description

Algorithm()

~Algorithm()

void

clear()

Clears the algorithm state.

bool

empty()

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.

String

getDefaultName()

void

read(const FileNode & fn)

Reads algorithm parameters from a file storage.

void

save(const String & filename)

void

write(
    const Ptr< FileStorage > & fs,
    const String & name = String() )

void

write(FileStorage & fs)

Stores algorithm parameters in a file storage.

void

write(
    FileStorage & fs,
    const String & name )

Static Public Member Functions#

Static Public Member Functions inherited from cv::Algorithm

Return

Name

Description

static Ptr< _Tp >

load(
    const String & filename,
    const String & objname = String() )

Loads algorithm from the file.

static Ptr< _Tp >

loadFromString(
    const String & strModel,
    const String & objname = String() )

Loads algorithm from a String.

static Ptr< _Tp >

read(const FileNode & fn)

Reads algorithm from the file node.

Additional Inherited Members#

Protected Member Functions inherited from cv::Algorithm

Return

Name

Description

void

writeFormat(FileStorage & fs)

Detailed Description#

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

Examples
samples/cpp/stitching_detailed.cpp.

Constructor & Destructor Documentation#

~Feature2D()#

cv::Feature2D::~Feature2D()

Member Function Documentation#

compute()#

void cv::Feature2D::compute(
InputArray image,
std::vector< KeyPoint > & keypoints,
OutputArray descriptors )

Python:

cv.Feature2D.compute(image, keypoints[, descriptors]) -> keypoints, descriptors
cv.Feature2D.compute(images, keypoints[, descriptors]) -> keypoints, descriptors

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

Parameters

  • image — Image.

  • keypoints — 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 — 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.

compute()#

void cv::Feature2D::compute(
InputArrayOfArrays images,
std::vector< std::vector< KeyPoint > > & keypoints,
OutputArrayOfArrays descriptors )

Python:

cv.Feature2D.compute(image, keypoints[, descriptors]) -> keypoints, descriptors
cv.Feature2D.compute(images, keypoints[, descriptors]) -> keypoints, descriptors

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  • images — Image set.

  • keypoints — 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 — 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.

defaultNorm()#

int cv::Feature2D::defaultNorm()

Python:

cv.Feature2D.defaultNorm() -> retval

descriptorSize()#

int cv::Feature2D::descriptorSize()

Python:

cv.Feature2D.descriptorSize() -> retval

descriptorType()#

int cv::Feature2D::descriptorType()

Python:

cv.Feature2D.descriptorType() -> retval

detect()#

void cv::Feature2D::detect(
InputArray image,
std::vector< KeyPoint > & keypoints,
InputArray mask = noArray() )

Python:

cv.Feature2D.detect(image[, mask]) -> keypoints
cv.Feature2D.detect(images[, masks]) -> keypoints

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

Parameters

  • image — Image.

  • keypoints — 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.

Here is the call graph for this function:

cv::Feature2D::detect Node1 cv::Feature2D::detect Node2 cv::noArray Node1->Node2

cv::Feature2D::detect Node1 cv::Feature2D::detect Node2 cv::noArray Node1->Node2

detect()#

void cv::Feature2D::detect(
InputArrayOfArrays images,
std::vector< std::vector< KeyPoint > > & keypoints,
InputArrayOfArrays masks = noArray() )

Python:

cv.Feature2D.detect(image[, mask]) -> keypoints
cv.Feature2D.detect(images[, masks]) -> keypoints

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  • images — Image set.

  • keypoints — 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].

Here is the call graph for this function:

cv::Feature2D::detect Node1 cv::Feature2D::detect Node2 cv::noArray Node1->Node2

cv::Feature2D::detect Node1 cv::Feature2D::detect Node2 cv::noArray Node1->Node2

detectAndCompute()#

void cv::Feature2D::detectAndCompute(
InputArray image,
InputArray mask,
std::vector< KeyPoint > & keypoints,
OutputArray descriptors,
bool useProvidedKeypoints = false )

Python:

cv.Feature2D.detectAndCompute(image, mask[, descriptors[, useProvidedKeypoints]]) -> keypoints, descriptors

Detects keypoints and computes the descriptors

empty()#

bool cv::Feature2D::empty()

Python:

cv.Feature2D.empty() -> retval

Return true if detector object is empty.

getDefaultName()#

String cv::Feature2D::getDefaultName()

Python:

cv.Feature2D.getDefaultName() -> retval

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.

read()#

void cv::Feature2D::read(const FileNode & fn)

Python:

cv.Feature2D.read(fileName)
cv.Feature2D.read(arg1)

Reads algorithm parameters from a file storage.

read()#

void cv::Feature2D::read(const String & fileName)

Python:

cv.Feature2D.read(fileName)
cv.Feature2D.read(arg1)

write()#

void cv::Feature2D::write(const String & fileName)

Python:

cv.Feature2D.write(fileName)
cv.Feature2D.write(fs, name)

write()#

void cv::Feature2D::write(FileStorage & fs)

Python:

cv.Feature2D.write(fileName)
cv.Feature2D.write(fs, name)

Stores algorithm parameters in a file storage.

write()#

void cv::Feature2D::write(
FileStorage & fs,
const String & name )

Python:

cv.Feature2D.write(fileName)
cv.Feature2D.write(fs, name)

Source file#

The documentation for this class was generated from the following file: