In this paper, we address the problem of people detection and tracking in crowded scenes using range cameras. We propose a new method for people detection and localisation based on the combination of background modelling and template matching. The method uses an adaptive background model in the range domain to characterise the scene without people. Then a 3D template is placed in possible people locations by projecting it in the background to reconstruct a range image that is most similar to the observed range image. We tested the method on a challenging outdoor dataset and compared it to two methods that each shares one characteristic with the proposed method: a similar template-based method that works in 2D and a well-known baseline method that works in the range domain. Our method performs significantly better, does not deteriorate in crowded environments and runs in real time.