0% found this document useful (0 votes)
4K views12 pages

Final Report Mini Project Final

This certificate certifies that Shashidhar Suresh Ganiger and P Chandan Kumar completed a mini project on "Cartoonifing An Image" under the guidance of Mrs. Rashmi H C of the Department of Electronics and Communication Engineering at SRI SIDDHARTHA INSTITUTE OF TECHNOLOGY. The project was completed to fulfill the requirements for a Bachelor of Engineering degree in Information Science and Engineering for the academic year 2020-21. The project satisfied all academic requirements and was approved by the principal, head of department, and guide.

Uploaded by

Sha Var
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4K views12 pages

Final Report Mini Project Final

This certificate certifies that Shashidhar Suresh Ganiger and P Chandan Kumar completed a mini project on "Cartoonifing An Image" under the guidance of Mrs. Rashmi H C of the Department of Electronics and Communication Engineering at SRI SIDDHARTHA INSTITUTE OF TECHNOLOGY. The project was completed to fulfill the requirements for a Bachelor of Engineering degree in Information Science and Engineering for the academic year 2020-21. The project satisfied all academic requirements and was approved by the principal, head of department, and guide.

Uploaded by

Sha Var
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

SRI SIDDHARTHA INSTITUTE OF TECHNOLOGY

(A CONSTITUENT COLLEGE OF SRI SIDDHARTHA ACADEMY OF HIGHEREDUCATION)


MARALUR, TUMAKURU -572105

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify that the mini project work entitled Cartoonifing An Image is a
bonafide work carried out by Shashidhar Suresh Ganiger (18IS074), P Chandan Kumar
(18IS091) under the guidance of Mrs.Rashmi H C , Dept of ISE,SSIT in partial fulfillment of
the award of the degree of Bachelor of Engineering in INFORMATION SCIENCE AND
ENGINEERING during the academic year 2020-21.
It is certified that all the corrections/suggestions indicated for internal assessment has
been incorporated in the report. This project has been approved as it satisfies the academic
requirements with respect to the project work prescribed for the award of the degree of Bachelor
of INFORMATION SCIENCE AND ENGINEERING.

Signature of Guide Signature of the HOD Signature of the Principal


Mrs.Rashmi H C Dr. K Karunakara DR. M. S. RAVIPRAKASHA
Mtech,Ph.D B.E,Mtech,Ph.D B.E,Metch,Ph.D
Asst. Professor. Prof & HoD. Principal.

Submited by:
Shashidhar Suresh Ganiger – 18IS074
P Chandan Kumar --18IS091
ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion of any
task would be incomplete without mention of the people who made it possible and support
had been a constant source of encouragement which crowned my efforts with success.
We are deeply indebted and would like to express our sincere thanks to our
beloved Principal Dr. M.S. Raviprakasha, S.S.I.T, Tumakuru, for providing us an
opportunity to do this mini project work.
We feel grateful to Dr.K Karunakara, HOD & Professor, Department of
Information Science and Engineering, S.S.I.T, Tumakuru, for his constant encouragement in
this mini project work.
Our sincere thanks to our guide Mrs Rashmi H C , Asst., Professor
Department of Electronics and Communication, S.S.I.T, Tumakuru for his/her guidance and
whole hearted support.
We would like to express our sincere thanks to all the staff members of
Electronics and Communication Department, S.S.I.T. for their valuable guidance and
support.

SHASHIDHAR SURESH GANIGER - ( 18IS074)


P CHANDAN KUMAR - ( 18IS091 )

-
ABSTRACT

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 this 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
each of the picture element.
CONTENTS
Chapters Page No

1.Introduction 5
1.1 Literature Review 6
1.2 Objective 6
2. System Requirements 7
2.1 Algorithm 7
2.2Motivation 7
2.3 Objective of Result 7
3.Code Implementation 10
4.Conclusion 12
4.1 References 12
Chapter 1

INTRODUCTION
Advanced technology has become the integral part of our life . To satisfy the need of the
society, almost in each work, we use the technology . In current era computer science is major
subject . It has many real life applications such as cloud computing, NSPP ,remote monitoring,
Wireless sensor network uncertain,internet of things, Neural network, artificial intelligence,
FSPP, TP, internet Security and so on. Technology is the mode by which user can store, fetch,
communicate and utilize the information . The image processing plays a major role in all
computers related applications. The image processing appears in many real-life applications,
e.g., home security, banking system, education sector, defense system, Railway, and so on. In
this manuscript we discuss about the cartooning of image.
Each of these methodologies offers a rapid contribution to human interest. Each confined
methodology helps in filtering the picture element that forms to an image. There are various
factors that enables to produce the essence of an image. The concerns are contrasting and
appropriate color mixing, matching between any two pixels connecting two cells, accurate
placing of objects together combined to form image features. In the recent times there happened
to be drastic changes in ample fields. The uplift of these fields enhances in betterment of the
society. In the field of medicine, these processing of images enable to extract the fullest accuracy
of the images.
Image Processing is widely processed in the medical field such as in the MRI/ET scans .
The amount of research in the image processing has helped to acquire early detection of tumors.
There plays a vital role in the field of image processing and in the field of Biology. This
research bound to save livelihood as early detection can be identified and effective treatment can
be started off. These extended concepts have enabled to build better security systems which
ensure safety. The security/surveillance systems have managed to build systems depending on
the image processing algorithms,
The recent technology of fingerprint unlock, face detection unlock has resulted in
developing an efficient security. These Biometric systems perhaps have been now installed on to
smaller devices as well for the simpler usage. With the recent success apprehended by the social
media is duly with the techniques installed to enhance the user experience. E.g. – Facebook
confines with the auto tag mechanism to automatically suggest the person’s name and not by
manually tagging each person on the image.
The basic concept in this algorithm involves the technique of converting the RGB colour
image to an accurate, cartooned image without multiple filtrations or blurred image without
proper facilitation of edge detection. This user interface allows to apply the animation effects.
This naturally provides an artistic effect and comics as well with wide range of pictures.

DEPT OF ISE Page 5


1.1 LITERATURE REVIEW
Cartooning is a picture intended as satire, caricature, or humor. Cartoons are often featured in
print publications and online publications, like blogs and websites. Sometimes cartoons will consist
of just one picture, while others will consist of several pictures. Typically, characters and scenes in
most cartoons are not drawn realistically. Some cartoons may have a caption, speech, or thought
bubble that make the characters’ words or actions apparent.

Cartooning has its roots in caricature, from the Italian word caricare meaning to load or
exaggerate. Caricature gives weight to the most striking physical features of its subject for comic
effect. These unique portraits were created as an artist’s exercise, a way of gaining expertise in
defining the essence of a person with a few deft strokes of the pen. The great Italian
masters, Leonardo da Vinci, Annibale Carracci, and Gian Lorenzo Benini all drew this art
form.
Most cartoons are meant to convey a certain message or point out some type of irony. Depending
on the intended audience, cartoons might either be very complex or straightforward. Editorial and
political cartoons illustrate a point of view on current social and/or political topics and may depend
on dry humor and subtle irony. Other cartoons see the humor in everyday life, such as depicting
married life with exaggerated common marital situations. This type can be seen in advertising and
spots.

Other illustration genres related to cartooning are the comic strip (a sequence of cartoons) and the
graphic novel (a very long series of cartoons). Today, cartoonists are also creating storyboards,
which are used when producing animated films and video games.

1.2 OBJECTIVE

These are the main objectives we try to achive in this project.They are short and to the point
namely:

1. Cartoonify an image using OpenCv ,Import necessary packages and read the image or capture
an image from the webcam and save in a specific path.
2. Perform Color quantization technique.
3. Find edges in the image .
4. Combine edges and the quantized result.

DEPT OF ISE Page 6


Chapter 2
Specific Requirements

 CV2
 Easygui
 Numpy
 Imageio
 Matplotlib
 Os
 Visual Studio
 Python 3.9.5

2.1 Algorithm

The process to create a cartoon effect image can be initially branched into 2 divisions –
1) To detect, blur and bold the edges of the actual RGB color image.
2) To smooth, quantize and the conversion of the RGB image to grayscale. The results involved in
combining the image and help achieve the desired result .

 Identifying the Edges


Finding smooth outline that represents or bounds the shape of the image is an important
property to achieve a quality image. All Edge processing tasks are:
 MEDIAN FILTER – This filter helps in reducing the noise created during the downscaling
the image and later converting the original image to cartoon image by applying the bilateral
filter. Any extreme specks are smoothened over.
 EDGE DETECTION – At first the noise of the image is removed within the image .Later the
smoothened image is filtered using horizontal and vertical direction by dividing the cells of
the picture element(both x and y dimensions.)
 MORPHOLOGICAL OPERATIONS – This serves the purpose to Bolden and smoothen the
outline of the edges variably. The pixels that are highlighted but seems far are removed.
Hence the edge lines reduce to thinner outline.
 EDGE FILTERING – Two divisions of the constituent regions, any region that pertain below
a a certain threshold is removed. Small outline identified by the detection method is removed
from the final image.

DEPT OF ISE Page 7


 Colors to the RGB Image
The most important aspect is to eliminate the color regions and apply cartoon effects.

Through this algorithm, the colors are smoothened on multiple filtrations so as to create a
equal color regions.
 BILATERAL FILTERING – The important role of this filter is to smooth the images without
creating any sort of noise also while preserving the edges. Filtering is performed by reading
an image from the file and storing it in a matrix object. Initially creating an empty matrix to
store the result and applying bilateral filter. This totally depends on the kernel size and testing
by running more no of iterations.
 QUANTIZE COLOURS – The last step of the conversion involves the step of reducing the
number of colors in each pixel.

 Recombine
The final task is to overlay the edges onto the color image is when both the color and edge
image processing are complete.

We aim to transform images into its cartoon. Yes, we will CARTOONIFY the images. Thus, we
will build a python application that will transform an image into its cartoon using OpenCV.
We will import the following modules:

 CV2: Imported to use OpenCV for image processing


 easygui: Imported to open a file box. It allows us to select any file from our system.
 Numpy: Images are stored and processed as numbers. These are taken as arrays. We use
NumPy to deal with arrays.
 Imageio: Used to read the file which is chosen by file box using a path.
 Matplotlib: This library is used for visualization and plotting. Thus, it is imported to form the
plot of images.
 OS: For OS interaction. Here, to read the path and save images to that path.
We aim to build an application which looks like:

DEPT OF ISE Page 8


2.2 Motivation

 The higher literature review reveals that there varied gaps within the study of
converting image to a cartoon image.
 An obvious disadvantage of smoothing is the fact that it does not only smooth noise,
but also blurs important features such as edges and, thus, makes them harder to identify.
 Linear diffusion filtering dislocates edges when moving from finer to coarser scales.
 To implement multiple number of bilateral filters.
 To apply multiple number of values to the existing parameters.

2.3 Objective of result

 Following area unit the most objectives planned and accomplished during this
analysis work.
 Rapid image processing with high detection rates.
 To provide High accuracy model as compare with current existing models.
 To provide very low false positive rate.

DEPT OF ISE Page 9


Chapter 3
Code Implementation
import cv2 #for image processing
import easygui #to open the filebox
import numpy as np #to store image
import imageio #to read image stored at particular path
import sys
import matplotlib.pyplot as plt
import os
import tkinter as tk
from tkinter import filedialog
from tkinter import *
from PIL import ImageTk, Image
top=tk.Tk()
top.geometry('400x400')
top.title('Cartoonify Your Image !')
top.configure(background='white')
label=Label(top,background='#CDCDCD', font=('calibri',20,'bold'))
def upload():
ImagePath=easygui.fileopenbox()
cartoonify(ImagePath)
def cartoonify(ImagePath):
# read the image
originalmage = cv2.imread(ImagePath)
originalmage = cv2.cvtColor(originalmage, cv2.COLOR_BGR2RGB)
#print(image) # image is stored in form of numbers

# confirm that image is chosen


if originalmage is None:
print("Can not find any image. Choose appropriate file")
sys.exit()
ReSized1 = cv2.resize(originalmage, (960, 540))
#plt.imshow(ReSized1, cmap='gray')
#converting an image to grayscale
grayScaleImage= cv2.cvtColor(originalmage, cv2.COLOR_BGR2GRAY)
ReSized2 = cv2.resize(grayScaleImage, (960, 540))
#plt.imshow(ReSized2, cmap='gray')
#applying median blur to smoothen an image
smoothGrayScale = cv2.medianBlur(grayScaleImage, 5)
ReSized3 = cv2.resize(smoothGrayScale, (960, 540))
#plt.imshow(ReSized3, cmap='gray')
#retrieving the edges for cartoon effect
#by using thresholding technique
getEdge = cv2.adaptiveThreshold(smoothGrayScale, 255,
cv2.ADAPTIVE_THRESH_MEAN_C,
cv2.THRESH_BINARY, 9, 9)
ReSized4 = cv2.resize(getEdge, (960, 540))
#plt.imshow(ReSized4, cmap='gray')
#applying bilateral filter to remove noise
#and keep edge sharp as required
colorImage = cv2.bilateralFilter(originalmage, 9, 300, 300)
ReSized5 = cv2.resize(colorImage, (960, 540))
#plt.imshow(ReSized5, cmap='gray')
#masking edged image with our "BEAUTIFY" image
DEPT OF ISE Page 10
cartoonImage = cv2.bitwise_and(colorImage, colorImage, mask=getEdge)
ReSized6 = cv2.resize(cartoonImage, (960, 540))
#plt.imshow(ReSized6, cmap='gray')
# Plotting the whole transition
images=[ReSized1, ReSized2, ReSized3, ReSized4, ReSized5, ReSized6]
fig, axes = plt.subplots(3,2, figsize=(8,8), subplot_kw={'xticks':[], 'yticks':[]},
gridspec_kw=dict(hspace=0.1, wspace=0.1))
for i, ax in enumerate(axes.flat):
ax.imshow(images[i], cmap='gray')
save1=Button(top,text="Save cartoon image",command=lambda: save(ReSized6,
ImagePath),padx=30,pady=5)
save1.configure(background='#364156', foreground='white',font=('calibri',10,'bold'))
save1.pack(side=TOP,pady=50)
plt.show()
def capture():
cam = cv2.VideoCapture(0)
cv2.namedWindow("test")
img_counter = 0
while True:
ret, frame = cam.read()
if not ret:
print("failed to grab frame")
break
cv2.imshow("test", frame)
k = cv2.waitKey(1)
if k%256 == 27:
# ESC pressed
print("Escape hit, closing...")
break
elif k%256 == 32:
# SPACE pressed
img_name = "opencv_frame_{}.png".format(img_counter)
cv2.imwrite(img_name, frame)
print("{} written!".format(img_name))
img_counter += 1
cam.release()
def save(ReSized6, ImagePath):
#saving an image using imwrite()
newName="cartoonified_Image"
path1 = os.path.dirname(ImagePath)
extension=os.path.splitext(ImagePath)[1]
path = os.path.join(path1, newName+extension)
cv2.imwrite(path, cv2.cvtColor(ReSized6, cv2.COLOR_RGB2BGR))
I= "Image saved by name " + newName +" at "+ path
tk.messagebox.showinfo(title=None, message=I)
#cv2.destroyAllWindows()
upload=Button(top,text="Cartoonify an
Image",command=upload,padx=10,pady=5)
upload.configure(background='#364156', foreground='white',font=('calibri',10,'bold'))
upload.pack(side=TOP,pady=50)

abc=Button(top,text="Capture",command=capture,padx=10,pady=5)
abc.configure(background='#364156', foreground='white',font=('calibri',10,'bold'))
abc.pack(side=TOP,pady=100)
top.mainloop()

DEPT OF ISE Page 11


Chapter 4

CONCLUSION
First of all, the basic tools to handle the titled problems of the thesis are incorporated. It
includes origin and history of image processing, different types of uncertain environment,
existing methods for cartoon imaging. Amid the previous three decades, the topic of image
processing has gained vital name and recognition among researchers because of their frequent
look in varied and widespread applications within the field of various branches of science and
engineering. [37] As an example, image processing is helpful to issues in signature recognition,
digital video processing, Remote Sensing and finance. Conclusion and Future Directions Firstly,
we use high-resolution camera to take picture of the internal structure of the wire. Secondly, we
use OpenCV image processing functions to implement image pre-processing. Thirdly we use
morphological opening and closing operations to segment image because of their blur image
edges. The main attraction of the paper is to solve different types of images having one object,
two object and three object which can’t be solved by any of the exiting methods but can be
solved by our proposed method.
4.1 References

 https://www.academia.edu/44964756/Cartooning_an_Image_Using_Opencv_and_Python

 https://www.illustrationhistory.org/genres/cartooning

 https://www.kapwing.com/cartoonify

 https://www.cartoonize.net/

 https://www.befunky.com/features/photo-to-cartoon/

DEPT OF ISE Page 12

You might also like