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)https://singtown.com/learn/50013/
按照视频步骤操作。
@kidswong999 你好,使用视频的代码还是识别不到人脸,返回的objects为空,但是其他的比如色块的识别是正常的
换一个位置,换一个光照环境,换个角度。
@kidswong999 换成纯白的背景也是不行,会不会是内置的frontalface的问题
你用的什么硬件,什么固件?sensor用的什么?