Project Report On: Hand Gesture Detection and Recognition
Project Report On: Hand Gesture Detection and Recognition
PROJECT REPORT ON
HAND GESTURE DETECTION
AND RECOGNITION
PROJECT DONE BY -
ARNAB DAS
ELECTRONICS AND COMMUNICATION
ENGINEERING DEPARTMENT
JALPAIGURI GOVERNMENT ENGINEERING COLLEGE
3rd YEAR ( 6th SEMESTER)
2016
CONTENT
1. ABSTRACT
2. INTRODUCTION
3. THE PROPOSED METHOD
Global Thresholding
Curvature Algorithm
4. FLOW CHART
5. MATLAB CODE WITH OUTPUT
6. LIMITATIONS
7. CONCLUSION AND FUTURE WORK
8. REFECENCES
9. ACKNOWLEDGEMENTS
1. ABSTRACT
Abstract-In the process of vision-based hand gesture human- computer interaction, to
extract the motion hand gesture accurately and quickly is the premise and key of
improving recognition hand gesture's speed and accuracy .The image is acquired
randomly, and undergoes several processing stages before a meaningful recognition can
be achieved. Some of these stages include skin detection to effectively capture only the
skin region of the hand Skin detections method is used to create a segmented hand image
and to differentiate with the background, Median and smoothing lters are integrated to
remove the noise, application of the morphological operation to get the outline of the
hand, and apply curvature algorithm to determine the finger count. . Experimental results
demonstrate that our system can successfully recognize hand gesture
2. INTRODUCTION
A Motivation Gesture and Gesture recognition terms are heavily encountered in human
computer interaction. Gestures are the motion of the body or physical action form by the
user in order to convey some meaningful information. Gesture recognition is the process
by which gesture made by the user is made known to the system. Through the use of
computer vision or machine eye, there is great emphasis on using hand gesture as a
substitute of new input modality in broad range applications. With the development and
realization of virtual environment, current user-machine interaction tools and methods
including mouse, joystick, keyboard and electronic pen are not sufficient. Hand gesture
has the natural ability to represents ideas and actions very easily, thus using these
different hand shapes, being identified by gesture recognition system and interpreted to
generate corresponding event, has the potential to provide a more natural interface to
the computer system. This type of natural interaction is the core of immers ive virtual
environments. If we ignore the world of computers for a while and consider interaction
among human beings, we can simply realize that we are utilizing a wide range of gestures
in our daily personal communication. By the fact it is also shown that people gesticulate
more when they are talking on telephone and are not able to see each other as in face
to face communication. The gestures vary greatly among cultures and context still are
intimately used in communication. The significant use of gestures in our daily life as a
mode of interaction motivates the use of gestural interface and employs them in wide
range of application through computer vision.
Related Work In some passed decades Gesture recognition becomes very influencing
term. There were many gesture recognition techniques developed for tracking and
recognizing various hand gestures. Each one of them has their pros and cons. The older
one is wired technology, in which users need to tie up themselves with the help of wire
in order to connect or interface with the computer system. In wired technology user
cannot freely move in the room as they connected with the computer system via wire and
limited with the length of wire. Some of the major drawbacks of wearable gloves are the
cost and also the need for sophisticated sensors and hardware. Several different methods
have been proposed for hand gesture recognition using vision systems
( ) (, )
Lets e(x, y) denote the set of coordinates defining a neighborhood centered at (x, y)
in an RGB component vectors in this neighborhood is
1
1
(, ) =
1
[
(, )
( )
(, )
( )
( )
(, )
]
Matlab supports a number of predefined 2-D linear spatial filters, obtained by using
function fspecial. Which generates a filter mask w using the syntax
TYPE
average
disk
gaussian
laplacian
log
motion
prewitt
sobel
unsharp
We use disk type mask for smoothing the image for noise removal and blurring
h = fspecial('disk', radius)
return a circular averaging filter (pillbox) within the square matrix of side
(2*radius+1).
The default radius is 5.
Ex. >> h = fspecial('disk', 4)
The transformation used to convert from RGB to YCbCr color space is shown
in the equation (1):
16
65.481
[ ] = [128 ] + [37.797
128
112
128.553
74.203
93.786
24.996
112 ] [ ] .. [1]
18.214
Some examples of segmentation of hand shape using the skin color algorithm
are shown in the figure bellow
Global Thresholding:
One way to choose a threshold is by visual inspection of the image histogram.
The threshold value T distinguishes the object and the background. Another
method of choosing T is by trial and error, picking different thresholds until
one is found that produces a good result as judged by the observer. This is an
effective environment which follows the following procedure:
1. Select an initial estimate for T. (Generally the mid-point between the
minimum and maximum intensity values in the image.)
2. Segment the image using T. This will produce two groups of pixels: G1,
consisting of all pixels with intensity values >= T, and G2, consisting of pixels
with values < T.
3. Compute the average intensity values u1 and u2 for the pixels in the regions
G1 and G2.
4. Compute a new threshold value:
Where n is the total number of pixels in the image, nq is the number of pixels
that have intensity level rq, and L is the total number of possible intensity
levels in the image. Now suppose that a threshold k is chosen such that Co is
the set of pixels with levels [0, 1, , k-1] and C1 is the set of pixels with levels
[k, k+1, , L-1]. Otsus method chooses the threshold value k that maximizes
the between-class variance, which is defined as
Where
Where
While either set A or B can be thought of as an "image", A is usually considered
as the image and B is called a structuring element. The structuring element is
to mathematical morphology what the convolution kernel is to linear filter
theory.
Let A be an N*M binary image array with background represented by the value
0. The goal of boundary extraction is to find the pixels that are on the boundary
of the image, that is, simple one edge detection procedure. Let, B is a
structural element. Two steps for this boundary extraction procedure are, first
erosion is made between A and B, then next is subtraction of that eroded
image from the original image A as shown in figure below.
Fig: (a) A simple binary image, (b) Boundary Extraction- Result using
mathematical morphological
Curvature Algorithm :
The notion of curvature measures how sharply a curve bends. We would
expect the curvature to be 0 for a straight line, to be very small for curves
which bend very little and to be large for curves which bend sharply. If we
move along curve, we see that the direction of the tangent vector will not
change as long as the curve is at. Its direction will change if the curve bends.
The more the curve bends, the more the direction of the tangent vector will
change. So, it makes sense to study how the tangent vector changes as we
move along a curve.
But because we are only interested in the direction of the tangent vector, not
Its magnitude, we will consider the unit tangent vector. Curvature is defined
as follows:
Let C be a smooth curve with position vector () where s is the arc length
parameter. The curvature of C is defined to be:
is the unit tangent vector, Note the letter used to denote the
Where
curvature is the Greek letter kappa denoted k.
=
4. FLOW CHART :
START
END
e=1;
win=[-1 0;-1 -1;0 -1;1 -1;1 0;1 1;0 1;-1 1];
se=5;
flag=0;
while flag==0
if(se>1)
for i=1:se-1
u=x+win(i,1);
v=y+win(i,2);
if(b3(u,v)==1)
x1=u;
y1=v;
flag=1;
if(i>=1&&i<=4)
se=i+4;
else
se=i+4-8;
end
end
end
end
if((se<8)&&(flag==0))
for i=se+1:8
u=x+win(i,1);
v=y+win(i,2);
if(b3(u,v)==1)
x1=u;
y1=v;
flag=1;
if(i>=1&&i<=4)
se=i+4;
else
se=i+4-8;
end
end
end
end
if(flag==1)
if(x1==r(1,1))&&(y1==r(2,1))
else
e=e+1;
r1(1,e)=x1;
r1(2,e)=y1;
x=x1;
y=y1;
flag=0;
end
end
end
% curvature finding ...
bp=45;
j=1;
for i=1:size(r1,2)-bp
d=sqrt((r1(1,i+bp)-r1(1,i))^2+(r1(2,i+bp)-r1(2,i))^2);
u=0;
for k=1:bp
u=u+sqrt((r1(1,i+k)-r1(1,i))^2+(r1(2,i+k)-r1(2,i))^2);
end
t(j)=u/d;
j=j+1;
end
t1=t>=30;
% finger counting ...
cnt=0;
for i=2:size(t1,2)
if((t1(i)-t1(i-1))==1)
cnt= cnt+1;
end
end
count=(cnt+1)/2;
if(count==0.5)
count=0;
else
count=round(count);
end
% result display ...
imshow(a);
h=msgbox(sprintf('the count is = %d',count));
Outputs :
Output
for
count 1
Output
for
count 2
Output
for
count 3
Output
for
count 4
Output
for
count 5
6. LIMITATIONS :
In our program there are some limitations like if the background is of skin color
then this background pixels also become a part of our object pixels, which is not
desirable.
Another limitation is in the image the hand can not be placed in vertical downward
direction, problem in finger counting will arise.
8. REFERENCES :
1.
2.
3.
4.
9. ACKNOWLEDGEMENTS :
I am thankful to my guides, Manvendra Sir, Palash Sir and Jayashree Maam and my Project Head,
Pradipta Sir for guiding me throughout the project and helping me achieve the desired results as
mentioned in the project. I also thank ITR, DRDO for providing me the opportunity to carry out
the project of my choice.