How to create Haar Cascade (xml) for tracking hands or fingers with OpenCV?

12,938

This is a really good tutorial about the haar feature detection: http://note.sonots.com/SciSoftware/haartraining.html, you should read it as the method of detecting a face is the same as with any other object.

In short you need a lot of different images, some having the object in them (positives) and some lacking the object (negatives). I believe opencv provides a binary which iterates trough a list of images given and creates an xml for you. Just be sure to give opencv a lot (really, a damn lot) of images to make the algorithm more accurate.

Another way of getting what you want would be to use the watershed algorithm and to mark the hand once manualy. The algorithm should then be able to follow the hand for all continous frames though that shouldn't be very accurate.

Also, using a haar classifier isn't very accurate if it comes to the exact location of the object talking of proportions as it only returns the bounding box of the object and you would have to search for the contours and orientation of the hand yourself.

Hope this helps.

Share:
12,938
user400724
Author by

user400724

Updated on June 04, 2022

Comments

  • user400724
    user400724 almost 2 years

    OpenCV provides us functions that they used to train classifiers for their face detection system, called HaarTraining, so that we can create our own object classifiers using these functions.

    I'm wondering how to create my own "hand classifier" using these features ? Please help.