image processing - How to detect groups of circles with openCV? -


I have a picture like below. I want to find a group of circles (their status) in images. The following examples should have three groups. Background is white or white color

(The image of the source will not be such rectangles. I have just illustrated how to be a group)

Is it possible to find ?

Circles know

About this type of picture In: example2

rectangular circles without:  example 3

 Example 4 <

1 - Just invert the image,

2 - Then spread the image so that all the circles are connected / div>

<->

For example:

For example: : //i.stack.imgur.com/UOSv2.png "alt =" Image details here Enter ">

Comments