-2

I am working on the project where i first need to detect the object and make outline that covers whole object it can be seen on 1st image. It was successfuly done by the contour Detection. The next thing which i want to to do is to make a circle inside the outline object.

How it can be done with if we have multiple objects we can do contour detection to detect and outlined it but how to draw a circle in inside of each outlined object.

Please see attached picture. This contains a single object but in can be multiple also.

Outlined after Contour Detection

Drawing circle inside outlined object

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87

1 Answers1

0

It can be achieved simply by -

  • First, extract the contour image (Contour filled with white colour and rest in black).
  • Then apply distance transformation on the image.
  • In this distance transform matrix now, find the point having the highest value. This point will be the center of the circle and the corresponding distance will be the radius.
Rahul Kedia
  • 1,400
  • 6
  • 18