I have noisy images from which I extract the contours using OpencCV's
findCountours, which performs binarization internally. This results in innumerable small outlines made of three or four pixels, which I would like to avoid.
I want to discard these, either before extracting the contours, or during that step. I could binarize the image myself and use a size filter (i.e. erase the blobs tiny in area), or I could use a variant of the contouring function that implicitly discards the very short outlines.
But I can't find OpenCV functions that look like this. Any hint ?
Note that I don't want to use any denoising function, as it will degrade the signal. I don't want to erode either, for the same reason.
Example of outlines to be discarded (don't mind the annotations):
I am not asking to get rid of all noisy blobs, but of the smallest ones.