9. 手掌关键点分类
在AI摄像头进行手掌关键点分类。
检测手掌推理后得到关键点坐标,并计算每根手指的关节角度来识别手势(如 fist、five、gun、love 等)。
9.1. 手势
id:0 - fist 拳头
id:1 - five 手掌
id:2 - gun 枪
id:3 - love 爱
id:4 - one 一
id:5 - six 六
id:6 - three 三
id:7 - thumbUp 点赞大拇指
id:8 - yeah 剪刀手
9.2. 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(4)
while True:
smart_camera.hand_keypoint_class.recognize()
if smart_camera.hand_keypoint_class.gesture_id != None:
print(str('手势id:') + str(smart_camera.hand_keypoint_class.gesture_id))
print(str('手势字符串:') + str(smart_camera.hand_keypoint_class.gesture_str))
9.3. mPython图形化示例