| 212 | } |
| 213 | |
| 214 | bool NeedMouth( // true if we need the mouth detector for the given mods |
| 215 | const vec_Mod& mods) // in: the ASM model(s) |
| 216 | { |
| 217 | static bool need_mouth = true; // static for efficiency |
| 218 | if (need_mouth && mouth_det_g.empty()) // not yet opened? |
| 219 | { |
| 220 | // we need the eyes if the estart field of any model is ESTART_EYE_AND_MOUTH |
| 221 | need_mouth = false; |
| 222 | for (int imod = 0; imod < NSIZE(mods); imod++) |
| 223 | if (mods[imod]->Estart_() == ESTART_EYE_AND_MOUTH) |
| 224 | { |
| 225 | need_mouth = true; |
| 226 | } |
| 227 | } |
| 228 | return need_mouth; |
| 229 | } |
| 230 | |
| 231 | // Possibly open OpenCV eye detectors and mouth detector. We say "possibly" because |
| 232 | // the eye and mouth detectors will actually only be opened if any model in mods |
no test coverage detected