# Hand segmentation - hand gesture recognition

Hi guys :) I am working on real-time hand gesture recognition system. The hirst step on the way to hand gesture recognition is the hand segmentation. I've tried already various methods. Inter alia I used already BackgroundSubtractorMOG2 - it doesn't work well, then I tried HSV tresholding and it works also quite bad, so I've written my own background subtraction method. It looks like that:

Mat HandDetect::diffBackground(Mat & frame)
{
cout << "diffBackground" << endl;
Mat tempBg;
Mat tempFrame;
Mat frame1;

transform2Gray(frame, frame1);
cout << "diffBackground01" << endl;
BG = frame1 * ALPHA + BG * (1 - ALPHA);

cout << "convertTo" << endl;
frame1.convertTo(tempFrame, CV_8U);
cout << "convertTo1" << endl;
BG.convertTo(tempBg, CV_8U);

................
}


It looks like that and works quite fine. First of all, I take a photo on the background, creating so called background model, then I subtract the frame from the background model and I threshold the result. Everything works fine, under one condition, namely if there is a lot light then some noises are created.

As you can see, aroung the mask of the hand there are some noises caused by the light. Are you able to recommend me some method allowing to remove the noise.

edit retag close merge delete

Sort by » oldest newest most voted

Instead of simple thresholding, try an adaptive threshold. You also may want to do an edge detection ( with or without background subtraction ).

more

Official site

GitHub

Wiki

Documentation