眨眼张嘴检测
在AI摄像头进行眨眼张嘴检测。
眨眼和张嘴检测是计算机视觉中常见的面部行为分析任务,通常用于疲劳检测、活体检测、人机交互等场景。
Python示例
例程:眨眼张嘴检测
#mPythonType:0
from mpython import *
import smartcamera_k230 as smartcamera
smart_camera = smartcamera.SmartCameraK230(tx=Pin.P1, rx=Pin.P0)
smart_camera.model_init(27)
while True:
smart_camera.face_living_body.recognize()
print(str('眨眼次数:') + str(smart_camera.face_living_body.mouth_blink_counter[0]))
print(str('张嘴次数:') + str(smart_camera.face_living_body.mouth_blink_counter[1]))
mPython图形化示例
函数方法
- smart_camera.model_init(cur_state)
实例化模型
- 参数:
cur_state (int) -- 初始化模型id
- class smart_camera.face_living_body
- recognize()
运行识别