OpenCV  3.4.20-dev
Open Source Computer Vision
Hough Circle Transform

Prev Tutorial: Hough Line Transform

Next Tutorial: Object detection with Generalized Ballard and Guil Hough Transform


In this tutorial you will learn how to:


Hough Circle Transform

What does this program do?



The image we used can be found here

Load an image:

Convert it to grayscale:

Apply a Median blur to reduce noise and avoid false circle detection:

Proceed to apply Hough Circle Transform:

Draw the detected circles:

You can see that we will draw the circle(s) on red and the center(s) with a small green dot

Display the detected circle(s) and wait for the user to exit the program:


The result of running the code above with a test image is shown below: