enter image description here

I reached there the last step is to count the circles. Please help me.

  • 1
    $\begingroup$ Please post the code as code and not as an image. You should also post the input to your code, img2, so that others can reproduce your result. $\endgroup$ – C. E. Jan 31 '18 at 10:18

Length[comps] will answer your question. If you only know the Graphics-object (pict=Show[...]) you can count as follows:

Length@Cases[pict, _Circle, Infinity]
|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.