简体   繁体   中英

Find the most common circle from an array of circles python opencv

I am using opencv to do some image detecting. For now, I'm detecting some circles in an image. It's doing it pretty good, but I've set it to detect multiple circles for one real circle, to remove some false positives.

Here is a sample: 样品

In this image, I have like 6-8 circles totally. I want to get from all the circles, just 2 circles, the most common ones.

I am using opencv to get the circles from the images. I have a list of all the points (x,y) and I don't know how to make it take the most common one.

Any suggestions are appreciated.

I think that clustering by k-means could be a solution to your problem as described here . Depending on the number of false positives you can experiment with the parameters, but as I don't have experience with that typical part of opencv I can't make any suggestions.

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