I am developing an OpenCV application under Python. Several of the processing steps involve blob analysis (connected components labeling) after binarization. All is fine, except sometimes, when image noise is present, the number of blobs explodes and so does the processing time (say 1 second instead of 10 ms).
For the moment I am using the function connectedComponentsWithStats. I actually need the areas and centroids of the blobs.
Do you know of an alternative function which remains fast when there are many blobs, or which does a pre-filtering on size, or a way to apply a size filer on the binary image ?