Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Road signs detection using voila jone's algorithm with the help of opencv
1. 1 | P a g e
CHAPTER 1 INTRODUCTION
The objective of this chapter is to discuss the introduction, motivation, background, contributions
& outline of the project.
In order to solve the concerns over road and transportation safety, automatic road sign detection
and recognition techniques have been introduced. These techniques can detect and recognize
road signs from and within images captured by cameras or imaging sensors. In adverse traffic
conditions, the driver may not notice road signs, which may cause accidents. In such scenarios,
the detection system comes into action. To develop an automatic detection process is a tedious
job given the continuous changes in the environment and lighting conditions. Among the other
issues that also need to be addressed is partial obscuring, multiple traffic signs appearing at a
single time, and blurring and fading of traffic signs, which can also create problem for the
detection purpose.
The problem to be solved is detection of road signs in an image. A human can do this easily, but
a computer needs precise instructions and constraints. For applying the detection process in real-
time environment, a fast algorithm is needed.Detecting an object in an image is a computer
vision problem for which a wide variety of algorithms exist. Because of fast and accurate
detection, we have decided to employ the Viola-Jones detection algorithm.
The Viola–Jones object detection framework is the first object detection framework to provide
competitive object detection rates in real-time proposed in 2001 by Paul Viola and Michael
Jones. Although it can be trained to detect a variety of object classes, it was motivated primarily
by the problem of face detection.
2. 2 | P a g e
1.1 Motivation
As we are living in the era of technology so we want to do a project on the latest technology
available in the market. We research multiple websites for the project and found that face
detection is very popular andintriguingtopic, but we want to do something different than face
detection so we consult with our project supervisor and decided to work on road sign detection
given that it is real-life problem and can be solved using by modern computer vision. Equally we
can learn something new while working on the project.
1.2 Background
In 1960s, the first semi-automated system for facial recognition to locate the
features(such as eyes, ears, nose, and mouth) on the photographs.
In 1970s, Goldstein and Harmon used 21 specific subjective markers such as hair color
and lip thickness to automate the recognition.
In 1988, Kirby and Sirovich used standard linear algebra technique, to the face
recognition.
In 2001, Paul viola and Michael Jones comes with a idea of the first object
detection framework to provide competitive object detection rates in real-time. And
introduced an algorithm known as Viola-Jones Algorithm.
1.3 Contributions
The contributions of our work are given below:
a) To train the classifier using adaboost algorithm in OpenCV to detect German road signs
in still images by implementing Viola-Jones algorithm.
b) To use OpenCV to detect German road signs in 600 still images.
1.4 Outline of the project
The workings of road sign detection was using Viola Jones, in Figure 4 below was a scheme of
how sign detection works using the Viola-Jones algorithm from the beginning of the detection
process to the results of the detection process. The first process was to read the sample of the
sign image of an image or read the sample of the sign image that was stored in OpenCv. From
3. 3 | P a g e
the image that had been stored it would be done Haar feature reading by processing the image
into boxes to get the difference of threshold value of the dark areas and bright areas of the image.
If the difference between the dark and the bright areas above the threshold or threshold value,
then it could be said that the feature exists.
Further to determine whether or not there were hundreds of Haar features on an image and on a
different scale efficiently used Integral Image. In general, the integration adds small units
simultaneously. In this case the small units were pixel values. The integral value for each pixel
was the sum of all the pixels from top to bottom. Starting from the top left to the bottom right,
the entire image could be summed with multiple integer operations per pixel. Then to select the
specific Haar feature method called AdaBoost is used.
Figure 4.Cascade Scheme Classifier Sign Detection Process with Viola-Jones Algorithm
AdaBoost combines many weak classifiers to create a powerful classifier. By combining some
AdaBoost classifiers as filter circuits that were efficient enough to classify the image area. Each
filter was a separate AdaBoost classifier that consists of a weak classifier or a Haar filter.During
the filter process, if any of the filters fail to pass an image area, then the area was immediately
classed as non-sign. However, when the filter passes an image area and passes through all filter
processes in the filter circuit, the image area was classified as the sign. The next stage was
cascade classifier. The order of filters on the cascade was determined by the weight given
AdaBoost. The largest weighted filter was placed in the first process, aiming to erase the non-
sign image area as quickly as possible. The last stage was showed the object of the sample image
that has been detected sign or not–sign.
Sign or Non-
Sign
4. 4 | P a g e
CHAPTER 2 WHAT AND WHY OF THE PROJECT
2.1 What of the project
Detecting an object in an image is a computer vision problem for which a wide variety of
algorithms exist. Because we wanted our system to work in real-time, we have decided to
employ the Viola-Jones detection algorithm.
2.1.1 VIOLA-JONES ALGORITHM
The Viola-Jones method combined four stages:
1. Haar Feature Selection
2. Creating Integral Image
3. AdaBoost Testing
4. Cascading Classifiers
The Viola-Jones detector works by sliding a detection window across an image. At each position,
the classifier makes the decision if there is a desired object inside the window. In the vast
majority of window’s positions, the object is not found. The number of classifications for an
image is equal to the number of windows positions, which can be in the order of 105
or 106
. This
is why the classification itself has to be as fast as possible.
Viola-Jones algorithm is based on a cascade of boosted Haar’s features. Boosting is done
through AdaBoost, a machine learning algorithm which combines weak classifiers built on
Haar’s features into a strong classifier. Given enough different weak classifiers, AdaBoost will
produce a strong classifier with arbitrary precision. The decision of whether the object is
detected is made through voting of weak classifiers, each according to its weights. Cascading
classifiers speeds up this process significantly, because more important weak classifiers get to
vote first, if their decision is negative, the image is rejected and other less important classifiers
do not vote at all. Object is classified positively only if it successfully passes through the
cascade, positively classified in each stage. Final classifier works in real time because:
a) Haar’s features take constant time to calculate from integral image;
5. 5 | P a g e
b) In a classifier produced by AdaBoost, voting is done as a summation of weighted
classifiers;
c) On average, only a small subset of classifiers votes every time because of the cascading.
2.1.2 Haar-like Features
Haar-like features are digital image features used in object recognition.Viola and Jones adapted
the idea of using Haar wavelets and developed the so-called Haar-like features. A Haar-like
feature considers adjacent rectangular regions at a specific location in a detection window, sums
up the pixel intensities in each region and calculates the difference between these sums. This
difference is then used to categorize subsections of an image.The feature used in a particular
classifier is specified by its shape (1a, 1b etc.), position within the region of interest and the
scale.
Figure 1. Harr like Features
Haar-Like Feature values were derived from the difference in the number of dark area pixel
values by the number of bright area pixels:
F(Haar) = ∑ 𝐹 𝑤ℎ𝑖𝑡𝑒 − ∑ 𝐹𝑏𝑙𝑎𝑐𝑘
F(Haar) was the total feature value, ∑ 𝐹 𝑤ℎ𝑖𝑡𝑒was the feature value on the brightest area
and∑ 𝐹𝑏𝑙𝑎𝑐𝑘 was the feature value on the dark area. Haar features are composed of either two or
three rectangles.
6. 6 | P a g e
2.1.3 Integral Image
Rectangle features can be computed very rapidly using an intermediate representation for the
image which we call integral image. The integral image at location x, y contains the sum of the
pixels above and to the left of the x,y, inclusive:
ii(x,y) = ∑ 𝑖(𝑥′, 𝑦′)
𝑥′
≤𝑥′
,𝑦′≤ 𝑦
Figure 2.Integral Image
According to figure 2, the sum of the pixels within rectangle D cane be computed with four array
references. The value at the integral image at location 1 is the sum of the pixels in the rectangle
A. The value at location 2 is A+B, at location 3 is A+C and at location 4 is A+B+C+D. The sum
within D can be computed as 4+1-(2-3).
2.1.4 AdaBoost
AdaBoost, short for Adaptive Boosting, is a machine learning algorithm. Problems in machine
learning often suffer from the curse of dimensionality — each sample may consist of a huge
number of potential features (for instance, there can be 162,336 Haar features, as used by
the Viola–Jones object detection framework, in a 24×24 pixel image window), and evaluating
every feature can reduce not only the speed of classifier training and execution, but in fact reduce
predictive power. The AdaBoost training process selects only those features known to improve
7. 7 | P a g e
the predictive power of the model, reducing dimensionality and potentially improving execution
time as irrelevant features need not be computed.
2.1.5 CASCADE CLASSIFIER
A classifier (namely a cascade of boosted classifiers working with Haar-like features) is trained
with a few hundred sample views of a particular object (i.e., a face or a car), called positive
examples, that are scaled to the same size (say, 24x24), and negative examples - arbitrary images
of the same size.
After a classifier is trained, it can be applied to a region of interest (of the same size as used
during the training) in an input image. The classifier outputs a “1” if the region is likely to show
the object (i.e., face/car), and “0” otherwise. To search for the object in the whole image one can
move the search window across the image and check every location using the classifier. The
classifier is designed so that it can be easily “resized” in order to be able to find the objects of
interest at different sizes, which is more efficient than resizing the image itself. So, to find an
object of an unknown size in the image the scan procedure should be done several times at
different scales.
Figure 2. Cascade Classifier
The word “cascade” in the classifier name means that the resultant classifier consists of several
simpler classifiers (stages) that are applied subsequently to a region of interest until at some
stage the candidate is rejected or all the stages are passed.
8. 8 | P a g e
2.2 Why of the Project
Sometimes drivers tends to forget to see road sign which may result severe accidents, by this
technique they didn’t have to lose any sign while driving. In order to solve the concerns over
road and transportation safety, automatic road sign detection and recognition techniques have
been introduced. These techniques can detect and recognize road signs from and within images
captured by cameras or imaging sensors. In adverse traffic conditions, the driver may not notice
road signs, which may cause accidents.
The characteristics of Viola–Jones algorithm which make it a good detection algorithm are:
Robust – very high detection rate (true-positive rate) & very low false-positive rate always.
Real time – For practical applications at least 2 frames per second must be processed.
Object detection only (not recognition) - The goal is to distinguish object from non-object
(detection is the first step in the recognition process).
3. ANALYSIS
Each of these methods signifies the importance and utility for different applications.
Since these methods are progressive, more and more advancements are made every day
to achieve accurate and true face detection.
Since these methods are progressive, more and more advancements are made every day
to achieve accurate and true face detection. For applications such as employee details,
member details and criminal record uses the frontal views of the face.
A rapid approach using machine learning and haarlike features are used recently for fast
detection and reduce the likelihood of computing huge amount of data.