Patent Description:
Not only a digital camera but also electronic devices having a camera such as a smart phone have been widely spread. The electronic devices having the camera may perform an auto focus function that operates to focus on an object. Using the auto focus function, the electronic device may focus on the object even when there is no separate input of a user.

<CIT> discloses methods and apparatuses for calibration of phase detection auto focus (PDAF) camera systems. In one aspect, the method involves capturing a first image of a scene at an initial lens position, the first image including a first left image and a first right image captured using left and right photodiodes. The method may also involve calculating an initial phase difference between the first left image and first right image and estimating an in-focus lens position based on the initial phase difference. The method may further involve moving the lens to a final lens position at which a final phase difference between a second left image and a second right image of a second image captured at the final lens position is substantially zero and calibrating the estimation of the in-focus lens position based on the initial lens position, the final lens position, and the initial phase difference.

Aspects of the present disclosure are to address at least the above-mentioned problems and/or disadvantages and to provide at least the advantages described below.

There are several types of controlling schemes as an auto focus controlling scheme. For example, there are passive controlling schemes such as contrast AF or active controlling schemes such as laser AF. An electronic device may control an actuator to move a location of a lens disposed in a camera to perform an auto focus control function. The electronic device needs to rapidly determine and move the location of the lens to rapidly perform the auto focus control.

In addition, as a size of a camera module is miniaturized, electronic devices having a plurality of cameras with various lenses have been widely spread. When the electronic device captures an image using the plurality of cameras, the switched camera needs to be refocused when switching to another camera to capture the image while capturing the image using one camera.

The disclosure may provide an electronic device and a method for controlling auto focus of the electronic device that may perform an auto focus function accurately and rapidly.

Accordingly, an aspect of the disclosure is to provide an electronic device according to appended claim <NUM>.

Also disclosed herein is a method according to appended claim <NUM>.

<FIG> is a block diagram of an electronic device <NUM> in a network environment <NUM> according to various embodiments. Referring to <FIG>, the electronic device <NUM> may communicate with an electronic device <NUM> through a first network <NUM> (e.g., a short-range wireless communication network) or may communicate with an electronic device <NUM> or a server <NUM> through a second network <NUM> (e.g., a long-distance wireless communication network) in the network environment <NUM>. According to an embodiment, the electronic device <NUM> may communicate with the electronic device <NUM> through the server <NUM>. According to an embodiment, the electronic device <NUM> may include a processor <NUM>, a memory <NUM>, an input device <NUM>, a sound output device <NUM>, a display device <NUM>, an audio module <NUM>, a sensor module <NUM>, an interface <NUM>, a haptic module <NUM>, a camera module <NUM>, a power management module <NUM>, a battery <NUM>, a communication module <NUM>, a subscriber identification module <NUM>, or an antenna module <NUM>. According to some embodiments, at least one (e.g., the display device <NUM> or the camera module <NUM>) among components of the electronic device <NUM> may be omitted or one or more other components may be added to the electronic device <NUM>. According to some embodiments, some of the above components may be implemented with one integrated circuit. For example, the sensor module <NUM> (e.g., a fingerprint sensor, an iris sensor, or an illuminance sensor) may be embedded in the display device <NUM> (e.g., a display).

The processor <NUM> may execute, for example, software (e.g., a program <NUM>) to control at least one of other components (e.g., a hardware or software component) of the electronic device <NUM> connected to the processor <NUM> and may process or compute a variety of data. According to an embodiment, as a part of data processing or operation, the processor <NUM> may load a command set or data, which is received from other components (e.g., the sensor module <NUM> or the communication module <NUM>), into a volatile memory <NUM>, may process the command or data loaded into the volatile memory <NUM>, and may store result data into a nonvolatile memory <NUM>. According to an embodiment, the processor <NUM> may include a main processor <NUM> (e.g., a central processing unit or an application processor) and an auxiliary processor <NUM> (e.g., a graphic processing device, an image signal processor, a sensor hub processor, or a communication processor), which operates independently from the main processor <NUM> or with the main processor <NUM>. Additionally or alternatively, the auxiliary processor <NUM> may use less power than the main processor <NUM>, or is specified to a designated function. The auxiliary processor <NUM> may be implemented separately from the main processor <NUM> or as a part thereof.

The auxiliary processor <NUM> may control, for example, at least some of functions or states associated with at least one component (e.g., the display device <NUM>, the sensor module <NUM>, or the communication module <NUM>) among the components of the electronic device <NUM> instead of the main processor <NUM> while the main processor <NUM> is in an inactive (e.g., sleep) state or together with the main processor <NUM> while the main processor <NUM> is in an active (e.g., an application execution) state. According to an embodiment, the auxiliary processor <NUM> (e.g., the image signal processor or the communication processor) may be implemented as a part of another component (e.g., the camera module <NUM> or the communication module <NUM>) that is functionally related to the auxiliary processor <NUM>.

The memory <NUM> may store a variety of data used by at least one component (e.g., the processor <NUM> or the sensor module <NUM>) of the electronic device <NUM>. For example, data may include software (e.g., the program <NUM>) and input data or output data with respect to commands associated with the software. The memory <NUM> may include the volatile memory <NUM> or the nonvolatile memory <NUM>.

The program <NUM> may be stored in the memory <NUM> as software and may include, for example, an operating system <NUM>, a middleware <NUM>, or an application <NUM>.

The input device <NUM> may receive a command or data, which is used for a component (e.g., the processor <NUM>) of the electronic device <NUM>, from an outside (e.g., a user) of the electronic device <NUM>.

The sound output device <NUM> may output a sound signal to the outside of the electronic device <NUM>. The speaker may be used for general purposes, such as multimedia play or recordings play, and the receiver may be used for receiving calls. According to an embodiment, the receiver and the speaker may be either integrally or separately implemented.

The display device <NUM> may visually provide information to the outside (e.g., the user) of the electronic device <NUM>. For example, the display device <NUM> may include a display, a hologram device, or a projector and a control circuit for controlling a corresponding device. According to an embodiment, the display device <NUM> may include a touch circuitry configured to sense the touch or a sensor circuit (e.g., a pressure sensor) for measuring an intensity of pressure on the touch.

The audio module <NUM> may convert a sound and an electrical signal in dual directions. According to an embodiment, the audio module <NUM> may obtain the sound through the input device <NUM> or may output the sound through the sound output device <NUM> or an external electronic device (e.g., the electronic device <NUM> (e.g., a speaker or a headphone)) directly or wirelessly connected to the electronic device <NUM>.

The sensor module <NUM> may generate an electrical signal or a data value corresponding to an operating state (e.g., power or temperature) inside or an environmental state (e.g., a user state) outside the electronic device <NUM>. According to an embodiment, the sensor module <NUM> may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an infrared sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

The interface <NUM> may support one or more designated protocols to allow the electronic device <NUM> to connect directly or wirelessly to the external electronic device (e.g., the electronic device <NUM>). According to an embodiment, the interface <NUM> may include, for example, an HDMI (high-definition multimedia interface), a USB (universal serial bus) interface, an SD card interface, or an audio interface.

A connecting terminal <NUM> may include a connector that physically connects the electronic device <NUM> to the external electronic device (e.g., the electronic device <NUM>).

The haptic module <NUM> may convert an electrical signal to a mechanical stimulation (e.g., vibration or movement) or an electrical stimulation perceived by the user through tactile or kinesthetic sensations.

The camera module <NUM> may shoot a still image or a video image. According to an embodiment, the camera module <NUM> may include, for example, at least one or more lenses, image sensors, image signal processors, or flashes.

According to an embodiment, the power management module <NUM> may be implemented as at least a part of a power management integrated circuit (PMIC).

According to an embodiment, the battery <NUM> may include, for example, a non-rechargeable (primary) battery, a rechargeable (secondary) battery, or a fuel cell.

The communication module <NUM> may establish a direct (e.g., wired) or wireless communication channel between the electronic device <NUM> and the external electronic device (e.g., the electronic device <NUM>, the electronic device <NUM>, or the server <NUM>) and support communication execution through the established communication channel. The communication module <NUM> may include at least one communication processor operating independently from the processor <NUM> (e.g., the application processor) and supporting the direct (e.g., wired) communication or the wireless communication. According to an embodiment, the communication module <NUM> may include a wireless communication module <NUM> (e.g., a cellular communication module, a short-range wireless communication module, or a GNSS (global navigation satellite system) communication module) or a wired communication module <NUM> (e.g., an LAN (local area network) communication module or a power line communication module). The corresponding communication module among the above communication modules may communicate with the external electronic device <NUM> through the first network <NUM> (e.g., the short-range communication network such as a Bluetooth, a WiFi direct, or an IrDA (infrared data association)) or the second network <NUM> (e.g., the long-distance wireless communication network such as a cellular network, an internet, or a computer network (e.g., LAN or WAN)). The above-mentioned various communication modules may be implemented into one component (e.g., a single chip) or into separate components (e.g., chips), respectively. The wireless communication module <NUM> may identify and authenticate the electronic device <NUM> using user information (e.g., international mobile subscriber identity (IMSI)) stored in the subscriber identification module <NUM> in the communication network, such as the first network <NUM> or the second network <NUM>.

In such a case, at least one antenna appropriate for a communication scheme used in the communication network, such as the first network <NUM> or the second network <NUM>, may be selected, for example, by the communication module <NUM> from the plurality of antennas.

At least some components among the components may be connected to each other through a communication method (e.g., a bus, a GPIO (general purpose input and output), an SPI (serial peripheral interface), or an MIPI (mobile industry processor interface)) used between peripheral devices to exchange signals (e.g., a command or data) with each other.

According to an embodiment, the command or data may be transmitted or received between the electronic device <NUM> and the external electronic device <NUM> through the server <NUM> connected to the second network <NUM>. Each of the external electronic devices <NUM> and <NUM> may be the same or different types as or from the electronic device <NUM>. According to an embodiment, all or some of the operations performed by the electronic device <NUM> may be performed by one or more external electronic devices among the external electronic devices <NUM>, <NUM>, or <NUM>. For example, when the electronic device <NUM> performs some functions or services automatically or by request from a user or another device, the electronic device <NUM> may request one or more external electronic devices to perform at least some of the functions related to the functions or services, in addition to or instead of performing the functions or services by itself. The one or more external electronic devices receiving the request may carry out at least a part of the requested function or service or the additional function or service associated with the request and transmit the execution result to the electronic device <NUM>. The electronic device <NUM> may provide the result as is or after additional processing as at least a part of the response to the request. To this end, for example, a cloud computing, distributed computing, or client-server computing technology may be used.

<FIG> is a block diagram illustrating a structure of an electronic device <NUM> according to an embodiment.

According to an embodiment, an electronic device <NUM> may include at least one of a camera <NUM>, a processor <NUM>, a memory <NUM>, and a sensor <NUM>. The memory <NUM> according to an embodiment may store a program including instructions for allowing the electronic device <NUM> to operate. The processor <NUM> may control components of the electronic device <NUM> or process data by executing instructions stored in the memory <NUM>. In an embodiment to be described below, an operation performed by the processor <NUM> or the electronic device <NUM> may be performed when the processor <NUM> executes the instructions stored in the memory <NUM>.

According to an embodiment, the sensor (or a distance sensor) <NUM> may provide the processor <NUM> with information about a distance value for a subject <NUM> under control of the processor <NUM>. The sensor <NUM> may include a sensor that may detect a distance to the subject <NUM>. For example, the sensor <NUM> may include a time-of-flight (TOF) module. The TOF module may include an illumination source that emits radiation having a wavelength or a range of wavelengths and an optical receiver that may operate to detect the wavelength or the range of the wavelengths thereof. A time-of-flight may be determined by measuring a time until a light pulse reaches the optical receiver after being emitted and reflected by the subject <NUM>. However, the disclosure is not limited thereto, and the sensor <NUM> may be formed according to another embodiment.

The processor <NUM> may determine a location of a lens of the camera <NUM> based on the distance value for the subject <NUM>. The processor <NUM> may use the distance value and/or calibration data stored in the memory <NUM> to determine the location of the lens of the camera <NUM>. According to an embodiment, the processor <NUM> may search for the lens location matching the distance value from the calibration data formed in a look-up table. According to an embodiment, the processor <NUM> may determine a function defining a relationship between the distance value and the lens location from the calibration data, and input the distance value into the determined function to receive the lens location back. According to an embodiment, the calibration data may be the function defining the relationship between the distance value and the lens location. According to an embodiment, the lens location may be formed in a form of a code value for controlling an actuator that moves the lens.

According to an embodiment, the processor <NUM> may update the calibration data based on a result of performing focus detection. However, because it is difficult to determine a correct focus by only a performance of an image processor in a low light level environment or in a situation where characteristics of a camera sensor are not good, the processor <NUM> may not update the calibration data in the low light level environment in which a light level value obtained during the operation of the camera is lower than a specified value or in the situation where the characteristics of the camera sensor are not good. In an environment in which the image processor is difficult to focus, the focus may be adjusted effectively and accurately using distance measurement information (e.g., a value measured using the TOF module).

The processor <NUM> may control the camera <NUM> based on the determined lens location. According to an embodiment, the processor <NUM> may transmit a control signal corresponding to a determined lens code to an actuator of the camera <NUM>. For example, the processor <NUM> may set the determined lens location as an initial location of the lens for the camera <NUM> to automatically focus. The camera <NUM> may generate image data capturing the subject <NUM>.

According to an embodiment, the electronic device <NUM> may further include a display device <NUM>. The display device <NUM> may include, for example, a display capable of outputting a screen, such as a liquid crystal display (LCD), an organic light emitting diode panel, and the like. The display device <NUM> may output a user interface for outputting an image captured by the camera <NUM> in a live view or for interacting with the user under control of the processor <NUM>.

<FIG> is a flowchart <NUM> illustrating a process, by an electronic device, of focusing on a subject, according to an embodiment. <FIG> will be described with reference to the reference numerals shown in <FIG>.

In operation <NUM>, the processor <NUM> may obtain a distance value using the sensor <NUM>. For example, the processor <NUM> may obtain a value corresponding to a distance such as <NUM> or <NUM>.

In operation <NUM>, the processor <NUM> may determine a lens location that matches the obtained distance value. According to an embodiment, the processor <NUM> may determine the lens location that matches the distance value using the calibration data stored in the memory <NUM>.

In operation <NUM>, the processor <NUM> may control the camera <NUM> such that the lens of the camera <NUM> moves to a location corresponding to the determined lens location based on the determined lens location.

<FIG> is a diagram illustrating a concept of calibration data <NUM> according to an embodiment.

The calibration data <NUM> according to an embodiment may include information <NUM> about a distance (e.g., a distance value) and information <NUM> about a lens location (e.g., an AF code).

Referring to <FIG>, the distance value <NUM> and the AF code <NUM> included in the calibration data <NUM> may be mapped to each other and stored in the memory <NUM> in a state of being linked with each other.

<FIG> is a flowchart <NUM> illustrating a process, by an electronic device, of determining a lens location based on calibration data, according to an embodiment.

In operation <NUM>, the processor <NUM> of the electronic device <NUM> may execute an auto focus function when the camera <NUM> operates. For example, when a camera application installed on the electronic device <NUM> is executed, the processor <NUM> may control the camera <NUM> such that an image focuses on the subject <NUM> while outputting the image obtained through the camera <NUM> in the live-view through the display device <NUM>.

When the auto focus function is executed, in operation <NUM>, the processor <NUM> may obtain a distance value for the subject <NUM> through the sensor <NUM>. For example, when the sensor <NUM> includes the TOF module, radiation having a wavelength may be emitted and then a wavelength of the radiation reflected on the subject <NUM> may be detected to obtain a distance value corresponding to a time-of-flight of the wavelength of the corresponding radiation.

In operation <NUM>, the processor <NUM> may determine a lens location based on the distance value. According to an embodiment, the processor <NUM> may use calibration data (e.g., the calibration data <NUM> of <FIG>) stored in the memory <NUM> to determine the lens location. For example, the processor <NUM> may obtain an AF code (e.g., the AF code <NUM> of <FIG>) indicating the location of the lens of the camera <NUM> corresponding to a distance value (e.g., the distance value <NUM> of <FIG>) from the calibration data. The processor <NUM> may transmit a control signal corresponding to the obtained AF code to the camera <NUM>, so that the lens of the camera <NUM> may be located at a location for finding a focus. The processor <NUM> may analyze the image captured by the camera <NUM> to determine the location of the lens that allows the focus to be located on the subject while moving the location of the lens of the camera <NUM>.

According to an embodiment, the calibration data may be set in the electronic device <NUM> based on characteristics of the electronic device <NUM> at a time of manufacture of the electronic device <NUM>. However, when an impact is applied on the electronic device <NUM> or when an environment such as temperature is different from that at the time of the manufacture, initially set calibration data may be less accurate. Thus, calibration data may be needed to find correct location of the lens even in the environment different from that at the time of the initial manufacture.

The processor <NUM> may obtain lens location data including information about the distance value for the subject and the lens location focused on the subject as a result of executing the auto focus function. The processor <NUM> may collect the lens location data obtained as the result of executing the auto focus function. In operation <NUM>, the processor <NUM> may update the calibration data stored in the memory <NUM> based on the lens location data. According to an embodiment, the updating of the calibration data may mean merging the calibration data with the collected lens location data. According to an embodiment, a scheme for fitting the camera <NUM> using data corrected for each distance and a scheme for fitting the camera <NUM> using the collected data may be mixed with each other and used.

In operation <NUM>, the processor <NUM> may determine the lens location based on the updated calibration data when the camera <NUM> is operated to execute the auto focus function.

<FIG> illustrates a graph <NUM> for describing an example of collected lens location data.

The electronic device <NUM> according to an embodiment may collect lens location data <NUM> formed of a pair of the location of the lens and the distance value, while executing the auto focus function. According to an embodiment, the electronic device <NUM> may define a function indicating a relationship <NUM> between the location of the lens and the distance to the subject based on the collected lens location data <NUM>. For example, the electronic device <NUM> may determine the location of the lens for the detected distance value using the function defined based on the lens location data <NUM>. For example, the electronic device <NUM> may determine the location of the lens relative to the distance value using the collected lens location data <NUM>. For example, when the function is defined in a form of y=<NUM>. 7x+<NUM> based on the collected lens location data, the electronic device <NUM> may obtain a lens location of a <NUM> code to focus on a subject whose detected distance is <NUM>. In the above example, the function is presented in a form of a primary polynomial, but the function may be defined in other forms. Considering a complexity of calculation and an accuracy of the function together, the function may be defined in a form of a cubic polynomial.

In the disclosure, the updating of the calibration data based on the collected lens location data or the determining of the relationship between the location of the lens and the distance value based on the collected lens location data may be referred to as learning of the lens location data.

<FIG> is a diagram <NUM> illustrating a process of identifying lens location data according to an embodiment.

When the electronic device <NUM> learns results of performing the auto focus, not all the results of performing the auto focus function may be focused on the subject favorably. Therefore, the accuracy may be lowered when performing the auto focus function by learning poor results of performing the auto focus function. Thus, according to an embodiment, the electronic device <NUM> may identify a validity of the obtained lens location data, and the electronic device <NUM> may be allowed to learn the lens location data when the lens location data is valid as the verification result.

According to an embodiment, the processor <NUM> may obtain the lens location data in operation <NUM> of <FIG>, and may obtain capturing environment information associated with the obtained lens location data in operation <NUM>. The capturing environment information may mean information about an environment associated with image capturing when capturing the image using the auto focus function. For example, the capturing environment information may include motion information about a motion of the electronic device, filter value information such as a contrast filter value, brightness value information, signal to noise ratio information, and information about a disparity of the image or a BV value.

In an embodiment, in operation <NUM>, the processor <NUM> may obtain the capturing environment information through the sensor of the electronic device <NUM>. For example, the processor <NUM> may obtain a value detected through a sensor capable of detecting a motion, such as a gyro sensor, an acceleration sensor, or a gravity sensor as the capturing environment information. As another example, the processor <NUM> may obtain a temperature value as the capturing environment information using a temperature sensor.

In an embodiment, the processor <NUM> may obtain the capturing environment information from the image obtained through the camera <NUM> in operation <NUM>. For example, the processor <NUM> may calculate a brightness value, a signal to noise ratio, or a disparity of the image as the capturing environment information from the image captured through the camera <NUM>.

In operation <NUM>, the processor <NUM> may identify the validity of the lens location data based on the obtained capturing environment information. According to an embodiment, when the capturing environment information satisfies a specified environment condition, the processor <NUM> may determine that the lens location data is valid. A case in which the capturing environment information satisfies the specified environment condition may mean a case in which a value included in the capturing environment information is included in a range included in the specified environment condition, for example. For example, when the signal to noise ratio included in the capturing environment information is less than <NUM>, the processor <NUM> may determine that the lens location data is invalid.

In operation <NUM>, when it is determined that the lens location data is valid, the processor <NUM> may learn the lens location data. According to an embodiment, when it is determined that the lens location data is valid, the processor <NUM> may perform operation <NUM> of <FIG>.

According to an embodiment, the electronic device <NUM> may renew the specified environment condition based on the result of performing the auto focus function. For example, when an image that is well focused on the subject using the auto focus function is obtained, the electronic device <NUM> may obtain capturing environment information associated with a time when the image was obtained, and renew the environment condition to determine that the lens location data obtained from the corresponding capturing environment information is valid.

<FIG> illustrates a graph <NUM> for describing a method for obtaining new lens location data based on a distribution chart of lens location data collected by an electronic device according to an embodiment.

According to an embodiment, the electronic device <NUM> may prevent an amount of data from being concentrated for some distance sections based on the distribution chart of the lens location data. For example, when there is the lens location data collected as in the graph <NUM> of <FIG>, the electronic device <NUM> may select the lens location data to be used for learning to be evenly distributed for each distance section.

As an example, lens location data included in a region <NUM> of a <NUM>/distance between <NUM> and <NUM> in which a density of the lens location data is low may be collected more. For example, when the lens location data is obtained, the processor <NUM> may use the lens location data for the learning when the distance value corresponding to the obtained lens location data is included in the region <NUM> where the density of the data is lower than a specified value in the distribution graph <NUM>. As an example, when the distance value corresponding to the obtained lens location data is included in the region <NUM> where the density of the data is lower than the specified value in the distribution graph <NUM>, the environment condition for determining the validity of the lens location data may be relaxed.

According to an embodiment, the electronic device <NUM> may learn the lens location data when a user input corresponding to a learning command of the user is received, instead of learning the lens location data each time the lens location data is obtained. The obtained lens location data may be accumulated and stored in the memory <NUM> separately from the calibration data. The accumulated and stored lens location data may be referred to as learning data.

A method for receiving the learning command of the user may be implemented by various embodiments. For example, when an item corresponding to the learning of the lens location data of menu items related to a camera setting is selected, the electronic device <NUM> may learn the lens location data included in the learning data. For an example, the electronic device <NUM> may perform the auto focus function and then evaluate and score one or more results of performing the auto focus function. When the scored evaluation result is below or equal to a specified value, the electronic device <NUM> may output a user interface including a message <NUM> as shown in <FIG>. When a button <NUM> included in the user interface is selected, the electronic device <NUM> may learn the lens location data included in the learning data. Alternatively, when the scored evaluation result is below or equal to the specified value, the electronic device <NUM> may learn the lens location data without a separate input.

<FIG> illustrates a diagram for describing a method for updating the calibration data <NUM> using learning data <NUM> by the electronic device <NUM> according to an embodiment.

When the lens location data is obtained as the result of performing the auto focus function, the electronic device <NUM> according to an embodiment may accumulate and store the lens location data as the learning data <NUM> separate from the calibration data <NUM>.

Thereafter, when the learning command for the lens location data is received from the user or when a condition for initiating the learning is satisfied, the electronic device <NUM> may update the calibration data <NUM> by merging the calibration data <NUM> and the learning data <NUM> with each other. After updating the calibration data <NUM>, the electronic device <NUM> may delete the learning data <NUM> from the memory <NUM>.

The electronic device <NUM> according to an embodiment may include at least one of a first camera <NUM>, a second camera <NUM>, a processor <NUM>, and a memory <NUM>. The memory <NUM> according to an embodiment may store a program including instructions for operating the electronic device <NUM>. The processor <NUM> may execute the instructions stored in the memory <NUM> to control components of the electronic device <NUM> or process data. In the disclosure, an operation referred to as being performed by the processor <NUM> or the electronic device <NUM> may be implemented as being performed when the processor <NUM> executes the instructions stored in the memory <NUM>.

According to an embodiment, the electronic device <NUM> may capture the subject <NUM> using at least one of the first camera <NUM> or the second camera <NUM>. The processor <NUM> may control at least one of the first camera <NUM> or the second camera <NUM> to focus at least one of the first camera <NUM> and the second camera <NUM> on the subject <NUM>. For example, the processor <NUM> may use a sensor (not shown) to obtain information about a distance value for the subject <NUM> to detect a distance from at least one of the first camera <NUM> and the second camera <NUM> to the subject <NUM>. The sensor (not shown) according to the present embodiment may be formed according to various embodiments, like the sensor <NUM> of <FIG>.

According to an embodiment, the processor <NUM> may execute a camera application for capturing the subject <NUM> using at least one of the first camera <NUM> and the second camera <NUM>. According to an embodiment, the camera application may be stored in the memory <NUM>. When the camera application is executed, the processor <NUM> may output the image obtained from one of the first camera <NUM> and the second camera <NUM> through a display device <NUM> as a live-view.

According to an embodiment, the processor <NUM> may select one of the first camera <NUM> and the second camera <NUM>. In a following description, when it is described that one of the first camera <NUM> and the second camera <NUM> is selected, it may be interpreted that the reverse may be available. When outputting an image obtained from the first camera <NUM> through the display device <NUM> as the live-view, the processor <NUM> may control the camera obtaining the image to focus on the subject <NUM>. As an example, when receiving an image capturing command in a state of outputting the image obtained from the first camera <NUM> through the display device <NUM>, the electronic device <NUM> may store the image being output in the memory <NUM> as a file. The image capturing command may be input through an input device (e.g., the input device <NUM> of <FIG>) disposed in the electronic device <NUM>.

According to an embodiment, a camera switching command may be input to the electronic device <NUM> in the state in which the processor <NUM> is outputting the image obtained from the first camera <NUM> through the display device <NUM> as the live-view. In response to the camera switching command, the processor <NUM> may output an image obtained from the second camera <NUM> through the display device <NUM> as a live-view instead of the image obtained from the first camera <NUM>.

The camera switching command may refer to a command for switching a camera selected for image capturing among cameras provided in the electronic device <NUM> to another camera. The camera switching command may be implemented variously according to embodiments. For example, referring to <FIG>, the electronic device <NUM> may output a live-view image <NUM> as an image obtained using a camera having a wide angle lens while capturing an image at a magnification of <NUM>. In this connection, when a zoom-in command is input, the electronic device <NUM> may increase the magnification of the image being captured. When the magnification of the image increases equal to or above a specified value, the electronic device <NUM> may output a live-view image <NUM> as an image obtained using a camera having a narrow angle lens. For example, a command for increasing the magnification of the image to be equal to or above the specified value may be the camera switching command. As an example, the camera switching command may be implemented in other forms. For example, the electronic device <NUM> may output a list of cameras (e.g., the first camera <NUM> and the second camera <NUM> of <FIG>) provided in the electronic device <NUM> through the display device <NUM>, and receive an input of selecting one of the cameras in the list. For example, the input of selecting one of the cameras in the list may be used as the camera switching command. As an example, a voice including a phrase "switch to the wide angle camera" may be received through an input device (e.g., the input device <NUM> of <FIG>) of the electronic device <NUM>. A result recognized by the processor <NUM> through a voice recognition function for the received voice may be used as the camera switching command.

According to an embodiment, the first camera <NUM> and the second camera <NUM> may respectively include lenses different from each other in at least one of an angle of view or a focal length. For example, the first camera <NUM> may be a wide angle camera having a wide angle lens, and the second camera <NUM> may be a narrow angle camera having a narrow angle lens. As an example, the first camera <NUM> may be a standard angle camera having a standard angle lens, and the second camera <NUM> may be the narrow angle camera having the narrow angle lens. As an example, the first camera <NUM> may be a telephoto camera having a telephoto lens, and the second camera <NUM> may be the wide angle camera having the wide angle lens. For an example, a focal length of the lens disposed in the first camera <NUM> may be longer than a focal length of the lens disposed in the second camera <NUM>. However, the disclosure is not limited thereto, and a combination of the first camera <NUM> and the second camera <NUM> may be formed in various embodiments.

When switching the camera selected for the image capturing in response to the camera switching command from the first camera <NUM> to the second camera <NUM>, the electronic device <NUM> may perform the auto focus function again to focus the second camera <NUM> on the subject <NUM>. In an embodiment, information about a lens location determined by the first camera <NUM> to focus on the subject <NUM> and lens location conversion data stored in the memory <NUM> may be used to perform the auto focus function rapidly and accurately. For example, first lens location data may mean data including information about a location of the lens of the first camera <NUM> (e.g., an AF code of the first camera), and second lens location data may mean data including information about a location of the lens of the second camera <NUM> (e.g., an AF code of the second camera). According to an embodiment, the lens location conversion data may include data in which the first lens location data and the second lens location data are mapped with each other. According to an embodiment, the lens location conversion data may include a conversion function (or a formula) indicating a relationship between the first lens location data and the second lens location data. According to an embodiment, the lens location conversion data may be stored in the memory <NUM> at the time of the manufacture of the electronic device <NUM>. According to an embodiment, the lens location conversion data may be formed by storing a result of performing the auto focus function by switching the camera based on the camera switching command in the memory <NUM>.

According to an embodiment, in response to the camera switching command, the processor <NUM> may obtain the second lens location data mapped to the first lens location data set in the first camera <NUM> to focus on the subject <NUM> from the lens location conversion data. The processor <NUM> may use the second lens location data as the location of the lens of the second camera <NUM> for the second camera <NUM> to perform the auto focus function.

In an operation in which the user uses the electronic device <NUM>, an operating environment or an operating state of at least one of the first camera <NUM> and the second camera <NUM> may change. In this case, a difference between a mapping relationship between the first lens location data and the second lens location data of the lens location conversion data stored in the memory <NUM> and the operating states of the first camera <NUM> and the second camera <NUM> may occur. According to an embodiment, after completing the auto focus function, the processor <NUM> may renew the lens location conversion data based on data corresponding to the actual operating states. For example, when the second camera <NUM> is focused on the subject <NUM> based on the second lens location data through the second camera <NUM> based on the camera switching command while the first camera <NUM> is focused on the subject <NUM> based on the first lens location data through the first camera <NUM>, the processor <NUM> may update the lens location conversion data stored in the memory <NUM> based on the first lens location data and the second lens location data. When the first camera <NUM> and the second camera <NUM> have a large difference in sensor characteristics such as whether there is phase difference information, it may be effective when the second camera is focused using focus information of the first camera having the phase difference information.

According to an embodiment, when the lens location conversion data is updated based on the lens location data that is not correctly focused even after performing the auto focus function, an accuracy of the lens location conversion data may rather become low. Thus, the processor <NUM> may identify a validity of at least one of the first lens location data and the second lens location data, and then update the lens location conversion data based on the data with the identified validity.

<FIG> is a flowchart <NUM> illustrating a process, by the electronic device <NUM>, of updating lens location conversion data according to an embodiment.

According to an embodiment, the electronic device <NUM> may include the first camera <NUM> and the second camera <NUM>. When it is necessary to adjust the focuses of the first camera and the second camera together, the electronic device <NUM> may perform an auto focus function for the first camera <NUM> and the second camera <NUM>. For example, when a zoom function of the camera application is operating, an auto focus function may be performed for the wide angle lens camera and the narrow angle lens camera. As an example, an auto focus function for a plurality of lenses may be performed together even in a live bokeh mode for applying a background blur effect to a preview image.

In operation <NUM>, the processor <NUM> of the electronic device <NUM> may activate an operation of the first camera <NUM>.

According to an embodiment, in operation <NUM>, as a result of performing the auto focus function, the processor <NUM> of the electronic device <NUM> may obtain the first lens location data corresponding to the location of the lens of the first camera focused on the subject.

According to an embodiment, in operation <NUM>, the processor <NUM> of the electronic device <NUM> may receive the camera switching command through the input device (e.g., the input device <NUM> of <FIG>). For example, when the zoom function of the camera application is operating and when the image capturing magnification is out of a specified range, the processor <NUM> may process the command for controlling the zoom function as the camera switching command. As an example, because the auto focus function for the plurality of lenses is also performed during the operation in the live bokeh mode for applying the background blur effect to the preview image, the processor <NUM> may receive an execution command of the live bokeh mode as the camera switching command. When the camera selected for capturing the image is switched from the first camera to the second camera, the processor <NUM> received the camera switching command may perform an auto focus function for the second camera. In operation <NUM>, the processor <NUM> may obtain second lens location data for the second camera determined as a result of performing the auto focus function for the second camera.

According to an embodiment, the processor <NUM> may calculate a distribution chart for at least one of the first lens location data and the second lens location data, and perform operation <NUM> and operation <NUM> or perform operation <NUM> when at least one of the first lens location data and the second lens location data is included in a region having a density lower than a specified value.

In operation <NUM>, the processor <NUM> may update the lens location conversion data stored in the memory <NUM> based on the first lens location data and the second lens location data. According to an embodiment, the processor <NUM> may collect a plurality of pairs of the first lens location data and the second lens location data, and then replace the existing lens location data with the collected data. According to an embodiment, the processor <NUM> may merge the existing lens location data and the collected data with each other.

According to an embodiment, in operation <NUM>, the processor <NUM> may identify a validity of at least one of the first lens location data and the second lens location data, and use the data with the identified validity to update the lens location conversion data. For example, as in operations <NUM>, <NUM>, and <NUM> of <FIG>, the processor <NUM> may identify the validity of the at least one of the first lens location data and the second lens location data based on the capturing environment information.

<FIG> is a flowchart <NUM> illustrating a process, by an electronic device, of determining a lens location based on updated lens location conversion data according to an embodiment.

According to an embodiment, in operation <NUM>, the processor <NUM> of the electronic device <NUM> may activate the operation of the first camera similarly to operation <NUM>. In operation <NUM>, the processor <NUM> may obtain the first lens location data for the first camera similarly to operation <NUM>.

In operation <NUM>, the processor <NUM> may receive the camera switching command. When the camera switching command is received, in operation <NUM>, the processor <NUM> may determine the second lens location data indicating the lens location of the second camera based on the lens location conversion data stored in the memory <NUM> and the first lens location data. In operation <NUM>, the processor <NUM> may execute the auto focus function based on the determined lens location of the second camera. For example, referring to lens location conversion data <NUM> of <FIG>, when a first camera AF code <NUM> included in the first lens location data is <NUM>, the processor <NUM> may perform the auto focus function starting with the location of the lens of the second camera having a second camera AF code <NUM> of <NUM> as an initial location. The processor <NUM> may obtain second lens location data including information about the location of the lens of the second camera determined as a result of performing operation <NUM>.

In operation <NUM>, the processor <NUM> may determine whether the location of the lens of the second camera determined based on the lens location conversion data is correct. For example, when a difference between the location of the lens of the second camera determined based on the lens location conversion data and the location of the lens of the second camera determined as a result of executing the auto focus function in operation <NUM> is equal to or below a specified value, the processor <NUM> may determine that the location of the lens of the second camera determined based on the lens location conversion data is correct.

When the location of the lens of the second camera determined based on the lens location conversion data is not correct, in operation <NUM>, the processor <NUM> may update the lens location data based on the first lens location data obtained in operation <NUM> and the second lens location data obtained in operation <NUM>.

<FIG> is a diagram conceptually illustrating an example of lens location conversion data <NUM> according to an embodiment. Referring to <FIG>, the lens location conversion data <NUM> according to an embodiment may include the first camera AF code <NUM> corresponding to the location of the lens of the first camera <NUM> and the second camera AF code <NUM> corresponding to the first camera AF code <NUM>. According to an embodiment, the lens location conversion data <NUM> may be stored in the memory <NUM> in a form of a look-up table that allows a conversion between the first camera AF code <NUM> and the second camera AF code <NUM>. According to an embodiment, the lens location conversion data <NUM> may be stored in the memory <NUM> in a form of a function (or a formula) defining a relationship between the first camera AF code <NUM> and the second camera AF code <NUM>.

<FIG> illustrates a graph <NUM> for describing an example of collected lens location data and a lens location conversion function according to an embodiment.

Referring to the graph <NUM> of <FIG>, the processor <NUM> may collect lens location data <NUM> formed of a pair of first lens location data and second lens location data.

The processor <NUM> may update the lens location data based on lens location data <NUM> according to an embodiment. According to an embodiment, the processor <NUM> may store a set of the collected lens location data <NUM> in the memory <NUM> as new lens location conversion data. According to an embodiment, the processor <NUM> may merge the collected lens location data <NUM> with the lens location conversion data stored in the memory <NUM>. According to an embodiment, the processor <NUM> may determine a function <NUM> that defines a relationship between the first lens location data and the second lens location data from the set of the lens location data <NUM>. The processor <NUM> may store the determined function <NUM> as the lens location conversion data. As an example, the processor <NUM> may modify the function that defines the relationship between the first lens location data and the second lens location data stored in the memory <NUM> based on the collected lens location data <NUM>. However, a scheme for updating the lens location conversion data is not limited thereto.

<FIG> is a flowchart <NUM> illustrating a process of identifying lens location data according to an embodiment.

According to an embodiment, the processor <NUM> of the electronic device <NUM> may identify a validity of the lens location data based on capturing environment information about an environment condition associated with the image capturing (or performing the auto focus function). As an example, the processor <NUM> may use lens location data with the identified validity to update the lens location conversion data.

According to an embodiment, the processor <NUM> may perform operations <NUM> and <NUM> for obtaining the first lens location data and the second lens location data. In operation <NUM>, the processor <NUM> may obtain capturing environment information associated with at least one of the first lens location data and the second lens location data.

According to an embodiment, the operation <NUM> may include an operation, by the processor <NUM>, of obtaining information detected using a sensor of a sensor module (e.g., the sensor module <NUM> of <FIG>) included in the electronic device <NUM>. For example, the processor <NUM> may obtain information about motion of the electronic device <NUM> from a motion sensor (e.g., a gyro sensor, an acceleration sensor, or a gravity sensor) as the capturing environment information. As an example, the processor <NUM> may obtain a temperature value (e.g., an ambient temperature of the electronic device <NUM> or a camera internal temperature) using a temperature sensor as the capturing environment information. According to an embodiment, information included in the capturing environment information may include other information.

According to an embodiment, operation <NUM> may include an operation, by the processor <NUM>, of obtaining information about one or more of the first camera <NUM> and the second camera <NUM>. For example, the processor <NUM> may obtain a filter value for one or more of the first camera <NUM> and the second camera <NUM> as the capturing environment information. As an example, the processor <NUM> may obtain information associated with an image captured by one or more of the first camera <NUM> and the second camera <NUM> as the capturing environment information. For example, the processor <NUM> may obtain at least one of a brightness value, a signal to noise ratio (PD signal to noise ratio), or a disparity of a phase of the captured image as the capturing environment information.

In operation <NUM>, the processor <NUM> may identify a validity of the obtained lens location data. For example, the processor <NUM> may determine whether the lens location data is valid based on whether a value included in the lens location data is within a specified range. For example, when an x-axis value of a p-gyro sensor is equal to or above -<NUM> and equal to or below <NUM>, a y-axis value is equal to or above -<NUM> and equal to or below <NUM>, and a z-axis value is equal to or above -<NUM> and equal to or below <NUM>, the processor <NUM> may determine that the lens location data is valid. As an example, when the filter value is equal to or above <NUM>, the processor <NUM> may determine that the lens location data is valid. As an example, when the signal-to-noise ratio is equal to or above <NUM>, the processor <NUM> may determine that the lens location data is valid. As an example, when two or more types of the capturing environment information are included within a specified range, the processor <NUM> may determine that the lens location data is valid.

According to an embodiment, a condition for identifying the validity of the lens location data may be renewed based on a result of performing the auto focus function. For example, the processor <NUM> may adjust the specified range during the operation of at least one of the first camera <NUM> and the second camera <NUM> based on a motion value, a BV value, a filter value and a signal to noise ratio of an environment well-focused on the subject.

In operation <NUM>, the processor <NUM> may determine whether the lens location data is valid in response to the verification result. When it is determined that the lens location data is valid, the processor <NUM> may perform operation <NUM> of updating the lens location conversion data.

<FIG> is a diagram for describing a method for determining, by the electronic device <NUM>, the lens location conversion data <NUM> using learning data <NUM>, according to an embodiment.

According to an embodiment, when the first lens location data for the first camera <NUM> and the second lens location data for the second camera <NUM> are obtained, the electronic device <NUM> may map the obtained first and second lens location data with each other and accumulate and store the mapped first and second lens location data. The data that accumulates and stores the first lens location data (e.g., a first camera AF code <NUM> of <FIG>) and the second lens location data (e.g., a second camera AF code <NUM> of <FIG>) may be referred to as the learning data <NUM>.

According to an embodiment, the electronic device <NUM> may output a user interface for determining whether to update the lens location conversion data <NUM> through the display device <NUM>. When a user input of commanding the execution of the update is received through the user interface output through the display device <NUM>, the electronic device <NUM> may update the lens location conversion data <NUM> based on the learning data <NUM> in response to the user input. The user interface may be an item indicating the update of the lens location conversion data <NUM> on a menu screen or a message similar to the message <NUM> shown in <FIG>.

According to an embodiment, the user interface associated with the update of the lens location conversion data <NUM> may be output when an evaluation of a result of performing the auto focus function by the processor <NUM> is out of a specified range. For example, when an average time required to focus using the auto focus function is greater than a specified value, or when a quality of an image captured after focusing using the auto focus function is lower than a specified value, the user interface may be output.

An electronic device (e.g., the electronic device <NUM> of <FIG> or the electronic device <NUM> of <FIG>) according to an embodiment may include a camera (e.g., the camera module <NUM> of <FIG> or the camera <NUM> of <FIG>), a sensor (e.g., the sensor module <NUM> of <FIG> or the sensor <NUM> of <FIG>), a memory (e.g., the memory <NUM> of <FIG> or the memory <NUM> of <FIG>), and a processor (e.g., the processor <NUM> of <FIG> or the processor <NUM> of <FIG>) operatively connected with the camera, the sensor, and the memory. The sensor may detect a distance value, and a memory may store calibration data for correcting a lens location of the camera based on the distance value detected by the sensor. The memory may store instructions that, when executed, cause the processor to perform specified operations. The processor may determine the lens location of the camera based on the distance value of when the camera is operated when the instructions are executed. Further, the processor may obtain lens location data for the distance value and the determined lens location. Further, the processor may update the calibration data based on the lens location data, and determine the lens location of the camera based on the updated calibration data.

In this connection, the calibration data may be obtained by mapping a code corresponding to the lens location with the distance value.

Further, according to an embodiment, the processor may further obtain capturing environment information associated with a condition of an environment for the camera to capture an image, and identify a validity of the lens location data based on the capturing environment information. In updating of the calibration data, the processor may update the calibration data based on lens location data with the identified validity as the verification result of the lens location data. Further, according to an embodiment, the environment information may include at least one of motion information indicating a motion of the electronic device detected through a motion sensor, a filter value, a brightness value, a signal to noise ratio, a temperature value, and a disparity of the image captured by the camera.

Further, according to an embodiment, the processor may output a user interface for determining whether to update the calibration data on a display device (e.g., the display device <NUM> of <FIG> or the display device <NUM> of <FIG>), and update the calibration data in response to a user input received using the user interface. Further, according to an embodiment, the processor may store learning data obtained by accumulating the lens location data in the memory, and then update the calibration data based on the learning data in response to the user input. The processor may delete the learning data used for the update from the memory.

Further, according to an embodiment, the sensor may include a time-of-flight (TOF) module. The processor may obtain a light level value when the camera is operated, and may not update the calibration data in a case of a low light level environment in which the light level value is lower than a specified value. Further, the processor may perform an auto focus function using distance measurement information measured using the time-of-flight module in the low light level environment.

Further, according to an embodiment, an electronic device (e.g., the electronic device <NUM> of <FIG> or the electronic device <NUM> of <FIG>) may include a first camera (e.g., the camera module <NUM> of <FIG> or the first camera <NUM> of <FIG>), a second camera (the camera module <NUM> of <FIG> or the second camera <NUM> of <FIG>), a memory (e.g., the memory <NUM> of <FIG> or the memory <NUM> of <FIG>), and a processor (e.g., the processor <NUM> of <FIG> or the processor <NUM> of <FIG>). The processor may be operatively connected with the first camera, the second camera, and the memory. The memory may store lens location conversion data mapping first lens location data for the first camera with second lens location data for the second camera.

The memory may store instructions that, when executed, cause the processor to perform specified operations. The processor may obtain the first lens location data for the first camera when the first camera is operated when the instructions are executed. The processor may obtain the second lens location data for the second camera in response to a first camera switching command (e.g., operation <NUM> of <FIG>) for switching a selected camera from the first camera to the second camera. Further, the processor may update the lens location conversion data based on the first lens location data and the second lens location data. After the lens location conversion data is updated, the processor may determine a lens location of the second camera based on the updated lens location conversion data in response to a second camera switching command (e.g., operation <NUM> of <FIG>) for switching the selected camera from the first camera to the second camera.

According to an embodiment, environment information may include at least one of motion information indicating a motion of the electronic device detected through a motion sensor, a filter value, a brightness value, a signal to noise ratio, a temperature value, and a disparity.

According to an embodiment, the processor may calculate a distribution chart associated with at least one of the first lens location data and the second lens location data. The processor may update the lens location conversion data when the at least one of the first lens location data and the second lens location data is included in a region in the distribution chart having a low density of data.

According to an embodiment, the electronic device may further include a display device (e.g., the display device <NUM> of <FIG> or the display device <NUM> of <FIG>). The processor may output a user interface for determining whether to update the lens location conversion data on the display device, and update the lens location conversion data in response to a user input received using the user interface.

According to an embodiment, the processor may accumulate a pair of data obtained by mapping the first lens location data and the second lens location data with each other and store the pair of data in the memory as learning data when the lens location data is valid. Further, the processor may update the lens location conversion data based on the learning data in response to the user input received through the user interface. Further, the processor may delete the learning data used for the update from the memory.

According to an embodiment, the first camera and the second camera may respectively include lenses different from each other in at least one of a focal length and an angle of view.

According to an embodiment, the processor may determine a lens location conversion function based on the lens location conversion data. Further, the processor may input a lens location of the first camera into the determined lens location conversion function in response to the second camera switching command (e.g., the operation <NUM> of <FIG>). The processor may determine a lens location of the second camera based on a value returned by the lens location conversion function in response to the input lens location of the first camera.

According to an embodiment, a method for determining a lens location by an electronic device (e.g., the electronic device <NUM> of <FIG> or the electronic device <NUM> of <FIG>) having a camera (e.g., the camera module <NUM> of <FIG> or the camera <NUM> of <FIG>), the electronic device may obtain a distance value using a distance sensor (e.g., the sensor module <NUM> of <FIG> or the sensor <NUM> of <FIG>). Further, the electronic device may determine a lens location based on the distance value when the camera is operated. Further, a processor may update calibration data based on lens location data including information about the distance value and the determined lens location. Thereafter, the processor may determine the lens location of the camera based on the updated calibration data.

According to an embodiment, the electronic device may obtain capturing environment information of the camera. Further, the updating of the calibration data may include identifying a validity of the lens location data based on the capturing environment information. Further, the updating of the calibration data may include updating the calibration data based on the lens location data having the identified validity as a result of identifying the validity of the lens location data.

According to an embodiment, the electronic device may further perform accumulating and storing the lens location data as learning data. Further, the updating of the calibration data may further include receiving a user input associated with the update of the calibration data, and updating the calibration data based on the learning data in response to the user input.

In an embodiment, according to a method for determining a lens location by an electronic device (e.g., the electronic device <NUM> of <FIG> or the electronic device <NUM> of <FIG>) having a first camera (e.g., the camera module <NUM> of <FIG> or the first camera <NUM> of <FIG>) and a second camera (e.g., the camera module <NUM> of <FIG> or the second camera <NUM> of <FIG>), the electronic device may obtain first lens location data for the first camera when the first camera is operated. A processor may perform obtaining second lens location data for the second camera by executing an auto focus function in response to a first camera switching command (e.g., the operation <NUM> of <FIG>) for switching a selected camera from the first camera to the second camera. Further, the electronic device may update lens location conversion data mapping a first lens location for the first camera and a second lens location for the second camera with each other based on the first lens location data and the second lens location data. Thereafter, the electronic device may determine a lens location of the second camera based on the updated lens location conversion data in response to a second camera switching command (e.g., the operation <NUM> of <FIG>) for switching the selected camera from the first camera to the second camera.

The electronic device according to various embodiments disclosed in the disclosure may be various types of devices. The electronic device may include, for example, a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a mobile medical appliance, a camera, a wearable device, or a home appliance. The electronic device according to an embodiment of the disclosure should not be limited to the above-mentioned devices.

It should be understood that various embodiments of the disclosure and terms used in the embodiments do not intend to limit technical features disclosed in the disclosure to the particular embodiment disclosed herein. With regard to description of drawings, similar or related components may be assigned with similar reference numerals. As used herein, singular forms of noun corresponding to an item may include one or more items unless the context clearly indicates otherwise. In the disclosure disclosed herein, each of the expressions "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "one or more of A, B, and C", or "one or more of A, B, or C", and the like used herein may include any and all combinations of one or more of the associated listed items. The expressions, such as "a first", "a second", "the first", or "the second", may be used merely for the purpose of distinguishing a component from the other components, but do not limit the corresponding components in other aspect (e.g., the importance or the order).

The term "module" used in the disclosure may include a unit implemented in hardware, software, or firmware and may be interchangeably used with the terms "logic", "logical block", "part" and "circuit". The "module" may be a minimum unit of an integrated part or may be a part thereof. The "module" may be a minimum unit for performing one or more functions or a part thereof. For example, according to an embodiment, the "module" may include an application-specific integrated circuit (ASIC).

Various embodiments of the disclosure may be implemented by software (e.g., the program <NUM>) including an instruction stored in a machine-readable storage medium (e.g., an internal memory <NUM> or an external memory <NUM>) readable by a machine (e.g., the electronic device <NUM>). For example, the processor (e.g., the processor <NUM>) of a machine (e.g., the electronic device <NUM>) may call the instruction from the machine-readable storage medium and execute the instructions thus called. This means that the machine may perform at least one function based on the called at least one instruction. The one or more instructions may include a code generated by a compiler or executable by an interpreter. The machine-readable storage medium may be provided in the form of non-transitory storage medium. Here, the term "non-transitory", as used herein, means that the storage medium is tangible, but does not include a signal (e.g., an electromagnetic wave). The term "non-transitory" does not differentiate a case where the data is permanently stored in the storage medium from a case where the data is temporally stored in the storage medium.

According to an embodiment, the method according to various embodiments disclosed in the disclosure may be provided as a part of a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of machine-readable storage medium (e.g., a compact disc read only memory (CD-ROM)) or may be directly distributed (e.g., download or upload) online through an application store (e.g., a Play Store™) or between two user devices (e.g., the smartphones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or generated in a machine-readable storage medium such as a memory of a manufacturer's server, an application store's server, or a relay server.

According to various embodiments, each component (e.g., the module or the program) of the above-described components may include one or plural entities. According to various embodiments, at least one or more components of the above components or operations may be omitted, or one or more components or operations may be added. Alternatively or additionally, some components (e.g., the module or the program) may be integrated in one component. In this case, the integrated component may perform the same or similar functions performed by each corresponding components prior to the integration. According to various embodiments, operations performed by a module, a programming, or other components may be executed sequentially, in parallel, repeatedly, or in a heuristic method, or at least some operations may be executed in different sequences, omitted, or other operations may be added.

According to the embodiments disclosed in the disclosure, the accuracy of the lens location matching the distance information may be improved based on the usage environment of the electronic device.

Further, according to the embodiments disclosed in the disclosure, when the camera of the electronic device having the plurality of cameras is switched, the location of the lens for find the focus may be determined more rapidly.

Claim 1:
An electronic device comprising:
a camera comprising a lens;
a distance sensor for detecting a distance value relative to an object;
a memory for storing calibration data comprising a look-up table which matches a lens location of the camera to the distance value detected by the distance sensor; and
a processor operatively connected with the camera, the distance sensor, and the memory,
wherein the memory stores instructions that, when executed, cause the processor to:
determine the lens location of the camera using the distance value, detected by the distance sensor, and the calibration data, by searching for the lens location matching the distance value from the calibration data in the look-up table, based on the camera being operated;
execute an auto focus function using the determined lens location of the camera;
obtain lens location data, including information about the distance value for the object and the lens location focused on the object as a result of executing the auto focus function;
obtain a brightness value while the camera is operated;
identify whether the brightness value is lower than a specified value;
if the brightness value is lower than the specified value, maintain the calibration data;
if the brightness value is greater than or equal to the specified value, update the calibration data based on the obtained lens location data; and
determine the lens location of the camera based on the updated calibration data.