1. A computer-implemented method for processing data, comprising: receiving a depth map of a scene containing a body of a humanoid subject, the depth map comprising a matrix of pixels, each pixel corresponding to a respective location in the scene and having a respective pixel value indicative of a distance from a reference location to the respective location; segmenting the depth map so as to find a contour of the body; processing the contour in order to identify a torso and one or more limbs of the subject; and generating an input to control an application program running on a computer by analyzing a disposition of at least one of the identified limbs in the depth map.