I am performing adaptive thresholding on an image to find an object's borders. However, on some points of the object, the adaptive threshold has gaps and spills over into other objects (due to colour similarity in rare points on the object's border). These gaps are too large to fill in using morphological closing (dilate followed by erosion).
Is there a way to detect these and remove them, considering they don't occur very often, and are relatively small to the perimeter of the entire shape.
I've found that just increasing iterations/window sizes for closing just messes up things too much to be useful.
I want to perform houghline transform after a good adaptive threshold, but the adaptive threshold spilling out of the object of interest's boundaries add many more potential line detections into the binary image.
I thought maybe running kernels over the detected lines in those images and adding white pixels if sufficiently small breaks are detected in the adaptive threshold borders? Has anyone tried something like this?
Thanks!