1. A method for face detection, comprising: capturing, using an imaging assembly, a depth map of a scene by projecting infrared radiation onto the scene and processing the infrared radiation in order to generate the depth map, which comprises an array of three-dimensional coordinates, comprising a depth coordinate at each point within a predefined area; capturing, using the imaging assembly, a two-dimensional image of the scene; selecting, by a computer, one or more locations in the two-dimensional image to test for presence of human faces; at each selected location, defining by the computer a respective face detection window having a size that is scaled according to the depth coordinate of the location that is indicated by the depth map; and processing, using the computer, a part of the two-dimensional image that is contained within each face detection window to determine whether the face detection window contains a human face.