feature_detection_and_description.rst 12.5 KB

Feature Detection and Description

Note

  • An example explaining keypoint detection and description can be found at opencv_source_code/samples/cpp/descriptor_extractor_matcher.cpp

FAST

Detects corners using the FAST algorithm

Detects corners using the FAST algorithm by [Rosten06].

Note

In Python API, types are given as cv2.FAST_FEATURE_DETECTOR_TYPE_5_8, cv2.FAST_FEATURE_DETECTOR_TYPE_7_12 and cv2.FAST_FEATURE_DETECTOR_TYPE_9_16. For corner detection, use cv2.FAST.detect() method.

[Rosten06]
  1. Rosten. Machine Learning for High-speed Corner Detection, 2006.

MSER

Maximally stable extremal region extractor.

class MSER : public CvMSERParams
{
public:
    // default constructor
    MSER();
    // constructor that initializes all the algorithm parameters
    MSER( int _delta, int _min_area, int _max_area,
          float _max_variation, float _min_diversity,
          int _max_evolution, double _area_threshold,
          double _min_margin, int _edge_blur_size );
    // runs the extractor on the specified image; returns the MSERs,
    // each encoded as a contour (vector<Point>, see findContours)
    // the optional mask marks the area where MSERs are searched for
    void operator()( const Mat& image, vector<vector<Point> >& msers, const Mat& mask ) const;
};

The class encapsulates all the parameters of the MSER extraction algorithm (see http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions). Also see http://code.opencv.org/projects/opencv/wiki/MSER for useful comments and parameters description.

Note

  • (Python) A complete example showing the use of the MSER detector can be found at opencv_source_code/samples/python2/mser.py

ORB

Class implementing the ORB (oriented BRIEF) keypoint detector and descriptor extractor, described in [RRKB11]. The algorithm uses FAST in pyramids to detect stable keypoints, selects the strongest features using FAST or Harris response, finds their orientation using first-order moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or k-tuples) are rotated according to the measured orientation).

[RRKB11] Ethan Rublee, Vincent Rabaud, Kurt Konolige, Gary R. Bradski: ORB: An efficient alternative to SIFT or SURF. ICCV 2011: 2564-2571.

ORB::ORB

The ORB constructor

ORB::operator()

Finds keypoints in an image and computes their descriptors

BRISK

Class implementing the BRISK keypoint detector and descriptor extractor, described in [LCS11].

[LCS11] Stefan Leutenegger, Margarita Chli and Roland Siegwart: BRISK: Binary Robust Invariant Scalable Keypoints. ICCV 2011: 2548-2555.

BRISK::BRISK

The BRISK constructor

BRISK::BRISK

The BRISK constructor for a custom pattern

BRISK::operator()

Finds keypoints in an image and computes their descriptors

KAZE

Class implementing the KAZE keypoint detector and descriptor extractor, described in [ABD12].

class CV_EXPORTS_W KAZE : public Feature2D
{
public:
    CV_WRAP KAZE();
    CV_WRAP explicit KAZE(bool extended, bool upright, float threshold = 0.001f,
                          int octaves = 4, int sublevels = 4, int diffusivity = DIFF_PM_G2);
};

Note

AKAZE descriptor can only be used with KAZE or AKAZE keypoints

[ABD12] KAZE Features. Pablo F. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision (ECCV), Fiorenze, Italy, October 2012.

KAZE::KAZE

The KAZE constructor

AKAZE

Class implementing the AKAZE keypoint detector and descriptor extractor, described in [ANB13].

class CV_EXPORTS_W AKAZE : public Feature2D
{
public:
    CV_WRAP AKAZE();
    CV_WRAP explicit AKAZE(int descriptor_type, int descriptor_size = 0, int descriptor_channels = 3,
                           float threshold = 0.001f, int octaves = 4, int sublevels = 4, int diffusivity = DIFF_PM_G2);
};

Note

AKAZE descriptors can only be used with KAZE or AKAZE keypoints. Try to avoid using extract and detect instead of operator() due to performance reasons.

[ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear Scale Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. In British Machine Vision Conference (BMVC), Bristol, UK, September 2013.

AKAZE::AKAZE

The AKAZE constructor

SIFT

The SIFT algorithm has been moved to opencv_contrib/xfeatures2d module.