Member-only story
Performing Image Annotation using Python and OpenCV
Learn how to create bounding boxes for your images
One of the common tasks in deep learning is object detection, a process in which you locate specific objects in a given image. An example of object detection is detecting cars in an image, where you could tally the total number of cars detected in an image. This might be useful in cases where you need to analyze the traffic flow at a specific junction.
In order to train a deep learning model to detect specific objects, you need to supply your model with a set of training images, with the coordinates of the specific object in the images all mapped out. This process is known as image annotation. Image annotation assigns labels to objects present in an image, with the objects all marked out.
In this article, I will show you how to use Python and OpenCV to annotate your images — you will use your mouse to mark out the object that you are annotating and the application will draw a bounding rectangle around the object. You can then see the coordinates of the object you have mapped out and optionally save it to a log file.
Displaying an Image using OpenCV
First, create a text file and name it as bounding.py. Then, populate it with the following statements:








