13. 人体骨骼关键点识别
13.1. 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(10)
while True:
smart_camera.person_keypoint_detect.recognize()
if len(smart_camera.person_keypoint_detect.keypoints) != 0:
print(str('骨骼关键点数据') + str(smart_camera.person_keypoint_detect.keypoints))
13.2. mPython图形化示例
13.3. 人体关键点位置示意图
13.4. 关键点数据格式
13.4.1. 17个骨骼关键点数据按照以下顺序排列:
鼻子
左眼
右眼
左耳
右耳
左肩
右肩
左肘
右肘
左腕
右腕
左髋
右髋
左膝
右膝
左踝
右踝
13.4.2. 示例数据
[[344.8, 84.40001, 0.9], [344.8, 78.9, 0.8], [339.2, 78.9, 0.9], [355.8, 78.9, 0.5], [328.2, 78.9, 0.7], [361.2, 106.2, 1.0], [312.0, 111.8, 1.0], [388.5, 117.2, 0.9], [295.5, 150.0, 0.9], [432.2, 122.8, 0.8], [306.5, 188.2, 0.8], [344.8, 188.2, 1.0], [312.0, 193.8, 1.0], [344.8, 232.2, 0.9], [323.0, 237.5, 0.9], [328.2, 286.8, 0.8], [312.0, 292.2, 0.8]]
每个骨骼关键点数据包含三个元素,分别是x坐标、y坐标和置信度。置信度表示模型对该关键点位置的预测准确程度,数值范围通常在0到1之间,数值越大表示预测越准确。