I'm planning to write a program using Open-CV to count the number of objects in an image similar to the one below.
The method I'm planning to employ is to use the histogram to threshold the image and then to use Blob detection to count the number of Blobs that are identified. This would work fine as long as the pellet like objects do not touch each other. (Overlapping is out of scope though) I've looked into the possibility of using the Watershed segmentation to identify objects that are touching each other.
What I'm not clear is, how to apply these two techniques for an image that may or may not have overlapping pellets. Provided that there is at least one instance of pellets touching each other in an image, am I to perform both the techniques? If so in what order? Or am I to perform Watershed only since there's going to be overlapping somewhere and performing Blob detection would lead to an erroneous output due to the merged blobs? Thanks in advance.