Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of minRepeatability parameter of SimpleBlobDetector in OpenCV?

Tags:

opencv

There is a minRepeatability parameter in SimpleBlobDetector in OpenCV. What is the use of this parameter. How will it affect blob detection if I vary it from 1 to, say, 20?

like image 301
ravvv Avatar asked Oct 06 '15 15:10

ravvv


People also ask

What is simpleBlobDetector?

simpleBlobDetector implements a simple algorithm for extracting blobs an Image object. A blob is a region in an image that differs in properties (e.g. brightness, color) from surrounding regions.

What is blob detection in image processing?

In Image processing, blob detection refers to modules that are aimed at detecting points and/or regions in the image that differ in properties like brightness or color compared to the surrounding.

What is blob detection Opencv?

Blob stands for Binary Large Object and refers to the connected pixel in the binary image. The term "Large" focuses on the object of a specific size, and that other "small" binary objects are usually noise. There are three processes regarding BLOB analysis.


1 Answers

The relevant code is in blobdetector.cpp.

The detect function (the only one using minRepeatability):

  1. finds blob centers at different threshold (from minThreshold to maxThreshold with thresholdStep) on the grayscale image
  2. if the same blob center is found at different threshold values (within a minDistBetweenBlobs), then it (basically) increases a counter for that blob.
  3. if the counter for each blob is >= minRepeatability, then it's a stable blob, and produces a KeyPoint, otherwise the blob is discarded.

So minRepeatability is how a blob is stable across different thresholds on the grayscale image.

Default values are:

thresholdStep = 10;
minThreshold = 50;
maxThreshold = 220;
minRepeatability = 2;
minDistBetweenBlobs = 10;

The max valid value for minRepeatability is then: (maxThreshold - minThreshold) / thresholdStep, or every blob will be discarded. The minimum valid value is 1, meaning that all blobs will be kept and provide a KeyPoint.

like image 136
Miki Avatar answered Sep 18 '22 16:09

Miki