Hand guesture recognition using openCV

When i was searching in google for openCV’s hand guesture recognition, i found one library which is called HandVu by accident. On its demoes showed on webpage, the functionalities seems indeen powerful, interacting with virtual 3D objects, controlling virtual menu and the most important thing is that it is background independant.

However, i think, openCV’s default functions which are included in its library maybe probably have this abilities. As a result, today i found a openCV function called


-Structure describing a single contour convexity detect

and there is  a illustration picture on the side of the instruction like below:


So, on the positive side, that means once the hand contour is extracted, it is possible to detect what guesture the hand has. And that, would be a big step of object recognition.

Author: Andol Li

A HCI researcher, a digital media lecturer, an information product designer, and a python/php/java coder.

42 Comments On “ Hand guesture recognition using openCV”

  1. Hi!
    First of all congrates for doing such wonderful an motivating works. May be you are so havituated to all those, bu for me you are a rock-star. Presently I am involved in a project of “Controlling Robot Motion by Hand Gesture”, and your suggestions are really proving helpful to me. Keep doing good jobs.

    Deb, India

    • Hello Deb,
      I am also working on “controlling robot movements using hand gestures”.will u pls send me some sample codes about finding convexity defects.i hv found contours..my email id is yogeshkawde@gmail.com
      waiting for ur reply

  2. Hi!
    In hurry I did some spelling mistakes in the reply…Whatever leave it. I want to know; have you done any project for hand gesture matching in OpenCV?

  3. Hi Andol,
    I am a beginner in openCV, what should i learn in openCV to make interactive programs for my projects.

    thank you

  4. hello Ando, if u were to summarise how to do hand gesture recognition, how do u think i should approach it? i am doing a project on that and i know how to find contours, please direct me what to do next.

  5. hi again Ando, i managed to find the hand and draw a box around it thanx to you, now i want to control the mouse by setting its coordinates to say the center of the box. do u have any idea on how to go about it? just to get the x,y coordinates of the mouse and change them. Thank you so much

  6. hello Andol could you please help me on hand detection I did the skin color detection part what can i do next to now the hand

  7. Andol I am doing a fingertip detection (from wbcam) project using opencv , I am trying to use cvConvexHull2 and cvConvexityDefects , but It is not working , can you please get me source code of finger detection . I just badly need it. Please help me.

  8. Andol I am doing a fingertip detection project using opencv , I am trying to use cvConvexHull2 and cvConvexityDefects , but It is not working , can you please get me source code of finger detection . I just badly need it. Please help me.

  9. can anyone tell me how to use haartraining xml file in a code every time i run program using xml file i made it shows command window and then closes immidiately.pls advise me on this

  10. Hy everyone
    I am facing an issue that although it seems to b out of the above discussion but don’t mind as i m a beginner in DIGITAL IMAGE PROCESSING…….
    The issue is that “Whenever i try to install openCV 2.2.0 it asks be where to extract the files instead of initializing the Setup…..”
    Can anybody plz tell me what’s Wrong???????

      • @Khurram
        Hi Khurram, the .exe file extraction is a normal part of installation, through which the installation file unzips rough files into a folder as you specify. In the folder a number of .cmake files can be compiled.

        • Thanks Andol…….
          I’hv got your point and also searched for the solution……….
          But now i m stuck at another point……….
          How to configure Microsoft Visual Studio 2010 for OpenCV????
          In Visual Studio 2010 i couldn’t find the proper Stuff to modify under visual c++ directories category??………….
          like going to tools>options>projects and solutions>visual C++ Directories

          • @Khurram Shehzad
            have you sorted out the vs2010 configuration of openCV2.3.1, if not, I would like to post a tutorial about that topic, for your convenience.


      • @Khurram
        my visual studio is 2008 version, so, I am afraid, no simple answer could be given. But it should be similar as vs 2008 in configuring libraries, head files and other resources.
        Keep moving, Cheers

  11. Hy Andol .

    I want to show convexity defect points of hand on video .
    for that i did some thing like this

    for(int i = 0; itotal ; i++)

    CvPoint* p = (CvPoint *)cvGetSeqElem(defects,i);

    cvCircle(pyImg, cvPoint(p->x , p->y), 20, cvScalar(0,0,0), 2);


    but I got alot of errors at cvCircle .
    Could any one tell me how to show convexity defect points on hand /.
    Please help me thanks

    • @Nitish
      I am afraid I have little experienced in configuring openCV with turbo c. However, to set up openCV libs and header files correctly, there is rich information in opencv wiki, although it may not be exactly what you looking for, but should be inspiring.

Leave a comment
Due to technical adjustments, the comment function is shortly closed and will be re-openning soon. Thanks.

Copyrights 2006-2018 © All rights reserved
Theme Tree2, re-designed by Andol Li, powered by WordPress and Bootsrap
WWW.ANDOL.ME | 浙ICP备15040508号-1
公安备案图标 浙公网安备33010602004018号
Back to top