Device comprising: a lens
system (110) for receiving light from an environment external to the device; Distance evaluation circuits (150) configured to identify corresponding distances to each of a plurality of objects located within a
field of view (320) of the lens
system (110), including a first object and a second object; Selection circuits (160) coupled to the distance evaluation circuits (150) for determining a focus of the lens
system (110), the selection circuits (160) comprising logic that, when executed, causes the device to perform operations comprising: Determining a first count of each of the plurality of objects that would appear in focus while the first object is at a first near
depth of field based on a first focal configuration and a first aperture (122), the first count representing a total number of the plurality of objects that would appear in focus while the first object is at the first near
depth of field; Determining a second count of each of the plurality of objects that would appear in focus while the second object is at a second near
depth of field based on a second focal configuration and the first aperture (122), the second count representing a total number of the plurality of objects that would appear in focus while the second object is at the second near depth of field; Comparing a first
score based on the first count and a second
score based on the second count; and providing, based on the comparing, a
signal (162) indicating a preference between the first focal configuration or the second focal configuration; a focus control (170) coupled to adjust the lens system (110) based on the
signal (162); and an
image sensor (124) optically coupled to capture an image received with the lens system (110), where either: the first
score is calculated based on weighting values assigned to the plurality of objects that would appear in focus while the first object is at the first near depth of
field based on a location of the respective object in the
field of view (320), and the second score is calculated based on weighting values assigned to the plurality of objects that would appear in focus while the second object is at the second near depth of
field based on a location of the respective object in the
field of view (320), and / or the first score is calculated based on weight values assigned to the multiple objects that would appear in focus while the first object is at the first near depth of
field based on an
object type of the object, and the second score is calculated based on weight values assigned to the multiple objects that would appear in focus while the second object is at the second near depth of field based on an
object type of the object.