OpenCV
4.1.1-pre
Open Source Computer Vision
|
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me! |
Next Tutorial: Random generator and text with OpenCV
In this tutorial you will learn how to:
For this tutorial, we will heavily use two structures: cv::Point and cv::Scalar :
It represents a 2D point, specified by its image coordinates \(x\) and \(y\). We can define it as:
or
For this tutorial, we will heavily use two structures: cv::Point and cv::Scalar :
It represents a 2D point, specified by its image coordinates \(x\) and \(y\). We can define it as:
or
Since we plan to draw two examples (an atom and a rook), we have to create two images and two windows to display them.
We created functions to draw different geometric shapes. For instance, to draw the atom we used MyEllipse and MyFilledCircle:
And to draw the rook we employed MyLine, rectangle and a MyPolygon:
Let's check what is inside each of these functions:
Compiling and running your program should give you a result like this: