python 如果你发现一张脸,在树莓派上做点什么。另见https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/face_det

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 如果你发现一张脸,在树莓派上做点什么。另见https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/face_det相关的知识,希望对你有一定的参考价值。

import time # for timing
from imgproc import *
import RPi.GPIO as GPIO

cam = Camera(160, 120)
view = Viewer(cam.width, cam.height, "Face detection")
while True:
    image = cam.grabImage()
    faces = image.detectFaces()
    if len(faces) > 0:
        GPIO.output(13, GPIO.HIGH)
        time.sleep(0.2)
        GPIO.output(13, GPIO.LOW)
        time.sleep(0.2)

以上是关于python 如果你发现一张脸,在树莓派上做点什么。另见https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/face_det的主要内容,如果未能解决你的问题,请参考以下文章