You are on page 1of 25

CHAPTER 1

INTRODUCTION

1.1 Overview
Cartoons are illustrations of characters that can be imaginary or are based on a personality. They are
semi-realistic or non-realistic, which are popular nowadays to depict a situation or a happening in a
funny, satirical way.
One of the earliest examples of traditionally animated movies, Fantasmagorie (1908), in which all the
movie frames were hand-drawn, and till years the animation culture with hand-drawn frames. Walt
Disney caught the race with their remarkable cartoon series and took the animation cartoons to the
next level.
Earlier, cartoonists used to draw these cartoons by hand, and when 'Anime' started catching the light,
it became difficult for them to attract each movie frame by hand, which took a lot of time and was
not reversible if met with a mistake.
With increasing technology, numerous software came into the market to digitally draw the
illustrations, thus reducing human effort and were more efficient than being hand-drawn by artists.
Which also, in time, improved with numerous features introduced. Toy Story (1995), the first fully
computer-animated feature film, was a huge success. It portrayed the characters as very interactively
stunning, and the excellent animation made it very life-like.
Playing with images is also a 'fun' activity, and lately, image manipulation has been blowing up social
sites, with many people making careers in image manipulation and enhancement. The OpenCV library
works on the same principle.
Although digital animation has more audience, there are still millions of people who still purchase
comic books. Therefore, there is still a vast market for paper comics because why not? The traditional
way of enjoying cartoons is always fun.
The primary intent of this work is to convert a real-life photograph into a cartoon effect. The most
well-known, fun, and popular form of art is the cartoon. Image-to-image conversion is the process of
creating a visual relationship between the input and output images. Image cartooning is the process
of using software to transform real-world photographs into cartoons.
2D or 3D art formats are frequently used to create cartoons. Identifying items in photographs,
counting objects, counting dimensions, and appreciating image-to-blur effects are all part of the
process of converting images to cartoons. The 2D matrix is used to see each image. Every line, as
well as every shade and color in a picture, must be obtained in order to create a cartoon that looks

1
exactly like the actual thing. Convolutional Neural Networks (CNN) have served as the foundation
for a number of techniques. "Cartoon Renderer" is the framework that is used to translate a single
trained model into many cartoon styles. Cartoons are a type of art that is used frequently. Many artists
use real-world images to produce cartoon effects, just like they do with other types of art.

1.2 Objective
Several images and videos are used as input data for this work. The main goal of this work is to
accurately transform an RGB (Red, Green, and Blue) image into a cartoon image with numerous
filtrations (or a blurred image with appropriate edge detection). Cartoons are crucial to entertainment,
instruction, and advertising. Multimedia and computer graphics research has been getting more and
more intense. Automatic cartoon object extraction is very helpful in many different applications; one
of the most significant is the retrieval of cartoon images, where the user of the system seeks out
comparable images in order to query an image from the database in character. In order to retrieve
cartoon characters, some automatic methods that separate the region(s) of interest from other, less
important regions in an image have been modified. These methods use partial features to identify
regions and/or aspects that are unsuitable for cartoon characterization or gesture recognition. Others
used Salient Object Detection, while some efforts went beyond extracting the central objects. In order
to process images and cartoonize them, this work suggests using the K-Means clustering algorithm.
This work demonstrates how efficient image processing may perform tasks that would often need a
machine learning model and significant computer capacity. Images are used as input in this work.
Converting these photos to videos is simple. The process is taking the source image, using a bilateral
filter to blur it, using Canny to locate its edges, then converting the image to HSV (Hue-Saturation
Value) format and clustering it using K-means. Draw outlines on the image and then convert it back
to RGB format. Finally, display the image while using erosion to thicken the boundaries.

2
CHAPTER 2
LITERATURE SURVEY

Title: Cartoonizing the Image” an International Journal of Advanced Trends in Computer Science
and Engineering.
Author: MD. Salar Mohammad, Bollepalli Pranitha, Shivani Goud Pandula, Pulakanti Teja Sree.
Year: 2017.
Description:
In this Processing technique is used to cartoonize an image. image Processing-In the field of the
research processing of an image consisting of identifying an object in an image identify the
dimensions, no of objects, changing the images to blur effect and such effects are highly appreciated
in the modern era of media and communication. There are multiple properties in the Image
Processing. Each of the property estimates the image to be produced more with essence and sharper
image. each image is examined to various grid. Each picture element together is viewed as a 2-D
Matrix. With each of the cell store different pixel values corresponding to the each of the picture
element
Title: Cartoonizer: Convert Images and Videos to Cartoon-Style Images and Videos.
Author: S. Rajatha, Anusha Shrikant Makkigadde, Neha L. Kanchan, Sapna, K. Janardhana Bhat.
Year: 2018.
Description:
In this paper, Cartoon GAN, where GAN stands for Generative Adversarial Network is used to
transform images (snapshots) to the finest cartooned image (animated image). With the help of the
loss function and of two types named as Adversarial loss and content loss, we got a flexible as well
as a clear edge defined images. Also with the help of CV2 which is Computer Vision, we have
transformed video into animation (cartoonized video).
Title: Cartoon Image Generation from Sketch by Using Conditional Generative Adversarial
Networks.
Author: Zengchang Qin, Zhenbo Luo, Hua Wang.
Year: 2019.
Description:
Recently, realistic image generation using deep neural network has become a hot topic in machine
learning and computer vision. In this paper, the sketch-to-image synthesis problem is investigated by
using Conditional Generative Adversarial Networks (CGAN). The new model is not only capable of
3
painting hand-draw sketch with proper colors, but also allowing users to indicate preferred colors.
Experimental results on two sketch datasets show that the auto-painter performs better that existing
image-to-image methods. Auto-painter is a supervised learning model, given a black-and-white
sketch, the model can generate a painted colorful image based on given sketch image pairs in the
training data.
Title: Cartoonization Using White-box Technique in Machine Learning
Author: Harshitha R, Kavya S Muttur, Prof. Jyothi Shetty Dept. Computer Science,
Year: 2020.
Description:
In this paper, White-box Technique is used to cartoonize the image. By observing the cartoon
painiting behaviour and consulting artists, this paper purpose to separately identify three white-box
representations from images. International Journal of Research Publication and Reviews, Vol 3, no
11, pp 1081-1089 November 2022 1083 The surface representation that contains a smooth surface of
cartoon images. The structure representation that refers to the sparse color blocks and flatten global
content is the celluloid style workflow. And the texture representation that reflects high frequency
texture, contour, and details in cartoon images.
Title: Transformation of Realistic Images and Videos into Cartoon Images and Video using GAN.
Author: Akanksha Apte, Ashwathy Unnikrishnan, Navjeevan Bomble, Prof. Sachin Gavhane.
Year: 2021.
Description:
In this paper, a method is proposed that is white-box controllable image cartoonization framework
with the help of GAN, which can generate highquality cartoonized images and videos from real-world
photos and videos. Images are decomposed under three cartoon representations surface, structure and
texture representation. Image processing models such as OpenCV, PIL, etc. are used to extract three
representations for network training, and result styles could be controlled by adjusting the weight of
each representation.

4
CHAPTER 3
SYSTEM ANALYSIS

Purpose of Project
The main purpose of project is to convert the user input image into a Cartoon image.

3.1 EXISTING SYSTEM

The existing system proposes a method that makes an input target image into exaggerated cartoon-
like images by using reference images. To deform a target image, they extract feature points from
target image and define the feature point model on reference images. And then apply feature based
warping method to the deformation.

DISADVANTAGES:

➢ Lack of Clarity.

➢ Space Consuming.

➢ Need of reference images.

➢ Not reversible or Irreversible.

➢ Complex task.

➢ Physical strain.

5
3.2 PROPOSED SYSTEM

The proposed system is used to make the cartoon like images from the input or reference images
by creating an edge mask and using a simple technique like colour quantization of the image and
then combining them. The system is capable of converting the image to Cartoonization. The system
can handle PNG, jpg, jpeg and can success convert into the cartooned. The user can download the
cartoonized image. The clarity of image depends on the pixels of the image uploaded to the project.

ADVANTAGES:

➢ System can handle png, jpg, jpeg and can success convert into the cartooned.
➢ Easy Uploading of Images.
➢ Fast conversion of image to cartoon.

3.3 MODULES
➢ Gray Scale Conversion.
➢ Image Smoothening.
➢ Image Masking.

Gray Scale Conversion:


Grayscale conversion means converting an image into gray representation, omitting other colors. This
can be done by applying mathematical formulation on the RGB values and replacing them in the
image or creating new image with those new values. Each pixel has its pixel values with three values:
Red, Green and Blue.
Image Smoothening:
Image smoothing is a digital image processing technique that reduces and suppresses image noises.
In the spatial domain, neighborhood averaging can generally be used to achieve the purpose of
smoothing.
Image Masking:
Image masking is an extremely useful technique to edit your images in a non-destructive way. With
image masking, you can “conceal and reveal,” meaning you can hide portions of your image and
display other portions, allowing you much more flexibility in how you edit your images.

6
3.4 SYSTEM REQUIREMENTS SPECIFICATIONS
As the project is developed in python, we have developed our project in Google Colab as it contains
all the required libraries and packages.
Google Colab is a platform where anybody can write and execute arbitrary python code through
browser and is especially well suited to machine learning, data analysis and education.

Hardware Requirements:
The hardware requirements may serve as the basis for a contract for the implementation of the system
and should therefore be a complete and consistent specification for the whole system.

➢ Processor : Any processor with minimum 2.9GHz speed.

➢ RAM : Minimum 4 GB.


Software Requirements:
The software requirements document is the specification of the system. It should include both a
definition and a specification of requirements. The software requirements provide a basis for creating
the software requirements specification.

➢ Operating System : Windows 10 or above.

7
CHAPTER 4
SYSTEM DESIGN

UML Diagrams Introduction:


Each view is defined by asset of diagram, which is as follows

User Model View The unified modeling language (UML) is general purpose,
developmental, modeling language in the field of software engineering that is intended to provide
a standard way to visualize the design of a system. The unified modeling language (UML) offers
a way to visualize a system's architecture blueprints in a diagram (see image), including elements
such asany activities individual components of the system and how they can interact with other
software components. How the system will run, how entities interact with others components and
interfaces) external user interface.

Although originally intended solely for object-oriented design documentation, the unified
modeling language (UML) has been extended to cover a larger set of desi documents and been
found useful in many contexts.

The unified modeling language allows the software engineer to express an analysis model
using the modeling notation that is governed by a set of syntactic semantic and pragmaticrules.

A UML system is represented using five different views that describe the system from
distinctly different perspective. Each view is defined by asset of diagram, which is as follows

• User Model View

i. This view represents the system from the user's perspective.

ii. The analysis representation describes a usage scenario from the end-user’s
perspective.

• Structural Model View

i. In this model the data and functionality are arrived from inside the system

ii. This model view models the static structures

• Behavioral Model View

It represents the dynamic of behavioral as parts of the system, depicting the interactionsof
collection between various structural elements described in the user model and structural
model view.

• Implementation Model View

In this the structural and behavioral as parts of the system are represented as they are
to be built.
8
• Environmental Model

The system is to be implemented are represented UML analyses modeling this focuses on
the user model and structural model views of the system.

UML design modeling, which focuses on the behavioral modeling, implementation modeling
and environmental model views. Use case Diagram represent the functionality of the system from
a user's point of view Use case are used during requirements elicitation and analysis to represent
the functionality of the system. Use cases focus on the behavior of the system from external point
of view. There are five types of UML diagrams for this project namely:

• Class diagram

• Use case diagram

• Sequence diagram

• Activity diagram

• Data Flow diagram

9
4.1 Class Diagram:
Class diagrams are the most common diagrams used in UML.

Class diagram consists of classes interfaces associations and collaborations.

Class diagram basically represent the object reigned view of a system which is static in nature.

FIG 4.1. Class Diagram

10
4.2 Use Case Diagram:

Use case diagrams are a set of use cases, actors and their relationships. They represent the use
case view of a system.

A use case represents a particular functionality of a system.

So, use case diagram is used to describe the relationship among the functionalities and their
internal external controllers. These controllers are known as actors.

FIG 4.2. Use Case Diagram

11
4.3 Sequence Diagram:
A sequence diagram is an interaction diagram. From the name it is clear that the diagram deals

with some sequences, which are the sequence of messages flowing from one object toanother.

Interaction among the components of a system is very important from implementation andexecution
perspective.

So, sequence diagram is used to visualize the sequence of calls in a system to perform a

specific functionality.

FIG 4.3. Sequence Diagram

12
4.4 Activity Diagram:
Activity diagram describes the flow of control in a system. So, it consists of activities and

links. The flow can be sequential, concurrent or branched.

Activities are nothing but the functions of a system. Numbers of activity diagrams are

prepared to capture the entire flow in a system.

Activity diagrams are used to visualize the flow of control in a system. This is prepared to

have an idea of how the system will work when executed.

In this project the activity diagram shows the flow functions/activity.

FIG 4.4. Activity Diagram

13
4.5 Data Flow Diagram

A data flow diagram shows the way information flows through a process or system. It includes
data inputs and outputs, data stores, and the various sub processes the data moves through. DFDs
are built using standardized symbols and notation to describe various entities and their
relationships. Data flow diagrams visually represent systems and processes that would be hard to
describe in achunk of text. You can use these diagrams to map out an existing system and make
it better or to plan out a new system for implementation. Visualizing each element makes it easy
to identifyinefficiencies and produce the best possible system.

FIG 4.5. Data Flow Diagram

14
CHAPTER 5
SOFTWARE TESTING

TESTING PROCESS
We all make mistakes and if left unchecked, some of these mistakes can lead to failures or bugs
that can be very expensive to recover from. Testing our code helps to catch these mistakes or avoid
getting them into production in the first place. Testing therefore is very important in software
development. Used effectively, tests help to identify bugs, ensure the quality of the product and to
verify that the software does what it is meant to do.

5.1 TYPES OF TESTINGS


5.1 Unit Testing:
Unit testing includes the design of test belongings that validate that the internal program logic is
operative properly, and that program input produces valid outputs. All choice branches and internal
code flow should be authorized. It is the testing of separate software units of the request. It is done
after the close of an individual unit before integration. This is a structural testing, that relies on data of
its structure and is invasive. Unit tests achieve basic tests at factor level and test a specific commercial
process, application, and/or system formation. Unit tests ensure that each single path of business
process completes accurately to the documented provisions and contains clearly defined inputs and
probable results.

5.2 Integration Testing:


Integration tests are calculated to test integrated software components to regulate if they actually
run as one program. Testing is occasion driven and is more concerned with the basic result of screens
or fields. Integration tests validate that although the workings were individually approval, as shown by
positively unit testing, the grouping of components is correct and dependable. Integration testing is
specifically aimed at revealing the problems that arise from the grouping of components.

5.3 Functional Testing:


Functional tests provide systematic protests that functions tested are accessible as stated by the
business and technical necessities, system certification and user guides.
Functional difficult is centered on the subsequent items:
15
➢ Valid Input is used to identified classes of valid input must be accepted.
➢ Invalid Input is used to identified classes of illegal input must be disallowed.
➢ Functions is used to identified purposes must be exercised.
➢ Output is used to classify modules of request outputs.
➢ Systems/Procedures is used to interfacing systems or events must be appealed.
Organization and grounding of functional tests is focused on supplies, key functions, or special test
belongings. In addition, systematic coverage pertaining to identify Business process flows; data fields,
predefined processes, and succeeding processes must be well-thought-out for testing. Before functional
testing is complete, supplementary tests are identified and the operative value of recent test is resulted.

5.4 System Testing:


System testing confirms that the entire combined software system meets supplies. It tests a
configuration to ensure known and predictable outcomes. An example of system testing is the
arrangement -oriented system mixing test. System testing is based on procedure similes and flows,
emphasizing predriven process links and addition points.

5.5 White Box Testing:


White Box Testing is a challenging in which the software tester has information of the inner workings,
construction and language of the software, or at least its drive. It is used to test areas that cannot be
stretched from a black box level.

5.6 Black Box Testing:


Black Box Testing is testing the software short of any knowledge of the inner mechanisms,
building or language of the module actuality tested. Black box tests, as most other kinds of tests, must
be printed from a final source document, such as requirement or necessities file, such as specification
or requirement file. It is a testing in which the software below test is treated, as a black box you cannot
“see” into it. The test provides inputs and respond to outputs without seeing how the software works.

16
CHAPTER 6
IMPLEMENTATION

Coding:

import numpy as np
import cv2
import matplotlib.pyplot as plt
def read_file(filename):
img=cv2.imread(filename)
img=cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(img)
plt.show()
return img
filename="/content/download 1.jpg"
img = read_file(filename)
org_img=np.copy(img)
#create edge mask
def edge_mask(img,line_size,blur_value):
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
gray_blur = cv2.medianBlur(gray,blur_value)
edges=cv2.adaptiveThreshold(gray_blur, 255, cv2.ADAPTIVE_THRESH_MEAN_C,
cv2.THRESH_BINARY, line_size, blur_value)
return edges
line_size, blur_value = 7,7
edges = edge_mask(img,line_size,blur_value)
plt.imshow(edges)
plt.show()
line_size, blur_value = 7,7
edges = edge_mask(img,line_size,blur_value)
plt.imshow(edges, cmap='gray')
17
plt.show()
#reduce the color palette
def color_quantization(img, k):
#transform the image
data = np.float32(img).reshape((-1,3))
#determine the criteria
criteria = (cv2.TERM_CRITERIA_EPS+ cv2.TERM_CRITERIA_MAX_ITER, 20, 0.001)
#k-means clustering
ret, label, center = cv2.kmeans(data, k, None, criteria, 10,
cv2.KMEANS_RANDOM_CENTERS)
center = np.uint8(center)
result = center[label.flatten()]
result = result.reshape(img.shape)
return result
img = color_quantization(img, k=5)
plt.imshow(img)
plt.show()
#reduce the noise
blurred = cv2.bilateralFilter(img, d=3, sigmaColor=200, sigmaSpace=200)
plt.imshow(blurred)
plt.show()
#combine edge mask with quantized image
def Cartoon():
c= cv2.bitwise_and(blurred, blurred, mask = edges)
plt.imshow(c)
plt.title("Caartoonified image")
plt.show()
plt.imshow(org_img)
plt.title("original image")
plt.show()
Cartoon()

18
CHAPTER 7
TECHNOLOGICAL DESCRIPTION
Google Colab:

Colab is hosted Jupyter notebook service that requires no setup to use and provides free access to
computing resources, including GPUs and TPUs. Colab is especially well suited to machine learning,
data science, and education. Colaboratory, or “Colab” for short, is a product from Google Research.
Colab allows anybody to write and execute arbitrary python code through the browser.

Python:
➢ Python is a high-level, general-purpose programming language. Its design philosophy
emphasizes code readability with the use of significant indentation.
➢ Python is dynamically typed and garbage-collected. It supports multiple programming
paradigms, including structured (particularly procedural), object-oriented and functional
programming. It is often described as a "batteries included" language due to its comprehensive
standard library.
➢ Guido van Rossum began working on Python in the late 1980s as a successor to the ABC
programming language and first released it in 1991 as Python 0.9.0. Python 2.0 was released
in 2000. Python 3.0, released in 2008, was a major revision not completely backward-
compatible with earlier versions. Python 2.7.18, released in 2020, was the last release of
Python 2.
➢ Python consistently ranks as one of the most popular programming languages.

7.2 Importance of Python

• Python is Interpreted - Python is processed at runtime by the interpreter. You do not need to
compile your program before executing it. This is similar to PERL and PHP.

• Python is Interactive - You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.

• Python is Object-Oriented - Python supports Object-Oriented style or technique of


programming that encapsulates code within objects.

19
• Python is a Beginner's Language - Python is a great language for the beginner-level
programmers and supports the development of a wide range of applications from simple text
processing to WWW browsers to games.

MACHINE LEARNING
Machine learning is a very hot topic for many key reasons, and because it provides the ability
to automatically obtain deep insights, recognize unknown patterns, and create high performing
predictive models from data, all without requiring explicit programming instructions. This high level
understanding is critical if ever involved in a decision-making process surrounding the usage of
machine learning, how it can help achieve business and project goals, which machine learning
techniques to use, potential pitfalls, and how to interpret the results.

The most common machine learning tasks that one may come across while trying to solve a
machine learning problem. Under each task are also listed a set of machine learning methods that
could be used to resolve these tasks.

Following are the key machine learning tasks:


Regression

Classification

Clustering

Multivariate querying

Density estimation

Dimension reduction

Testing and matching

20
CHAPTER 8
OUTPUT SCREENS

21
22
CHAPTER 9
CONCLUSION

Image cartoonization helps in transforming real world photos into cartoon images. Cartoons are an
essential part of everyone’s childhood. They are certainly most important part of entertainment for
children. Cartoons can help children learn school related things. They can help children learn colors,
shapes and life facts. The Animation industries are very much interested in creating more cartoons
every day and the standards are also increasing day by day. The system is a success overall as it gives
satisfactory results. The output is largely dependent on the input experimented and tested; the
system works satisfactorily with almost all images.
The cartooning of images has a tremendous scope in the animation industry. Animated pictures are
frequently used in advertisements to keep the audience engaged and communicate information quickly
and effectively. Animated pictures are often used for educational purposes especially for the younger
age group. Cartooning of images also have a huge scope to print publications, and publishing
companies. Gaming sector is looking very promising. Especially mobile gaming and app development
sectors will see good growth in the near future. Looking at the present trends and status, it is safe to
say that the field of animation will see growth in the future.
Finally it can be concluded that an image can be converted into a cartoonized image with suitable
techniques which gives efficient output and less time consumption. Through many applications are
developed for Cartoonizing, implementation using Python or any other language gives better
understanding and better outputs.

23
CHAPTER 10
FUTURE SCOPE
Sentimental analysis can be very effective in predicting election results, stock market or movie
review. Like reviews of Facebook and twitter can be also used to give useful data which can be used
topredict future.
For instance, image processing is useful for problems with remote sensing, finance, digital video
processing, and signature recognition. In order to implement picture preprocessing, we first accept
input and then apply OpenCV image processing methods. Due of the blurred image edges, we apply
morphological opening and closing procedures to segment images. The major goal of the study is to
solve various sorts of photographs with one, two, or three objects that cannot be solved by any of the
existing methods but can be solved by the approach we present. It can produce the precise result
mentioned above, and a variety of input photographs will result in pleasing outcomes. The algorithm
is not flawless, though, and it does not react predictably to all inputs. It would be absurd to anticipate
that a one-size-fits-all method will deliver consistent outcomes given the range of input photos. So,
we've demonstrated how to turn an image into a cartoon. We have provided samples of how a cartoon
is created from a pictures.

24
CHAPTER 11
REFERENCES

[1] Ashish Dutta, Maizatul Akmar Ismail, and Tutut Herawan, “A Systematic Review on
Educational Data Mining”,) 2016 IEEE [2]

[2] Vipin Kumar · J. Ross Quinlan,” Top 10 algorithms in data mining”, Springer-Verlag
London Limited 2007

[3] Carlos Márquez Vera, Cristóbal Romero Morales and Sebastián Ventura Soto, “Predictingof
school failure and dropout by using data mining techniques”, The IEEE Journal of Latin-
American Learning Technologies (IEEE-RITA), Feb 2013

[4] Mustafa Agaoglu, “Predicting Instructor Performance Using Data Mining Techniques in
Higher Education," IEEE Access, 2016

[5] Feldman, R., Sanger. (2007)” The text mining handbook: advanced approaches in analyzing
unstructured data.”

[6] Markus Hofmann, Ralf Klingenberg, “RapidMiner: Data Mining Use Casesand Business
Analytics Applications (Chapman & Hall/CRC Data Mining and Knowledge Discovery
Series),” CRC Press, October 25, 2013.^ “RapidMiner,September 1, 2015.

[7] Guido Deutsch, “RapidMiner from Rapid-I at CeBIT 2010,” Data MiningBlog, March
18, 2010.

[8] “Interview with RapidMiner's Ingo Mierswa, RalfKlinkenberg”, KDnuggets,February, 2010.

[9] “German Predictive Analytics Startup Rapid-I Rebrands AsRapidMiner”,


TechCrunch, November 4, 2013.

25

You might also like