Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find center of object?

I have black and white image after binarization. After that I get one object with irregular shape. Link to this image is below. How can I inscribe this object to circle?? or How can I find "center" of this object??

http://s6.ifotos.pl/img/opticdisk_xhnrnwe.png

like image 587
user1666649 Avatar asked Sep 12 '12 18:09

user1666649


1 Answers

You can find the center of gravity of the pixels using a simple formula which is the sum of the x coordinates divided by the number of points and the sum of the y coordinates divided by the number of points (I mean white points).

Then you can draw a circle centered in the center of gravity with radious half of the maximum distance between points.

Here you have a graphic explanation for this.

like image 109
Jav_Rock Avatar answered Sep 26 '22 12:09

Jav_Rock