1

I'm trying to make a hand detection program by using OpenCV and Haar cascade. It works quite well but it's very jerky. So I'm asking myself if this is a trouble of the haar file that would be too 'cheap' or if there's a way to refine the detection by using contours or feature detection (or may be some other techniques).

What I would like to perform would be the same as this face detection, but for hands : Face Detection (see FaceOSC)

Thanks a lot.

EDIT : here is the kind of stuff I would like to do : Hand extraction It seems that he performs it with contour detection, but how to find the hand ?

Ilmari Karonen
  • 49,047
  • 9
  • 93
  • 153
Benoît Lahoz
  • 1,270
  • 1
  • 18
  • 43
  • What do you mean by "jerky"? Does that mean that the frame rate at which you can detect hands is low, or that the detected hand position jumps around from one frame to the next? I can tell you that you're going to have to do something much more complicated than just using the Haar cascade if you want to achieve something like that face detection. – UIAdam Jan 20 '12 at 09:25
  • Check out this [SO](http://stackoverflow.com/questions/8593091/robust-hand-detection-via-computer-vision). Your aim seem to be little complicated. [Here](http://www.google.co.in/url?sa=t&rct=j&q=active%20appearance%20model%20revisited&source=web&cd=1&sqi=2&ved=0CCQQFjAA&url=http%3A%2F%2Fwww.cs.cmu.edu%2F~efros%2Fcourses%2FAP06%2FPapers%2Fmatthews_ijcv_2004.pdf&ei=czUZT4OxNImyrAfkqeHHDQ&usg=AFQjCNGDfAVPYR-FOIhEfHpsWhUetNjMXA) is the paper used for the video, you refer to. Check it out. – Abid Rahman K Jan 20 '12 at 09:33
  • @Adam W Thanks ! It is "jerky" : the program detects hands sometimes only 1 frame on 2. I'm trying to implement tracking so it would keep a trace of the previously detected hand but I don't have really good results. – Benoît Lahoz Jan 20 '12 at 14:56
  • @arkiaz Thanks, I'll read this paper. – Benoît Lahoz Jan 20 '12 at 14:57

2 Answers2

3

The Hand Extraction video, you gave the link, is based on skin color detection and convex hull finding.

1) Change image to YCrCb (or HSV).

2) Threshold the image so that hand becomes white and everything other to black.

3) Remove noise

4) Find center of hand (if you like).

5) Use convex hull to find sharpest points which will be finger tips.

You can get full details from this paper.

Anyway, no need of haar cascades.

Abid Rahman K
  • 51,886
  • 31
  • 146
  • 157
  • Thanks so much ! I didn't think about changing the colorspace to HSV. It's a really useful tip. But... your point 4 is kind of problematic for me : how can I find the center of the hand ? By detecting convexity defects ? Another thing : on the video there's a computer screen on the left. How did he threshold his pic without keeping it on the image ? – Benoît Lahoz Jan 20 '12 at 15:00
  • Finding center is explained in that paper.Read that.
    What is the problem if there is a computer screen? When you threshold image, you take only those which has color of your hand,all other got blackened.
    – Abid Rahman K Jan 20 '12 at 16:31
  • Sorry, but there's no link in your comment. – Benoît Lahoz Jan 20 '12 at 17:51
  • The link for the paper in my answer. OK. no problem. [Try here also](http://www.google.co.in/url?sa=t&rct=j&q=palm%20position%20tracking%20using%20convex%20hull%20finding&source=web&cd=4&ved=0CDQQFjAD&url=http://www.cs.brown.edu/research/pubs/theses/masters/2010/park.pdf&ei=yDgZT_vJFYbxrQeggaHFDQ&usg=AFQjCNFbZGKCxYE48ACTrbL41CvWxzycXA) – Abid Rahman K Jan 20 '12 at 17:56
0

obviously if the HAAR classifier-based detection results become so-called 'jerky', in my opinion which means the detection is not stable and jumps around the detecting image, then the problem is on the quality of classifier.

as far as there are enough positive/negative samples, lets say 5k/5k, the results should be quite robust already. Based on my experiences, I used 700 positive hand gesture samples and 1200 negative samples, and the results seemed satisfied to some extent. but after I used another group of 8000 positive samples and 10200 negative samples with different features included, the results were even worse than the former.

So, I would suggest you to carefully reset your training samples, such like the ratio, content features and colours.

Andol Li
  • 211
  • 2
  • 6