@kidswong999 换成纯白的背景也是不行,会不会是内置的frontalface的问题
F
fuv6 发布的帖子
-
教程的人脸识别代码识别不了
import sensor, time, image sensor.reset() sensor.set_contrast(3) sensor.set_gainceiling(16) sensor.set_framesize(sensor.HQVGA) sensor.set_pixformat(sensor.GRAYSCALE) face_cascade = image.HaarCascade("frontalface", stages=25) print(face_cascade) clock = time.clock() while (True): clock.tick() img = sensor.snapshot() objects = img.find_features(face_cascade, threshold=0.75, scale=1.35) #在找到的目标上画框,标记出来 for r in objects: img.draw_rectangle(r)