1

We (my group and I) want to be able to track a hand (well the index fingertip mostly). The hand is basically the same colour as the face in the picture, but as you can see, so is a lot of the noise we get. It works very well with a black "screen" behind the hand.

Now the problem is that Adaptive thresholding is useful only on Grayscale images, and as such would not detect the hand very well.

I've tried googling HSV Adaptive Thresholding but no luck, so I figured stackoverflow had some great ideas.

EDIT: The current HSV -> Binary threshold:

inRange(hsvx, Scalar(0, 50, 0), Scalar(20, 150, 255), bina);

Image here

  • Split the HSV Image into separate channels.!! create a trackbar for each of the channels.!!You can vary the values in the trackbar and assign the values to the inRange to filter the pixel values. – Dr. Mallikarjun Anandhalli Nov 03 '15 at 14:29

2 Answers2

1

I suggest you use a color histogramming for your tracking. Camshift is doing it for example to good success.

There is camshift sample code in OpenCV. See http://docs.opencv.org/master/db/df8/tutorial_py_meanshift.html (very brief explanation) or https://github.com/Itseez/opencv/blob/master/samples/cpp/camshiftdemo.cpp (code sample)

If you want to go with your thresholding, you are already proper about not thresholding the V channel. I would still suggest to do separate adaptive thresholding on H and S.

ypnos
  • 50,202
  • 14
  • 95
  • 141
1

I would suggest you using a histogram backprojection algorithm.

Back Projection is a way of recording how well the pixels of a given image fit the distribution of pixels in a histogram model. You can specify the histogram model by using manually selected set of hand-pixels. This algorithm outputs an image where each pixel has the value of likelihood the color of this pixel is a color of the skin (is similar to the skin). You can then specify a likelihood threshold to adjust the performance.

It will let you find the skin-colured areas in the image.

For details see:

MaciekS
  • 401
  • 8
  • 18