Wednesday, June 1, 2011

Fingertip Detection

I have done that.
Now I am able to recognize fingertips. The program needs some modifications
and corrections, but it works :))



  1. Pretty cool. Will you be sharing the source code?

  2. Yes, I`ll publish it.
    I am clearing now code from unnecessary things and adding some comments. I think I`ll publish it in my next post.


  3. could you please just give a brief explanation how you track the finger? What method do you use?

  4. You can find the source code of project in

    The process of fingertip detection is the following :
    1. Cropping part of the image, which interested me : (by (X,Y) and by Z)
    2. Finding the contours of the hand
    3. Finding points of the contour, which belongs to fingertip.


  5. Vahaf,
    Thank you very much.
    I am not familiar with openCV so it is quite hard for me to read the code.
    After you find the points of the contour, which belongs to figertip, how do you track those points in the consequence frame? and how Z is use?

  6. As you know OpenNI gives you one point of your hand. Using Z coordinate I filter background and foreground of my hand and give my hand one color. So pixels of image are 0 or 250(you can write anything).
    In this task I only need to find the fingertips. So I run my algorithm for every frame (30 times in each second). Tracking is done in this way.
    I am not saving any old frames, or poses of my hand.


    P.S This is for first version only :))

  7. Do you have to do Kinect calibration before tracking hand?

  8. No, no calibration have been done before hand tracking.


  9. Hi,
    thats very nice, as you code you given link i used for X-pro Asus i am able to see my finger tips but after some time my application hanged all the time and show error index is out of bound at line if (rgb[new Point(p.X + i, p.Y + j)].Green < 80)
    this line you have defined in DepthImageAnalyser.CS can you please how can i remove this error in my application..


  10. Hello Yogendra,
    I didn`t test the program on a Asus Xtion Pro. I think the problem is with a depth image resolution. Please check the resolution of the captured depth image. The easiest solution is to put if block in a try catch block. It must help.


  11. hi Vahag,

    Thanks to reply me now i am able to finger detection using code and now my application is not going to crash and hang,Thanks a lot to provide your code,please now i am implementing mouse using this code but if you have any idea how could i get the palm center point please can give me any idea to find palm center my id is