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??
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With