How to convert Image into Sketch using Python | Converting Image to Sketch ( 5 Lines of Code )

Опубликовано: 06 Февраль 2021
на канале: Falcon Infomatic
4,411
87

Title: Convert A Photo To Pencil Sketch Using Python

Introduction:
📌In this video, I will show you how to convert an image to a pencil sketch using the Python programming language in just 5 lines of code! Python is a general-purpose programming language that was created in the late 1980s and has seen significant growth in popularity from big tech companies and communities over the years.
📌One of the reasons for its popularity growth is its ease of use and simplicity. Just think that we are about to transform an image in just 5 lines of code !!
Actually, it could be less.

Concepts:
Before writing any code let’s walk through some of the steps that will be used and try to understand them a bit.
📌Step 1: Find an image that we want to convert into a pencil sketch. I am going to use the image of a Jerry.
📌Step 2: Read in the Red, Blue, Green (RBG) image and then convert it to a grayscale image. This effectively makes the image a classic “black and white” photo. This will be our “greyscale image”.
📌Step 3: We are going to invert the “grey scaled image” also known as getting the image negative, this will be our “inverted greyscale image”. Inversion can be used to enhance details.
📌Step 4: Use a Gaussian function to blur the image. In image processing, a Gaussian blur (also known as Gaussian smoothing) is the result of blurring an image by a Gaussian function.
📌Step 5: Invert the newly created “blurred image”, this will be called the “inverted blurred image”.
📌Step 6: Now we are going to create the pencil sketch image by blending the “greyscale image” with the “inverted blurred image”. This can be done by dividing the “grayscale image” by the “inverted blurred image”. Since images are just arrays we can easily do this in programming by using the divide function from the cv2 library.

Quick Steps:
1. Convert the RGB colour image to grayscale.
2. Invert the grayscale image to get a negative.
3. Apply a Gaussian blur to the negative from step 2.
4. Blend the grayscale image from step 1 with the blurred negative from step 3

Source Code & Link:
Link - https://drive.google.com/drive/folder...

#Python, #Imagetosketch, #Imagetosketchinpython, #Imagetopencilsketch
====*====

✅ Now donation is open, you can donate to help us grow ✅

✅ Paypal - https://www.paypal.me/soosai01

✅ Google Pay - 7418713984

====*====

For More Videos:

📌 Contact Management System in Python
   • Contact Management System in Python |...  

📌 How To Get Latest News In Python
   • Web Scraping NEWS Articles with Pytho...  ​

📌Health Management System using SQLite and Python
   • Health Management System using SQLite...  ​​

📌How to Extract Images from Pdf File using Python
   • How to Extract Images from Pdf File u...  ​​​

📌Gender and Age Detection using OpenCV and Python
   • Gender and Age Detection using OpenCV...  ​​​

📌 Find and Draw Contours with OpenCV in Python
   • Find and Draw Contours with OpenCV in...  ​​​​

📌 Colour detection using Python and OpenCV
   • Color detection using python and Open...  ​​​​

📌 Sentiment Analysis using Python
   • Sentiment Analysis using Python  ​​​​

📌 Make Your Own Haar Cascade Object Detector Using GUI In Windows
   • Make Your Own Haar Cascade Object Det...  ​​​

📌 Python Tutorial In Detail
   • Python Programming Language  

📌 Data Visualisation Running Graph
   • Data Visualization  

📌 Computer Hacks and Tricks
   • Computer Tricks And Hacks  

====*====

Follow Me Here For More Help or Queries

📌Facebook -   / falcon-infomatic-108235664061988  

📌Instagram -   / falconinfomatic  

====*====

SUBSCRIBE NOW for weekly videos on Python Tutorial, Computer Hacks and Tricks, Data Visualisation, Technology, and Many More.