Now that we have loaded the classifier (just once during initialization), we can use it to detect faces in each new camera frame. But first, we should do some initial processing of the camera image just for face detection by performing the following steps:
- Grayscale color conversion: Face detection only works on grayscale images. So we should convert the color camera frame to grayscale.
- Shrinking the camera image: The speed of face detection depends on the size of the input image (it is very slow for large images but fast for small images), and yet detection is still fairly reliable, even at low resolutions. So we should shrink the camera image to a more reasonable size (or use a large ...