find centered coeccentric circles and draw circle

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
lojesus75
Posts: 9
Joined: 2017-02-01T19:50:50-07:00
Authentication code: 1151

find centered coeccentric circles and draw circle

Post by lojesus75 »

Hello,

I have a question

There are 10 black circles in the image. I want to get the center of the black circle and make a circle of random number.
It seems possible using image magic.

Thanks for best regards
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: find centered coeccentric circles and draw circle

Post by snibgo »

Please show a sample input image. You can upload to somewhere like dropbox.com and paste the URL here.

Please state the version number of IM you use, and your platform.

If you have a black circle on a white background, "-morphology distance" can find the centre.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: find centered coeccentric circles and draw circle

Post by fmw42 »

So can -connected-components.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: find centered coeccentric circles and draw circle

Post by snibgo »

Good point, Fred, thanks. Connected-components is far simpler, as it directly gives the centroid of the component, which is the centre of the circle.
snibgo's IM pages: im.snibgo.com
lojesus75
Posts: 9
Joined: 2017-02-01T19:50:50-07:00
Authentication code: 1151

Re: find centered coeccentric circles and draw circle

Post by lojesus75 »

Thank you for your interest.

I will create a sample image and share it through google drive.

Thanks for your best regards
Post Reply