OpenCV 5.0.0
Open Source Computer Vision
Loading...
Searching...
No Matches
Feature Detection and Description

Detailed Description

Classes

struct  cv::Accumulator< T >
struct  cv::Accumulator< char >
struct  cv::Accumulator< short >
struct  cv::Accumulator< unsigned char >
struct  cv::Accumulator< unsigned short >
class  cv::AffineFeature
 Class for implementing the wrapper which makes detectors and extractors to be affine invariant, described as ASIFT in [YM11] . More...
class  cv::ALIKED
 ALIKED feature detector and descriptor extractor. More...
class  cv::DISK
 DISK feature detector and descriptor, based on a DNN model. More...
class  cv::FastFeatureDetector
 Wrapping class for feature detection using the FAST method. More...
class  cv::Feature2D
 Abstract base class for 2D image feature detectors and descriptor extractors. More...
class  cv::GFTTDetector
 Wrapping class for feature detection using the goodFeaturesToTrack function. : More...
class  cv::KeyPointsFilter
 A class filters a vector of keypoints. More...
struct  cv::L1< T >
struct  cv::L2< T >
class  cv::MSER
 Maximally stable extremal region extractor. More...
class  cv::ORB
 Class implementing the ORB (oriented BRIEF) keypoint detector and descriptor extractor. More...
class  cv::SIFT
 Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform (SIFT) algorithm by D. Lowe [Lowe04] . More...
class  cv::SimpleBlobDetector
 Class for extracting blobs from an image. : More...
struct  cv::SL2< T >

Typedefs

typedef AffineFeature cv::AffineDescriptorExtractor
typedef AffineFeature cv::AffineFeatureDetector
typedef Feature2D cv::DescriptorExtractor
typedef Feature2D cv::FeatureDetector
typedef SIFT cv::SiftDescriptorExtractor
typedef SIFT cv::SiftFeatureDetector

Functions

void cv::computeRecallPrecisionCurve (const std::vector< std::vector< DMatch > > &matches1to2, const std::vector< std::vector< uchar > > &correctMatches1to2Mask, std::vector< Point2f > &recallPrecisionCurve)
void cv::evaluateFeatureDetector (const Mat &img1, const Mat &img2, const Mat &H1to2, std::vector< KeyPoint > *keypoints1, std::vector< KeyPoint > *keypoints2, float &repeatability, int &correspCount, const Ptr< FeatureDetector > &fdetector=Ptr< FeatureDetector >())
void cv::FAST (InputArray image, std::vector< KeyPoint > &keypoints, int threshold, bool nonmaxSuppression=true, FastFeatureDetector::DetectorType type=FastFeatureDetector::TYPE_9_16)
 Detects corners using the FAST algorithm.
int cv::getNearestPoint (const std::vector< Point2f > &recallPrecisionCurve, float l_precision)
float cv::getRecall (const std::vector< Point2f > &recallPrecisionCurve, float l_precision)
void cv::goodFeaturesToTrack (InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask, int blockSize, int gradientSize, bool useHarrisDetector=false, double k=0.04)
void cv::goodFeaturesToTrack (InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask, OutputArray cornersQuality, int blockSize=3, int gradientSize=3, bool useHarrisDetector=false, double k=0.04)
 Same as above, but returns also quality measure of the detected corners.
void cv::goodFeaturesToTrack (InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask=noArray(), int blockSize=3, bool useHarrisDetector=false, double k=0.04)
 Determines strong corners on an image.

Typedef Documentation

◆ AffineDescriptorExtractor

◆ AffineFeatureDetector

◆ DescriptorExtractor

#include <opencv2/features.hpp>

Extractors of keypoint descriptors in OpenCV have wrappers with a common interface that enables you to easily switch between different algorithms solving the same problem. This section is devoted to computing descriptors represented as vectors in a multidimensional space. All objects that implement the vector descriptor extractors inherit the DescriptorExtractor interface.

◆ FeatureDetector

#include <opencv2/features.hpp>

Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch between different algorithms solving the same problem. All objects that implement keypoint detectors inherit the FeatureDetector interface.

◆ SiftDescriptorExtractor

◆ SiftFeatureDetector

Function Documentation

◆ computeRecallPrecisionCurve()

void cv::computeRecallPrecisionCurve ( const std::vector< std::vector< DMatch > > & matches1to2,
const std::vector< std::vector< uchar > > & correctMatches1to2Mask,
std::vector< Point2f > & recallPrecisionCurve )

◆ evaluateFeatureDetector()

void cv::evaluateFeatureDetector ( const Mat & img1,
const Mat & img2,
const Mat & H1to2,
std::vector< KeyPoint > * keypoints1,
std::vector< KeyPoint > * keypoints2,
float & repeatability,
int & correspCount,
const Ptr< FeatureDetector > & fdetector = PtrFeatureDetector >() )

◆ FAST()

void cv::FAST ( InputArray image,
std::vector< KeyPoint > & keypoints,
int threshold,
bool nonmaxSuppression = true,
FastFeatureDetector::DetectorType type = FastFeatureDetector::TYPE_9_16 )

#include <opencv2/features.hpp>

Detects corners using the FAST algorithm.

Parameters
imagegrayscale image where keypoints (corners) are detected.
keypointskeypoints detected on the image.
thresholdthreshold on difference between intensity of the central pixel and pixels of a circle around this pixel.
nonmaxSuppressionif true, non-maximum suppression is applied to detected keypoints (corners).
typeone of the three neighborhoods as defined in the paper: FastFeatureDetector::TYPE_9_16, FastFeatureDetector::TYPE_7_12, FastFeatureDetector::TYPE_5_8

Detects corners using the FAST algorithm by [Rosten06] .

Check the corresponding tutorial for more details.

◆ getNearestPoint()

int cv::getNearestPoint ( const std::vector< Point2f > & recallPrecisionCurve,
float l_precision )

◆ getRecall()

float cv::getRecall ( const std::vector< Point2f > & recallPrecisionCurve,
float l_precision )

◆ goodFeaturesToTrack() [1/3]

void cv::goodFeaturesToTrack ( InputArray image,
OutputArray corners,
int maxCorners,
double qualityLevel,
double minDistance,
InputArray mask,
int blockSize,
int gradientSize,
bool useHarrisDetector = false,
double k = 0.04 )
Python:
cv.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners
cv.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]) -> corners
cv.goodFeaturesToTrackWithQuality(image, maxCorners, qualityLevel, minDistance, mask[, corners[, cornersQuality[, blockSize[, gradientSize[, useHarrisDetector[, k]]]]]]) -> corners, cornersQuality

◆ goodFeaturesToTrack() [2/3]

void cv::goodFeaturesToTrack ( InputArray image,
OutputArray corners,
int maxCorners,
double qualityLevel,
double minDistance,
InputArray mask,
OutputArray cornersQuality,
int blockSize = 3,
int gradientSize = 3,
bool useHarrisDetector = false,
double k = 0.04 )
Python:
cv.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners
cv.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]) -> corners
cv.goodFeaturesToTrackWithQuality(image, maxCorners, qualityLevel, minDistance, mask[, corners[, cornersQuality[, blockSize[, gradientSize[, useHarrisDetector[, k]]]]]]) -> corners, cornersQuality

#include <opencv2/features.hpp>

Same as above, but returns also quality measure of the detected corners.

Parameters
imageInput 8-bit or floating-point 32-bit, single-channel image.
cornersOutput vector of detected corners.
maxCornersMaximum number of corners to return. If there are more corners than are found, the strongest of them is returned. maxCorners <= 0 implies that no limit on the maximum is set and all detected corners are returned.
qualityLevelParameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see cornerMinEigenVal ) or the Harris function response (see cornerHarris ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected.
minDistanceMinimum possible Euclidean distance between the returned corners.
maskRegion of interest. If the image is not empty (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
cornersQualityOutput vector of quality measure of the detected corners.
blockSizeSize of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs .
gradientSizeAperture parameter for the Sobel operator used for derivatives computation. See cornerEigenValsAndVecs .
useHarrisDetectorParameter indicating whether to use a Harris detector (see cornerHarris) or cornerMinEigenVal.
kFree parameter of the Harris detector.

◆ goodFeaturesToTrack() [3/3]

void cv::goodFeaturesToTrack ( InputArray image,
OutputArray corners,
int maxCorners,
double qualityLevel,
double minDistance,
InputArray mask = noArray(),
int blockSize = 3,
bool useHarrisDetector = false,
double k = 0.04 )
Python:
cv.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners
cv.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]) -> corners
cv.goodFeaturesToTrackWithQuality(image, maxCorners, qualityLevel, minDistance, mask[, corners[, cornersQuality[, blockSize[, gradientSize[, useHarrisDetector[, k]]]]]]) -> corners, cornersQuality

#include <opencv2/features.hpp>

Determines strong corners on an image.

The function finds the most prominent corners in the image or in the specified image region, as described in [Shi94]

  • Function calculates the corner quality measure at every source image pixel using the cornerMinEigenVal or cornerHarris .
  • Function performs a non-maximum suppression (the local maximums in 3 x 3 neighborhood are retained).
  • The corners with the minimal eigenvalue less than \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) are rejected.
  • The remaining corners are sorted by the quality measure in the descending order.
  • Function throws away each corner for which there is a stronger corner at a distance less than maxDistance.

The function can be used to initialize a point-based tracker of an object.

Note
If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
Parameters
imageInput 8-bit or floating-point 32-bit, single-channel image.
cornersOutput vector of detected corners.
maxCornersMaximum number of corners to return. If there are more corners than are found, the strongest of them is returned. maxCorners <= 0 implies that no limit on the maximum is set and all detected corners are returned.
qualityLevelParameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see cornerMinEigenVal ) or the Harris function response (see cornerHarris ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected.
minDistanceMinimum possible Euclidean distance between the returned corners.
maskOptional region of interest. If the image is not empty (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
blockSizeSize of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs .
useHarrisDetectorParameter indicating whether to use a Harris detector (see cornerHarris) or cornerMinEigenVal.
kFree parameter of the Harris detector.
See also
cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
Examples
samples/cpp/lkdemo.cpp.