| 374 | } |
| 375 | |
| 376 | static bool VerticalOverlap( // do the two eye rectangles overlap vertically? |
| 377 | const Rect& left, // in |
| 378 | const Rect& right) // in |
| 379 | { |
| 380 | const int topleft = left.y + left.height; |
| 381 | const int topright = right.y + right.height; |
| 382 | |
| 383 | return (left.y >= right.y && left.y <= right.y + right.height) || |
| 384 | (topleft >= right.y && topleft <= right.y + right.height) || |
| 385 | (right.y >= left.y && right.y <= left.y + left.height) || |
| 386 | (topright >= left.y && topright <= left.y + left.height); |
| 387 | } |
| 388 | |
| 389 | // Return the indices of the best left and right eye in the list of eyes. |
| 390 | // returned by the feature detectors. |