Cartooning an Image using Open CV

Published on . Written by

Cartooning an Image using OpenCV-Python
Cartooning a digital image sounds a very interesting, fun and easy project to work on. So as to achieve an animation picture from a digital image, we only need some bilateral filter and edge detection mechanism. These bilateral filters will assist us with reducing the color or shading palette of the image, which is an important step for the animation look, and edge detection are used to get a perfect bold silhouette.

Read more..
Project Description


Skyfi Labs Projects
OpenCV-Python: OpenCV-Python is a library of Python used to determine computer vision problems. OpenCV-Python utilizes Numpy, which is an exceptionally improved and reliable library for numerical activities with a MATLAB-style structure.

We are going to utilize the OpenCV python library to convert an RGB color image into an animation image. Here RGB Color expresses a framework for speaking the colors to be utilized on a computer display.

Bilateral filter: A bilateral filter is utilized for smoothening images and decreasing commotion or noise while safeguarding edges. By using a Bilateral filter, we can diminish the color palette of the image.

Edge detection mechanism: It is a technique utilized in different fields like image processing and computer vision, especially in the regions of feature detection and extraction. It incorporates various kinds of scientific and mathematical techniques that expect to recognize focuses on a digital image at which the image brightness changes either officially or strongly and furthermore distinguishes a few discontinuities in the images.

Project Implementation

Essentially, we are going to utilize a series of image transformations and bilateral filters. Here is the step to change over an ordinary computerized picture to cartoonish pictures.

  1. The initial step of cartooning image is to apply the bilateral filter to decrease the shading or color palette of the image, which implies first we need to downscale the image and afterward apply the bilateral filter to get an animation flavor and again we upscale the image.
  1. The next step is to get a blurred image of the real image. And we just need the blurring of the limits without colors to interfere in this process. So, for this, we first convert the genuine picture to grayscale.
  1. The following stage is to apply the median blur so as to diminish image noise in the grayscale image.
  1. Next, we make an edge mask from the grayscale image utilizing an adaptive thresholding technique.
  1. In the last step, we have to recognize the edges in the image and afterward add this to the recently changed pictures to get cartoonish or sketch pen impact to the picture. After this step, we finally combine the final images obtained from the previous steps.
  1. Here we get our cartoonist image.
Software requirement:

Programming language: OpenCV- python

Operating System: Windows, ubuntu

Kit required to develop Cartooning an Image using Open CV:
Technologies you will learn by working on Cartooning an Image using Open CV:


Any Questions?


Subscribe for more project ideas