EDITED:
Hey
I am looking for a quick way to count objects in a binary image (object = 1, background = 0).
I have tried Connected Component Labeling and it works for square shapes but the rounded shapes it has a problems. Could someone have a look at the code and let me know where am wrong.
Attached is what I have done for the connected component labeling.