| 543 | // center of the mouth determined by manual landmarking). Correct that here. |
| 544 | |
| 545 | static int MouthVerticalShift( |
| 546 | const int ileft_best, // in |
| 547 | const int iright_best, // in |
| 548 | const int imouth_best, // in |
| 549 | const vec_Rect& leyes, // in |
| 550 | const vec_Rect& reyes, // in |
| 551 | const vec_Rect& mouths) // in |
| 552 | { |
| 553 | double shift = 0; // assume no shift |
| 554 | if (ileft_best != -1 && iright_best != -1) // got both eyes? |
| 555 | { |
| 556 | CV_Assert(imouth_best != -1); |
| 557 | // get eye mouth distance: first get center of both eyes |
| 558 | const double xleft = leyes[ileft_best].x + leyes[ileft_best].width / 2; |
| 559 | const double yleft = leyes[ileft_best].y + leyes[ileft_best].height / 2; |
| 560 | const double xright = reyes[iright_best].x + reyes[iright_best].width / 2; |
| 561 | const double yright = reyes[iright_best].y + reyes[iright_best].height / 2; |
| 562 | const double eyemouth = |
| 563 | PointDist((xleft + xright) / 2,(yleft + yright) / 2, |
| 564 | mouths[imouth_best].x, mouths[imouth_best].y); |
| 565 | static const double MOUTH_VERT_ADJUST = -0.050; // neg to shift up |
| 566 | shift = MOUTH_VERT_ADJUST * eyemouth; |
| 567 | } |
| 568 | return cvRound(shift); |
| 569 | } |
| 570 | |
| 571 | static bool MouthOnNose( // true if mouth is probably a mouth false detect on the nostrils |
| 572 | const Rect& mouth, // in: left eyes found by eye detector |
no test coverage detected