Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Split connected blobs

Hello

I am using contours to detect the circles 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:

image description

This is the binary image I get after using inRange.

image description

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?

Split connected blobs

Hello

I am using contours to detect the circles 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:

image description

This is the binary image I get after using inRange.

image description

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?

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:

image description

This is the binary image I get after using inRange.

image description

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. image description

Im using this code to get it:

Imgproc.erode(filtered, filtered, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(8,8)));

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:

image description

This is the binary image I get after using inRange.

image description

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. image description

Im using this code to get it:

Imgproc.erode(filtered, filtered, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(8,8)));