Tuesday, April 19, 2011

Testing about hand tracking


      In semester A, I made a testing for hand tracking, which is coded with a library "fingerDector" ( source: http://forum.openframeworks.cc/index.php?&topic=1916.0) from Openframeworks forum.
      As the result, my left hand was tracked and drawn by a baby blue line nicely.
      However, its performance was quite unstable and easy to go wrong, by reasons of dark in light and things in surrounding like a hand (but not skin color), noise in background or weak indoor light.So,from the start of semester B, I searched many methods to reduce these issues.

      From the web, theres are many methods to reduce these problem, but they are not easy to understand or used by a beginner like me. 

      It is luckily that, I found there is a class called “ofxGrayImage” from Openframeworks forum, is good for isolating the noise.  In its theory, there is a static image in gray scale compare with a live image that is taken from the camera by converting in gray scale, to analyze the difference between 2 images and produce an image.


      It is very nice in tracking hands, but usually in a less noisy background with no objects move in background. Otherwise, it would move the rectangle in purple and track on the moving redundant objects. But the purpose of  this project is an installation and there must be many people walk in front of camera. So, I need to find another solution for reducing the problems.

In these months, I visited the openframeworks forum and youtube video websites, to find how people can do the hand tracking accurately. In the end of January, I found an excellent video in YouTube website, the link is http://www.youtube.com/watch?v=d_iANcXzV3A&feature=email&email=comment_reply_received , which matches to what I wanted. So I asked him how to track immediately and accurately. The reply was:



     After that, as he mentioned, the noise of hand tracking is always due to the things in background, but they are different color. Also, by reference from the information I found from the web. I tried to test the hand tracking by color tracking in ofxOpenCV library. In addition, I put some variables to enhance the quality of image for hand tracking, which are dilate, blur and erode.
 

From th result of combining two codes, fingerDetector and color image class in ofxOpenCV library, I got the above result. It is totally what I want! 
Finally I applied these hand tracking code into the sound visualization Program, and found it quite accurate but made a little lag of the screen. After some modifications, they works quite well altogether, as you can see the green rectangle for hand tracking stick on the hand.


No comments:

Post a Comment

Please leave any comment to us, thanks!