Face Detection

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 91

CHAPTER-1

INTRODUCTION

1.1 INTRODUCTION TO PROJECT

Face detection involves separating image windows into two classes; one
containing faces (training the background (clutter). It is difficult because
although commonalities exist between faces, they can vary considerably in
terms of age, skin color and facial expression. The problem is further
complicated by differing lighting conditions, image qualities and geometries, as
well as the possibility of partial occlusion and disguise. An ideal face detector
would therefore be able to detect the presence of any face under any set of
lighting conditions, upon any background.
DIFFERENT APPROACHES OF FACE DETECTION:
There are two predominant approaches to the face detection problem:
Geometric (feature based) and photometric (view based). As researcher interest
in face recognition continued, many different algorithms were developed, three
of which have been well studied in face detection literature.
Recognition algorithms can be divided into two main approaches:
1.1.1. Geometric: Is based on geometrical relationship between facial
landmarks, or in other words the spatial configuration of facial features. That
means that the main geometrical features of the face such as the eyes, nose
and mouth are first located and then faces are classified on the basis of various
geometrical distances and angles between features.(figure 2)

1.1.2. Photometric stereo: Used to recover the shape of an object from a


number of images taken under different lighting conditions. The shape of the
recovered object is defined by a gradient map, which is made up of an array of
surface normal (Zhao and Chellappa, 2006) (figure 3).
Popular recognition algorithms include:
1. Principal Component Analysis using Eigenfaces, (PCA)
2. Linear Discriminate Analysis,

1|Page
3. Elastic Bunch Graph Matching using the Fisherface algorithm.

2|Page
1.2 FACE DETECTION:

Face detection involves separating image windows into two classes; one
containing faces (training the background (clutter). It is difficult because
although commonalities exist between faces, they can vary considerably in
terms of age, skin color and facial expression. The problem is further
complicated by differing lighting conditions, image qualities and geometries, as
well as the possibility of partial occlusion and disguise. An ideal face detector
would therefore be able to detect the presence of any face under any set of
lighting conditions, upon any background. The face detection task can be
broken down into two steps. The first step is a classification task that takes
some arbitrary image as input and outputs a binary value of yes or no,
indicating whether there are any faces present in the image. The second step
is the face localization task that aims to take an image as input and output the
location of any face or faces within that image as some bounding box with (x,
y, width, height).

The face detection system can be divided into the following steps:-

1. Pre-Processing: To reduce the variability in the faces, the images are


processed before they are fed into the network. All positive examples that is the
face images are obtained by cropping
images with frontal faces to include only the front view. All the cropped images
are then corrected for lighting through standard algorithms.

2.Classification: Neural networks are implemented to classify the images as


faces or nonfaces by training on these examples. We use both our
implementation of the neural network and the Matlab neural network toolbox
for this task. Different network configurations are experimented with to
optimize the results.

3|Page
3.Localization: The trained neural network is then used to search for faces in
an image and if present localize them in a bounding box. Various Feature of
Face on which the work has done on:-Position Scale Orientation Illumination

4|Page
1.3 The History of Face Detection
Face detection began as early as 1977 with the first automated system being
introduced By Kanade using a feature vector of human faces. In 1983, Sirovich
and Kirby introduced the principal component analysis(PCA) for feature
extraction. Using PCA, Turk and Pentland Eigenface was developed in 1991 and
is considered a major milestone in technology. Local binary pattern analysis for
texture recognition was introduced in 1994 and is improved upon for facial
recognition later by incorporating Histograms(LBPH) [4], [5]. In 1996
Fisherface was developed using Linear discriminant analysis (LDA) for
dimensional reduction and can identify faces in different illumination conditions,
which was an issue in Eigenface method [6]. Viola and Jones introduced a face
detection technique using HAAR cascades and ADABoost [7]. In 2007, A face
recognition technique was developed by Naruniec and Skarbek using Gabor Jets
that are similar to mammalian eyes. In This project, HAAR cascades are used
for face detection and Eigenface, Fisherface and LBPH are used for face
detection.

5|Page
CHAPTER-2

LITERATURE SURVEY

Face detection is a computer technology that determines the location and


size of human face in arbitrary (digital) image. The facial features are detected
and any other objects like trees, buildings and bodies etc are ignored from the
digital image. It can be regarded as a specific case of object-class detection,
where the task is finding the location and sizes of all objects in an image that
belong to a given class. Face detection, can be regarded as a more general case
of face localization. In face localization, the task is to find the locations and
sizes of a known number of faces (usually one). Basically there are two types of
approaches to detect facial part in the given image i.e. feature base and image
base approach. Feature base approach tries to extract features of the image
and match it against the knowledge of the face features. While image base
approach tries to get best match between training and testing images.

Fig 2.1 detection methods

2.1 FEATURE BASE APPROCH:

6|Page
Active Shape Model Active shape models focus on complex non-rigid
features like actual physical and higher level appearance of features Means that
Active Shape Models (ASMs) are aimed at automatically locating landmark
points that define the shape of any statistically modelled object in an image.
When of facial features such as the eyes, lips, nose, mouth and eyebrows. The
training stage of an ASM involves the building of a statistical

a) facial model from a training set containing images with manually


annotated landmarks. ASMs is classified into three groups i.e. snakes,
PDM, Deformable templates
b) 1.1)Snakes: The first type uses a generic active contour called snakes,
first introduced by Kass et al. in 1987 Snakes are used to identify head
boundaries [8,9,10,11,12]. In order to achieve the task, a snake is first
initialized at the proximity around a head boundary. It then locks onto
nearby edges and subsequently assume the shape of the head. The
evolution of a snake is achieved by minimizing an energy function,
Esnake (analogy with physical systems), denoted as Esnake = Einternal
+ EExternal Where Einternal and EExternal are internal and external
energy functions. Internal energy is the part that depends on the
intrinsic properties of the snake and defines its natural evolution. The
typical natural evolution in snakes is shrinking or expanding. The
external energy counteracts the internal energy and enables the
contours to deviate from the natural evolution and eventually assume
the shape of nearby features—the head boundary at a state of equilibria.
Two main consideration for forming snakes i.e. selection of energy terms
and energy minimization. Elastic energy is used commonly as internal
energy. Internal energy is vary with the distance between control points
on the snake, through which we get contour an elastic-band
characteristic that causes it to shrink or expand. On other side external
energy relay on image features. Energy minimization process is done by
optimization techniques such as the steepest gradient descent. Which

7|Page
needs highest computations. Huang and Chen and Lam and Yan both
employ fast iteration methods by greedy algorithms. Snakes have some
demerits like contour often becomes trapped onto false image features
and another one is that snakes are not suitable in extracting non convex
features.

2.1.1 Deformable Templates:

Deformable templates were then introduced by Yuille et al. to take into


account the a priori of facial features and to better the performance of snakes.
Locating a facial feature boundary is not an easy task because the local
evidence of facial edges is difficult to organize into a sensible global entity using
generic contours. The low brightness contrast around some of these features
also makes the edge detection process. Yuille et al. took the concept of snakes
a step further by incorporating global information of the eye to improve the
reliability of the extraction process.

Deformable templates approaches are developed to solve this problem.


Deformation is based on
local valley, edge, peak, and brightness .Other than face boundary,
salient feature (eyes,nose, mouth and eyebrows) extraction is a great
challenge of face recognition.
E = Ev + Ee + Ep + Ei + Einternal ; where Ev , Ee , Ep , Ei , Einternal are
external energy due to valley, edges, peak and image brightness and internal
energy

2.1.2 PDM (Point Distribution Model):

8|Page
Independently of computerized image analysis, and before ASMs were
developed, researchers developed statistical models of shape . The idea is that
once you represent shapes as vectors, you can apply standard statistical
methods to them just like any other multivariate object. These models learn
allowable constellations of shape points from training examples and use
principal components to build what is called a Point Distribution Model. These
have been used in diverse ways, for example for categorizing Iron Age
broaches. Ideal Point Distribution Models can only deform in ways that are
characteristic of the object. Cootes and his colleagues were seeking models
which do exactly that so if a beard, say, covers the chin, the shape model
can \override the image" to approximate the position of the chin under the
beard. It was therefore natural (but perhaps only in retrospect) to adopt Point
Distribution Models. This synthesis of ideas from image processing and
statistical shape modelling led to the Active Shape Model. The first parametric
statistical shape model for image analysis based on principal components of
inter-landmark distances was presented by Cootes and Taylor in. On this
approach, Cootes, Taylor, and their colleagues, then released a series of papers
that cumulated in what we call the classical Active Shape Model.

2.2) LOW LEVEL ANALYSIS:

Based on low level visual features like color, intensity, edges, motion etc.
Skin Color Base Color is avital feature of human faces. Using skin-color as a
feature for tracking a face has several advantages. Color processing is much
faster than processing other facial features. Under certain lighting conditions,
color is orientation invariant. This property makes motion estimation much
easier because only a translation model is needed for motion estimation.
Tracking human faces using color as a feature has several problems like the
color representation of a face obtained by a camera is influenced by many
factors (ambient light, object movement, etc

9|Page
Fig 2.2. face detection

Majorly three different face detection algorithms are available based on


RGB, YCbCr, and HIS color space models. In the implementation of the
algorithms there are three main steps viz.

(1) Classify the skin region in the color space,


(2) Apply threshold to mask the skin region and
(3) Draw bounding box to extract the face image.

Crowley and Coutaz suggested simplest skin color algorithms for


detecting skin pixels.

10 | P a g e
The perceived human color varies as a function of the relative direction to the
illumination.

The pixels for skin region can be detected using a normalized color histogram,
and can be normalized for changes in intensity on dividing by luminance.
Converted an [R, G, B] vector is converted into an [r, g] vector of normalized
color which provides a fast means of skin detection. This algorithm fails when
there are some more skin region like legs, arms, etc. Cahi and Ngan suggested
skin color classification algorithm with YCbCr color space. Research found that
pixels belonging to skin region having similar Cb and Cr values. So that the
thresholds be chosen as [Cr1, Cr2] and [Cb1, Cb2], a pixel is classified to have
skin tone if the values [Cr, Cb] fall within the thresholds. The skin color
distribution gives the face portion in the color image. This algorithm is also
having the constraint that the image should be having only face as the skin
region. Kjeldson and Kender defined a color predicatein HSV color space to
separate skin regions from background. Skin color classification in HSI color
space is the same as YCbCr color space but here the responsible values are hue
(H) and saturation (S). Similar to above the threshold be chosen as [H1, S1]
and [H2, S2], and a pixel is classified to have skin tone if the values [H,S] fall
within the threshold and this distribution gives the localized face image. Similar
to above two algorithm this algorithm is also having the same constraint.

2.3) MOTION BASE:

When use of video sequence is available, motion information can be used


to locate moving objects. Moving silhouettes like face and body parts can be
extracted by simply thresholding accumulated frame differences . Besides face
regions, facial features can be located by frame differences .

2.3.1 Gray Scale Base:

11 | P a g e
Gray information within a face can also be treat as important features.
Facial features such as eyebrows, pupils, and lips appear generally darker than
their surrounding facial regions. Various recent feature extraction algorithms
search for local gray minima within segmented facial regions. In these
algorithms, the input images are first enhanced by contrast-stretching and
gray-scale morphological routines to improve the quality of local dark patches
and thereby make detection easier. The extraction of dark patches is achieved
by low-level gray-scale thresholding. Based method and consist three levels.
Yang and huang presented new approach i.e. faces gray scale behavior in
pyramid (mosaic) images. This system utilizes hierarchical Face location consist
three levels. Higher two level based on mosaic images at different resolution. In
the lower level, edge detection method is proposed. Moreover this algorithms
gives fine response in complex background where size of the face is unknown

2.3.2 Edge Base:

Face detection based on edges was introduced by Sakai et al. This work
was based on analyzing line drawings of the faces from photographs, aiming to
locate facial features. Than later Craw et al. proposed a hierarchical framework
based on Sakai et al.‘s work to trace a human head outline. Then after
remarkable works were carried out by many researchers in this specific area.
Method suggested by Anila and Devarajan was very simple and fast. They
proposed frame work which consist three steps i.e. initially the images are
enhanced by applying median filter for noise removal and histogram
equalization for contrast adjustment. In the second step the edge image is
constructed from the enhanced image by applying sobel operator. Then a novel
edge tracking algorithm is applied to extract the sub windows from the
enhanced image based on edges. Further they used Back propagation Neural
Network (BPN) algorithm to classify the sub-window as either face or non-face.

12 | P a g e
2.4 FEATURE ANALYSIS

These algorithms aim to find structural features that exist even when the
pose, viewpoint, or lighting conditions vary, and then use these to locate faces.
These methods are designed mainly for face localization.

2.4.1 Feature Searching

Viola Jones Method:

Paul Viola and Michael Jones presented an approach for object detection
which minimizes computation time while achieving high detection accuracy.
Paul Viola and Michael Jones [39] proposed a fast and robust method for face
detection which is 15 times quicker than any technique at the time of release
with 95% accuracy at around 17 fps. The technique relies on the use of simple
Haar-like features that are evaluated quickly through the use of a new image
representation. Based on the concept of an ―Integral Image‖ it generates a
large set of features and uses the boosting algorithm AdaBoost to reduce the
overcomplete set and the introduction of a degenerative tree of the boosted
classifiers provides for robust and fast interferences. The detector is applied in
a scanning fashion and used on gray-scale images, the scanned window that is
applied can also be scaled, as well as the features evaluated.

Gabor Feature Method:

Sharif et al proposed an Elastic Bunch Graph Map (EBGM) algorithm that


successfully implements face detection using Gabor filters. The proposed
system applies 40 different Gabor filters on an image. As a result of which 40
images with different angles and orientation are received. Next, maximum
intensity points in each filtered image are calculated and mark them as fiducial
points. The system reduces these points in accordance to distance between
them. The next step is calculating the distances between the reduced points
using distance formula. At last, the distances are compared with database. If

13 | P a g e
match occurs, it means that the faces in the image are detected. Equation of
Gabor filter [40] is shown below`

2.5 CONSTELLATION METHOD

All methods discussed so far are able to track faces but still some issue
like locating faces of various poses in complex background is truly difficult. To
reduce this difficulty investigator form a group of facial features in face-like
constellations using more robust modelling approaches such as statistical
analysis. Various types of face constellations have been proposed by Burl et
al. . They establish use of statistical shape theory on the features detected from
a multiscale Gaussian derivative filter. Huang et al. also apply a Gaussian filter
for pre-processing in a framework based on image feature analysis.

2.5.1 Neural Network

Neural networks gaining much more attention in many pattern


recognition problems, such as OCR, object recognition, and autonomous robot
driving. Since face detection can be treated as a two class pattern recognition
problem, various neural network algorithms have been proposed. The
advantage of using neural networks for face detection is the feasibility of
training a system to capture the complex class conditional density of face
patterns. However, one demerit is that the network architecture has to be

14 | P a g e
extensively tuned (number of layers, number of nodes, learning rates, etc.) to
get exceptional performance. In early days most hierarchical neural network
was proposed by Agui et al. The first stage having two parallel subnetworks in
which the inputs are filtered intensity values from an original image. The inputs
to the second stage network consist of the outputs from the sub networks and
extracted feature values. An output at the second stage shows the presence of
a face in the input region. Propp and Samal developed one of the earliest neural
networks for face detection. Their network consists of four layers with 1,024
input units, 256 units in the first hidden layer, eight units in the second hidden
layer, and two output units. Feraud and Bernier presented a detection method
using auto associative neural networks. The idea is based on which shows an
auto associative network with five layers is able to perform a nonlinear principal
component analysis. One auto associative network is used to detect frontal-
view faces and another one is used to detect faces turned up to 60 degrees to
the left and right of the frontal view. After that Lin et al. presented a face
detection system using probabilistic decision-based neural network (PDBNN)
[49]. The architecture of PDBNN is similar to a radial basis function (RBF)
network with modified learning rules and probabilistic interpretation.

2.6 LINEAR SUB SPACE METHOD

Eigen faces Method:

An early example of employing eigen vectors in face recognition was done


by Kohonen in which a simple neural network is demonstrated to perform face
recognition for aligned and normalized face images. Kirby and Sirovich
suggested that images of faces can be linearly encoded using a modest number
of basis images. The idea is arguably proposed first by Pearson in 1901 and
then by HOTELLING in 1933 .Given a collection of n by m pixel training.

Images represented as a vector of size m X n, basis vectors spanning an


optimal subspace are determined such that the mean square error between the

15 | P a g e
projection of the training images onto this subspace and the original images is
minimized. They call the set of optimal basis vectors Eigen pictures since these
are simply the eigen vectors of the covariance matrix computed from the
vectorized face images in the training set. Experiments with a set of 100
images show that a face image of 91 X 50 pixels can be effectively encoded
using only50 Eigen pictures.

A reasonable likeness (i.e. capturing 95 percent of the variance)

2.7 STATISTICAL APPROCH

Support Vector Machine (SVM):

SVMs were first introduced Osuna et al. for face detection. SVMs work as
a new paradigm to train polynomial function, neural networks, or radial basis

16 | P a g e
function (RBF) classifiers. SVMs works on induction principle, called structural
risk minimization, which targets to minimize an upper bound on the expected
generalization error. An SVM classifier is a linear classifier where the separating
hyper plane is chosen to minimize the expected classification error of the
unseen test patterns .In Osunaet al. developed an efficient method to train an
SVM for large scale problems, and applied it to face detection. Based on two
test sets of 10,000,000 test patterns of 19 X 19 pixels, their system has slightly
lower error rates and runs approximately30 times faster than the system by
Sung and Poggio . SVMs have also been used to detect faces and pedestrians in
the wavelet domain.

CHAPTER-3

FEASIBILITY REPORT
Preliminary investigation examine project feasibility, the likelihood the
system will be useful to the organization. The main objective of the feasibility

17 | P a g e
study is to test the Technical, Operational and Economical feasibility for adding
new modules and debugging old running system. All system is feasible if they
are unlimited resources and infinite time. There are aspects in the feasibility
study portion of the preliminary investigation:

1 Technical Feasibility
2 Operation Feasibility
3 Economical Feasibility
3.1 Technical Feasibility

The technical issue usually raised during the feasibility stage of the
investigation includes the following:

1 Does the necessary technology exist to do what is suggested?


2 Do the proposed equipments have the technical capacity to hold the data
required to use the new system?
3 Will the proposed system provide adequate response to inquiries,
regardless of the number or location of users?
4 Can the system be upgraded if developed?
5 Are there technical guarantees of accuracy, reliability, ease of access and
data security?
Earlier no system existed to cater to the needs of ‘Secure Infrastructure
Implementation System’. The current system developed is technically feasible.
Thus it provides an easy access to the users. The database’s purpose is to
create, establish and maintain a workflow among various entities in order to
facilitate all concerned users in their various capacities or roles. Permission to
the users would be granted based on the roles specified. Therefore, it provides
the technical guarantee of accuracy, reliability and security. The work for the
project is done with the current equipment and existing software technology.
Necessary bandwidth exists for providing a fast feedback to the users
irrespective of the number of users using the system.

3.2 Operational Feasibility

18 | P a g e
Proposed projects are beneficial only if they can be turned out into information
system. That will meet the organization’s operating requirements. Operational
feasibility aspects of the project are to be taken as an important part of the
project implementation. Some of the important issues raised are to test the
operational feasibility of a project includes the following: -

1 Is there sufficient support for the management from the users?


2 Will the system be used and work properly if it is being developed and
implemented?
3 Will there be any resistance from the user that will undermine the
possible application benefits?
This system is targeted to be in accordance with the above-mentioned issues.
Beforehand, the management issues and user requirements have been taken
into consideration. So there is no question of resistance from the users that can
undermine the possible application benefits.

The well-planned design would ensure the optimal utilization of the computer
resources and would help in the improvement of performance status.

3.3 Economic Feasibility

A system can be developed technically and that will be used if installed must
still be a good investment for the organization. In the economical feasibility, the
development cost in creating the system is evaluated against the ultimate
benefit derived from the new systems. Financial benefits must equal or exceed
the costs. The system is economically feasible. It does not require any addition
hardware or software. Since the interface for this system is developed using the
existing resources and technologies. There is nominal expenditure and
economical feasibility for certain.

CHAPTER-4

SOFTWARE AND HARWARE REQUIREMENT


SPECIFICATIONS

19 | P a g e
4.1 INTRODUCTION

4.1.1 Purpose: The main purpose for preparing this document is to give a
general insight into the analysis and requirements of the existing system or
situation and for determining the operating characteristics of the system.

4.1.2 Scope: This Document plays a vital role in the development life cycle
(SDLC) and it describes the complete requirement of the system. It is meant for
use by the developers and will be the basic during testing phase. Any changes
made to the requirements in the future will have to go through formal change
approval process.

4.2 DEVELOPERS RESPONSIBILITIES OVERVIEW:

The developer is responsible for:

 Developing the system, which meets the SRS and solving all the
requirements of the system?
 Demonstrating the system and installing the system at client's location after
the acceptance testing is successful.
 Submitting the required user manual describing the system interfaces to
work on it and also the documents of the system.
 Conducting any user training that might be needed for using the system.
Maintaining the system for a period of one year after installation.

4.3 REQUIRED FEATURES OF SYSTEM

Usability

20 | P a g e
The system is designed with completely automated process hence there is no or
less user intervention.

Reliability

The system is more reliable because of the qualities that are inherited from the
chosen platform php. The code built by using php is more reliable.

Performance

This system is developing in the high level languages and using the advanced
front-end and back-end technologies it will give response to the end user on
client system with in very less time.

Supportability

The system is designed to be the cross platform supportable. The system is


supported on a wide range of hardware and any software platform, which is
having Apache, built into the system.

Implementation

The system is implemented in web environment using core php. The apache is
used as the web server and windows xp professional is used as the platform.

4.4 REQUIRED SOFTWARE SPECIFICATION

 OS WINDOWS 10X OR EARLIER UPTO 7X


 PYTHON 3.X VERSION
 PYCHARM IDE 2019.1.3
 HAAR CASCADE TRAINER

4.5 REQUIRED HARDWARE SPECIFICATION

 Processor :- INTEL CORE I3 OR ABOVE


 RAM :- 1 GB

21 | P a g e
 Hard Disk :- 50 GB
 Monitor :- Color monitor
 Keyboard :- 104 keys
 Mouse :- Any pointing device

CHAPTER-5

SELECTED SOFTWARE

22 | P a g e
5.1 SELECTED SOFTWARE

WINDOWS OS 10 HOME

Microsoft Windows 10 for desktop, the successor to Windows 8.1,


comes in two versions: Windows 10 Pro and Windows 10 Home. This is
a stark contrast to earlier versions of Windows, which came in as many
as seven editions. Of the two editions, Windows 10 Pro, as you may
have guessed, has more features. Unlike Windows 7 and 8.1, in which
the basic variant was markedly crippled with fewer features than its
professional counterpart, Windows 10 Home packs in a large set of new
features that should suffice most users' needs. This begs the question,
which among Windows 10 Pro and Windows 10 Home is the right
version for you.

What do you get with Windows 10 Home

Windows 10 Home is the basic variant of Windows 10. It comes with a


number of new features including the revamped Start Menu. The
company decided to chop it off from Windows 8 three years ago, but on
popular demand, this feature is making a return to the desktop
operating system. You also get a full-fledged version of Cortana, the
digital voice assistant formerly exclusively available on Windows Phone.
Other than that, the Home edition also gets you features like Battery
Saver, TPM support, and company's new biometrics security feature
called Windows Hello.

Battery Saver, for those unfamiliar, is a feature that makes your system
more power efficient. It does so by limiting the background activity on
the device. A TPM is a microchip that offers additional security-related
functions. Many motherboard manufacturers install TPM chip on their

23 | P a g e
device. Microsoft assures that if your motherboard has that chip,
Windows 10 Home will provide support for it.

Home users will also be able to utilise the all-new Virtual Desktops
option and Snap assist feature with up to 4 apps on one screen.
Furthermore, they can also give a whirl to Continuum, a flagship feature
of Windows 10 that lets you quickly switch from desktop mode to tablet
mode. You are also bestowed with Microsoft Edge, the brand new
browser in town.

The Home edition also supports Windows Update - eligible to snag


automatic updates from Microsoft - and also provides security measures
such as Microsoft Passport. The aforementioned features should fit an
average Joe's bill as the company is providing all the essential features
in the basic variant.

However, if you crave for more sophisticated protection, or if your work


requires features such as support for side-loading of business apps, the
Home edition could leave a lot to be desired, and you are better off with
the Pro edition.

What do you get with Windows 10 Pro

The Pro edition of Windows 10, in addition to all of Home edition's


features, offers sophisticated connectivity and privacy tools such as
Domain Join, Group Policy Management, Bitlocker, Enterprise Mode
Internet Explorer (EMIE), Assigned Access 8.1, Remote Desktop, Client
Hyper-V, and Direct Access.

24 | P a g e
Assigned Access 8.1, for instance, allows you to lock user accounts and
prevent them from accessing specific apps. BitLocker, on the other
hand, is one of the most powerful disk-encryption tools on Windows. It
lets you encrypt your external USB-drives. You also get tools that
facilitate seamless connectivity while joining Azure Active Directory, and
a Business Store for Windows 10. So should you get the Pro edition
instead?

It all comes down to this: do you need features such as Client Hyper-V,
which is a built-in virtualisation solution in Windows. Does your work
require you to connect to a Windows domain? If yes, you should
purchase the Pro edition. Else, the Home edition is what you need.

Beyond Home and Pro

While Windows 10 Home and Pro are direct paths for retail users, there
are other variants of Windows 10 as well like Windows 10 Enterprise
and Windows 10 Student. The Enterprise edition, as you may expect, is
meant to meet the demands of medium and large sized organisations.
It comes with even more sophisticated features such as Device Guard,
which gives a company the ability to lock down devices. Unlike the
other two Windows 10 Editions, however, the Enterprise variant won't
be available for sale in retail stores. Instead, it will be sold through
volume licensing.

The Windows 10 Education edition is designed for schools - students,


teachers, staff, and administrators. The edition comes with most of
Enterprise edition's feature. It too won't be available on sale at retail

25 | P a g e
stores, though, and will be seeded out through academic volume
licensing.

Speaking of other Windows 10 editions, we also have Windows 10


Mobile, and Windows 10 Mobile Enterprise. As their names suggest,
both are designed to empower smartphones and not the desktop
platform. Microsoft is also releasing Windows 10 Core, an operating
system for Internet of Things devices.

If you are upgrading Also worth noting is that if you have already have
a legit copy of Windows 7 Starter, Windows 7 Home Basic, Windows 7
Home Premium, or Windows 8.1, you will get a free upgrade to
Windows 10 Home. Existing legit users of Windows 7 Pro, Windows 7
Ultimate, or Windows 8.1 Pro will get a free upgrade to Windows 10
Pro.

5.2 PYTHON 3.7 VERSION

What is Python?

Python is a popular programming language. It was created by Guido


van Rossum, and released in 1991.

It is used for:

web development (server-side),

26 | P a g e
software development,

mathematics,

system scripting.

What can Python do?

Python can be used on a server to create web applications.

Python can be used alongside software to create workflows.

Python can connect to database systems. It can also read and modify
files.

Python can be used to handle big data and perform complex


mathematics.

Python can be used for rapid prototyping, or for production-ready


software development.

Why Python?

Python works on different platforms (Windows, Mac, Linux, Raspberry


Pi, etc).

Python has a simple syntax similar to the English language.

Python has syntax that allows developers to write programs with fewer
lines than some other programming languages.

Python runs on an interpreter system, meaning that code can be


executed as soon as it is written. This means that prototyping can be
very quick.

Python can be treated in a procedural way, an object-orientated way or


a functional way.

27 | P a g e
Good to know

The most recent major version of Python is Python 3, which we shall be


using in this tutorial. However, Python 2, although not being updated
with anything other than security updates, is still quite popular.

In this tutorial Python will be written in a text editor. It is possible to


write Python in an Integrated Development Environment, such as
Thonny, Pycharm, Netbeans or Eclipse which are particularly useful
when managing larger collections of Python files.

Python Syntax compared to other programming languages

Python was designed for readability, and has some similarities to the
English language with influence from mathematics.

Python uses new lines to complete a command, as opposed to other


programming languages which often use semicolons or parentheses.

Python relies on indentation, using whitespace, to define scope; such as


the scope of loops, functions and classes. Other programming
languages often use curly-brackets for this purpose.

Python is an interpreted, high-level, general-purpose programming


language. Created by Guido van Rossum and first released in 1991,
Python's design philosophy emphasizes code readability with its notable
use of significant whitespace. Its language constructs and object-
oriented approach aim to help programmers write clear, logical code for
small and large-scale projects.

Python is dynamically typed and garbage-collected. It supports multiple


programming paradigms, including procedural, object-oriented, and

28 | P a g e
functional programming. Python is often described as a "batteries
included" language due to its comprehensive standard library.

Python was conceived in the late 1980s as a successor to the ABC


language. Python 2.0, released 2000, introduced features like list
comprehensions and a garbage collection system capable of collecting
reference cycles. Python 3.0, released 2008, was a major revision of
the language that is not completely backward-compatible, and much
Python 2 code does not run unmodified on Python 3. Due to concern
about the amount of code written for Python 2, support for Python 2.7
(the last release in the 2.x series) was extended to 2020. Language
developer Guido van Rossum shouldered sole responsibility for the
project until July 2018 but now shares his leadership as a member of a
five-person steering council.

Python interpreters are available for many operating systems. A global


community of programmers develops and maintains CPython, an open
source[32] reference implementation. A non-profit organization, the
Python Software Foundation, manages and directs resources for Python
and CPython development.

Python is an easy to learn, powerful programming language. It has


efficient high-level data structures and a simple but effective approach
to object-oriented programming. Python’s elegant syntax and dynamic
typing, together with its interpreted nature, make it an ideal language
for scripting and rapid application development in many areas on most
platforms.

The Python interpreter and the extensive standard library are freely
available in source or binary form for all major platforms from the
Python Web site, https://www.python.org/, and may be freely
distributed. The same site also contains distributions of and pointers to
many free third party Python modules, programs and tools, and
additional documentation.

29 | P a g e
The Python interpreter is easily extended with new functions and data
types implemented in C or C++ (or other languages callable from C).
Python is also suitable as an extension language for customizable
applications.

This tutorial introduces the reader informally to the basic concepts and
features of the Python language and system. It helps to have a Python
interpreter handy for hands-on experience, but all examples are self-
contained, so the tutorial can be read off-line as well.

For a description of standard objects and modules, see The Python


Standard Library. The Python Language Reference gives a more formal
definition of the language. To write extensions in C or C++, read
Extending and Embedding the Python Interpreter and Python/C API
Reference Manual. There are also several books covering Python in
depth.

This tutorial does not attempt to be comprehensive and cover every


single feature, or even every commonly used feature. Instead, it
introduces many of Python’s most noteworthy features, and will give
you a good idea of the language’s flavor and style. After reading it, you
will be able to read and write Python modules and programs, and you
will be ready to learn more about the various Python library modules
described in The Python Standard Library.

History

Guido van Rossum at OSCON 2006.

30 | P a g e
Main article: History of Python

Python was conceived in the late 1980s by Guido van Rossum at


Centrum Wiskunde & Informatica (CWI) in the Netherlands as a
successor to the ABC language (itself inspired by SETL), capable of
exception handling and interfacing with the Amoeba operating system.
Its implementation began in December 1989. Van Rossum continued as
Python's lead developer until July 12, 2018, when he announced his
"permanent vacation" from his responsibilities as Python's Benevolent
Dictator For Life, a title the Python community bestowed upon him to
reflect his long-term commitment as the project's chief decision-maker.
[36] In January, 2019, active Python core developers elected Brett
Cannon, Nick Coghlan, Barry Warsaw, Carol Willing and Van Rossum to
a five-member "Steering Council" to lead the project.

Python 2.0 was released on 16 October 2000 with many major new
features, including a cycle-detecting garbage collector and support for
Unicode.

Python 3.0 was released on 3 December 2008. It was a major revision


of the language that is not completely backward-compatible. Many of its
major features were backported to Python 2.6.x[40] and 2.7.x version
series. Releases of Python 3 include the 2to3 utility, which automates
(at least partially) the translation of Python 2 code to Python 3.

Python 2.7's end-of-life date was initially set at 2015 then postponed to
2020 out of concern that a large body of existing code could not easily
be forward-ported to Python 3. In January 2017, Google announced
work on a Python 2.7 to Go transcompiler to improve performance
under concurrent workloads.

Features and philosophy

Python is a multi-paradigm programming language. Object-oriented


programming and structured programming are fully supported, and

31 | P a g e
many of its features support functional programming and aspect-
oriented programming (including by metaprogramming[45] and
metaobjects (magic methods)). Many other paradigms are supported
via extensions, including design by contract and logic programming.

Python uses dynamic typing, and a combination of reference counting


and a cycle-detecting garbage collector for memory management. It
also features dynamic name resolution (late binding), which binds
method and variable names during program execution.

Python's design offers some support for functional programming in the


Lisp tradition. It has filter, map, and reduce functions; list
comprehensions, dictionaries, sets and generator expressions. The
standard library has two modules (itertools and functools) that
implement functional tools borrowed from Haskell and Standard ML.

The language's core philosophy is summarized in the document The Zen


of Python (PEP 20), which includes aphorisms such as:

Beautiful is better than ugly

Explicit is better than implicit

Simple is better than complex

Complex is better than complicated

Readability counts

Rather than having all of its functionality built into its core, Python was
designed to be highly extensible. This compact modularity has made it
particularly popular as a means of adding programmable interfaces to
existing applications. Van Rossum's vision of a small core language with
a large standard library and easily extensible interpreter stemmed from
his frustrations with ABC, which espoused the opposite approach.

32 | P a g e
Python strives for a simpler, less-cluttered syntax and grammar while
giving developers a choice in their coding methodology. In contrast to
Perl's "there is more than one way to do it" motto, Python embraces a
"there should be one—and preferably only one—obvious way to do it"
design philosophy. Alex Martelli, a Fellow at the Python Software
Foundation and Python book author, writes that "To describe something
as 'clever' is not considered a compliment in the Python culture."

Python's developers strive to avoid premature optimization, and reject


patches to non-critical parts of the CPython reference implementation
that would offer marginal increases in speed at the cost of clarity. When
speed is important, a Python programmer can move time-critical
functions to extension modules written in languages such as C, or use
PyPy, a just-in-time compiler. Cython is also available, which translates
a Python script into C and makes direct C-level API calls into the Python
interpreter.

An important goal of Python's developers is keeping it fun to use. This is


reflected in the language's name—a tribute to the British comedy group
Monty Python and in occasionally playful approaches to tutorials and
reference materials, such as examples that refer to spam and eggs
(from a famous Monty Python sketch) instead of the standard foo and
bar.

A common neologism in the Python community is pythonic, which can


have a wide range of meanings related to program style. To say that
code is pythonic is to say that it uses Python idioms well, that it is
natural or shows fluency in the language, that it conforms with Python's
minimalist philosophy and emphasis on readability. In contrast, code
that is difficult to understand or reads like a rough transcription from
another programming language is called unpythonic.

33 | P a g e
Users and admirers of Python, especially those considered
knowledgeable or experienced, are often referred to as Pythonists,
Pythonistas, and Pythoneers.

5.3 PYCHARM IDE 2019.1.3

PyCharm is a dedicated Python and Django IDE providing a wide range


of essential tools for Python developers, tightly integrated together to
create a convenient environment for productive Python development
and Web development.

PyCharm is available in three editions: Professional, Community, and


Educational (Edu). The Community and Edu editions are open-source
projects and they are free, but they have less features. PyCharm Edu
provides courses and helps you learn programming with Python. The
Professional edition is commercial, and provides an outstanding set of
tools and features. For details, see the editions comparison matrix.

PYCHARM FEATURES

Intelligent Coding Assistance

PyCharm provides smart code completion, code inspections, on-the-fly


error highlighting and quick-fixes, along with automated code
refactorings and rich navigation capabilities.

Intelligent Code Editor

34 | P a g e
PyCharm’s smart code editor provides first-class support for Python,
JavaScript, CoffeeScript, TypeScript, CSS, popular template languages
and more. Take advantage of language-aware code completion, error
detection, and on-the-fly code fixes!

Smart Code Navigation

Use smart search to jump to any class, file or symbol, or even any IDE
action or tool window. It only takes one click to switch to the
declaration, super method, test, usages, implementation, and more.

Fast and Safe Refactorings

Refactor your code the intelligent way, with safe Rename and Delete,
Extract Method, Introduce Variable, Inline Variable or Method, and
other refactorings. Language and framework-specific refactorings help
you perform project-wide changes.

Built-in Developer Tools

PyCharm’s huge collection of tools out of the box includes an integrated


debugger and test runner; Python profiler; a built-in terminal;
integration with major VCS and built-in database tools; remote
development capabilities with remote interpreters; an integrated ssh
terminal; and integration with Docker and Vagrant.

Debugging, Testing and Profiling

Use the powerful debugger with a graphical UI for Python and


JavaScript. Create and run your tests with coding assistance and a GUI-
based test runner. Take full control of your code with Python Profiler
integration.

VCS, Deployment and Remote Development

35 | P a g e
Save time with a unified UI for working with Git, SVN, Mercurial or
other version control systems. Run and debug your application on
remote machines. Easily configure automatic deployment to a remote
host or VM and manage your infrastructure with Vagrant and Docker.

Database tools

Access Oracle, SQL Server, PostgreSQL, MySQL and other databases


right from the IDE. Rely on PyCharm’s help when editing SQL code,
running queries, browsing data, and altering schemas.

Web Development

In addition to Python, PyCharm provides first-class support for various


Python web development frameworks, specific template languages,
JavaScript, CoffeeScript, TypeScript, HTML/CSS, AngularJS, Node.js,
and more.

Python Web frameworks

PyCharm offers great framework-specific support for modern web


development frameworks such as Django, Flask, Google App Engine,
Pyramid, and web2py, including Django templates debugger,
manage.py and appcfg.py tools, special autocompletion and navigation,
just to name a few.

JavaScript & HTML

PyCharm provides first-class support for JavaScript, CoffeeScript,


TypeScript, HTML and CSS, as well as their modern successors. The
JavaScript debugger is included in PyCharm and is integrated with the
Django server run configuration.

Live Edit

36 | P a g e
Live Editing Preview lets you open a page in the editor and the browser
and see the changes being made in code instantly in the browser.
PyCharm auto-saves your changes, and the browser smartly updates
the page on the fly, showing your edits.

Scientific Tools

PyCharm integrates with IPython Notebook, has an interactive Python


console, and supports Anaconda as well as multiple scientific packages
including Matplotlib and NumPy.

Interactive Python console

You can run a REPL Python console in PyCharm which offers many
advantages over the standard one: on-the-fly syntax check with
inspections, braces and quotes matching, and of course code
completion.

Scientific Stack Support

PyCharm has built-in support for scientific libraries. It supports Pandas,


Numpy, Matplotlib, and other scientific libraries, offering you best-in-
class code intelligence, graphs, array viewers and much more.

Conda Integration

Keep your dependencies isolated by having separate Conda


environments per project, PyCharm makes it easy for you to create and
select the right environment

Debug Your Python Code with PyCharm

Visual Debugging

37 | P a g e
Some coders still debug using print statements, because the concept is
hard and pdb is intimidating. PyCharm’s python debugging GUI makes it
easy to use a debugger by putting a visual face on the process. Getting
started is simple and moving on to the major debugging features is
easy.

Debug Everywhere

Of course PyCharm can debug code that you’re running on your local
computer, whether it’s your system Python, a virtualenv, Anaconda, or
a Conda env. In PyCharm Professional Edition you can also debug code
you’re running inside a Docker container, within a VM, or on a remote
host through SSH.

Debug Inside Templates PRO ONLY

When you’re working with templates, sometimes a bug sneaks into


them. These can be very hard to resolve if you can’t see what’s going
on inside them. PyCharm’s debugger enables you to put a breakpoint in
Django and Jinja2 templates to make these problems easy to fix.

Note: to debug templates, first configure the template language.

JavaScript PRO ONLY

Any modern web project involves JavaScript, therefore any modern


Python IDE needs to be able to debug JavaScript as well. PyCharm
Professional edition comes with the highly capable JavaScript debugger
from WebStorm. Both in-browser JS and NodeJS are supported by the
JavaScript debugger.

Debugging During TDD

38 | P a g e
Test-driven development, or TDD, involves exploration while writing
tests. Use the debugger to help explore by setting breakpoints in the
context you are investigating:

This investigation can be in your test code or in the code being tested,
which is very helpful for Django integration tests (Django support is
available only in PyCharm Professional Edition). Use a breakpoint to find
out what is coming from a query in a test case:

No Code Modification Necessary

PDB is a great tool, but requires you to modify your code, which can
lead to accidentally checking in `pdb.set_trace()` calls into your git
repo.

See What Your Code Does

Breakpoints

All debuggers have breakpoints, but only some debuggers have highly
versatile breakpoints. Have you ever clicked ‘continue’ many times until
you finally get to the loop iteration where your bug occurs? No need for
that with PyCharm’s conditional breakpoints.

Sometimes all you want to do is see what a certain variable’s value is


throughout code execution. You can configure PyCharm’s breakpoints to
not suspend your code, but only log a message for you.

Exceptions can ruin your day, that’s why PyCharm’s debugger is able to
break on exceptions, even if you’re not entirely sure where they’re
coming from.

To help you stay in control of your debugging experience, PyCharm has


an overview window where you can see all of your breakpoints, as well
as disable some by checkbox. You can also temporarily mute all of your
breakpoints until you need them.

39 | P a g e
See Variable Values at a Glance

As soon as PyCharm hits a breakpoint, you’ll see all your variable values
inline in your code. To make it easy to see what values have changed
since the last time you hit the breakpoint, changed values are
highlighted.

Watches

Customize your variable view by adding watches. Whether they’re


simple or complex, you’ll be able to see exactly what you want to see.

Control Your Code

Visually Step Through Your Code

If you want to know where your code goes, you don’t need to put
breakpoints everywhere. You can step through your code, and keep
track of exactly what happens.

Run Custom Code

In some cases, the easiest way to reproduce something is to force a


variable to a certain value. PyCharm offers both `evaluate expression`
to quickly change something, and a console if you’d like more control.
The console can even use the ipython shell if it is installed.

Speed

Faster Than PDB

For Python 3.6 debugging, PyCharm’s debugger is the fastest debugger


on the market. Even faster than PDB. What this means is that you can
simply always run your code under the debugger while developing, and
easily add breakpoints when you need them. Just make sure to click
‘install’ when PyCharm asks whether or not to install the Cython
speedups.

40 | P a g e
5.4 HAAR CASCADE GUI TRAINER

1. Introduction

Cascade Trainer GUI is a program that can be used to train, test and
improve cascade classifier models. It uses a graphical interface to set the
parameters and make it easy to use OpenCV tools for training and testing
classifiers.

If you are new to the concept of object detection and classifiers please
consider visiting http://opencv.org for more information.

2. Installation

2.1. Prerequisites

Currently Cascade Trainer GUI can be used on Windows (7 or above). The


installation procedure is pretty straightforward and it only involves
pressing a couple of “Next” buttons.

3. How to Use

In this section different parts and functionalities of Cascade Trainer GUI


are described. Note that by moving your mouse over to each element on
the graphical interface you will get a short description of it at the bottom
status bar.

When Cascade Trainer GUI is first started you will be presented with the
following screen. This is the starting screen and it can be used for training
classifiers. To train classifiers usually you need to provide the utility with

41 | P a g e
thousands of positive and negative image samples, but there are cases
when you can achieve the same with less samples.

To start the training, you need to create a folder for your classifier. Create
two folders inside it. One should be “p” (for positive images) and the other
should be “n” (for negative images).

For example, you should have a folder named “Car” which has the
mentioned folders inside it.

Positive image samples are the images of the object you want to train your
classifier and detect.

For example, if you want to train and detect cars then you need to have
many car images.

And you should also have many negative images. Negative images are
anything but cars.

Important Note 1: Negative images must NEVER include any positive


images. Not even partially.

Important Note 2: In theory, negative images can be any image that is not
the positive image but in practice, negative images should be relevant to
the positive images. For example, using sky images as negative images is
a poor choice for training a good car classifier, even though it doesn’t have
a bad effect on the overall accuracy:

Start by pressing the Browse button in Train tab. Select the folder you
have created for the classifier.

42 | P a g e
Common, Cascade and Boost tabs can be used for setting numerous
parameters for customizing the classifier training. Cascade Trainer GUI
sets the most optimized and recommended settings for these parameters
by default, still some parameters need to be modified for each training.
Note that detailed description of all these parameters are beyond the
scope of this help page and require deep knowledge about cascade
classification techniques.

You can set pre-calculation buffer size to help with the speed of training
process. You can assign as much memory as you can for these but be
careful to not assign too much or too low. For example if you have 8 GB of
RAM on your computer then you can safely set both of the buffer sizes
below to 2048.

Next you need to set the sample width and height. Make sure not to set it
to a very big size because it will make your detection very slow. Actually it
is quite safe to always set a small value for this. Recommended settings
for sample width and height is that you keep one aspect on 24 and set the
other accordingly. For example, if you have sample images that are
320×240 then first calculate the aspect ratio which in this case is 1.33:1
then multiply the bigger number with 24. You’d get 32×24 for sample
width and height.

You can also set the feature type to HAAR or LBP. Make sure to use HOG
only if you have OpenCV 3.1 or later. HAAR classifiers are very accurate
but require a lot more time to train so it is much wiser to use LBP if you
can provide your classifiers with many sample images. LBP classifiers on
the other hand are less accurate but train much quicker and detect almost
3 times faster.

As for the parameters in the Boost tab, it is recommended to keep the


default values unless you are quite sure about what you’re doing.

43 | P a g e
After all the parameters are set, press Start button at the bottom to start
training your cascade classifier. You’ll see the following log screen while
training is going on.

Wait for the training to complete.

Now if you exit Cascade Trainer GUI and go to the classifier folder you will
notice that there are new files and folders are created in this folder.

“n” and “p” are familiar but the rest are new. “classifier” folder contains
XML files that are created during different stages of training. If you check
inside “classifier” folder, you’ll notice something similar to the following.

“stage#.xml” files are temporary files that won’t be needed anymore.

“params.xml” contains the parameters you have used for the training.
(Just a reminder file)

“cascade.xml” is the actual cascade classifier and if the training completed


successfully then you should have this file inside classifier folder.

“neg.lst”, “pos.lst” and “pos_samples.vec” are temporary files created for


training the classifier and they can also be removed without having any
effect.

To test your classifiers, go to Test tab from the tab bar at the top and set
the options as described below and finally press Start.

Select your cascade classifier using the Browse button at the top. You can
also manually enter the path to cascade XML file in the Cascade Classifier
XML field. This cascade classifier will be used for detection in images
and/or videos.

You can select one of the following for Input Settings and you need to set
the path according to this option:

44 | P a g e
• Single Image: A single image will be used as the scene in which
detection will be done. In this case Path should point to a single image file.
(Only supported images can be selected.)

• Images in a Folder: A folder containing many images will be used for


testing. In this case Path should be set to a folder that contains one or
more scene images.

• Video: A video file will be used for testing the classifier. In this case Path
should point to a video file that will be used as input.

After setting the input settings it is time for output settings. Output type
and path should be set according to what was chosen in input settings. See
below:

• Images in a Folder: Detected objects will be saved to multiple images


inside a folder. In this case Path should be set to a folder. Note that this
option can be used with all of the possible options in input.

• Video: A video file with the detected objects highlighted with a red
rectangle will be created. In this case Path should point to a video file that
will be created after the test completes. Note that this option will only work
if Video is selected in the input settings.

After clicking on Start button test will start. You’ll see a progress bar and
the following preview screen with results.

You can also use Cropper tool to crop images from the object you want to
detect. It provides very simple tools to achieve this. Try to use relevant
negative images and always separately train objects that are too much
visually different. You can crop images from frames in a video file or from
a folder full of images.

45 | P a g e
CHAPTER-6
DIGITAL IMAGE PROCESSING
6.1 DIGITAL IMAGE PROCESSING
Interest in digital image processing methods stems from two principal
application areas:
1. Improvement of pictorial information for human interpretation
2. Processing of scene data for autonomous machine perception

46 | P a g e
In this second application area, interest focuses on procedures for extracting
image information in a form suitable for computer processing.
Examples includes automatic character recognition, industrial machine vision
for product assembly and inspection, military recognizance, automatic
processing of fingerprints etc.
Image:
Am image refers a 2D light intensity function f(x, y), where(x, y) denotes
spatial coordinates and the value of f at any point (x, y) is proportional to
the brightness or gray levels of the image at that point. A digital image is an
image f(x, y) that has been discretized both in spatial coordinates and
brightness. The elements of such a digital array are called image elements
or pixels.
A simple image model:
To be suitable for computer processing, an image f(x, y) must be
digitalized both spatially and in amplitude. Digitization of the spatial
coordinates (x, y) is called image sampling. Amplitude digitization is called
gray-level quantization.
The storage and processing requirements increase rapidly with the spatial
resolution and the number of gray levels.
Example: A 256 gray-level image of size 256x256 occupies 64k bytes of
memory.

Types of image processing


• Low level processing
• Medium level processing
• High level processing

Low level processing means performing basic operations on images


such as reading an image resize, resize, image rotate, RGB to gray level
conversion, histogram equalization etc. The output image obtained after low

47 | P a g e
level processing is raw image. Medium level processing means extracting
regions of interest from output of low level processed image. Medium level
processing deals with identification of boundaries i.e edges .This process is
called segmentation. High level processing deals with adding of artificial
intelligence to medium level processed signal.

48 | P a g e
6.2 FUNDAMENTAL STEPS IN IMAGE PROCESSING

Fundamental steps in image processing are


1. Image acquisition: to acquire a digital image
2.Image pre-processing: to improve the image in ways that increases the
chances for success of the other processes.
3. Image segmentation: to partitions an input image into its constituent
parts of objects.
4. Image segmentation: to convert the input data to a from suitable for
computer processing.
5. Image description: to extract the features that result in some
quantitative information of interest of features that are basic for
differentiating one class of objects from another.
6. Image recognition: to assign a label to an object based on the
information provided by its description.

49 | P a g e
Representat
Segmentat
ion
ion and
description

Pre-
processing

Recognition
Image
Knowledge And
acquisition base

fig.3.1. Fundamental steps in digital image processing

6.3 ELEMENTS OF DIGITAL IMAGE PROCESSING SYSTEMS

50 | P a g e
A digital image processing system contains the following blocks as shown in
the figure

Storage

• Optical discs
• Tape
• Video tape
• Magnetic discs

Imag
e Display unit
acquisition Processing Unit TV
 monitors
equipments
 Computer  Printers
Work
 Video  station  Projectors
 Scanner

Communication channel

Fig.3.3. Elements of digital image processing systems

The basic operations performed in a digital image processing system include

1. Acquisition
2. Storage

51 | P a g e
3. Processing
4. Communication
5. Display

6.3.1 A simple image formation model


Image are denoted by two-dimensional function f(x, y).f(x, y) may be
characterized by 2 components:

1. The amount of source illumination i(x, y) incident on the scene


2. The amount of illumination reflected r(x, y) by the objects of the scene
3. f(x, y) = i(x, y)r(x, y), where 0 < i(x,y) < and 0 < r(x, y) < 1
Typical values of reflectance r(x, y):
• 0.01 for black velvet
• 0.65 for stainless steel
• 0.8 for flat white wall paint
• 0.9 for silver-plated metal
• 0.93 for snow Example of typical ranges of illumination i(x, y) for
visible light (average values)
• Sun on a clear day: ~90,000 lm/m^2,down to 10,000lm/m^2 on a
cloudy day
• Full moon on a clear evening :-0.1 lm/m^2
• Typical illumination level in a commercial office. ~1000lm/m^

image Formats (supported by MATLAB Image Processing Toolbox)

Descripti
Format Full name on Recognized
name Extensions

52 | P a g e
Tagge Image A
TIFF d File flexible file format .tif, .tiff
Forma supportin
t g a variety
imag
e compression
standard
s including
JPEG

Joint standa
JPEG Photographic A rd for .jpg, .jpeg
compression of
Experts Group images
of photographic
quality

Graphi Frequentl use


GIF cs y d to .gif
Interchange make small
Format animations
on the
internet

Format used
BMP Windows Bitmap mainly for .bmp
simpl uncompresse
e d
imag
es

Portab Compres
PNG le Network ses full color .png
Graphi imag
cs es with
trasparency(
up to

53 | P a g e
48bits/p

Table.3.3. Image Formats Supported By MATLAB

CHAPTER-7
FACE DETECTION

The problem of face recognition is all about face detection. This is a fact
that seems quite bizarre to new researchers in this area. However, before
face recognition is possible, one must be able to reliably find a face and its
landmarks. This is essentially a segmentation problem and in practical
systems, most of the effort goes into solving this task. In fact the actual
recognition based on features extracted from these facial landmarks is only a
minor last step.

54 | P a g e
There are two types of face detection problems:

1) Face detection in images and


2) Real-time face detection

7.1 FACE DETECTION IN IMAGES

Figure 5.1 A successful face detection in an image with a frontal view of


a human face.

Most face detection systems attempt to extract a fraction of the whole


face, thereby eliminating most of the background and other areas of an
individual's head such as hair that are not necessary for the face recognition
task. With static images, this is often done by running a across the image.
The face detection system then judges if a face is present inside the window
(Brunelli and Poggio, 1993). Unfortunately, with static images there is a very
large search space of possible locations of a face in an image.

55 | P a g e
Most face detection systems use an example based learning approach
to decide whether or not a face is present in the window at that given instant
(Sung and Poggio,1994 and Sung,1995). A neural network or some other
classifier is trained using supervised learning with 'face' and 'non-face'
examples, thereby enabling it to classify an image (window in face detection
system) as a 'face' or 'non-face'.. Unfortunately, while it is relatively easy to
find face examples, how would one find a representative sample of images
which represent non-faces (Rowley et al., 1996)? Therefore, face detection
systems using example based learning need thousands of 'face' and 'non-face'
images for effective training. Rowley, Baluja, and Kanade (Rowley et
al.,1996) used 1025 face images and 8000 non-face images (generated from
146,212,178 sub-images) for their training set!

There is another technique for determining whether there is a face


inside the face detection system's window - using Template Matching. The
difference between a fixed target pattern (face) and the window is computed
and thresholded. If the window contains a pattern which is close to the target
pattern(face) then the window is judged as containing a face. An
implementation of template matching called Correlation Templates uses a
whole bank of fixed sized templates to detect facial features in an image
(Bichsel, 1991 & Brunelli and Poggio, 1993). By using several templates of
different (fixed) sizes, faces of different scales (sizes) are detected. The other
implementation of template matching is using a deformable template (Yuille,
1992). Instead of using several fixed size templates, we use a deformable
template (which is non-rigid) and there by change the size of the template
hoping to detect a face in an image.

A face detection scheme that is related to template matching is image


invariants. Here the fact that the local ordinal structure of brightness
distribution of a face remains largely unchanged under different illumination
conditions (Sinha, 1994) is used to construct a spatial template of the face
which closely corresponds to facial features. In other words, the average
grey-scale intensities in human faces are used as a basis for face detection.

56 | P a g e
For example, almost always an individuals eye region is darker than his
forehead or nose. Therefore an image will match the template if it satisfies
the 'darker than' and 'brighter than' relationships (Sung and Poggio, 1994).

57 | P a g e
7.2 REAL-TIME FACE DETECTION

Real-time face detection involves detection of a face from a series of


frames from a video-capturing device. While the hardware requirements for
such a system are far more stringent, from a computer vision stand point,
real-time face detection is actually a far simpler process than detecting a face
in a static image. This is because unlike most of our surrounding
environment, people are continually moving. We walk around, blink, fidget,
wave our hands about, etc.

Figure 5.2.1: Frame 1 from camera Figure 5.2.2: Frame 2 from


camera

Figure 5.2.3: Spatio-Temporally filtered image

58 | P a g e
Since in real-time face detection, the system is presented with a series
of frames in which to detect a face, by using spatio-temperal filtering (finding
the difference between subsequent frames), the area of the frame that has
changed can be identified and the individual detected (Wang and Adelson,
1994 and Adelson and Bergen 1986).Further more as seen in Figure exact
face locations can be easily identified by using a few simple rules, such as,

1)the head is the small blob above a larger blob -the body.

2)head motion must be reasonably slow and contiguous -heads won't jump
around erratically (Turk and Pentland 1991a, 1991b).

Real-time face detection has therefore become a relatively simple


problem and is possible even in unstructured and uncontrolled environments
using these very simple image processing techniques and reasoning rules.

7.3 FACE DETECTION PROCESS

Fig 5.3 Face detection

59 | P a g e
It is process of identifying different parts of human faces like eyes,
nose, mouth, etc… this process can be achieved by using MATLAB code In
this project the author will attempt to detect faces in still images by using
image invariants. To do this it would be useful to study the grey-scale
intensity distribution of an average human face. The following 'average
human face' was constructed from a sample of 30 frontal view human faces,
of which 12 were from females and 18 from males. A suitably scaled
colormap has been used to highlight grey-scale intensity differences.

scaled colormap scaled colormap (negative)

Figure 5.3.1 Average human face in grey-scale

The grey-scale differences, which are invariant across all the sample
faces are strikingly apparent. The eye-eyebrow area seem to always contain
dark intensity (low) gray-levels while nose forehead and cheeks contain
bright intensity (high) grey-levels. After a great deal of experimentation, the
researcher found that the following areas of the human face were suitable for
a face detection system based on image invariants and a deformable
template.

60 | P a g e
scaled colormap scaled colormap (negative)

Figure 5.3.2 Area chosen for face detection (indicated on average human
face in gray scale)

The above facial area performs well as a basis for a face template,
probably because of the clear divisions of the bright intensity invariant area
by the dark intensity invariant regions. Once this pixel area is located by the
face detection system, any particular area required can be segmented based
on the proportions of the average human face After studying the above
images it was subjectively decided by the author to use the following as a
basis for dark intensity sensitive and bright intensity sensitive templates.
Once these are located in a subject's face, a pixel area 33.3% (of the width of
the square window) below this.

Figure 5.3.3: Basis for a bright intensity invariant sensitive


template.

61 | P a g e
Note the slight differences which were made to the bright intensity invariant
sensitive template (compare Figures 3.4 and 3.2) which were needed because
of the pre-processing done by the system to overcome irregular lighting
(chapter six). Now that a suitable dark and bright intensity invariant
templates have been decided on, it is necessary to find a way of using these
to make 2 A-units for a perceptron, i.e. a computational model is needed to
assign neurons to the distributions displayed .

Fig 5.3.4 Scaned image detection

 San window over image


 Clasify window as either
1. Face
2. Non – Face

62 | P a g e
7.4 FACE DETECTION ALGORITHM

Fig 5.4 Face detection algorithm

Fig 5.4.1 mouth detection Fig 5.4.2 Nose detection

63 | P a g e
Fig 5.4.3 Eye detection

64 | P a g e
7.5 Face Detection using Haar-Cascades

A Haar wavelet is a mathematical fiction that produces square-shaped


waves with a beginning and an end and used to create box shaped
patterns to recognize signals with sudden transformations. An example is
shown in figure. By combining several wavelets, a cascade can be created
that can identify edges, lines and circles with different color intensities.
These sets are used in Viola Jones face detection technique in 2001 and
since then more patterns are introduced [10] for object detection as
shown in figure .

To analyze an image using Haar cascades, a scale is selected smaller


than the target image. It is then placed on the image, and the average of
the values of pixels in each section is taken. If the difference between two
values pass a given threshold, it is considered a match. Face detection on
a human face is performed by matching a combination of different Haar-
like-features. For example, forehead, eyebrows and eyes contrast as well
as the nose with eyes as shown below in figure A single classifier is not
accurate enough. Several classifiers are combined as to provide an
accurate face detection system as shown in the block diagram below in
figure

65 | P a g e
1

Figure 1: A Haar wavelet and resulting Haar-like features.

In this project, a similar method is used effectively to by identifying faces


and eyes in combination resulting better face detection. Similarly, in viola
Jones method [7], several classifies were combined to create stronger
classifiers. ADA boost is a machine learning algorithm that tests out
several week classifiers on a selected location and choose the most
suitable [7]. It can also reverse the direction of the classifier and get
better results if necessary [7]. 2. Furthermore, Weight-update-steps can
be updated

66 | P a g e
Figure 2: Several Haar-like-features matched to the features of authors
face.

only on misses to get better performance. The cascade is scaled by 1.25


and re-iterated in order to find different sized faces. Running the cascade
on an image using conventional loops takes a large amount of computing
power and time. Viola Jones [7] used a summed area table (an integral
image) to compute the matches fast. First developed in 1984 [11], it
became popular after 2001 when Viola Jones implemented Haar-cascades
for face detection. Using an integral image enables matching features with
a single pass over the image.

Figure 3: Haar-cascade flow chart

67 | P a g e
7.6 PRINCIPAL COMPONENT ANALYSIS (PCA)

Principal Component Analysis (or Karhunen-Loeve expansion) is a


suitable strategy for face recognition because it identifies variability
between human faces, which may not be immediately obvious. Principal
Component Analysis (hereafter PCA) does not attempt to categorize faces
using familiar geometrical differences, such as nose length or eyebrow
width. Instead, a set of human faces is analyzed using PCA to determine
which 'variables' account for the variance of faces. In face recognition,
these variables are called eigen faces because when plotted they display
an eerie resemblance to human faces. Although PCA is used extensively in
statistical analysis, the pattern recognition community started to use PCA
for classification only relatively recently. As described by Johnson and
Wichern (1992), 'principal component analysis is concerned with
explaining the variance- covariance structure through a few linear
combinations of the original variables.' Perhaps PCA's greatest strengths
are in its ability for data reduction and interpretation. For example a
100x100 pixel area containing a face can be very accurately represented
by just 40 eigen values. Each eigen value describes the magnitude of each
eigen face in each image. Furthermore, all interpretation (i.e. recognition)
operations can now be done using just the 40 eigen values to represent a
face instead of the manipulating the 10000 values contained in a 100x100
image. Not only is this computationally less demanding but the fact that
the recognition information of several thousand.

7.7 UNDERSTANDING EIGENFACES

Any grey scale face image I(x,y) consisting of a NxN array of


intensity values may also be consider as a vector of N 2. For example, a

68 | P a g e
typical 100x100 image used in this thesis will have to be transformed into
a 10000 dimension vector!

Figure 6.6.0 A 7x7 face image transformed into a 49 dimension


vector

This vector can also be regarded as a point in 10000 dimension space.


Therefore, all the images of subjects' whose faces are to be recognized
can be regarded as points in 10000 dimension space. Face recognition
using these images is doomed to failure because all human face images
are quite similar to one another so all associated vectors are very close to
each other in the 10000-dimension space.

69 | P a g e
Fig 6.6.1 Eigenfaces

The transformation of a face from image space (I) to face space (f)
involves just a simple matrix multiplication. If the average face image is A
and U contains the (previously calculated) eigenfaces,

f = U * (I - A)

This is done to all the face images in the face database (database
with known faces) and to the image (face of the subject) which must be
recognized. The possible results when projecting a face into face space
are given in the following figure.

There are four possibilities:

1. Projected image is a face and is transformed near a face in the


face database

70 | P a g e
2.Projected image is a face and is not transformed near a face in
the face database

3.Projected image is not a face and is transformed near a face in


the face database

4. Projected image is not a face and is not transformed near a


face in the face database

While it is possible to find the closest known face to the


transformed image face
by calculating the Euclidean distance to the other vectors, how does one
know whether the image that is being transformed actually contains a
face? Since PCA is a many-to-one transform, several vectors in the image
space (images) will map to a point in face space (the problem is that even
non-face images may transform near a known face image's faces space
vector). Turk and Pentland (1991a), described a simple way of checking
whether an image is actually of a face. This is by transforming an image
into face space and then transforming it back (reconstructing) into image
space. Using the previous notation,

I' = UT *U * (I - A

With these calculations it is possible to verify that an image is of a


face and recognize that face. O'Toole et al. (1993) did some interesting
work on the importance of eigen faces with large and small eigenvalues.
They showed that the eigen vectors with larger eigenvalues convey
information relative to the basic shape and structure of the faces. This
kind of information is most useful in categorizing faces according to sex,
race etc. Eigen vectors with smaller eigenvalues tend to capture
information that is specific to single or small subsets of learned faces
and are useful for distinguishing a particular face from any other face.
Turk and Pentland (1991a) showed that about 40 eigen faces were

71 | P a g e
sufficient for a very good description of human faces since the
reconstructed image have only about 2% RMS. pixel-by-pixel errors.

7.7.1 Eigenface

Eigenface is based on PCA that classify images to extract features using a


set of images. It is important that the images are in the same lighting
condition and the eyes match in each image. Also, images used in this
method must contain the same number of pixels and in grayscale. For this
example, consider an image with n x n pixels as shown in figure 4. Each
raw is concatenated to create a vector, resulting a 1 n 2 matrix. All the
images in the dataset are stored in a single matrix resulting a matrix with
columns corresponding the number of images. The matrix is averaged
(normalized) to get an average human face. By subtracting the average
face from each image vector unique features to each face are computed.
In the resulting matrix, each column is a representation of the difference
each face has to the average human face. A simplified illustration can be
seen in figure 4.

72 | P a g e
Figure 4: Pixels of the image are reordered to perform calculations for
Eigenface

73 | P a g e
The next step is computing the covariance matrix from the result. To
obtain the Eigen vectors from the data, Eigen analysis is performed using
principal component analysis. From the result, where covariance matrix is
diagonal, where it has the highest variance is considered the 1 st Eigen
vector. 2nd Eigen vector is the direction of the next highest variance, and it
is in 90 degrees to the 1 st vector. 3rd will be the next highest variation,
and so on. Each column is considered an image and visualized, resembles
a face and called Eigenfaces. When a face is required to be recognized,
the image is imported, resized to match the same dimensions of the test
data as mentioned above. By projecting extracted features on to each of
the Eigenfaces, weights can be calculated. These weights correspond to
the similarity of the features extracted from the different image sets in the
dataset to the features extracted from the input image. The input image
can be identified as a face by comparing with the whole dataset. By
comparing with each subset, the image can be identified as to which
person it belongs to. By applying a threshold detection and identification
can be controlled to eliminate false detection and recognition. PCA is
sensitive to large numbers and assumes that the subspace is linear. If the
same face is analyzed under different lighting conditions, it will mix the
values when distribution is calculated and cannot be effectively classified.
This makes to different lighting conditions poses a problem in matching
the features as they can change dramatically.

74 | P a g e
7.7.2 Fisherface

Fisherface technique builds upon the Eigenface and is based on LDA


derived from Ronald Fishers’ linear discriminant technique used for
pattern recognition. However, it uses labels for classes as well as data
point information [6]. When reducing dimensions, PCA looks at the
greatest variance, while LDA, using labels, looks at an interesting
dimension such that, when you project to that dimension you maximize
the difference between the mean of the classes normalized by their
variance [6]. LDA maximizes the ratio of the between-class scatter and
within-class scatter matrices. Due to this, different lighting conditions in
images has a limited effect on the classification process using LDA
technique. Eigenface maximizes the variations while Fisherface maximizes
the mean distance between and different classes and minimizes variation
within classes. This enables LDA to differentiate between feature classes
better than PCA and can be observed in figure 5 [12]. Furthermore, it
takes less amount of space and is the fastest algorithm in this project.
Because of these PCA is more suitable for representation of a set of data
while LDA is suitable for classification.

Figure 5: The first component of PCA and LDA. Classes in PCA looks more
mixed than of LDA

75 | P a g e
7.7.3 Local Binary Pattern Histogram

Local binary patterns were proposed as classifiers in computer vision and


in 1990 By Li Wang [4]. The combination of LBP with histogram oriented
gradients was introduced in 2009 that increased its performance in certain
datasets [5]. For feature encoding, the image is divided into cells (4 x 4
pixels). Using a clockwise or counter-clockwise direction surrounding pixel
values are compared with the central as shown in figure 6. The value of
intensity or luminosity of each neighbor is compared with the center pixel.
Depending if the difference is higher or lower than 0, a 1 or a 0 is
assigned to the location. The result provides an 8-bit value to the cell. The
advantage of this technique is even if the luminosity of the image

Figure 6: Local binary pattern histogram generating 8-bit number

76 | P a g e
is changed as in figure 7, the result is the same as before. Histograms are
used in larger cells to find the frequency of occurrences of values making
process faster. By analyzing the results in the cell, edges can be detected
as the values change. By computing the values of all cells and
concatenating the histograms, feature vectors can be obtained. Images
can be classified by processing with an ID attached. Input images are
classified using the same process and compared with the dataset and
distance is obtained. By setting up a threshold, it can be identified if it is a
known or unknown face. Eigenface and Fisherface compute the dominant
features of the whole training set while LBPH analyze them individually.

Figure 7: The results are same even if brightness is changed

77 | P a g e
CHAPTER 8
METHODOLOGY
Below are the methodology and descriptions of the applications used for
data gathering, face detection, training and face recognition. The project
was coded in Python using a mixture of IDLE and PYCharm IDEs.

8.1 Methodology in Face Detection

First stage was creating a face detection system using Haar-cascades.


Although, training is required for creating new Haar-cascades, OpenCV
has a robust set of Haar-cascades that was used for the project. Using
face-cascades alone caused random objects to be identified and eye
cascades were incorporated to obtain stable face detection. The flowchart
of the detection system can be seen in figure 8. Face and eye

Figure 8: The Flow chart of the face detection application

78 | P a g e
classifier objects are created using classifier class in OpenCV through the
cv2.CascadeClassifier() and loading the respective XML les. A camera
object is created using the cv2.VideoCapture() to capture images. By
using the CascadeClassifier.detectMultiScale() object of various sizes are
matched and location is returned. Using the location data, the face is
cropped for further verification. Eye cascade is used to verify there are
two eyes in the cropped face. If satisfied a marker is placed around the
face to illustrate a face is detected in the location.

8.2 Face Detection Process

For this project three algorithms are implemented independently. These


are Eigenface, Fisherface and Linear binary pattern histograms
respectively. All three can be implemented using OpenCV libraries. There
are three stages for the face recognition as follows:

1.Collecting images IDs


2.Extracting unique features, classifying them and storing in XML les
3.Matching features of an input image to the features in the saved XML
les and predict identity

8.2.1 Collecting the image data

Collecting classification images is usually done manually using a photo


editing software to crop and resize photos. Furthermore, PCA and LDA
requires the same number of pixels in all the images for the correct
operation. This time consuming and a laborious task is automated through
an application to collect 50 images with different expressions. The
application detects suitable expressions between 300ms, straightens any
existing tilt and save them. The Flow chart for the application is shown in
figure 9.

79 | P a g e
Figure 9: The Flowchart for the image collection

80 | P a g e
Application starts with a request for a name to be entered to be stored
with the ID in a text le. The face detection system starts the first half.
However, before the capturing begins, the application check for the
brightness levels and will capture only if the face is well illuminated.
Furthermore, after the face is detected, the position of the eyes are
analyzed. If the head is tilted, the application automatically corrects the
orientation. These two additions were made considering the requirements
for Eigenface algorithm. The Image is then cropped and saved using the
ID as a filename to be identified later. A loop runs this program until 50
viable images are collected from the person. This application made data
collection efficient.

8.2.2 Training the Classifiers

OpenCV enables the creation of XML les to store features extracted from
datasets using the FaceRe-cognizer class. The stored images are
imported, converted to grayscale and saved with IDs in two lists with
same indexes. Face Recognizer objects are created using face recognizer
class. Each recognizer can take in parameters that are described below:

cv2.face.createEigenFaceRecognizer()

1.Takes in the number of components for the PCA for crating


Eigenfaces. OpenCV documentation mentions 80 can provide
satisfactory reconstruction capabilities.
2.Takes in the threshold in recognizing faces. If the distance to the
likeliest Eigenface is above this threshold, the function will return a
-1, that can be used state the face is unrecognizable

cv2.face.createFisherfaceRecognizer()

1.The first argument is the number of components for the LDA for the
creation of Fisherfaces. OpenCV mentions it to be kept 0 if uncertain.
2.Similar to Eigenface threshold. -1 if the threshold is passed.

81 | P a g e
cv2.face.createLBPHFaceRecognizer()

1.The radius from the center pixel to build the local binary pattern.
2.The Number of sample points to build the pattern. Having a
considerable number will slow down the computer.
3.The Number of Cells to be created in X axis.
4.The number of cells to be created in Y axis.
5.A threshold value similar to Eigenface and Fisherface. if the threshold
is passed the object will return -1

82 | P a g e
Recognizer objects are created and images are imported, resized,
converted into numpy arrays and stored in a vector. The ID of the image
is gathered from splitting the le name, and stored in another vector. By
using FaceRecognizer.train(NumpyImage, ID) all three of the objects are
trained. It must be noted that resizing the images were required only for
Eigenface and Fisherface, not for LBPH. Next, the configuration model is
saved as a XML le using FaceRecognizer.save(FileName). In this project,
all three are trained and saved through one application for convenience.
The ow chart for the trainer is shown in figure 10.

Figure 10: Flowchart of the training application

83 | P a g e
8.2.3 The Face Recognition using Detection

Face recognizer object is created using the desired parameters. Face


detector is used to detect faces in the image, cropped and transferred to
be recognized. This is done using the same technique used for the image
capture application. For each face detected, a prediction is made using
FaceRecognizer.predict() which return the ID of the class and confidence.
The process is same for all algorithms and if the confidence his higher
than the set threshold, ID is -1. Finally, names from the text le with IDs
are used to display the name and confidence on the screen. If the ID is
-1, the application will print unknown face without the confidence level.
The ow chart for the application is shown in figure 11.

Figure 11: Flowchart of the face recognition application

84 | P a g e
8.3 Discussion

Early attempts on Eigenface and Fisherface was disappointing since the


LBPH alone recognized a face. By designing an application to test the
algorithms, and after calibration with new data, both algorithms
performed well. The tester applications also allowed accurate threshold
settings. Another problem was people tilting their head when images
taken for the data. This was fixed with an application that identifies the
locations of the eyes and rotate the image to correct the o -set. It was
noticed that some early-stage images in the data-set
differentbrightness’s. To resolve this, before taking an image, the
brightness was averaged to prevent dark images. These changes to the
system improved the performance noticeably.

85 | P a g e
CHAPTER 9
OUTPUT SCREENS

86 | P a g e
CHAPTER 10

87 | P a g e
CONCLUSION
This paper describes the mini-project for visual perception and
autonomy module. Next, it explains the technologies used in the
project and the methodology used. Finally, it shows the results,
discuss the challenges and how they were resolved followed by a
discussion. Using Haar-cascades for face detection worked extremely
well even when subjects wore spectacles. Real time video speed was
satisfactory as well devoid of noticeable frame lag. Considering all
factors, LBPH combined with Haar-cascades can be implemented as a
cost effective face recognition platform. An example is a system to
identify known troublemakers in a mall or a supermarket to provide
the owner a warning to keep him alert or for automatic attendance
taking in a class.

88 | P a g e
CHAPTER 11
FUTURE ENHANCEMENT
Today, one of the fields that uses facial detection the most is security.
This Facial Detection system can be enhanced by Facial Recognition
which is a very effective tool that can help law enforcers recognize
criminals and software companies are leveraging the technology to help
users access their technology. This technology can be further developed
to be used in other avenues such as ATMs, accessing confidential files, or
other sensitive materials. This can make other security measures such as
passwords and keys obsolete.

Another way that innovators are looking to implement facial detection &
recognition is within subways and other transportation outlets. They are
looking to leverage this technology to use faces as credit cards to pay for
your transportation fee. Instead of having to go to a booth to buy a ticket
for a fare, the face recognition would take your face, run it through a
system, and charge the account that you’ve previously created. This could
potentially streamline the process and optimize the flow of traffic
drastically. The future is here.

89 | P a g e
CHAPTER 12
BIBLIOGRAPHY
[1] Takeo Kanade. Computer recognition of human faces, volume
47. Birkhauser Basel, 1977.
[2] Lawrence Sirovich and Michael Kirby. Low-dimensional
procedure for the characterization of human faces. Josa a,
4(3):519{524, 1987.
[3] M. Turk and A. Pentland. Eigenfaces for recognition. Journal
of Cognitive Neuroscience, 3(1):71{86, Jan 1991.
[4] Dong chen He and Li Wang. Texture unit, texture spectrum,
and texture analysis. IEEE Transactions on Geoscience and Remote
Sensing, 28(4):509{512, Jul 1990.
[5] X. Wang, T. X. Han, and S. Yan. An hog-lbp human detector
with partial occlusion handling. In 2009 IEEE 12th International
Conference on Computer Vision, pages 32{39, Sept 2009.
[6] P. N. Belhumeur, J. P. Hespanha, and D. J. Kriegman.
Eigenfaces vs. sherfaces: recognition using class speci c linear
projection. IEEE Transactions on Pattern Analysis and Machine
Intelligence, 19(7):711{720, Jul 1997.
[7] P. Viola and M. Jones. Rapid object detection using a boosted
cascade of simple features. In Proceed-ings of the 2001 IEEE
Computer Society Conference on Computer Vision and Pattern
Recognition. CVPR 2001, volume 1, pages I{511{I{518 vol.1,
2001.
[8] John G Daugman. Uncertainty relation for resolution in space,
spatial frequency, and orientation optimized by two-dimensional
visual cortical lters. JOSA A, 2(7):1160{1169, 1985.
[9] S Mar^celja. Mathematical description of the responses of
simple cortical cells. JOSA, 70(11):1297{ 1300, 1980.
[10] Rainer Lienhart and Jochen Maydt. An extended set of haar-
like features for rapid object detection. In Image Processing. 2002.

90 | P a g e
Proceedings. 2002 International Conference on, volume 1, pages
I{I. IEEE, 2002.
[11] John P Lewis. Fast template matching. In Vision interface,
volume 95, pages 15{19, 1995.
[12] Meng Xiao He and Helen Yang. Microarray dimension reduction,

2009.

91 | P a g e

You might also like