Learning OpenCV 3 by Adrian Kaehler & Gary Bradski
Author:Adrian Kaehler & Gary Bradski
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2016-12-27T16:00:00+00:00
Keypoint finder
Start by taking a look at (a somewhat simplified version of) the blob detector’s declaration:
class SimpleBlobDetector : public Feature2D { public: struct Params { Params(); float minThreshold; // First threshold to use float maxThreshold; // Highest threshold to use float thresholdStep; // Step between thresholds size_t minRepeatability; // Blob must appear // in this many images float minDistBetweenBlobs; // Blob must be this far // from others bool filterByColor; // True to use color filter uchar blobColor; // always 0 or 255 bool filterByArea; // True to use area filter float minArea, maxArea; // min and max area to accept // True to filter on "circularity", and min/max // ratio to circle area bool filterByCircularity; float minCircularity, maxCircularity; // True to filter on "inertia", and min/max eigenvalue ratio bool filterByInertia; float minInertiaRatio, maxInertiaRatio; // True to filter on convexity, and min/max ratio to hull area bool filterByConvexity; float minConvexity, maxConvexity; void read( const FileNode& fn ); void write( FileStorage& fs ) const; }; static Ptr<SimpleBlobDetector> create( const SimpleBlobDetector::Params ¶meters = SimpleBlobDetector::Params() ); virtual void read( const FileNode& fn ); virtual void write( FileStorage& fs ) const; ... };
As you can see from scanning over this declaration, it is clear that there is not actually much going on here. There is a definition for cv::SimpleBlobDetector::Params, a structure that can hold all of the information needed to actually run a simple blob detector, a constructor (which takes a Params argument), and read() and write() functions that will allow us to store the state of our detector. Of course, there are also the all-important detect() routines inherited from the cv::Feature2D interface.
We already know how the detect() member works, in the sense that what it does is entirely generic to all feature detectors; what really matters to us here is how to set up the parameters in the Params argument to the constructor. The first group of five parameters controls the basic functioning of the algorithm. We use thresholdStep, minThreshold, and maxThreshold to configure the set of thresholded images to generate. We do so by starting at minThreshold and stepping up by thresholdStep each time up until, but not including, maxThreshold. It is typical to start with a value around 50 to 64 and step in small increments (e.g., 10) up to about 220 to 235, thus avoiding the often-less-informative ends of the intensity distribution. minRepeatability determines how many (consecutive) threshold images must contain overlapping blob candidates in order for the candidates to be combined into a blob. This number is typically a small integer, but rarely less than two. The actual meaning of “overlapping” is controlled by minDistBetweenBlobs. If two blob candidates have their centers within this distance, they are considered to be related to the same blob. Keep in mind that this one is in pixel units, and so should scale with your image. The default constructor for cv::SimpleBlobDetector::Params sets this to 10, which is probably only suitable for images of about 640 × 480.
The remaining parameters affect the different filtering
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Computer Design | Control Systems |
DSPs | Embedded Systems |
Microprocessor Design | PIC Microcontroller |
Linux Device Driver Development Cookbook by Rodolfo Giometti(3933)
Embedded Programming with Modern C++ Cookbook by Igor Viarheichyk(3615)
Implementing Cellular IoT Solutions for Digital Transformation by Dennis McCain(3550)
Embedded Linux Development Using Yocto Project - Third Edition by Otavio Salvador & Daiane Angolini(3380)
TinyML Cookbook by Gian Marco Iodice(3317)
Simplifying 3D Printing with OpenSCAD by Colin Dow(2842)
TinyML Cookbook by Gian Marco Iodice & Ronan Naughton(2603)
Fusion 360 for Makers by Lydia Sloan Cline(2219)
Networking A Beginner's Guide by Bruce Hallberg(2209)
Hands-On Linux for Architects by Denis Salamanca(2051)
But How Do It Know? by J. Clark Scott(2030)
Computers For Seniors For Dummies by Nancy C. Muir(1996)
Raspberry Pi and MQTT Essentials by Dhairya Parikh(1953)
Arduino Project Handbook, Volume 2: 25 Simple Electronics Projects for Beginners by Geddes Mark(1947)
9781803246888-ENHANCING DEEP LEARNING WITH BAYESIAN INFERENCE by Unknown(1901)
Hack and HHVM by Owen Yamauchi(1884)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1860)
MicroPython Projects by Jacob Beningo(1736)
Hands-On Internet of Things with MQTT by Tim Pulver(1707)
