13. Human Skeleton Keypoint Recognition

13.1. Python Example

Example: Human Skeleton Keypoint Recognition
#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('Skeleton keypoint data: ') + str(smart_camera.person_keypoint_detect.keypoints))

13.2. mPython Graphical Example

../../../../_images/body_skeleton_keypoints.png

13.3. Human Keypoint Position Diagram

../../../../_images/body_keypoint_position_diagram.jpg

13.4. Keypoint Data Format

13.4.1. The 17 skeleton keypoint data are arranged in the following order:

  1. Nose

  2. Left eye

  3. Right eye

  4. Left ear

  5. Right ear

  6. Left shoulder

  7. Right shoulder

  8. Left elbow

  9. Right elbow

  10. Left wrist

  11. Right wrist

  12. Left hip

  13. Right hip

  14. Left knee

  15. Right knee

  16. Left ankle

  17. Right ankle

13.4.2. Example Data

[[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]]

Each skeleton keypoint datum contains three elements: the x coordinate, the y coordinate, and the confidence. The confidence indicates how accurately the model predicts the keypoint position; its value usually ranges from 0 to 1, and a larger value means a more accurate prediction.