1 | initial version |
One approach might be to use findContours() to get a collection of outline points, then use fitEllipse() to fit an ellipse to them. If the two axis lengths are very similar, it's a circle, otherwise it's not. The ellipse fitting tends to be pretty sensitive to outliers though, so in the case where you do have a circle, you'd need to have very few outline points that don't lie on the circle. It's hard to say without knowing what your data looks like.