1. A method for generating a depth map, the method comprising: obtaining a plurality of captured images of a scene captured at different times; generating a background image of the scene, the background image including non-moving objects in the scene; for each of the plurality of captured images: determining a difference map indicating the difference between a pixel of the captured image and a corresponding pixel of the background image, and generating a probability map based on the difference map, the probability map indicating a probability that each pixel of the captured image depicts a moving object; combining the plurality of captured images to form a temporally averaged image, the combining including multiplying an intensity value of each pixel in at least one of the plurality of captured images by the corresponding value in the corresponding probability map; and generating a depth map from the temporally averaged image.