O'Reilly logo

Smart Internet of Things Projects by Agus Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a simple program with OpenCV

There are many program samples that show how to use OpenCV using Python. In our case, we build a simple program to detect a circle in a still image.

Consider we have the following image, which is used for testing. You can find the image file in the source code files, called circle.png.

Building a simple program with OpenCV

To find a circle in a still image, we use circle Hough Transform (CHT). A circle can be defined as follows:

Building a simple program with OpenCV

(a,b) is the center of a circle with radius r. These parameters will be computed using the CHT method.

Let's build a demo! ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required