I am trying to segment an image with spherical-shaped objects, something like this being the source:
I tried several approaches:
- blur, adaptive thresholding, skeletonization, then connected components analysis, but it is very sensitive to lighting conditions;
- hough circles (with various pre-filters) which gives too much bogus results, reacts to single points and so on;
- distance map (after adaptive threshold) and watershed, with which I did not get very far (perhaps lack of experience).
The adaptive thresholding gives visually nicely separated objects (below shown with superimposed distance map) but I am having hard time to see which way to proceed all way to segmentation.
I am aware I am not using some features of the scene which are known are not exploited by the algorithm, such as
- all objects are plus minus circular (modulo occlusion);
- the objects cover the entire scene, i.e. they are packed quite tightly;
- size range is known (this is used after segmentation to prune the result only for what is meaningful, but this knowledge comes only after segmentation as clean-up, not as improvement of the segmentation itself)
I would be grateful for some ideas on how to move on.