When I detect some faces in the upper picture(sonicyouth.jpg), one of them is slant .When use harr-like features to detect them.Only 3 faces can be recognized, the female one is omitted.The code as follows:
import cv2
import sys
imagePath = "sonicyouth.jpg"
cascPath = "haarcascade_frontalface_default.xml"
# Create the haar cascade
faceCascade = cv2.CascadeClassifier(cascPath)
# Read the image
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Detect faces in the image
faces = faceCascade.detectMultiScale(
gray,
scaleFactor=1.05,
minNeighbors = 8,
minSize=(30, 30),
# flags = cv2.cv.CV_HAAR_SCALE_IMAGE
flags = cv2.CASCADE_SCALE_IMAGE|cv2.CASCADE_FIND_BIGGEST_OBJECT|cv2.CASCADE_DO_ROUGH_SEARCH
)
print("Found {0} faces!".format(len(faces)))
The result is "Found 3 faces!".How can I perform the detection result?With RCNN or sth. else?Especially to the rotation face.