I have this binary Black Particle Borders image of many non-spherical particle borders/outlines. Unfortunately, due to bad image quality, the borders are not continuous, but have some gaps. Is there any way I can fill the holes to obtain complete border lines? My ultimate goal is to fill the particle shapes in black. I use ImageJ for that, however, ImageJ only recognizes about 10% of the particles as actual particles to fill, as the others do not have complete outlines.
Things that I tried are:
the findContours method from openCV in python, but it only draws a small line around and inside the outline, which means there is a space between these outer and inner lines, which changes and enlarges the particle shape and size. You can see the results in this image. Contours Drawn by OpenCV I also tried bluring the image or changing threshold values, but it did not fill the holes.
use ImageJ to dilate the borders/outlines, so that the outlines grow in thickness and the "loose ends" might touch each other after dilation. Unfortunately the dilation is too great and nearly every particle is connected afterwards. Filling the particles would then result in to much space being filledNot only particls are filled, but space in between too.
From the attached sample image I conclude that you like to obtain conflicting results: Closing contour gaps and separating touching contour objects. I see little chance for a satisfying solution, especially with the low spatial resolution of the sample image. I highly recommend to start tackling the problem before image binarization, e.g. by considering gray-value morphological operations.