Fingertips Detection Using Kinect


Full Post on my New Blog

In my previous post, I have shown how to use Kinect with OpenCV using Freenect library. I and Siddharth have been working on Kinect for gesture recognition and so far we are able to detect fingertips using contours and hull.

First thing that you would want to do is segment out hands in the frame. Siddharth has worked out a depth based adaptive threshold algorithm which enables us to segment out the object which is a bit ahead of the whole body. The algorithm works on depth of the object and segments out object based on its relative depth from other objects. So here’s how he has done it.

Thresholding:

# get Maximum and Minimum depth
double min_intensity, max_intensity;
minMaxLoc(img_depth, &min_intensity, &max_intensity);
 
int i, j, k, sum = 0, count = 0;
 
for(i = 0; i < 480; i++)
{
    for(j = 0 ; j < 640; j++)
    {
        if(img_depth.at<uchar>(i, j) < 180)
        {
            sum += img_depth.at<uchar>(i, j);
            count++;
        }
    }
}
 
int range = 15;
 
if(count)
{   
    range = 190 - sum/count;
}
 
Mat img_thresh;
threshold(img_depth, img_thresh, min_intensity + range, 255, THRESH_BINARY_INV);
medianBlur(img_thresh, img_thresh, 5);
Thresholdin hands

Thresholdin hands

Read More

Advertisements

3 thoughts on “Fingertips Detection Using Kinect

  1. Hello brother, Im taking help from ur tutorial.I got a problem. I wants to run simplecv and opencv simultaneously. Like i detect red object using opencv code and green using simplecv. Is it possible. If possible how.Plz help me

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s