OpenCV
Open Source Computer Vision
|
Prev Tutorial: Hough Line Transform
Next Tutorial: Remapping
Original author | Ana Huamán |
Compatibility | OpenCV >= 3.0 |
In this tutorial you will learn how to:
In the line detection case, a line was defined by two parameters (r, \theta). In the circle case, we need three parameters to define a circle:
C : ( x_{center}, y_{center}, r )
where (x_{center}, y_{center}) define the center position (green point) and r is the radius, which allows us to completely define a circle, as it can be seen below:
The sample code that we will explain can be downloaded from here. A slightly fancier version (which shows trackbars for changing the threshold values) can be found here.
The image we used can be found here
You can see that we will draw the circle(s) on red and the center(s) with a small green dot
The result of running the code above with a test image is shown below: