Use scale_factor instead of scale in find_features

* Updated all scripts.
This commit is contained in:
iabdalkader 2017-01-08 18:23:25 +02:00
parent 861627d61b
commit 96e4f770c0
9 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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)

View File

@ -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)

View File

@ -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:

View File

@ -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)