MSO
MSO

Reputation: 549

Fit contours to a circle

I'm trying to fit some circle like contours in OpenCV to a perfect circle, just like on the figure above.

The contours that I'm trying to fit are just like the one in this pic.

I'm trying to do it by using HoughCircles function but it too imprecise results. Someone know any way to do it properly without using OpenCV HoughCircles function??

Upvotes: 1

Views: 5018

Answers (1)

Haris
Haris

Reputation: 14053

  1. Find contour in the image.

  2. Use minimum enclosing circle for the contour.

See opencv example Drawing enclosing circle and bounging box for contour

Upvotes: 2

Related Questions