Split connected blobs
Hello
I am using contours to detect the balls by their area. The problem arises when the balls are next to each other. I have tried the erode function but I can't get it right.
This is a sample picture:
This is the binary image I get after using inRange.
How would you guys tackle this problem? Would you use erode? In that case, which parameters would you give to the function? Is there any other way than erode, which is not very complex?
EDIT: Adding eroded image by request.
Im using this code to get it:
Imgproc.erode(filtered, filtered, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(8,8)));
Can you upload the results you get with erode?
I have added it to the question
I think it would have worked if you didn't have text on the balls. Perhaps you can fill the holes and then apply erode. Not sure though.