In this post, we will go through a program to get a pencil sketch from an image using python and OpenCV.
Step 1:
Read the Image.
Step 3:
Create a new image by converting the original image to grayscale.
Step 4:
Invert the grayscale image. We can invert images simply by subtracting from 255, as grayscale images are 8 bit images or have a maximum of 256 tones.
Step 5:
Blur the inverted image using GaussianBlur method in OpenCV library and invert the blurred image.