The faces in the image can be found using the cv2.detectMultiScale() function, with the pretrained face cascade classifier. This function accepts the following parameters:
- scaleFactor: This is a parameter that specifies the extent to which the image size is decreased for each image scale and used to create a scale pyramid (for example, a scale factor of 1.2 means reducing the size by 20%). The smaller the scaleFactor parameter, the higher the chance that a matching size is found (for detection, with the model).
- minNeighbors: This is a parameter that specifies the number of neighbors each candidate rectangle needs to keep. This parameter affects the quality of the detected faces—a larger value enables detection with higher ...