1. A method comprising: capturing, using a digital camera, a set of images corresponding to a set of lens positions based on the lens position data; determining focus metric information for each of a plurality of regions of interest in each image of the set; determining an optimal lens position for each of the regions of interest, based on the focus metric information from the images in the set; generating a depth map based on the optimal lens positions; and performing an image generation operation based on the generated depth map.