Adapted feature detection

If you wish to better control the number of detected points, a special subclass of the cv::FeatureDetector class, called cv::DynamicAdaptedFeatureDetector, is available. This allows you to specify the number of interest points that can be detected as an interval. In the case of the FAST feature detector, this is used as follows:

  cv::DynamicAdaptedFeatureDetector fastD( 
    new cv::FastAdjuster(40), // the feature detector 
    150,   // min number of features 
    200,   // max number of features 
    50);   // max number of iterations 
  fastD.detect(image,keypoints); // detect points

The interest points will then be iteratively detected. After each iteration, the number of detected points are checked and the detector threshold is adjusted ...

Get OpenCV 4 Computer Vision Application Programming Cookbook - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.