Ai Project Report PDF
Ai Project Report PDF
DONE BY:
NAME REGISTRATION NO:
TOPIC
1. Problem statement
2. Introduction
2.1 Motivation
2.2 Significance
3. Literature Survey
hould provide the related work so far happened 3.2
3.1 S
Gaps identified (if any)
3.3 Drive to the present work
4. Implementation
4.2 Algorithm
4.3 Complexity analysis
4.4 Program (Entire code need to copied in a folder and submit the same during review, include all the
dependencies)
5. Result analysis
6. Future work
7. References
Problem Statement
Automatic License Plate Recognition system is a real time embedded system which
automatically recognizes the license plate of vehicles. There are many applications ranging
from complex security systems to common areas and from parking admission to urban
traffic control. Automatic license plate recognition (ALPR) has complex characteristics due
to diverse effects such as
of light and speed. Most of the ALPR systems are built using proprietary tools like Matlab.
We have shown an alternative method of implementing ALPR systems using Free Software
including Python and the Open Computer Vision Library.
Keywords—
License plate, Computer Vision, Pattern Recognition, Python, OCR.
2.1 Motivation
Automatic License Plate Recognition (ALPR) is a computer vision technology to extract the
license number of vehicles from images. It is an embedded system which has numerous
applications and challenges. One of the notable contributions of the open source community
to the scientific world is Java. Intel’s researches in Computer Vision bore the fruit called Open
Computer Vision (OpenCV) library, which can support computer vision development.
Automatic license plate recognition is a Computer Vision technique which is able to recognize a
license plate number. This system is useful in many field likes parking lots, private and public
entrances, theft control. In this paper we designed such a system. First we capture the image
from camera then load into system after that we used OpenCV library tools. Then we make the
training set of different characters of different sizes. On the basis of these training set we
extracted the character from images. When the license plate is detected, its digits are
recognized and displayed in the GUI. In this mainly focuses on Neural Network and proprietary
tools OpenCV in which ALPR systems implementing using Free Software Open Computer
Vision Library including Java.
2.2 Significance
The scientific world is deploying research in intelligent transportation systems which have a
significant impact on peoples´ lives. Automatic License Plate Recognition (ALPR) is a
computer vision technology to extract the license number of vehicles from images. It is an
embedded system which has numerous applications and challenges.
Typical ALPR systems are implemented using proprietary technologies and hence are
costly. This closed approach also prevents further research and development of the system.
With the rise of free and open source technologies the computing world is lifted to new
heights.
People from different communities interact in a multi-cultural environment to develop
solutions for mans never ending problems. One of the notable
contribution of the open source community to the scientific world is Python. Intel’s
researches in Computer Vision bore the fruit called Open Computer Vision (OpenCV)
library, which can support computer vision development.
There are several applications where automatic license plate recognition can be used. The two major
values license plate recognition adds to systems are automation and security.
After integrating a License Plate Recognition Software Engine into intelligent transportation systems, it
becomes possible to automate motorway toll collection, analyse traffic, improve law enforcement, etc.
After integrating License Plate Recognition Software Engine into parking management systems,
controlled and automatic vehicle entry and exit in car parks or secure zones becomes possible.
Furthermore, the ability to recognise registration number is a significant added value for
comprehensive parking solutions or inventory management.
Literature Review
S PAPER ALGORITHM DATAS PERFORMAN PROBLEM IN PROPOSED
. DESCRIPTION USED ET CE MEASURE EXISTING METHOD
N USED SYSTEM
o Y. Aoyagi, GA with Trafficsi among the Image pattern the technique
1
T.Asakura the gn from 24 patterns recognition has based on GA
searching a video other than been chiefly [7] is
A study on traffic ability is image the speed researched only proposed to
sign applied for sign,it was for an individual recognize a
Recognition in this problem recognized object. However, circle traffic
scene image and a circle that only one it is an advanced sign by using
using genetic pattern in pattern was direction to only
algorithms and the image is not a sign recognize the brightness.
neural networks matched by object which This method
22nd International giving the becomes a is thought as
Conference on gene target from a a searching
Industrial information. scene image, problem from
Electronics, with the the scene
Control,and development of image. By
Instrumentation, the visual treating both
IEEE, August system of the the position
(1996) robot [l]. and the size
of the traffic
sign as gene
information,
the method
detecting the
traffic sign is
2 12132 developed.
Real time traffic Iterative This proved (i)The selective We have
sign detection training images to yield a extraction of proposed a
using color and algorithm from the speed of 2 fps Windows of multi-view
shape- based and eight at a level of interest, followed scheme, which
features TT le, AdaBoost cameras 96% detection by their combines 2D
ST Tran, S Mita, algorithm rate and 2 classification and 3D
TD Nguyen - false positives (ii) Exhaustive analysis and
Asian Conference per image slidingwindow efficient
on Intelligent …, based bounded
classification evaluation of
2010 linear
- Springer AdaBoost- like
3 Road (a) 3 classifier
Algorithm is Triangu lar road Edges are tested at To decrease the
. sign detection based on the 0 signs different levels of likelihood that
and recognition results of triangul :94% resolution by using signs are
using matching color ar road Circular road so-called a misidentified,
pursuit method segmentation signs; signs Hierarchical Structure the MP
SH Hsu, CL method and :91% Code. It is assumed training
Huang - Image followed by that closed algorithm
and Vision the template (b) 10 edgecontours are searches for a
Computing, 2001 matching. circular available at one of basis that
- Elsevier road signs these levels of separates the Ll
resolution, and coefficient
failures happen vectors
when the outline of between
the traffic sign merges different
with the classes of road
4 Traffic Sign training Swedish average background. signs
color-based EdgeBox
Detection and fully Traffic precision of methods, shape- [19], BING
Recognition convolutional Signs 98.67% based methods [42],
using Fully network Dataset and sliding Geodesic
Convolutional (FCN) using (STSD) window based Object
Network Guided bounding methods. Proposals[43]
Proposals box level (GOP),
Yingying Zhu, supervision selective
Chengquan search [25]
Zhang,
Duoyou
Zhou, Xinggang
Wang, Xiang Bai,
5 WenyuLiu,elsvier. Polygon LADOT images with proprietary a generalized
Generalized
traffic sign approximatio D sign in them algorithms use traffic sign
detection model n algorithm roadway 83.67% specific color detection
for developing a detects video images with filters and the model that
sign inventory Y an log no sign in features of can cope with
Tsai, P Kim, Z octagonal image them= specific shapes the essential
Wang - Journal of area that sets. 80.19% to distinguish a features of
Computing in should be a ( 37,640 specific type of traffic signs;
Civil Engineering, stop sign video traffic sign.but
2009 log they can detect
images) only stop signs
6 Image distortion- 121 88.88% object detection automatic
segmentation invariant different has been image road-sign
and shape fringe- road- feature recognition
analysis for road- adjusted JTC sign clustering. method based
sign detection JF (FJTC) images Bahlmann et al. on image
Khan, SMA technique for [26] detected segmentation
Bhuiyan… - IEEE recognition signs using a set and joint
Transactions on of color-sensitive transform
…, 2011 Haar wavelet correlation
ieeexplore.ieee.o features obtained (JTC) with the
rg from AdaBoost integration of
training and shape
temporal analysis.
information
7 Efficient the Multi- The The recognit propagation. algorithm is a
First, the image
algorithm for Scale images ion rate is color Multi- scale
automatic road Retinex (MSR were achieve d by segmented. version of the
sign recognition )algorithm taken at the system Second, the known
and its hardware different was around shape is algorithm as
implementation light 82 % extracted, and Single-Scale
C Souani, H conditio finally, the traffic Retinex (SSR):
Faiedh, K Besbes ns sign is just makes
- Journal of real- recognized by images
time image processing the obtained by
processing, 2014 local region. averaging
- Springer SSR at
different
scales. In the
recognition
stage, some
extracted
features, such
as symbol, J
Real-Time
Image Proc
colors and
shapes are
treated by a
Support
Vector
Machine
(SVM)
8 Traffic sign shape 60 000 95.39% Edge Image
recognition signature traffic At the peak detection in gray segmentation
algorithm based and dual-tree sign image.Clustering based on
on shape complex images and intelligent transforming
signature and wavelet from feature value of RGB
dual-tree transform several analysis.Image color space
complex wavelet traffic segmentation and shape
transform Z Cai, video by classifier
M Gu - Journal of sequenc threshold in based on
Central South es specific signature
University, 2013 color feature can
- Springer space,then be effective in
analysis with detecting
geometrical multiple
edge traffic signs in
complex
urban scenes.
9 Fast traffic sign the first GTSRB HOG traffic sign Two
recognition with optimization and STS +ANN= detection and optimizations
a rotation called RIBP 95.41% recognition can for robust and
invariant binary (Rotation SIFT be divided into fast traffic
pattern based invariant +ANN= three categories. sign
feature S Yin, P binary 97.10% First, pre- recognition
Ouyang, L Liu, Y pattern the processing algorithm
Guo, S Wei - second methods are exhibits the
Sensors, 2015 - optimization researched to highest
mdpi.com called ANN locate and discriminative
(Artificial recognize the performance
Neural traffic signs. among the
Network) Second, pre- state-of-the-
based processing art features,
feature methods the
dimension combining with techniques of
reduction classification are artificial
and adopted to neutral
classification achieve robust network
traffic signs based feature
recognition. dimension
Third, specific reduction and
design classification
features are proposed
combing with the to reduce the
classifiers are recognition
used to achieve time.
the robust and
computing
efficient
recognition.
1 Traffic sign Deep neural 12630 Accuracy of Bayesian In our
0 recognition with networks test 93.65% classifiers, proposed
hinge loss using the BP images boosting, tree method we
trained algorithm classifiers , and use Deep
convolutional support neural
neural networks J vector networks
Jin, K Fu, C machines using the BP
Zhang - IEEE (SVMs) . These algorithm
Transactions on methods, from include
Intelligent …, today’s point of two
2014 view, are parts. The
- considered using first compares
ieeexplore.ieee.o hand-coded the
rg features such as convergence
a circle detector of HLSGD and
in , a Haar cross- entropy
wavelet SGD.
[6] in , and a The second
histogram of compares the
oriented gradient test accuracy
(HOG) or scale- of our HLSGD
invariant feature and the IJCNN
transform (SIFT) 2011
.
PROCESSES
In India, basically, there are two kinds of license- plates, black characters in white plate and black
characters in yellow plate. The former for private vehicles and latter for commercial, public service
vehicles. The system tries to address these two categories of plates.
CAPTURE
The image of the vehicle is captured using a high resolution photographic camera. A better
choice is an Infrared (IR) camera. The camera may be rolled and pitched with respect to the
license plates
PROPOSED SYSTEM
system.
PREPROCESS
processes:
Resize – The image size from the camera might be large and can drive the system slow.
LOCALIZE
Rear or front part of the vehicle is captured into an image. The image certainly contains other parts
of the vehicle and the environment, which are of no requirement to the system. The area in the
image that interests us is the license plate and needs to be localized from the noise. Localization is
basically a process of binarizing the image. There are two motivations for this operation –
1.Highlighting characters
2.Suppressing background.
In order to eliminate undesired image areas, a connected component algorithm is first applied to the
binarized plate candidate. Connected component analysis is performed to identify the characters in
the image. Basic idea is to traverse through the image and find the connected pixels. Each of the
connected components (blobs) are labelled and extracted.
SEGMENTATION
Segmentation is the process of cropping out the labelled blobs. These blobs are expected to be the
required portion of the license number. A special algorithm called Image Scissoring is introduced
here. In this algorithm, the license plate is vertically scanned and scissored at the row on which there
is no white pixel and the scissored area is copied into a new matrix.
There are unwanted blobs even after segmentation. These are classified using special
algorithms.
CHARACTER RECOGNITION
Finally, the selected blobs are send to an Optical Character Recognition (OCR) Engine, which
returns the ASCII of the license number.
TOOLS
PYTHON
With so much of freedom, Python helps the user to think problem centric rather than language
centric as in other cases. These features makes Python a best option for scientific computing.
OPENCV
OpenCV is a library of programming functions for real time computer vision originally developed by
Intel and now supported by Willogarage. It is free for use under the open source BSD license. The
library has more than five hundred optimized algorithms. It is used around the world, with forty
thousand people in the user group. Uses range from interactive art, to mine inspection, and advanced
robotics. The library is mainly written in C, which makes it portable to some specific platforms such as
Digital Signal Processor. Wrappers for languages such as C, Python, Ruby and Java (using JavaCV)
have been developed to encourage adoption by a wider audience. The recent releases have
interfaces for C++. It focuses mainly on real-time image processing. OpenCV is a cross-platform
library, which can run on Linux, Mac OS and Windows. To date, OpenCV is the best open source
computer vision library that developers and researchers can think of.
IMPLEMENTATION
OpenCV with Python is a deadly combination for computer vision. We will now revisit each phase in
the pipeline and see how they are implemented using the above tools.
CAPTURE
Starting from point one of capturing the image, OpenCV library has highly optimized algorithms for
all image processing operations. OpenCV provides interface for different camera models. The
following code snippet explains how to interface an in-built web camera and capture a frame.
hg.cvShowImage("Snapshot", frame)
PREPROCESS
Preprocessing involves resizing and changing colour spaces of the source image. Like any
other image processing toolkits, OpenCV also provides fast and quick procedures.
The original image is resized to the dimensions specified in the thumbnail object. Colour
LOCALIZE
Threshold operation is performed in this phase. To retain the image quality, adaptive threshold
algorithms are to be used. OpenCV provides complex and efficient adaptive thresholding
algorithms including Otsu method. cvThreshold(image, binary_image,128,255,
CV_THRESH_OTSU)
The above line of code returns a binary image which is adaptively thresholded. The
arguments follow the order:
1. Source image, 2. Destination image, 3. Threshold value, 4. Resultant value, and 5. Type of
threshold. The type CV_THRESH_OTSU performs Otsu algorithm on the source image.
CONNECTED COMPONENT ANALYSIS
cvBlobsLib is a library to perform binary images connected component labelling. It also provides
functions to manipulate, filter and extract results from the extracted blobs. The library provides two
basic functionalities: • Extract 8-connected components in binary or grayscale images.
• Filter the obtained blobs to get the interest objects in the image. This is performed using the
Filter method from CBlobResult.
The connected components are labelled using the above code snippet. filter blobs method is
used to filter out the blobs of required dimensions.
SEGMENTATION
Image Scissoring is hard-coded in Python by scanning the image vertically and cropping out white
portions. The algorithm, is fast and efficient than compared to other predefined image cropping
techniques. Segmentation phase also involves classification of the
collected blobs and recording only the essential ones. Undesirable blobs occur even after
segmentation. These are removed by two methods:
1) Aspect ratio based elimination.
2) Pixel coordinate based selection.
1) Aspect ratio based elimination: The aspect ratio (row/column) of each blob is calculated
and recorded. A binarized candidate is sure of containing more characters than unwanted blobs.
The mean of the aspect ratios are calculated and compared to all the blobs in turn.If anyone of
them has a larger deviation, that blob is removed from the candidate. This algorithm was
deviced based on research and experiment through out the process. The dynamic nature of
Python is exploited in every step of this algorithm. Pixel coordinate based selection: This
algorithm thrives on the fact that license numbers are occuring in the plate in a single set of
rows. Effectively, we can detect the edge of the license plate, and select the blobs coming
between the minimum and maximum row coordinates.
CODE IMPLEMENTATION
#%%writefile code.py
import os;
import cv2;
import logging;
import cv2
# logger setup
fileConfig("logging_config.ini");
logger = logging.getLogger();
class Plate:
self.plate_characters = [];
def preprocess(self,image):
self.readPlateNumber(characters_array);
self.showResults();
return True;
def findContour(self,image):
_,contours,_ = cv2.findContours(image, cv2.RETR_TREE,
cv2.CHAIN_APPROX_SIMPLE);
w,h,x,y = 0,0,0,0;
area = cv2.contourArea(contour);
if area > 6000 and area < 40000:
[x,y,w,h] = cv2.boundingRect(contour);
if w > 100 and w < 200 and h > 60 and h < 100:
self.roi.append([x,y,w,h]);
(0,255,0), 10);
def cropPlate(self):
if len(self.roi) > 1:
[x,y,w,h] = self.roi[0];
return True;
self.findCharacterContour();
self.tesseractCharacter();
return True;
[x,y,w,h] = dimensions;
def findCharacterContour(self):
gray_plate = cv2.cvtColor(deepcopy(self.plate_image), cv2.COLOR_BGR2GRAY) gray_plate =
0);
w,h,x,y = 0,0,0,0;
area = cv2.contourArea(contour);
1);
logger.info(character);
""" Tesseract: reads the character using the Tesseract libary """
def tesseractCharacter(self):
figure.subplot(subplot);
figure.xlabel(title);
figure.xticks([]);
figure.yticks([]);
#cv2.imshow("char",self.plate_characters[0]);
figure.imshow(image)
#cv2.imshow(image)
#cv2.imwrite('result.jpg',image);
#img_ori = PIL_Image.open('result.jpg')
#figure.imshow(img_ori)
#show()
return True;
def showResults(self):
plt.figure(self.plate_number);
fontsize=30);plt.xticks([]);plt.yticks([]);print(self.plate_number)
#cv2.imwrite('result5.jpg',self.plate_number)
plt.tight_layout();
plt.show()
return True;
import logging;
logger = logging.getLogger();
def run():
plates_array = loadImages("images/cars/");
#plates_array = loadImages("cars/")
characters_array = loadCharacters("images/characters/");
logger.info("All testing images and characters have been downloaded.");
plate.plateSearch(characters_array);
return True;
run();
OUTPUT
Given the input image and the output has been executed as shown.
CONCLUSION
The message of this research is to show that free and open source technologies are matured
enough for scientific computing domains. Python and OpenCV are good points of start for
researchers and students of computer vision.
PERFORMANCE ANALYSIS
The system works satisfactorily for wide variations in illumination conditions and different types of
number plates commonly found in India. It is definitely a better alternative to the existing
proprietary systems, even though there are known restrictions.
REFERENCES
4. http://opencv.willowgarage.com/documentation/python/
6. Nobuyuki Otsu (1979). A threshold selection method from gray-level histograms. IEEE
Trans. Sys., Man., Cyber
7.