Patent attributes
An electronic device according to various embodiments of the present invention may comprise: a camera including a lens assembly having one or more lenses, and a driving unit that can adjust focus by moving at least some of the lenses (a portion of the lenses) of the lens assembly; a memory; and a processor operatively connected to the lens assembly, the camera, and the memory. According to one embodiment, the processor can adjust the focus of an external object by: using the camera to obtain a first image and a second image of the external object, the first image corresponding to a first position of the portion of the lenses and the second image corresponding to a second position of the portion of the lenses; using the first image and the second image to determine conditions related to contrast characteristics of the external object; using the first image, the second image, and a designated point spread function to determine a first movement direction and the amount of movement of the portion of the lenses on the basis of the conditions satisfying a designated first condition; and moving the portion of the lenses according to the determined first movement direction and the determined amount of movement. According to one embodiment, the processor uses the contrast difference between the external object included in the first image and the second image to determine a second movement direction of the portion of the lenses on the basis of the conditions satisfying a designated second condition, and can adjust the focus of the external object on the basis of at least the contrast change of one or more images obtained while moving the portion of the lenses along the determined second movement direction. Other embodiments are also possible.