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

后端 未结 1 805
面向向阳花
面向向阳花 2020-12-31 21:17

There is a minRepeatability parameter in SimpleBlobDetector in OpenCV. What is the use of this parameter. How will it affect blob detection if I va

相关标签:
1条回答
  • 2020-12-31 21:53

    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.

    0 讨论(0)
提交回复
热议问题