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:
1. Grayscale color conversion: Face detection only works on grayscale images.
So we should convert the color camera frame to grayscale.
2. 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
value for minFeatureSize in the detector, as explained shortly).
3. Histogram equalization: Face detection is not as reliable in low-light
conditions. So we should perform histogram equalization to improve the
contrast and brightness.