What is proper algorithm for separating (counting) coffee beans on binary image? Beans can touch and partially overlap.
(source: beucher at cmm.ensmp.fr)>
Erosion may help. One paper doing that is this one but sadly I did not find a publicly available copy of it.