Get Started with Image Processing using OpenCV-Python

Siddharth Rastogi
3 min readMar 27, 2021


In this article, we will understand and learn Image Processing using the Python programming language. The most common library used for image processing is OpenCV (Open Source Computer Vision Library). OpenCV supports many algorithms related to Computer Vision and Machine Learning, and it is expanding day-by-day. Let’s discuss the brief intro of Image Processing and then see some hands-on using the OpenCV-Python library in the Project to make it more understandable.

Image Processing is the core part of Computer Vision, where we use the input image to extract the features from the Image and use those features to further train our models by Machine Learning algorithms to get the final output in the form of bar charts, tables, graphs, which describes the Information of the particular image.

For more information read What is Image Processing? How it is related to Machine Learning?

At the end of the article, you will get to know the basics of OpenCV-Python Library of Image Processing. Read the full article, ok so Let’s begin…

Some basics you should know

Before going to start, we should know some basics prerequisites to understand the OpenCV framework better. Firstly you should know the one programming language, as I will give the tutorial in python. So, I recommend you start with Python if you want to start your first project in the Image Processing and Machine Learning field.

To know some basics of Machine Learning or Image Processing, then you should read this article first. You should know some basics of Image, that each image is represented by a set of pixels. For a grayscale image, the pixel values range from 0 to 255, and they represent the intensity of that pixel (which means it has 256 possible different shades of gray from black to white).

You should also know about the color images, that it has three channels Red, Green, Blue (RGB) ( means 256 different shades of red, green, and blue ). By mixing these colors in some proportion, you will get the new desired colors.

Color image
Color image
Grayscale image
Grayscale image

Installing OpenCV in your systems

It is very easy to install the OpenCV library if you are using python. I have considered that you already installed Python (version 3) on your system.


pip install opencv-python


brew install opencv3 — with-contrib — with-python3


sudo apt-get install python3-opencv

Or if you want to check that if it is installed or not in your machine then run this in your command line:

import cv2

Basics of OpenCV

To get know better understanding of the basics of OpenCV please visit here



Siddharth Rastogi

I am a full stack developer, I have an expertise in Web Development. I write tech stuff and share my knowledge with others through blogs & articles.