Hand tracking and trajectory analysis for physical rehabilitation