Ask Your Question

Revision history [back]

Is there a 'c/cpp header file' alternative to OpenCV XML/YAML file storages for Real-time Object Detection in Embedded Systems, or Android NDK, etc.

I have implemented object detection in Android NDK using jni and stevehavelka's 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

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 */