开发者

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

OpenCV provides us functions that they used to train classifiers开发者_如何学JAVA 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜