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:
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 */
in past, i have coded an experimental utility to convert xml cascade to a header file (for old cascades like haarcascade_frontalface_alt.xml). i can publish it if needed. but it don't help to speed up object detection
you can read an xml cascade from memory:
but that won't give you much speedup, there's still xml to be parsed.
@sturkmen thank you for your insight.
@berak thanks, i will try it later.