deepof.utils.enforce_skeleton_constraints_numba
- deepof.utils.enforce_skeleton_constraints_numba(data, skeleton_constraints, original_pos, tolerance=0.1, correction_factor=0.5)
Adjusts the positions of body parts in each frame to ensure that the distances between connected parts adhere to predefined skeleton constraints within a specified tolerance.
- Parameters:
data (np.ndarray) – Motion capture data, shape (n_frames, n_body_parts, 2).
skeleton_constraints (list) – List of tuples (part1, part2, dist) defining the constraints between body parts and their expected distances.
original_pos (np.ndarray) – Boolean array indicating original (non-interpolated) positions, shape (n_frames, n_body_parts, 2).
tolerance (float) – Allowable deviation from the constraint distance (default: 0.1).
correction_factor (float) – Factor to control the strength of position adjustments (default: 0.5).
- Returns:
Adjusted motion capture data with enforced skeleton constraints.
- Return type:
np.ndarray