How to find the center of an object?

I have a black and white image after binarization. After that, I get one object with an irregular shape. Link to this image below. How can I insert this object into a circle? or How can I find the "center" of this object?

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

+5
source share
4 answers

You can find the center of gravity of 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 dots).

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

.

+9

, , , . . (, + ( - )/2), . ( ) .

+2

. . , - , - .

+2

, . , , .

+1
source

All Articles