diff --git a/src/omv/py/py_image.c b/src/omv/py/py_image.c index 3c90a61b4..94417f665 100644 --- a/src/omv/py/py_image.c +++ b/src/omv/py/py_image.c @@ -2127,7 +2127,7 @@ static mp_obj_t py_image_find_features(uint n_args, const mp_obj_t *args, mp_map cascade_t *cascade = py_cascade_cobj(args[1]); cascade->threshold = py_helper_lookup_float(kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 0.5f); - cascade->scale_factor = py_helper_lookup_float(kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_scale), 1.5f); + cascade->scale_factor = py_helper_lookup_float(kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_scale_factor), 1.5f); rectangle_t arg_r; py_helper_lookup_rectangle(kw_args, arg_img, &arg_r); diff --git a/usr/examples/05-Snapshot/snapshot_on_face_detection.py b/usr/examples/05-Snapshot/snapshot_on_face_detection.py index 8ec5ed5fa..e1fefdb11 100644 --- a/usr/examples/05-Snapshot/snapshot_on_face_detection.py +++ b/usr/examples/05-Snapshot/snapshot_on_face_detection.py @@ -39,7 +39,7 @@ while(True): # Threshold can be between 0.0 and 1.0. A higher threshold results in a # higher detection rate with more false positives. The scale value # controls the matching scale allowing you to detect smaller faces. - faces = img.find_features(face_cascade, threshold=0.5, scale=1.5) + faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5) if faces: diff -= 1 diff --git a/usr/examples/06-Video-Recording/gif_on_face_detection.py b/usr/examples/06-Video-Recording/gif_on_face_detection.py index dd2db2a14..5c4ed5b27 100644 --- a/usr/examples/06-Video-Recording/gif_on_face_detection.py +++ b/usr/examples/06-Video-Recording/gif_on_face_detection.py @@ -43,7 +43,7 @@ while(True): # Threshold can be between 0.0 and 1.0. A higher threshold results in a # higher detection rate with more false positives. The scale value # controls the matching scale allowing you to detect smaller faces. - faces = img.find_features(face_cascade, threshold=0.5, scale=1.5) + faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5) if faces: diff -= 1 diff --git a/usr/examples/06-Video-Recording/mjpeg_on_face_detection.py b/usr/examples/06-Video-Recording/mjpeg_on_face_detection.py index 90d295b82..db2ec2480 100644 --- a/usr/examples/06-Video-Recording/mjpeg_on_face_detection.py +++ b/usr/examples/06-Video-Recording/mjpeg_on_face_detection.py @@ -44,7 +44,7 @@ while(True): # Threshold can be between 0.0 and 1.0. A higher threshold results in a # higher detection rate with more false positives. The scale value # controls the matching scale allowing you to detect smaller faces. - faces = img.find_features(face_cascade, threshold=0.5, scale=1.5) + faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5) if faces: diff -= 1 diff --git a/usr/examples/07-Face-Detection/face_detection.py b/usr/examples/07-Face-Detection/face_detection.py index c7962031b..9bc5b485e 100644 --- a/usr/examples/07-Face-Detection/face_detection.py +++ b/usr/examples/07-Face-Detection/face_detection.py @@ -40,7 +40,7 @@ while (True): # Find objects. # Note: Lower scale factor scales-down the image more and detects smaller objects. # Higher threshold results in a higher detection rate, with more false positives. - objects = img.find_features(face_cascade, threshold=0.75, scale=1.35) + objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.35) # Draw objects for r in objects: diff --git a/usr/examples/07-Face-Detection/face_tracking.py b/usr/examples/07-Face-Detection/face_tracking.py index 5b7fb1be4..339feafaf 100644 --- a/usr/examples/07-Face-Detection/face_tracking.py +++ b/usr/examples/07-Face-Detection/face_tracking.py @@ -50,7 +50,7 @@ while (kpts1 == None): img = sensor.snapshot() img.draw_string(0, 0, "Looking for a face...") # Find faces - objects = img.find_features(face_cascade, threshold=0.5, scale=1.5) + objects = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5) if objects: # Expand the ROI by 11 pixels in each direction (half the pattern scale) face = (objects[0][0]-22, objects[0][1]-22,objects[0][2]+22*2, objects[0][3]+22*2) diff --git a/usr/examples/08-Eye-Tracking/face_eye_detection.py b/usr/examples/08-Eye-Tracking/face_eye_detection.py index 45aa5bf3d..13e5ab454 100644 --- a/usr/examples/08-Eye-Tracking/face_eye_detection.py +++ b/usr/examples/08-Eye-Tracking/face_eye_detection.py @@ -33,14 +33,14 @@ while (True): # Find a face ! # Note: Lower scale factor scales-down the image more and detects smaller objects. # Higher threshold results in a higher detection rate, with more false positives. - objects = img.find_features(face_cascade, threshold=0.5, scale=1.5) + objects = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5) # Draw faces for face in objects: img.draw_rectangle(face) # Now find eyes within each face. # Note: Use a higher threshold here (more detections) and lower scale (to find small objects) - eyes = img.find_features(eyes_cascade, threshold=0.5, scale=1.2, roi=face) + eyes = img.find_features(eyes_cascade, threshold=0.5, scale_factor=1.2, roi=face) for e in eyes: img.draw_rectangle(e) diff --git a/usr/examples/08-Eye-Tracking/iris_detection.py b/usr/examples/08-Eye-Tracking/iris_detection.py index 008bcb9c9..81b41e66c 100644 --- a/usr/examples/08-Eye-Tracking/iris_detection.py +++ b/usr/examples/08-Eye-Tracking/iris_detection.py @@ -39,7 +39,7 @@ while (True): # Find eyes ! # Note: Lower scale factor scales-down the image more and detects smaller objects. # Higher threshold results in a higher detection rate, with more false positives. - eyes = img.find_features(eyes_cascade, threshold=0.5, scale=1.5) + eyes = img.find_features(eyes_cascade, threshold=0.5, scale_factor=1.5) # Find iris for e in eyes: diff --git a/usr/examples/09-Feature-Detection/lbp.py b/usr/examples/09-Feature-Detection/lbp.py index 91f97f055..6ec5f1851 100644 --- a/usr/examples/09-Feature-Detection/lbp.py +++ b/usr/examples/09-Feature-Detection/lbp.py @@ -38,7 +38,7 @@ while (True): clock.tick() img = sensor.snapshot() - objects = img.find_features(face_cascade, threshold=0.5, scale=1.25) + objects = img.find_features(face_cascade, threshold=0.5, scale_factor=1.25) if objects: face = objects[0] d1 = img.find_lbp(face)