| 63 | //----------------------------------------------------------------------------- |
| 64 | |
| 65 | int stasm_init_ext( // extended version of stasm_init |
| 66 | const char* datadir, // in: directory of face detector files |
| 67 | int trace, // in: 0 normal use, 1 trace to stdout and stasm.log |
| 68 | void* detparams) // in: NULL or face detector parameters |
| 69 | { |
| 70 | int returnval = 1; // assume success |
| 71 | CatchOpenCvErrs(); |
| 72 | try |
| 73 | { |
| 74 | print_g = (trace != 0); |
| 75 | trace_g = (trace != 0); |
| 76 | if (mods_g.empty()) // not yet initialized? |
| 77 | { |
| 78 | if (trace) |
| 79 | { |
| 80 | // Open a log file in the current directory (if possible). |
| 81 | // After the log file is opened, lprintf and stasm_printf |
| 82 | // will print to stasm.log (as well as to stdout). |
| 83 | OpenLogFile(); |
| 84 | } |
| 85 | lprintf("Stasm version %s%s\n", |
| 86 | stasm_VERSION, trace? " Logging to stasm.log": ""); |
| 87 | CV_Assert(datadir && datadir[0] && STRNLEN(datadir, SLEN) < SLEN); |
| 88 | InitMods(mods_g, datadir); // init ASM model(s) |
| 89 | facedet_g.OpenFaceDetector_(datadir, detparams); |
| 90 | OpenEyeMouthDetectors(mods_g, datadir); |
| 91 | } |
| 92 | CheckStasmInit(); |
| 93 | } |
| 94 | catch(...) |
| 95 | { |
| 96 | returnval = 0; // a call was made to Err or a CV_Assert failed |
| 97 | } |
| 98 | UncatchOpenCvErrs(); |
| 99 | return returnval; |
| 100 | } |
| 101 | |
| 102 | int stasm_init( // call once, at bootup (to read models from disk) |
| 103 | const char* datadir, // in: directory of face detector files |
no test coverage detected