| 304 | } |
| 305 | |
| 306 | static Shape EstartEyes( |
| 307 | const DetectorParameter& detpar_roi, // in: detpar wrt the ROI |
| 308 | const Image& face_roi, // in |
| 309 | const Shape& meanshape) // in |
| 310 | { |
| 311 | Shape startshape; |
| 312 | Shape meanshape1(meanshape); |
| 313 | if (Valid(detpar_roi.lex) && Valid(detpar_roi.rex)) // both eyes available? |
| 314 | { |
| 315 | FlipIfLeftFacing(meanshape1, detpar_roi.eyaw, face_roi.cols); |
| 316 | // TODO Tune the following code, what approach is best? |
| 317 | if (detpar_roi.eyaw == EYAW00) |
| 318 | startshape = AlignMeanShapeToBothEyesEstMouth(detpar_roi, meanshape1); |
| 319 | else |
| 320 | startshape = AlignMeanShapeToBothEyesNoMouth(detpar_roi, meanshape1); |
| 321 | FlipIfLeftFacing(startshape, detpar_roi.eyaw, face_roi.cols); |
| 322 | } |
| 323 | else // at least one eye is missing, use the face det rectangle |
| 324 | { |
| 325 | startshape = |
| 326 | AlignMeanShapeToFaceDet(detpar_roi, meanshape1, |
| 327 | FACERECT_SCALE_WHEN_NO_EYES, face_roi); |
| 328 | } |
| 329 | return startshape; |
| 330 | } |
| 331 | |
| 332 | static Shape EstartEyeMouth( |
| 333 | const DetectorParameter& detpar_roi, // in: detpar wrt the ROI |
no test coverage detected