Motion Kinematics

Bitbox computes fundamental kinematic features of motion, including range of motion, total path length, average speed, and average acceleration.

You can compute these variables for face bounding boxes, head pose, facial landmarks, or body joints (coming soon). When using landmarks, variables are calculated for each landmark separately.

from bitbox.biomechanics import motion_kinematics

# run the processor
rects, lands, exp_global, pose, lands_can, exp_local = processor.run_all()

# compute motion kinematics for face rectangles
mrange, path, speed, accelaration = motion_kinematics(rects)

# compute motion kinematics for head pose
mrange, path, speed, accelaration = motion_kinematics(pose)

# compute motion kinematics for facial landmarks
mrange, path, speed, accelaration = motion_kinematics(lands)

When using face bounding boxes (rectangles), the center coordinates of the box are computed and used. With head pose, you can either use translation coordinates or rotation angles (yaw, pitch, roll).

# using translation coordinates
mrange, path, speed, accelaration = motion_kinematics(pose)

# using rotation angles
mrange, path, speed, accelaration = motion_kinematics(pose, angular=True)