简体   繁体   中英

Measure exact position of known circle using Python OpenCV

I have an image containing a bunch of circular features. I'd like to know exactly the exact location of the centre of a particular circle and its radius (preferably with sub-pixel accuracy).

校准圈

Rather than using a circle detector, which will try to find all of the circles, is there a method in OpenCV for fitting a circle to the image? Like this:

检测到校准圈


Update:

I have tried using the Hough circle detection method, and it seems to get confused about whether the circle should be on the inside or outside edge of the black line. The circle jumps around between the inside and outside edges, or sometimes tries to do both.

霍夫圆检测问题

All I can think of now is, if you know the approximate centre and radius, search for all the circles and use least fitting squares with the circle equation to find the one you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM