What is the algorithm that opencv uses for finding contours?

Milad R picture Milad R · May 3, 2012 · Viewed 26k times · Source

I need to use cv::FindContours() in a program and I have to know the algorithm behind that.

What algorithm does openCV use to find contours?

How does it work?

Answer

fireant picture fireant · May 3, 2012

If you read the documentation it is mentioned this function implements the algorithm of:

Suzuki, S. and Abe, K., Topological Structural Analysis of Digitized Binary Images by Border Following. CVGIP 30 1, pp 32-46 (1985)

OpenCV is open source if you want to see how this is implemented just need to read the code: https://github.com/opencv/opencv/blob/master/modules/imgproc/src/contours.cpp#L1655

One of the answers to this question has the link to the paper in question, that link is dead and the paper is behind a pay wall, perhaps google can help with finding a free copy.