Commit ea20e14b authored by tihmels's avatar tihmels

MultiScaleFactor verändert

parent 9870a0ec
......@@ -10,21 +10,25 @@ emotions = ["neutral", "anger", "disgust", "happy", "surprise"] # Define emotio
def detect_faces(emotion):
files = glob.glob('Basis_data/sorted_set/%s/*' % emotion) # Get list of all images with emotion
files = glob.glob('Basis_data/sorted_set/%s/*w' % emotion) # Get list of all images with emotion
filenumber = 0
for f in files:
frame = cv2.imread(f) # Open image
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Convert image to grayscale
scaleFactor = 1.05
minNeighbors = 10
minSize = (20, 20)
# Detect face using 4 different classifiers
face = faceDet.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=10, minSize=(5, 5),
face = faceDet.detectMultiScale(gray, scaleFactor, minNeighbors, minSize,
flags=cv2.CASCADE_SCALE_IMAGE)
face_two = faceDet_two.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=10, minSize=(5, 5),
face_two = faceDet_two.detectMultiScale(gray, scaleFactor, minNeighbors, minSize,
flags=cv2.CASCADE_SCALE_IMAGE)
face_three = faceDet_three.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=10, minSize=(5, 5),
face_three = faceDet_three.detectMultiScale(gray, scaleFactor, minNeighbors, minSize,
flags=cv2.CASCADE_SCALE_IMAGE)
face_four = faceDet_four.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=10, minSize=(5, 5),
face_four = faceDet_four.detectMultiScale(gray, scaleFactor, minNeighbors, minSize,
flags=cv2.CASCADE_SCALE_IMAGE)
# Go over detected faces, stop at first detected face, return empty if no face.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment