Saturday, April 9, 2011

Center of the Palm (Hand Tracking)

Until now I was using the center of the cluster as center of the hand (the dark blue dot). But this is not ideal, because if you open and close your hand, the center moves up and down. The same happens if you rotate the hand or if more of the arm becomes visible.


The solution is to find the center of the palm, which is quite stable during rotating, opening and closing the hand (the light green dot). This is done by finding the biggest circle inside the hands contour. The center of this circle is in most cases the center of the palm.


This circle can be found by identifying the point inside the contour that maximizes the distance to the points in the contour line. The line through the center of the cluster and the center of the palm could also be used as hand orientation indicator.

Legend
Blue point: Center of the cluster
Green point: Center of the palm
Red points: Finger tips
White line: Convex hull
Yellow line: Contour
Red line: Distance from the palm point to the contour
Green circle:  Biggest circle that is completely within the contour

22 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Would you mind to share the code to find greatest fitting circle? Update: dennis . guse [at] gmx.net

    ReplyDelete
  3. Hi Dennis

    The code is on CodePlex:
    http://candescentnui.codeplex.com/SourceControl/changeset/view/9489#96713

    Contour are the points on the edge of the hand, candidate points are points within the contour that might be the center. It does not check all points for performance reasons.

    Regards,
    Stefan

    ReplyDelete
  4. hi stefan


    a question, help! as identified candidate sites if I have the boundary points.

    thanks

    ReplyDelete
  5. Points on the contour can't be candidates for the center point of the biggest circle, only points inside the contour.

    Regards
    Stefan

    ReplyDelete
  6. hi stefan,

    a question, candidate sites are selected based on a specific radio within the contour of the hand.

    thanks

    ReplyDelete
  7. hi stefan,

    a question, I am currently taking each point within the outline and verify which of them has the largest radio before touching a point on the contour of the hand.

    I recommend

    thanks

    ReplyDelete
  8. That's about the same what I'm doing. But I only take every x-th point to speed things up.

    1. foreach x-th candidate (point inside the contour, for example only every 4th point)
    2. calculate the smallest distance to any point in the contour
    3. then take the candidate with the largest minimum distance

    ReplyDelete
  9. hi stefan,

    a question, I am currently taking each point within the contour and view which of them has largest radio, before touching a point on the contour of the hand.

    I recommend

    ReplyDelete
  10. hi stefan,

    do not understand what you mean

    1) foreach x-th candidate (point inside the contour, for example home and only 4th point).

    thanks

    ReplyDelete
  11. You repeat step 2 for each point of the hand inside the contour. To speed things up I only use every n-th point (for example every 4th).

    ReplyDelete
  12. Hi, Stefan

    According this article, you use these steps to find the center of palm as below:
    1. foreach x-th candidate
    2. calculate the smallest distance to any point in the contour
    3. then take the candidate with the largest minimum distance

    Question 1: What does "largest minimum" mean?

    Question 2:If there are two points in the contour, one is at little finger, and the others is Thumb. I thought the largest distance will occur in this situation. How do you correctly detect the center of palm?

    Thanks!
    Berry.

    ReplyDelete
  13. Hi Berry

    First: The center of the palm is not used to find the finger points.

    For a candidate point that could be the center of the hand you calculate the distance to all contour points. Of these distances you take the minimum.

    If you do this for all candidate points, you have one distance per candidate point (that is the smallest distance to the contour).

    Now take the candidate with the biggest distance. That's the center.

    Stefan

    ReplyDelete
  14. Hi, Stefan

    I see, but others question is candidate points are equal to contour points? Or just candidate points are the points within the contour?

    So the purpose of palm detection (find the center of palm) is to find the hand when I close my hand. right? If not, what's the purpose of this detection?

    Thanks!
    Berry

    ReplyDelete
  15. Candidate points are never points on the contour itself but all points within the contour. Because of performance reasons only every x-th (configurable) point is used.

    The purpose is to find the center of the palm. This point stays stable if you open and close the hand (the cluster center moves around). So when "grabbing" something by closing the hand, this point can be used.

    I think there's an option to turn off the palm detecion.

    ReplyDelete
  16. Hi, Stefan

    I got a very clear commentary.

    Thank you very much!!

    Berry

    ReplyDelete
  17. Hi stefan, finally I have some free time to work on the center of palm
    following ur concept, I have successfully get it to work
    Thanks alot for that

    see video
    http://youtu.be/niV9VL9APf4

    ReplyDelete
  18. Hi TcBoy

    Looks great!

    Thanks for mentioning me :-)

    - Stefan

    ReplyDelete
  19. Hi Stefan,

    I'm just wondering if you can use the library with ordinary webcams or is it just exclusive for Kinect?

    Thanks,
    Karl

    ReplyDelete
  20. Hi Karl

    It only works with cameras that support depth data (like Microsoft Kinect or Asus Wavi Xtion).

    - Stefan

    ReplyDelete
  21. Hi Stefan, your palm segmentation fingertip detection are very perfect. I am doing the palm segment and convex hull, but the result are not very good. Did you any image processing could your explain and share this part of code.

    ReplyDelete
  22. Hi Han

    All code is published here:
    http://candescentnui.codeplex.com/

    - Stefan

    ReplyDelete