I have implemented object detection in Android NDK using jni and [stevehavelka's assetbridge](https://bitbucket.org/smh377/assetbridge) where the cascade is loaded as follows:
Ex.
if (cat_face_cascade.empty()){
sprintf( cat_face_cascade_path, "%s/%s", getenv("ASSETDIR"), "lbpcascade_frontalcatface.xml");
/* Load the face cascades */
if( !cat_face_cascade.load(cat_face_cascade_path) ){
LOGE("Error loading cat face cascade");
abort();
};
Full code here:
[Cat-detector-Android-jni](https://github.com/melvincabatuan/CatFaceDetection/blob/master/app/jni/ImageProcessing.cpp)
However, I want to #include the xml cascade as a c/cpp header file to get rid of the parsing (not sure if this will help speed-up the frame rate, but i would like to try it anyway). Is there an OpenCV implementation somewhere similar to this idea?
Ex.
#ifndef CATDETECT_H
#define CATDETECT_H
/* ...
* ...
*/
const int HEIGHT = 24;
const int WIDTH = 24;
// etc.
#endif /* CATDETECT_H */
↧