1. A method of processing image data generated using an image capture device comprising a lens, the method comprising: generating, by a processor in the image capture device, metric data for a plurality of segments of an image, the metric data representing a plurality of focus measures for each of the segments generated at a plurality of lens positions; processing, by the processor, the metric data in order to cluster the segments into at least two groups on the basis of the respective focus measures of the segments, wherein each of at least one of the two groups includes multiple ones of the segments; and determining, by the processor, a lens position for each of the groups corresponding to a position of true focus for the corresponding group.