1. A method for detecting an object in a depth image, comprising: determining a detection window covering a region in the depth image, wherein a location of the detection window is based on a location of a candidate pixel in the depth image, wherein a size of the detection window is based on a depth value of the candidate pixel and a size of the object; segmenting a foreground region in the detection window based on the depth value of the candidate pixel and the size of the object; classifying the foreground region as not including the object, if a number of pixels in the foreground region is less than a threshold; and otherwise resizing the foreground region based on a training size of a classifier; determining a feature vector based on depth values of the pixels in the foreground region; and classifying the feature vector to detect the object.