In this article, we'll talk about Drawing with OpenCV. If you haven't done so already, be sure to read the previous article on setting pixels with Python
In this article, we’ll talk about Drawing with OpenCV. If you haven’t done so already, be sure to read the previous article on setting pixels with Python OpenCV.
A large part of working with Image Processing has to do with identifying objects and contours in a provided image.
This can be done by marking these shapes during the processing.
But, how do we do so?
The same question that plagued the scientists working on Image Processing led to the development of drawing in OpenCV.
We’ll be using a few of these functions to begin working with drawing in OpenCV in this article.
Note that this is the third article of the Image Processing Series, and it might a good idea to look into the introductory session before proceeding through this article!
To draw a rectangle in Python using OpenCV, use cv2.rectangle() function. The cv2 rectangle() method is used to draw a rectangle on any image.
To filter image pixels means you can convert the image from color to grayscale or add an extra layer to the image.
To get the proper size of an image, use numpy.shape property. In OpenCV, the image size (width, height) can be obtained as a tuple.
This video explains how to find and draw image contours using Python's Opencv. It will also explain the concept of image segmentation in opencv, a technique
There are two main morphological transformations.1) Image Dilate 2) Image Erosion. The cv2 module that supports the following two 1) cv2.dilate() 2) cv2.erode().