Patent ID: 8040429

Claim:
An electronic apparatus having a camera function, the electronic apparatus including an image pickup lens and an image pickup device, the electronic apparatus comprising: a drive mechanism that changes a position of the image pickup lens relative to the image pickup device, the image pickup device converting an image of a subject captured via the image pickup lens at each of a plurality of relative positions into an electric signal and outputting the electric signal; a signal processing section that processes the electric signal outputted from the image pickup device for each of the plurality of relative positions and generates a digital image signal corresponding to each relative position; and a focus control section that extracts, from the digital image signal corresponding to each of the plurality of relative positions, high-frequency components for a number of pixels selected from a focus area set in the image of the digital image signal, calculates a focus evaluation value corresponding to each relative position, identifies a maximum focus evaluation value among the calculated focus evaluation values, and moves the image pickup lens to the relative position that provides the maximum focus evaluation value, the focus control section determining whether or not a focus evaluation value corresponding to an initial position of the image pickup lens is contained in a predetermined range and changing the number of pixels to be selected from the focus area in the case where the focus evaluation value corresponding to the initial position is not contained in the predetermined range.