Hand Detection Using OpenCV

I am using the OpenCV library for an image processing project for hand detection. I initialized the image in iplimage , colored it, and then converted it to HSV using cvCvtColor(imageHand,imageHand,CV_BGR2HSV ); I do not know an effective algorithm to my problem. Check out my code:

 for( int row = 0; row < imageHand->height; row++ ) { for ( int col = 0; col < imageHand->width; col++ ) { h =(imageHand->imageData[imageHand->widthStep * row + col * 3]) ; s = (imageHand->imageData[imageHand->widthStep * row + col * 3 + 1]); v = (imageHand->imageData[imageHand->widthStep * row + col * 3 + 2]); if( h>85) { imageHand->imageData[imageHand->widthStep * row + col * 3 ] = 0 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 1 ] =0 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 2 ] = 0 ; } else { imageHand->imageData[imageHand->widthStep * row + col * 3 ] = 255 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 1 ] = 255 ; imageHand->imageData[imageHand->widthStep * row + col * 3 + 2 ] = 255 ; } } } 

I think the search range h is > 85 !? If you know a better algorithm than be guided by me.

+8
c ++ image-processing opencv computer-vision
source share
2 answers

If you look at this site, hand detection using opencv , you will find a similar algorithm in what you use. I would say that the easiest way to detect hands is to use color (that is, detect skin). I definitely recommend taking a look at the algorithm provided by this site first. There's another part that also goes into gesture recognition if this is a possible problem that you will have to handle.

Other features include:

  • Subtraction Background
    • It is very simple and easy to break, especially if you plan to change the background. But, if you expect to use it only in front of a white wall, say, a white wall ... this can be an easy way around this.
  • Shape analysis
    • Some success has been achieved with the detection of fingertips using the Generalized Hough transform. However, false positives can be a problem, but efficiency is a concern, especially in situations with a significant amount of background.
+6
source share

as Ancallan mentioned hand detection using opencv above, I would like to add more information on the topic of gesture detection. In this article, the author used a method of segmentation of skin color, which under certain circumstances received good results.

updated new manual gesture detection entry using openCV, in which the author used the HAAR classifier to detect a closed hand and the results are much more reliable than the first ones. but you need to indicate that the detection objects are somehow limited, since one classifier works for only one gesture.

+2
source share

All Articles