Ask Your Question
0

Finding Largest Circle Contained Within A Contour

asked 2017-01-21 21:01:36 -0500

jpistorino gravatar image

I know that there is an OpenCV function that will find the minimum circle that will contain a contour (minEnclosing Circle).

I am looking for the reverse, i.e., a way to determine the largest circle that will fit within a contour. Really, I just want the center of that circle.

Thanks for any help.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-21 21:20:42 -0500

Tetragramm gravatar image

That is not a well-formed problem. Namely, there can be more than one largest circle within a contour, but there is only one minimum enclosing circle.

You could brute force it, but it would be slow.

http://mathforum.org/library/drmath/v...

edit flag offensive delete link more

Comments

Thanks for your response. Your link used phrasing that led me to what I was looking for. Here is a previous OpenCV question with code. http://answers.opencv.org/question/14... It is true that this will be slow but it is good enough for my purpose (finding the point in the template image used in Generalized Hough Transform). Having found this in the template image, you should be able to find it in the query image using the GHT results without recalculating. This result would be useful for target tracking/grip planning, etc. While I agree that there may be more than one circle of the same size, finding one of them is useful. A maxInscribedCircle function maybe something to consider adding as a complement to minEnclosingCircle.

jpistorino gravatar imagejpistorino ( 2017-01-22 09:49:18 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-01-21 21:01:36 -0500

Seen: 1,274 times

Last updated: Jan 21 '17