mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Co-authored-by: Kwabena W Agyeman <kwagyeman@users.noreply.github.com> Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
15 lines
453 B
Python
15 lines
453 B
Python
def unittest(data_path, temp_path):
|
|
import image
|
|
|
|
# Load Haar Cascade
|
|
cascade = image.HaarCascade(data_path + "/frontalface.cascade")
|
|
|
|
# Load image and find keypoints
|
|
img = image.Image(data_path + "/dennis.pgm", copy_to_fb=True)
|
|
|
|
# Find objects
|
|
objects = img.find_features(cascade, threshold=0.75, scale_factor=1.25)
|
|
return (
|
|
objects and objects[0] == (189, 53, 88, 88) and objects[1] == (12, 11, 107, 107)
|
|
)
|