Next topic

The Hough Circle Transform works in a roughly analogous way to the Hough Line Transform explained in the previous tutorial. 

In the line detection case, a line was defined by two parameters .  In the circle case, we need three parameters to define a circle:

where define the center position (green point) and is the radius, which allows us to completely define a circle, as it can be seen below:

For sake of efficiency, OpenCV implements a detection method slightly trickier than the standard Hough Transform: The Hough gradient method, which is made up of two main stages.  The first stage involves edge detection and finding the possible circle centers and the second stage finds the best radius for each candidate center.  For more details, please check the book Learning OpenCV or your favorite Computer Vision bibliography