O'Reilly logo

OpenCV Essentials by Jesus Salido Tercero, Julio Alberto Patón Incertis, Ismael Serrano Gracia, Gloria Bueno García, Noelia Vállez Enano, Mª del Milagro Fernández Carrobles, Oscar Deniz Suarez

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

Text and drawing

In the previous section, we used a simple user interface to get input values by a trackbar. However, in many applications, the user has to point locations and regions on the image and mark them with text labels. For this purpose, the highgui module provides a set of drawing functions along with mouse event handling.

The drawThings code example shows an easy application to mark positions on an input image. The positions are marked with a red circle and a black text label next to it. The following screenshot displays the window with the input image and the marked positions on it. To mark each position on the image, the user uses has to click the left mouse button over it. In other application, the marked position could be the obtained ...

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