atduskgreg / opencv-processing

OpenCV for Processing. A creative coding computer vision library based on the official OpenCV Java API
Other
1.32k stars 464 forks source link

Gesture Cascades #94

Closed MrfksIv closed 8 years ago

MrfksIv commented 8 years ago

Hi

Is it possible to add new cascades in the cascade-file folder to track hand gestures? I added an xlm file in that folder named haarcascade_aGest.xml and also created a new static string in the opencv.java file: public final static String CASCADE_GEST = "haarcascade_aGest.xml";

However, when i try to load it in my sketch using opencv.loadCascade(CASCADE_GEST);

I get an error that the global variable CASCADE_GEST does not exist. What am I doing wrong? Is there another way to track hand gestures?

atduskgreg commented 8 years ago

You can load your own cascade much more simply than this. Simply drag the cascade xml file onto your sketch so that processing adds it to your data folder. Then call loadCascade with the path to that xml file. For example:

opencv.loadCascade(dataPath("haarcascade_aGest.xml"));

Now, for this to actually work to track something that xml file has to be a proper haarcascade trained to detect something. Is that what your xml file is?