This paper introduces a novel real-time human motion analysis system based on hierarchical tracking and inverse kinematics. This work constitutes a first step towards our goal of implementing a mechanism of human-machine interaction that allows a robot to provide feedback to a teacher in an imitation learning framework. In particular, we have developed a computer-vision based, upper-body motion analysis system that works without special devices or markers. Since such system is unstable and can only acquire partial information because of self-occlusions and depth ambiguity, we have employed a model-based pose estimation method based on inverse kinematics. The resulting system can estimate upper body human postures with limited perceptual cues, such as centroid coordinates and disparity of head and hands.