Patent ID: 7821568

Claim:
A device for forming an image of a subject, the device comprising: (a) a focusing lens having an optical axis, with the focusing lens being movable along the optical axis for focusing an image of the subject at an imaging position; (b) a motor connected to the focusing lens, operable for causing the focusing lens to move along the optical axis; (c) an image sensor having a sensing surface located at the imaging position, which produces electronic information in accordance with images on the sensing surface; and (d) a central processing unit electronically connected to the image sensor and receiving electronic information from the image sensor, and electronically connected to and controlling the motor, the central processing unit having a memory and program logic, in which the program logic in accordance with a predetermined first set of conditions stored in the memory, the predetermined first set of conditions having been set in advance, determines a start point of a search and one of two directions of search from the start point for an in-focus position of an image of the subject on the imaging position, and controls operation of the motor to move the focusing lens to the start point, and to move the focusing lens from the start point in the determined direction of search until an in-focus position is reached based on analyzing an autofocus evaluation value calculated from electronic information received from the image sensor, and stops the search for an in-focus position of an image if each of a predetermined second set of conditions are satisfied, wherein the predetermined first set of conditions includes at least one of: status of the flash, magnitude of brightness, magnitude of contrast, and ambient light levels, and the predetermined second set of conditions includes: an autofocus evaluation value at a current search position being a peak value; difference between the peak autofocus evaluation value and the autofocus evaluation value of predetermined defocusing being greater than a predetermined threshold; and absence of two or more peak autofocus evaluation values within a predetermined range around the current search position.