title: Skin detection from hue-saturation histogram - OpenCV Python
body: <p>I'm working on a little program in python to estimate the direction of pointing gestures with 2D picture from a monocular camera and I'm using OpenCV 2.3.
  I know it's a bit tricky but I'm motivated! :)
  My approach is fisrt to use the face detection to detect an area into which I'm sure there is a lot of skin: </p>
  
  <pre><code>img = cv2.imread("/home/max/recordings/cameras/imageTEST.jpg",1)
  img_hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV)
  hc1 = cv2.CascadeClassifier("/home/max/haarcascade_frontalface_alt.xml")
  faces1 = hc1.detectMultiScale(img)
  for (x,y,w,h) in faces1:
    cv2.rectangle(img, (x,y), (x+w,y+h), 255)
  crop_img = img[y+2:y+w, x+2:x+h]
  </code></pre>
  
  <p>I really want to use this method because I want my detection to be robust to light variation. Then I compute the hue-saturation histogram of the picture of the detected face to make a back projection:</p>
  
  <pre><code>roihist = cv2.calcHist([crop_img],[0,1], None, [180, 256], [0, 180, 0, 256] )
  dst = cv2.calcBackProject([img],[0,1],roihist,[0,180,0,256],1)
  </code></pre>
  
  <p>And finally I would be able to binarize the picture with a threshold and track the head and hands blobs to estimate the direction of pointing.
  I've no problem with my code but the skin is not detected...
  What am I doing wrong?
  Thx for your help!</p>
  
  <p>Max</p>