| 316 | // enough to enclose the _entire_ eye box). |
| 317 | |
| 318 | static Rect EyeInnerRect( |
| 319 | EYAW eyaw, // in |
| 320 | const Rect& facerect) // in |
| 321 | { |
| 322 | Rect rect = facerect; |
| 323 | switch (eyaw) |
| 324 | { |
| 325 | case EYAW00: // frontal model |
| 326 | rect.x += cvRound(.1 * facerect.width); |
| 327 | rect.width = cvRound(.8 * facerect.width); |
| 328 | rect.y += cvRound(.2 * facerect.height); |
| 329 | rect.height = cvRound(.28 * facerect.height); |
| 330 | break; |
| 331 | case EYAW_45: // left facing three-quarter model |
| 332 | rect.x += cvRound(.4 * facerect.width); |
| 333 | rect.width = cvRound(.5 * facerect.width); |
| 334 | rect.y += cvRound(.20 * facerect.height); |
| 335 | rect.height = cvRound(.25 * facerect.height); |
| 336 | break; |
| 337 | case EYAW_22: // left facing three-quarter model |
| 338 | rect.x += cvRound(.1 * facerect.width); |
| 339 | rect.width = cvRound(.8 * facerect.width); |
| 340 | rect.y += cvRound(.20 * facerect.height); |
| 341 | rect.height = cvRound(.25 * facerect.height); |
| 342 | break; |
| 343 | case EYAW22: // right facing three-quarter model |
| 344 | rect.x += cvRound(.1 * facerect.width); |
| 345 | rect.width = cvRound(.8 * facerect.width); |
| 346 | rect.y += cvRound(.20 * facerect.height); |
| 347 | rect.height = cvRound(.25 * facerect.height); |
| 348 | break; |
| 349 | case EYAW45: // right facing three-quarter model |
| 350 | rect.x += cvRound(.1 * facerect.width); |
| 351 | rect.width = cvRound(.5 * facerect.width); |
| 352 | rect.y += cvRound(.20 * facerect.height); |
| 353 | rect.height = cvRound(.25 * facerect.height); |
| 354 | break; |
| 355 | default: |
| 356 | Err("EyeInnerRect: Invalid eyaw %d", eyaw); |
| 357 | break; |
| 358 | } |
| 359 | rect.width = MAX(0, rect.width); |
| 360 | rect.height = MAX(0, rect.height); |
| 361 | return rect; |
| 362 | } |
| 363 | |
| 364 | // Is the horizontal overlap between the LeftEye and RightEye rectangles no |
| 365 | // more than 10% and is the horizontal distance between the edges of the |
no test coverage detected