From b5a95a1456043e9f14c10ea7dc192545bcf28027 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Tue, 9 May 2023 14:45:53 +0530 Subject: face_capture_dataset: Adding comments for detectMultiScale --- face-detection/01_face_capture_dataset.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/face-detection/01_face_capture_dataset.py b/face-detection/01_face_capture_dataset.py index d7ac82c..a56a274 100644 --- a/face-detection/01_face_capture_dataset.py +++ b/face-detection/01_face_capture_dataset.py @@ -25,7 +25,6 @@ cam.preview_configuration.align() cam.configure("preview") cam.start() -# Initialize individual sampling face count while True: # Capture a frame from the camera frame=cam.capture_array() @@ -35,7 +34,12 @@ while True: #Convert fram from BGR to grayscale frameGray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) #Create a DS faces- array with 4 elements- x,y coordinates top-left corner), width and height - faces = face_detector.detectMultiScale(frameGray, 1.3, 5) # 3 parameters- frame,scale-factor, + faces = face_detector.detectMultiScale( + frameGray, # The grayscale frame to detect + scaleFactor=1.1,# how much the image size is reduced at each image scale-10% reduction + minNeighbors=5, # how many neighbors each candidate rectangle should have to retain it + minSize=(30, 30)# Minimum possible object size. Objects smaller than this size are ignored. + ) for (x,y,w,h) in faces: #create a bounding box across the detected face cv2.rectangle(frame, (x,y), (x+w,y+h), (255,0,0), 3) #tuple -- cgit v1.2.3