1. A method of generating an entirely well-focused image of a three-dimensional scene, the method comprising the steps of: a) learning a prediction model including at least a focal depth probability density function (PDF), h(k), for all depth values k, from one or more historical tiles of the scene; b) predicting the possible focal surfaces in a subsequent tile of the scene by applying the prediction model; c) for each value of k, examining h(k) such that if h(k) is below a first threshold, no image is acquired at the depth k′ for said one tile; and if h(k) is above or equal to a first threshold, one or more images are acquired in a depth range around said value of k for said one tile; and d) processing the acquired images to generate a pixel focus map for said subsequent tile.