Friday, September 3rd, 2010, 1021 days ago
A method of detecting and recognising hand gestures using openCV
This post is about to introduce an efficient method of detecting and recognising hand gestures using the convexity detection of openCV, as illustrated in the picture on the left. In contrast to the previous work of detecting hand contours, this method steps further to recognise gestures of hand pretty accurately, meanwhile this shows possibilities of extend such work into using simple hand gestures to manipulate computer applications.
For more details, here is a relevant tutorial video made by original author who explains who this works.
Here gives the source code of this video demonstration.
All copyrights relevant to source codes and method explanations are reserved by the original author Luca Del Tongo, please refer to his blog for more details and any enquiries.You can download the full code at:
1) Full Demo Solution (Code + video 43Mb)
http://db.tt/MukGcwB
2) Full Demo Code
http://db.tt/GkT6J9k
POSTS MAY BE OF INTEREST
Release of HAAR classifier trained for...
A method of detecting and recognising ...
First trial of classifier training – t...
Hand gesture detection and recognition...
The colour range for HSV skin extraction
A failed example of hand gesture recog...
Writing a simple hand gesture picture ...
Needed!!! High quality positive/negati...
Using hand gestures to control mouse p...
The first set of images captured from ...
Hand gesture recognition using Adaboos...
Detecting hand gestures using Haarcasc...
is it necessary to use Artificial Intelligence to recognize the hand gesture ??
@Amir AI is not required to recognise the hand gestures since the recognition work mostly relies on computer vision like image analysis, in another words, computer vision is a necessary part for machines’ artificial intelligence because these devices need to recognise what they have seem.
can you please the provide any demo code for opencv 2.1 usig microsoft visual studio 2008 professional. i am just learning this if possible can you provide me some links to read about gesture recogition
@swaroop a reference of openCV with VS2008 can be found here http://www.andol.info/quote/1497.htm. About hand gesture recognition codes and examples, this post has provide relevant source codes, which only need miner modifications to run in VS2008.
hi again
thanks a load for the reply
plz can u give some links to read about hand gesture recognition especially with wearing any sort of markers on palm
Recognising hand gesture with wearing some marks would not be in the same categories as recognising natural hand gestures. Marker detection and recognition may help more, rather than natural hand gestures.
Is it need to install vs2010 to open it? Thank you. And would you mind to tell me how to use the hand detection in OpenCV?
@John VS2010 is an option, also it can be VS 2008 or Eclipse. To use the hand gesture recognition with openCV, firstly installing the openCV and including relevant libraries, of course. Secondly checking the algorithms used in the example of this post, and then use similar functions to done similar work. Actually the key function of this demonstration is the function called ‘CvConvexityDefect’, which can be referred here http://www.andol.info/hci/797.htm
Hi, Andol, thank you for your reply. I want to also start to doing the gesture recognition project, and I only know how to using the C++.
Would you mind to tell me why you used the C# to implement the project, why not using C or C++? Thank you.
@John As you have noticed the library used in the demonstration video, the author uses Emgu CV, which comes with better compatibility. Surely you can use C++ instead of C#, more information you can refer the author’s website here.
@Everybody
I have uploaded a VS2008 version of my Hand Gesture Recognition c# code.
You can find it here:
http://db.tt/ZAALlUH
Everyone who will use c++, won’t find any problem translating my code to opencv, the function i have used are based on opencv ones.
HTH, Luca
hello Luca,
Thank you very much for sharing your code
I’m working with opencv with C++ on VS2008,
i tried to cnovert the code from c# to, c++ but i find that difficult.
can you help me please
thanks
hey Luca,
I am trying to access http://db.tt/ZAALlUH link but it is not allowing me to do so.
can u plz help ?
Hey Luca and Andol,
When I am trying to execute your code the contour line of palm is not stable …it is coming very jittery…could u help me in this matter ? Thanks.
@Maddy
the contour detection may not stable, i guess.
hi Luca,
i am not able to run your code in my visual studio. i am actually not from programming background but for my project i need your code. Please help me. Please mail me necessary steps and error correction steps if their any.
My mail id:-
mandeepsingh09@outlook.com
hello, i want a full documentation on the opencv library, especially for edge detection and extraction of landmarks for example a hand in 2D, thank you
Please check the post above, carfully
I would like to exchange links with your site http://www.andol.info
Is this possible?
it is
hey i m trying to run the program in visual studio 2008 visual c++ directories but there are lot of errors. can you please provide the source code for the hand gesture recognition in.cpp
i hope i am not bothering you
Hi, Swaroop, please refer this ‘http://blogs.ugidotnet.org/wetblog’ and contact the author for further help since the source codes were developed by him.
Do you know of any hand and gesture recognition methods written in c++? I do not use visual studio and I do not know c#.
Actually the functions in the project above are the same as used in C++.
hey i wanna send data to my avr microcontroller from the visual studio whats the procedure
say i detect a gesture and i wanna control a motor through microcontroller so how do i send the data
This is beyond my research experiences, but you can google relevant posts about using visual studio to control a motor. Here is one of these references:
The only means of communication between the Arduino and the PC is the serial port.
The PC can write data to the serial port. The Arduino can read from the serial port.
Given that a means of communication exists, the only difficulty you will have will be choosing which language to use to write the application that runs on the PC.
Visual Studio is a programming environment, not a programming language. You can use it to write applications in Visual Basic, C, C++, C#, Java, etc. Each language will have it’s own mechanism for interfacing with the serial port.
Dear Andol,
How to detect the hands, whether could we threshold the image, over differentiating the color with the Hand and other surrounding,… Whether could color alone be sufficient to detect the Hand…?
yes, threshold then following differentiating colours is a possible way, but detecting hands by colours is not so robust as expected, because the backgrounds are never known what they will be.
Dear Andol,
Can U pls help me with the Hand detection…? we are working with some colors painted in our hand..?How to that normally and exactly without any colors…? Are would U suggest that painting the color will be a good process…?
It is easier to detect hands with colours painted, while comparing with natural hands. Colours suppose to highlight the hand contours and make image extraction efficient. About detecting natural hands, these posts may help:
http://www.andol.info/hci/1116.htm
http://www.andol.info/hci/905.htm
http://www.andol.info/hci/1661.htm
hey hi again,
can you suggest me how to implement openCV related codes in Microsoft robotics developer studio
Hi Swaroop, sorry for that i have not done any project relevant to robotics developer studio, therefore my only suggestion is to refer the way of using openCV within visual studio.
You can try to use this robotics studio services that encapsulates emgucv functions.
http://rdscv.codeplex.com/
HTH,
Luca
ye,Luca can help a lot
Dear Andol,
Can U pls help me with the Background substraction using OpenCV, whether it is possible to do that. If so can U pls guide me in doing that…?
Hi Ponraju, what you talked about is possible, to extract the background from dynamic images it is available to use functions relating to threshold, smooth, houghlines and houghcircles. Specific details of these functions can be found through openCV manuals.
I am newbie to OpenCV and I have been really interested in computer vision after seeing some amazing hacks on the internet for the kinect. I plan to do some of the stuff you have mentioned in this article and just want to thank you for taking the time to post this article.
Cheers mate
Hi Andol,
Thank for your great video
I am trying to run the code you posted, but i am have this run time error:
Unable to create capture from .\..\..\..\M2U00253.MPG
I got it,the video was missing.
I have another question, what should i do to run the program itself so it captures from the cam not from your video?
Thank you!
@Soofta Thought these functions in openCV might help:
CvCapture* cvCreateFileCapture( const char* filename );
CvCapture* cvCreateCameraCapture( int index );
void cvReleaseCapture( CvCapture** capture );
Dear ANDOL,
Could you say please basically say how to match two images? in fact how to compare two images and say that they are same or different?
@Ponraju My thoughts are, if you can extract some key points from two images, them compare these key points, the differences between these two images can be told.
Dear ANDOL,
What U think that would be a primary problem that is unsolved in the field of image processing? Could you suggest some?
@Ponraju I think, the primary problem of computer vision, of course i guess, that is to make the computer to understand the visions captured through the camera or similar devices.
Ya that could be more general? But could you be specific please? So that solving them in near future make a big difference?
Hey. We’re a group of 3 and are planning to do a project on hand gesture recognition. We’re final year Computer Science engineering students. Project duration is about 3 months or lesser. Completely unaware of OpenCV and OpenGl.
What would you suggest we do?
hi andol and luca.. can i have the copy of your source code for
finger detection as well as palm detection? thanks!