Multiple sets of pixel values representing a captured image of a scene are
received, with each set representing an image captured with a
corresponding degree of focus. An image processor may identify a region
of interest in the captured image, automatically determine the
configuration parameters for a lens assembly to provide a desired degree
of focus for the region of interest, and generate signals to configure a
lens assembly. In an embodiment, the region of interest is a face, the
desired degree of focus of the face is determined by computing a rate of
variation of luminance of pixels representing the face, and the desired
degree is the degree of the image having the maximum degree of focus.