| 107 | } |
| 108 | |
| 109 | int stasm_open_image_ext( // extended version of stasm_open_image |
| 110 | const char* image, // in: gray image data, top left corner at 0,0 |
| 111 | int width, // in: image width |
| 112 | int height, // in: image height |
| 113 | const char* imgpath, // in: image path, used only for err msgs and debug |
| 114 | int multiface, // in: 0=return only one face, 1=allow multiple faces |
| 115 | int minwidth, // in: min face width as percentage of img width |
| 116 | void* user) // in: NULL or pointer to user abort func |
| 117 | { |
| 118 | int returnval = 1; // assume success |
| 119 | CatchOpenCvErrs(); |
| 120 | try |
| 121 | { |
| 122 | CV_Assert(imgpath && STRNLEN(imgpath, SLEN) < SLEN); |
| 123 | CV_Assert(multiface == 0 || multiface == 1); |
| 124 | CV_Assert(minwidth >= 1 && minwidth <= 100); |
| 125 | |
| 126 | CheckStasmInit(); |
| 127 | |
| 128 | img_g = Image(height, width,(unsigned char*)image); |
| 129 | |
| 130 | #if TRACE_IMAGES |
| 131 | strcpy(imgpath_g, imgpath); // save the image path (for naming debug images) |
| 132 | #endif |
| 133 | // call the face detector to detect the face rectangle(s) |
| 134 | facedet_g.DetectFaces_(img_g, imgpath, multiface == 1, minwidth, user); |
| 135 | } |
| 136 | catch(...) |
| 137 | { |
| 138 | returnval = 0; // a call was made to Err or a CV_Assert failed |
| 139 | } |
| 140 | UncatchOpenCvErrs(); |
| 141 | return returnval; |
| 142 | } |
| 143 | |
| 144 | int stasm_open_image( // call once per image, detect faces |
| 145 | const char* image, // in: gray image data, top left corner at 0,0 |
no test coverage detected