Saturday, April 10, 2010

Hand isolation in OpenCV

This week I've been working on some hand-detection algorithms in Python and OpenCV. I have come up with a simple and fairly accurate combination of filters that can isolate my skin tone from a range of backgrounds in a range of lighting conditions.

Overhead artificial lighting (click to enlarge).

Natural back-lighting (click to enlarge).

The Python script separates (in real-time) the RGB image from the webcam into Hue, Saturation and Value. The hue is filtered to the red band (which is the base hue of my skin) and the saturation is filtered to discard the bottom 25% (the lower the saturation, the greater the chance of error in the hue calculation). The filtered saturation and hue are then combined with an AND operation to return a highlighting of the hand.


  1. This comment has been removed by a blog administrator.

  2. I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with in valuable information... Regards

  3. Ok, I got that image portion, but how can I get the (x,y) for the detected portion, Can you please help me with that?


    1. Hi Anon :)

      I think what you are looking for is Blob/Contour tracking - I haven't done any but at a quick glance this looks right:

      Good luck!


  4. great research... :D I really love your paper result ^_^
    I research for lighting removal.. but anyway I love your research, because I'm vision programmer. I'm really interesting with your research. ^_^