Just value your mind

A method of detecting and recognising hand gestures using openCV

hand gesture recognition using convexityThis 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.

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

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.





QR code for this post, SCAN ME
QR:  A method of detecting and recognising hand gestures using openCV

Posts may be of your interests

178 Comments On “ A method of detecting and recognising hand gestures using openCV”

  1. amir says:

    is it necessary to use Artificial Intelligence to recognize the hand gesture ??

    • Andol says:

      @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.

  2. swaroop says:

    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

    • Andol says:

      @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.

      • swaroop says:

        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

        • Andol says:

          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.

  3. John Jin says:

    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?

    • Andol says:

      @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

  4. John Jin says:

    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.

    • Andol says:

      @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.

  5. @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

  6. spirit says:

    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

  7. holera says:

    I would like to exchange links with your site http://www.andol.info
    Is this possible?

  8. swaroop says:

    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

    • Andol says:

      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.

  9. Kevin C. says:

    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#.

  10. swaroop says:

    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

    • Andol says:

      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.

  11. S.Ganesh Ponraju says:

    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…?

    • Andol says:

      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.

  12. S.Ganesh Ponraju says:

    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…?

  13. swaroop says:

    hey hi again,
    can you suggest me how to implement openCV related codes in Microsoft robotics developer studio

  14. 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…?

    • Andol says:

      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.

  15. Nimesh says:

    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.

  16. Soofta says:

    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

    • Soofta says:

      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!

      • Andol says:

        @Soofta Thought these functions in openCV might help:
        CvCapture* cvCreateFileCapture( const char* filename );
        CvCapture* cvCreateCameraCapture( int index );
        void cvReleaseCapture( CvCapture** capture );

        • rajiv pai says:

          dear andol,
          I did not get the way you explained the way to use the web cam feed directly instead of the video can you please explain that in detail

  17. S.Ganesh Ponraju says:

    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?

    • Andol says:

      @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.

  18. S.Ganesh Ponraju says:

    Dear ANDOL,
    What U think that would be a primary problem that is unsolved in the field of image processing? Could you suggest some?

    • Andol says:

      @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.

      • S.Ganesh Ponraju says:

        Ya that could be more general? But could you be specific please? So that solving them in near future make a big difference?

  19. Indu, Rahul, Uthara says:

    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?

  20. toni says:

    hi andol and luca.. can i have the copy of your source code for
    finger detection as well as palm detection? thanks!

1 2 3 5
Leave a comment

You can use these XHTML tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyrights 2006-2014 © Andol Li | Theme Tree2, re-designed by Andol Li| Powered by WordPress
WWW.ANDOL.INFO- 80 queries in 0.845 seconds. Go to TOP