• Roman Donchenko's avatar
    Merge remote-tracking branch 'origin/2.4' into merge-2.4 · 95a55453
    Roman Donchenko authored
    Conflicts:
    	modules/calib3d/perf/perf_pnp.cpp
    	modules/contrib/src/imagelogpolprojection.cpp
    	modules/contrib/src/templatebuffer.hpp
    	modules/core/perf/opencl/perf_gemm.cpp
    	modules/cudafeatures2d/doc/feature_detection_and_description.rst
    	modules/cudafeatures2d/perf/perf_features2d.cpp
    	modules/cudafeatures2d/src/fast.cpp
    	modules/cudafeatures2d/test/test_features2d.cpp
    	modules/features2d/doc/feature_detection_and_description.rst
    	modules/features2d/include/opencv2/features2d/features2d.hpp
    	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
    	modules/gpu/include/opencv2/gpu/gpu.hpp
    	modules/gpu/perf/perf_imgproc.cpp
    	modules/gpu/perf4au/main.cpp
    	modules/imgproc/perf/opencl/perf_blend.cpp
    	modules/imgproc/perf/opencl/perf_color.cpp
    	modules/imgproc/perf/opencl/perf_moments.cpp
    	modules/imgproc/perf/opencl/perf_pyramid.cpp
    	modules/objdetect/perf/opencl/perf_hogdetect.cpp
    	modules/ocl/perf/perf_arithm.cpp
    	modules/ocl/perf/perf_bgfg.cpp
    	modules/ocl/perf/perf_blend.cpp
    	modules/ocl/perf/perf_brute_force_matcher.cpp
    	modules/ocl/perf/perf_canny.cpp
    	modules/ocl/perf/perf_filters.cpp
    	modules/ocl/perf/perf_gftt.cpp
    	modules/ocl/perf/perf_haar.cpp
    	modules/ocl/perf/perf_imgproc.cpp
    	modules/ocl/perf/perf_imgwarp.cpp
    	modules/ocl/perf/perf_match_template.cpp
    	modules/ocl/perf/perf_matrix_operation.cpp
    	modules/ocl/perf/perf_ml.cpp
    	modules/ocl/perf/perf_moments.cpp
    	modules/ocl/perf/perf_opticalflow.cpp
    	modules/ocl/perf/perf_precomp.hpp
    	modules/ocl/src/cl_context.cpp
    	modules/ocl/src/opencl/haarobjectdetect.cl
    	modules/video/src/lkpyramid.cpp
    	modules/video/src/precomp.hpp
    	samples/gpu/morphology.cpp
    95a55453
feature_detection_and_description.rst 13.1 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.

BriefDescriptorExtractor

Class for computing BRIEF descriptors described in a paper of Calonder M., Lepetit V., Strecha C., Fua P. BRIEF: Binary Robust Independent Elementary Features , 11th European Conference on Computer Vision (ECCV), Heraklion, Crete. LNCS Springer, September 2010.

class BriefDescriptorExtractor : public DescriptorExtractor
{
public:
    static const int PATCH_SIZE = 48;
    static const int KERNEL_SIZE = 9;

    // bytes is a length of descriptor in bytes. It can be equal 16, 32 or 64 bytes.
    BriefDescriptorExtractor( int bytes = 32 );

    virtual void read( const FileNode& );
    virtual void write( FileStorage& ) const;
    virtual int descriptorSize() const;
    virtual int descriptorType() const;
    virtual int defaultNorm() const;
protected:
    ...
};

Note

  • A complete BRIEF extractor sample can be found at opencv_source_code/samples/cpp/brief_match_test.cpp

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

FREAK

Class implementing the FREAK (Fast Retina Keypoint) keypoint descriptor, described in [AOV12]. The algorithm propose a novel keypoint descriptor inspired by the human visual system and more precisely the retina, coined Fast Retina Key- point (FREAK). A cascade of binary strings is computed by efficiently comparing image intensities over a retinal sampling pattern. FREAKs are in general faster to compute with lower memory load and also more robust than SIFT, SURF or BRISK. They are competitive alternatives to existing keypoints in particular for embedded applications.

[AOV12]
  1. Alahi, R. Ortiz, and P. Vandergheynst. FREAK: Fast Retina Keypoint. In IEEE Conference on Computer Vision and Pattern Recognition, 2012. CVPR 2012 Open Source Award Winner.

Note

  • An example on how to use the FREAK descriptor can be found at opencv_source_code/samples/cpp/freak_demo.cpp

FREAK::FREAK

The FREAK constructor

FREAK::selectPairs

Select the 512 best description pair indexes from an input (grayscale) image set. FREAK is available with a set of pairs learned off-line. Researchers can run a training process to learn their own set of pair. For more details read section 4.2 in: A. Alahi, R. Ortiz, and P. Vandergheynst. FREAK: Fast Retina Keypoint. In IEEE Conference on Computer Vision and Pattern Recognition, 2012.

We notice that for keypoint matching applications, image content has little effect on the selected pairs unless very specific what does matter is the detector type (blobs, corners,...) and the options used (scale/rotation invariance,...). Reduce corrThresh if not enough pairs are selected (43 points --> 903 possible pairs)