OpenCV Starter Project - Pencil Sketch and Cartoon Paint

Apply non photo realistic effect to the image like, pencil and cartoon in Python using, OpenCV, matplotlib, ipywidgets.
Rating: 4.9 out of 5 (5 ratings)
693 students
English [Auto]
Pencil Sketch Image
Image to Cartoon Image
Gaussian Blur, Median Blur
Bilateral Filter
Edge Preserving Filter, Detail Enhance Filter
Image Processing with OpenCV
Ipython Widgets


  • Basic Python Knowledge


Welcome to Image to Cartoon Sketch using OpenCV in Python !!!

In this Course we will see, one of the most widely used image processing applications which are, Non- Photo Realistic Effects. You will generally see such an effect in most commercial software like Photoshop etc. Here, in this course using an open-source library in OpenCV, we will create such an effect by coding in Python.

What will you learn?

· Non-Photo Realistic Effect in OpenCV

· Pencil Sketch

· K Means Clustering in OpenCV

· Cartoon Paint using Bilateral Filter.

· Ipython Widgets for Hyperparameter Tuning.

In this class, we will develop two projects.

Project -1: Pencil Sketch & Tuning using Widgets

For any given image we will convert that into a perfect pencil sketch in Python. To develop this, we will use following filter.

1. Gaussian Blur

2. Division Image

3. Gamma Correction

Here you will learn the use of this filters and how to apply to any image. We will also create widgets. Using widgets, we will tune the hyperparameters for best desired pencil sketch.

Project - 2: Photo to Cartoon Photo

For any given image we will convert that into a perfect pencil sketch in Python. Just like pencil sketch we will create use multiple filters. Cartoon image is extension of pencil sketch. Here for a pencil sketch, we will segment the portion and paint it with appropriate colours using k means clustering. Finally, we will apply Bilateral filter to get desired cartoon image. The following flow we will use to create cartoon image.

1. Edge Mask image (pencil sketch)

2. Image Segmentation using K means Clustering.

3. Bilateral Filter.

We will also create the widgets to tune the hyperparameter to get the desired result. The is course is 100 % free and this is perfect project to start your journey towards image processing.

We will see you in the class on how to develop this from scratch.

Who this course is for:

  • Anyone who are beginner in Python

Course content

5 sections13 lectures48m total length
  • Introduction


Machine Learning Engineer
Devi Guskra
  • 4.4 Instructor Rating
  • 25 Reviews
  • 8,615 Students
  • 3 Courses

A Machine Learning Engineer with a demonstrated history of working in the information technology and services industry. Skilled in Machine Learning, Deep Learning, Statistical algorithms. We mostly worked on Image Processing and Natural Language processing application. I also successfully deployed many data science-related projects in cloud platforms as a service in AWS, Google Cloud, etc.

Team of Engineer and Developers
Data Science Anywhere Team
  • 4.4 Instructor Rating
  • 245 Reviews
  • 8,615 Students
  • 8 Courses


We're team of Machine Learning experts, AI developers working together to advance the state of the art in artificial intelligence. You will be hearing from us when new courses are released, answering Q&A and many more.

We are here to help you stay on the cutting edge of Data Science and Technology.


Data Science Anywhere Team