CN117970725A - Focusing control method and related device - Google Patents

Focusing control method and related device Download PDF

Info

Publication number
CN117970725A
CN117970725A CN202211300163.2A CN202211300163A CN117970725A CN 117970725 A CN117970725 A CN 117970725A CN 202211300163 A CN202211300163 A CN 202211300163A CN 117970725 A CN117970725 A CN 117970725A
Authority
CN
China
Prior art keywords
fitting
target
voltage value
phase difference
adjustable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211300163.2A
Other languages
Chinese (zh)
Inventor
胡昌盛
黄婉千
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Oppo Communication Technology Co ltd
Original Assignee
Xi'an Oppo Communication Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Oppo Communication Technology Co ltd filed Critical Xi'an Oppo Communication Technology Co ltd
Priority to CN202211300163.2A priority Critical patent/CN117970725A/en
Publication of CN117970725A publication Critical patent/CN117970725A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)

Abstract

The application discloses a focusing control method and a related device, which are applied to electronic equipment, wherein the method comprises the following steps: when the camera is turned on, acquiring a phase difference source image and an initial voltage value corresponding to an initial focusing position; determining a target focusing position; acquiring a target phase difference of a target focusing position according to the phase difference source image; obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, and the section a of fitting straight lines comprise a-1 dividing points; determining a target fitting line from the target fitting broken line according to the initial voltage value and a-1 dividing points, wherein the target fitting line is at least one section of fitting straight line in the section a of fitting straight line; determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value; the adjustable-focus lens is adjusted according to the target voltage adjustment amount. By adopting the embodiment of the application, the focusing accuracy of the adjustable lens can be improved.

Description

Focusing control method and related device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a focus control method and a related device.
Background
Along with the wide popularization and application of electronic devices (such as mobile phones, tablet computers and the like), the electronic devices can support more and more applications, have more and more functions, and develop towards diversification and individuation, so that the electronic devices become indispensable electronic articles in the life of users.
Of course, the shots of the electronic device are also continually iteratively updated. For example, adjustable lenses (Tlens) are also increasingly used in electronic devices. Generally, a focus-adjustable lens refers to a liquid lens, and mainly uses different voltages applied to the lens to deform a component with a changeable internal shape, so that focusing can be achieved through the deformed focus-adjustable lens, but at present, the focus-adjustable lens has low focusing accuracy, so that the problem of how to improve the focusing accuracy of the focus-adjustable lens is needed to be solved.
Disclosure of Invention
The embodiment of the application provides a focusing control method and a related device, which can improve the focusing accuracy of a focusing lens.
In a first aspect, an embodiment of the present application provides a focus control method, applied to an electronic device, where the electronic device includes an adjustable lens, the method includes:
when the camera is turned on, acquiring a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image;
Determining a target focusing position;
Acquiring a target phase difference corresponding to the target focusing position according to the phase difference source image;
Obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section a of fitting straight lines comprises a-1 division points, and the division points are intersection points of different fitting straight lines;
Determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one fitting straight line in the a-section fitting straight line;
Determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
and adjusting the adjustable-focus lens according to the target voltage adjustment amount.
In a second aspect, an embodiment of the present application provides an in-focus control apparatus applied to an electronic device including an adjustable-focus lens, the apparatus including: an acquisition unit, a determination unit and an adjustment unit, wherein,
The acquisition unit is used for acquiring a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image when the camera is opened;
the determining unit is used for determining a target focusing position;
The acquisition unit is further used for acquiring a target phase difference corresponding to the target focusing position according to the phase difference source image; obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section a of fitting straight lines comprises a-1 division points, and the division points are intersection points of different fitting straight lines;
The determining unit is used for determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one section of fitting straight line in the a section of fitting straight line; determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
The adjusting unit is used for adjusting the adjustable-focus lens according to the target voltage adjusting quantity.
In a third aspect, an embodiment of the present application provides an electronic device including a processor, a memory for storing one or more programs and configured to be executed by the processor, the programs including instructions for performing part or all of the steps as described by the first party.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to perform part or all of the steps described in the first aspect of the embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
It can be seen that, the focusing control method and related apparatus described in the embodiments of the present application are applied to an electronic device, where the electronic device includes an adjustable focus lens, when a camera is turned on, a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image are obtained, a target focusing position is determined, a target phase difference corresponding to the target focusing position is obtained according to the phase difference source image, a target fitting broken line is obtained, the target fitting broken line includes a-section fitting straight lines, a is an integer greater than 1, an abscissa of the target fitting broken line is a voltage value, and an ordinate of the target fitting broken line is a phase difference, the a-section fitting straight lines include a-1 division points, the division points are intersections of different fitting straight lines, a target fitting line is determined from the target fitting broken line according to the initial voltage value and the a-1 division points, and the target fitting line is at least one section of the a-section fitting straight lines, the target voltage adjustment quantity is determined according to the target fitting line, the target phase difference and the initial voltage value, and the adjustable focus lens is adjusted according to the target voltage adjustment quantity, on one hand, after the camera is opened, the corresponding voltage adjustment quantity is determined based on the phase difference of the focusing position, the initial voltage value, the fitting fold line and the dividing point thereof, namely, the voltage value corresponding to the phase difference can be searched from the fitting fold line by utilizing the phase difference, the initial voltage value is compared with the voltage value of the dividing point to determine the optimal fitting straight line, then the voltage value corresponding to the phase difference and needing to be adjusted is searched based on the fitting straight line, and then the voltage value is compared with the initial voltage value to determine the voltage adjustment quantity, on the other hand, the nonlinear characteristic of the PD curve of the adjustable focus lens can be overcome due to the adoption of the fitting fold line, further, the focusing accuracy of the adjustable-focus lens is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
Fig. 2 is a schematic software structure of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a focus control method according to an embodiment of the present application;
FIG. 4 is a schematic illustration of an in-focus position provided by an embodiment of the present application;
FIG. 5 is a schematic illustration of a fitted polyline provided by an embodiment of the present application;
FIG. 6 is a schematic illustration of another fitted polyline provided by an embodiment of the present application;
FIG. 7 is a schematic illustration of another fitted polyline provided by an embodiment of the present application;
FIG. 8 is a schematic illustration of another fitted polyline provided by an embodiment of the present application;
FIG. 9 is a flowchart of another focus control method according to an embodiment of the present application;
FIG. 10 is a graph of MTF for the same adjustable focus lens provided in an embodiment of the present application;
FIG. 11 is a schematic flow chart of adjusting the adjustable lens from an initial voltage to a preset voltage according to a voltage increasing direction according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a voltage variation of adjusting the adjustable lens from an initial voltage to a preset voltage according to a voltage increasing direction provided in an embodiment of the present application;
FIG. 13 is a schematic flow chart of adjusting the adjustable lens from an initial voltage to a preset voltage according to a voltage decreasing direction in an embodiment of the present application;
FIG. 14 is a flowchart of another focus control method according to an embodiment of the present application;
FIG. 15 is a flowchart of another focus control method according to an embodiment of the present application;
FIG. 16 is a flowchart of another focus control method according to an embodiment of the present application;
FIG. 17 is a flowchart of another focus control method according to an embodiment of the present application;
Fig. 18 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 19 is a block diagram showing functional units of a focus control apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
For a better understanding of aspects of embodiments of the present application, related terms and concepts that may be related to embodiments of the present application are described below.
It will be understood that the terms first, second, etc. as used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first threshold voltage may be referred to as a second threshold voltage, and similarly, a second threshold voltage may be referred to as a first threshold voltage, without departing from the scope of the application. Both the first threshold voltage and the second threshold voltage are threshold voltages, but they are not the same threshold voltage.
In particular implementations, the electronic devices may include electronic devices with adjustable lenses (Tlens), such as handheld devices (smartphones, tablets, etc.), in-vehicle devices (navigators, assisted reversing systems, vehicle recorders, in-vehicle refrigerators, etc.), wearable devices (smartphones, wireless headphones, smartwatches, smart glasses, etc.), customer premise Equipment (customer premise Equipment, CPE), computing devices or other processing devices connected to wireless modems, as well as various forms of User Equipment (UE), mobile Stations (MS), virtual reality/augmented reality devices, terminal devices (TERMINAL DEVICE), etc.
The electronic device may further include an intelligent home device, where the intelligent home device may be at least one of: the intelligent sound box, the intelligent camera, the intelligent electric cooker, the intelligent wheelchair, the intelligent massage chair, the intelligent furniture, the intelligent dish washer, the intelligent television, the intelligent refrigerator, the intelligent electric fan, the intelligent warmer, the intelligent clothes hanger, the intelligent lamp, the intelligent router, the intelligent switch board, the intelligent humidifier, the intelligent air conditioner, the intelligent door, the intelligent window, the intelligent cooking bench, the intelligent disinfection cabinet, the intelligent toilet, the sweeping robot and the like are not limited herein.
In the embodiment of the application, the PD curve refers to a curve of which the phase difference of object imaging changes along with the change of focusing positions in the focusing process of the camera on the object at a fixed object distance. The phase detection focusing (phase detection auto focus, PDAF), namely the system detects the phase difference between the current position and the focusing position, directly calculates the focusing position, and completes focusing, so that the focusing speed is higher, and the focusing is not influenced by the difference between the target position and the current position. The focusing lens of the electronic equipment in the embodiment of the application realizes focusing adjustment based on the PDAF technology.
In the embodiment of the application, the contrast focusing (contrast auto focus, CAF) system detects the image definition of a plurality of focusing positions, detects the position of the image with the highest definition, completes focusing, and has slower focusing speed, especially when the difference between the target position and the current position is larger.
With the continuous development of the related technology of the electronic device, the lens of the electronic device is also continuously and iteratively updated. For example, adjustable focus lenses are also increasingly used in electronic devices. In general, a focus adjustable lens refers to a liquid lens in which a variable internal shape member is deformed mainly by different voltages applied thereto, so that focusing can be achieved by the deformed focus adjustable lens.
Wherein the variable inner shape component of the adjustable lens is mainly made of piezoelectric materials. However, since the piezoelectric materials each have a hysteresis characteristic, the deformation amount of the piezoelectric material in the course of deformation with the applied voltage depends not only on the magnitude of the applied voltage but also on the initial shape of the piezoelectric material. For example, when the voltage Tlens (adjustable lens) is increased from 0 (V) to X (V) or from a higher voltage to X (V), since the piezoelectric materials each have hysteresis characteristics, although Tlens (adjustable lens) is at the same voltage X (V) at this time, it is apparent that the deformation amounts of the piezoelectric materials in Tlens (adjustable lens) are completely different in these two cases, that is, there is a difference in the shape of the piezoelectric thin film. Since there is a difference in the shape of the piezoelectric film in these two cases Tlens (adjustable focus lens), this will result in a difference in the diopter of Tlens, which in turn, will result in two different resolution images being acquired by Tlens at the same voltage.
Then, extending to the entire adjustable voltage range interval of Tlens, when focusing is performed by Tlens, then Tlens will correspond to two different resolution images at each voltage. Therefore, it is difficult to determine which voltage corresponds to the image with the highest definition to the bottom by adopting the focusing algorithm, and thus the problem of inaccurate focusing often occurs in the focusing process by the adjustable lens.
The first part, the software and hardware operation environment of the technical scheme disclosed by the application is introduced as follows.
As shown, fig. 1 shows a schematic structural diagram of an electronic device 100. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an ear-piece interface 170D, a sensor module 180, a compass 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriber identification module, SIM) card interface 195, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor AP, a modem processor, a graphics processor GPU, an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural network processor NPU, etc. Wherein the different processing units may be separate components or may be integrated in one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. In other embodiments, memory may also be provided in the processor 110 for storing instructions and data. Illustratively, the memory in the processor 110 may be a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. This avoids repeated accesses and reduces the latency of the processor 110, thereby improving the efficiency of the electronic device 100 in processing data or executing instructions. The processor may also include an image processor, which may be an image Pre-processor (preprocess IMAGE SIGNAL processor, pre-ISP), which may be understood as a simplified ISP, which may also perform some image processing operations, e.g., may obtain image statistics.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include inter-integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interfaces, inter-integrated circuit audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interfaces, pulse code modulation (pulse code modulation, PCM) interfaces, universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interfaces, mobile industry processor interfaces (mobile industry processor interface, MIPI), general-purpose input/output (GPIO) interfaces, SIM card interfaces, and/or USB interfaces, among others. The USB interface 130 is an interface conforming to the USB standard, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. The USB interface 130 may also be used to connect headphones through which audio is played.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle times, battery health (leakage, impedance), and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G/6G, etc. applied on the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wi-Fi (WIRELESS FIDELITY) network), bluetooth (BT), global navigation satellite system (global navigation SATELLITE SYSTEM, GNSS), frequency modulation (frequency modulation, FM), near Field Communication (NFC), infrared (IR), etc. applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, an organic light-emitting diode (OLED), an active-matrix organic LIGHT EMITTING diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (MINI LIGHT-emitting diode, miniled), microLed, micro-oLed, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or more display screens 194.
The electronic device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, so that the electrical signal is converted into an image visible to naked eyes. ISP can also perform algorithm optimization on noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature, etc. of the photographed scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or more cameras 193.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 may cause the electronic device 100 to execute the method of displaying page elements provided in some embodiments of the present application, as well as various applications, data processing, and the like, by executing the above-described instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system; the storage program area may also store one or more applications (such as gallery, contacts, etc.), etc. The storage data area may store data created during use of the electronic device 100 (e.g., photos, contacts, etc.), and so on. In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage units, flash memory units, universal flash memory (universal flash storage, UFS), and the like. In some embodiments, processor 110 may cause electronic device 100 to perform the methods of displaying page elements provided in embodiments of the present application, as well as other applications and data processing, by executing instructions stored in internal memory 121, and/or instructions stored in a memory provided in processor 110. The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., X, Y and the Z-axis) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the location where the display 194 is connected.
By way of example, fig. 2 shows a block diagram of the software architecture of the electronic device 100. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun rows (Android runtime) and system libraries, and a kernel layer, respectively. The application layer may include a series of application packages.
As shown in fig. 2, the application layer may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for the application of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android runtime is responsible for scheduling and management of the android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media library (media library), three-dimensional graphics processing library (e.g., openGL ES), 2D graphics engine (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The second part, the focus control method and the related device disclosed in the embodiment of the application are described as follows.
Referring to fig. 3, fig. 3 is a schematic diagram of an embodiment of a focus control method applied to an electronic device shown in fig. 1 or fig. 2, where the electronic device includes an adjustable lens, the focus control method may include the following steps:
301. when the camera is turned on, a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image are acquired.
In the embodiment of the application, when the camera is turned on, a phase difference source image (PD raw) can be acquired, wherein the phase difference source image can be a phase difference source image stored when the camera function is used last time, the phase difference source image can correspond to an initial focusing position, and the initial focusing position can correspond to an initial voltage value. The phase difference source image may include a plurality of pixel points, and each pixel point may correspond to one phase difference, that is, the phase differences at different positions are different.
302. And determining the target focusing position.
In the embodiment of the application, the target focusing position can be set by a user or default by the system. As shown in fig. 4, when the user performs a touch operation on the position of the dashed box in the figure, a corresponding target focusing position may appear, for example, the center point of the touch operation may be used as the target focusing position, and the user may select the focusing position by itself in this manner.
Optionally, the determining the target focusing position in step 302 may include the following steps:
a21, acquiring a preview image;
A22, carrying out target recognition on the preview image to obtain a target area;
A23, determining the target focusing position according to the target area;
Or alternatively;
B21, acquiring a target touch position aiming at the preview image;
and B22, determining the target focusing position according to the target touch position.
In the embodiment of the application, a preview image may be obtained, and then, a target area may be obtained by performing target recognition on the preview image, where the target area may be used as a target focusing position, and the recognized target may be a person, or other objects, which may be executed by a user or default by a system, for example, the objects may be animals, foods, and the like, which are not limited herein.
In addition, in the embodiment of the application, the user can perform touch operation on the preview image, further, the target touch position is obtained, and the target touch position can be used as the target focusing position, so that personalized focusing operation can be realized based on the user wish.
303. And acquiring a target phase difference corresponding to the target focusing position according to the phase difference source image.
In the embodiment of the application, the target focusing position can correspond to one coordinate position, and further, the target phase difference corresponding to the coordinate position can be obtained from the phase difference image based on the coordinate position.
304. The method comprises the steps of obtaining a target fitting broken line, wherein the target fitting broken line comprises a section of fitting straight line, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section of fitting straight line comprises a-1 division points, and the division points are intersection points of different fitting straight lines.
In the embodiment of the application, the target fitting broken line can be preset or default, and different fitting broken lines can be corresponding to different target focusing positions.
The target fit broken line may include a segment of fit straight line, a is an integer greater than 1, the abscissa of the target fit broken line is a voltage value, and the ordinate is a phase difference, that is, the x-axis represents the voltage value, and the y-axis represents the phase difference. The a-segment fitting straight line can comprise a-1 division points, namely the division points are the intersection points of different fitting straight lines. Each fitted line corresponds to a respective slope.
For example, as shown in fig. 5, it can be seen that when the fit broken line includes 1 division point, the fit broken line may be formed by a1 st fit straight line and a2 nd fit straight line, and the intersection point of the 2 nd fit straight line is the division point.
For further illustration, as shown in fig. 6, it can be seen that when the fitted broken line includes 2 division points, the fitted broken line may be formed by a 1 st fitted straight line, a 2 nd fitted straight line, and a 3 rd fitted straight line, and the intersection point of the fitted broken line is the division point, that is, the division point 1 and the division point 2.
Optionally, the step 304 of obtaining the target fit polyline may include the following steps:
41. Determining a target area identifier corresponding to the target focusing position;
42. and determining the target fitting broken line corresponding to the target region identifier according to a mapping relation between the preset region identifier and the fitting broken line.
In the embodiment of the application, the preview image can be divided into a plurality of areas in advance, different areas can correspond to different area identifications, and further, the target area identification corresponding to the target focusing position can be determined.
Of course, a mapping relation between a preset area identifier and a fitting fold line can be stored in advance, and then a target fitting fold line corresponding to the target area identifier can be determined based on the mapping relation, so that different fitting fold lines can be calibrated in advance based on different areas, and focusing accuracy can be improved.
305. And determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one fitting straight line in the a-section fitting straight line.
The target fitting line may be a fitting straight line or a fitting broken line.
In the embodiment of the application, the initial voltage value and the voltage values corresponding to the a-1 dividing points can be compared, and the corresponding fitting straight line is selected as the target fitting line according to the comparison result.
Taking the fitting broken line shown in fig. 5 as an example, the initial voltage value may be compared with the voltage value of the dividing point, if the initial voltage value is smaller than the voltage value of the dividing point, the 1 st fitting straight line may be used as the target fitting line, otherwise, if the initial voltage value is greater than or equal to the voltage value of the dividing point, the 2 nd fitting straight line may be used as the target fitting line.
For further illustration, taking the fitting broken line shown in fig. 6 as an example, the initial voltage value may be compared with the voltage values of 2 division points, if the initial voltage value is smaller than the voltage value of the division point 1, the 1 st fitting straight line may be used as the target fitting line, if the initial voltage value is greater than or equal to the voltage value of the division point 1 and smaller than the voltage value of the division point 2, the 2 nd fitting straight line may be used as the target fitting line, if the initial voltage value is greater than or equal to the voltage value of the division point 2, the 3 rd fitting straight line may be used as the target fitting line, and so on.
In specific implementation, the target fitting line can be determined from the target fitting broken lines according to the initial voltage value, a-1 division points and the target phase difference, the target fitting line is at least one fitting straight line in the a section of fitting straight lines, specifically, two straight lines x=initial voltage value and y=target phase difference can be made, the intersection point with the target fitting broken lines is determined through the two straight lines, and the straight line where the intersection point is located and the straight line between the intersection points can be taken as the target fitting line. In practical application, when the initial voltage value is close to the dividing point (when the initial voltage value is close to the voltage value of the dividing point), the phase difference spans the dividing point, and the slopes of the front section line and the back section line are called to generate corresponding fitting lines.
306. And determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value.
In the embodiment of the application, under the condition that the target fitting line and the target phase difference are determined, the reference voltage value corresponding to the target phase difference on the target fitting line can be determined, and then the difference value between the reference voltage value and the initial voltage value is used for determining the target voltage adjustment quantity.
Optionally, the step 306 determines a target voltage adjustment amount according to the target fitting line, the target phase difference, and the initial voltage value, including:
61. determining a reference voltage value corresponding to the target phase difference according to the target fitting line;
62. And determining the target voltage adjustment amount according to the reference voltage value and the initial voltage value.
In a specific implementation, as shown in fig. 7, in the case of determining the target fitting line, a straight line may be made, that is, y=the target phase difference, and an intersection point C may be generated between the straight line and the target fitting line, where the abscissa of the intersection point C is the reference voltage value, and then the difference between the reference voltage value and the initial voltage value may be used as the target voltage adjustment amount.
307. And adjusting the adjustable-focus lens according to the target voltage adjustment amount.
In the embodiment of the application, the adjustable-focus lens can be adjusted based on the target voltage adjustment amount. Due to the nonlinear characteristic of the PD curve of the Tlens camera, further, in the embodiment of the application, focusing adjustment is realized based on the fitting broken line, and focusing adjustment accuracy is improved.
Optionally, before the step 301, the method may further include the following steps:
A1, acquiring a voltage regulation range of the adjustable lens, and sampling the voltage regulation range to obtain P sampling voltages, wherein P is an integer greater than 1, and the voltage regulation range comprises a minimum adjustable voltage value and a maximum adjustable voltage value;
A2, acquiring phase difference source images corresponding to each sampling voltage in the P sampling voltages to obtain P phase difference source images;
A3, dividing each phase difference source image in the P phase difference source images into M and N areas according to a preset area dividing rule to obtain P and N area images, wherein M, N are integers which are larger than or equal to 1, and M and N are larger than 1;
a4, classifying according to the P.M.N area images to obtain M.N area image sets, wherein each area image set comprises P area images, the spatial positions of the P area images are the same, and each area image corresponds to one sampling voltage;
A5, fitting each of the M x N regional image sets to obtain M x N sets of fitting data, wherein each set of fitting data comprises P fitting points, and the abscissa of each fitting point is a voltage value and the ordinate of each fitting point is a phase difference;
And A6, fitting according to the M x N sets of fitting data to obtain M x N fitting fold lines.
In the embodiment of the application, the voltage adjustment range of the adjustable lens can be obtained, the voltage adjustment range can comprise a minimum adjustable voltage value Min and a maximum adjustable voltage value Max, then the voltage adjustment range can be sampled to obtain P sampling voltages, P is an integer greater than 1, and a specific sampling mode can comprise uniform sampling or random sampling.
Then, a phase difference source image corresponding to each sampling voltage in the P sampling voltages can be obtained to obtain P phase difference source images, that is, each sampling voltage corresponds to one phase difference source image, and each phase difference source image in the P phase difference source images is divided into m×n areas according to a preset area division rule to obtain p×m×n area images, M, N are integers greater than or equal to 1, and m×n is greater than 1, wherein the preset area division can be preset or default, for example, a nine-square lattice. Each region image may correspond to a region identifier, for example, taking a nine-square grid as an example, the 9 squares of the region image may be labeled, and then classified according to p×m×n region images to obtain m×n region image sets, where each region image set includes P region images, the spatial positions of the P region images are the same, and each region image corresponds to a sampling voltage, that is, the region images with the same region identifier may be divided into one region image set.
Further, each of m×n sets of region images may be fitted to obtain m×n sets of fitting data, where each set of fitting data may include P fitting points, and an abscissa of each fitting point is a voltage value, and an ordinate of each fitting point is a phase difference, so that each region image may be processed into one fitting point, and then fitting is performed according to m×n sets of fitting data to obtain m×n fitting fold lines, that is, each region identifier may correspond to one fitting fold line, where the target fitting fold line is one fitting fold line of m×n fitting fold lines.
Further, optionally, the step A6, performing fitting according to the m×n sets of fitting data to obtain m×n fitting broken lines, may include the following steps:
A61, obtaining k fitting points in the ith fitting data as dividing points, wherein the ith fitting data is any fitting data in the M x N fitting data, and k is a positive integer smaller than P;
a62, dividing the i-th fitting data into k+1 fitting point sets based on the voltage values of the k fitting points;
A63, fitting each fitting point set in the k+1 fitting point sets to obtain a k+1 section fitting straight line;
A64, determining a fitting broken line corresponding to the ith group of fitting data according to the k+1 section of fitting straight line.
In the embodiment of the present application, taking the ith set of fitting data as an example, the ith set of fitting data is any set of fitting data in the m×n sets of fitting data, k fitting points in the ith set of fitting data may be obtained as the dividing points, k is a positive integer smaller than P, then the ith set of fitting data may be divided into k+1 fitting point sets based on the voltage values of the k fitting points, for example, when k is an odd number, the fitting point with the voltage value in the k fitting points at the middle position may be used as the dividing point, for example, when k is an even number, any one of the two fitting points with the voltage value in the k fitting points at the middle position may be used as the dividing point.
Then, each fitting point set in the k+1 fitting point sets can be fitted to obtain k+1 sections of fitting straight lines, and finally, the fitting broken lines corresponding to the ith group of fitting data can be determined according to the k+1 sections of fitting straight lines, namely, the k+1 sections of fitting straight lines are connected based on the dividing points to obtain the fitting broken lines.
For example, as shown in fig. 8, 10 fitting points are provided, each fitting point corresponds to a voltage value and a phase difference, then a point P with the voltage value at a middle position can be used as a dividing point, the 10 fitting points are divided into 2 sets, fitting is performed on the fitting points of the 2 sets to obtain a1 st section fitting straight line and a 2 nd section fitting straight line, finally, the 2 section fitting straight lines are connected based on the point P to obtain a fitting broken line, and so on.
Optionally, in the step A6, fitting each of the m×n regional image sets to obtain m×n sets of fitting data may include the following steps:
And acquiring a phase difference of each region image in the jth region image set corresponding to a preset focusing position and a voltage value corresponding to the region image, and forming fitting points by the phase difference and the voltage value, so as to obtain the P fitting points, wherein the jth region image set is any region image set in the M x N region image sets.
In a specific implementation, the preset focusing position may be preset or default. Taking the jth area image set as an example, the jth area image set is any area image set in the m×n area image sets, then a phase difference between each area image in the jth area image set and a preset focusing position and a voltage value corresponding to the area image can be obtained, and the phase difference and the voltage value corresponding to the area image can be formed into fitting points, so that P fitting points are obtained.
Taking a mobile phone as an example, in the embodiment of the application, before leaving the factory, in the calibration process, a custom target is placed at a position corresponding to an object distance in a point in a range of change of a camera design image distance Tlens. If a camera is designed to have a certain Tlens camera design image distance of 3.33mm from the midpoint of the variation range, the corresponding object distance is about L (30 cm), namely a special target is placed at a position which is far from the camera L (30 cm); then the voltage of Tlens piezoelectric materials is increased from Min voltage to Max voltage, a PD raw image output by an image sensor is evenly obtained, then the PD raw image is reasonably partitioned (for example, divided into 8*6 areas), a curve of the PD of each area associated with focusing positions (voltage values) is obtained, and then the PD curve is reasonably segmented according to the morphological characteristics of the PD curve. For example, the PD curve inf (infinitely large) to 30cm is divided into a first segment, the curve 30cm to 15cm is divided into a second segment, and of course, the principle of three segments and more segments is the same, and the description is omitted here.
Next, the two PD curves of each area may be linearly fitted to obtain a segmentation slope k1 (the slope of the 1 st segment of the fitting line), a segmentation slope k2 (the slope of the 2 nd segment of the fitting line) and a segmentation point P of each area, and the segmentation point P and the segmentation slope of each area are recorded in the memory area of the camera, so as to complete calibration, and the segmentation calibration slopes k1, k2 and the recorded segmentation point P are shown in fig. 8.
In practical application, after a user turns on the camera, the system acquires a voltage value corresponding to the sensor PD raw image and the current focusing position, the PD phase difference of a focusing target (target focusing position) is calculated according to the PD phase difference, the current focusing position and known k1, k2 and P point positions, the difference between the target focusing position and the current focusing position, namely, the voltage difference, is calculated, and then the voltage is changed by Tlens based on the voltage difference to complete quick focusing, so that the Tlens camera can perform PDAF quick focusing according to the phase difference, and the focusing speed is far higher than that of the traditional CAF focusing scheme.
It can be seen that, the focusing control method described in the embodiment of the present application is applied to an electronic device, where the electronic device includes an adjustable focus lens, when a camera is turned on, a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image are obtained, a target focusing position is determined, a target phase difference corresponding to the target focusing position is obtained according to the phase difference source image, a target fitting broken line is obtained, the target fitting broken line includes a-section fitting straight lines, a is an integer greater than 1, an abscissa of the target fitting broken line is a voltage value, and an ordinate of the target fitting broken line is a phase difference, the a-section fitting straight lines include a-1 division points, the division points are intersections of different fitting straight lines, a target fitting line is determined from the target fitting broken line according to the initial voltage value and the a-1 division points, and the target fitting line is at least one fitting straight line of the a-section fitting straight lines, the method comprises determining target voltage adjustment amount according to target fitting line, target phase difference and initial voltage value, adjusting the adjustable focus lens according to the target voltage adjustment amount, on one hand, after opening the camera, determining corresponding voltage adjustment amount based on phase difference of focusing position, initial voltage value, fitting fold line and dividing point thereof, namely searching voltage value corresponding to the phase difference from the fitting fold line by using the phase difference, comparing the initial voltage value with voltage value of dividing point to determine optimal fitting straight line, searching voltage value corresponding to the phase difference based on the fitting straight line, comparing the voltage value with the initial voltage value to determine voltage adjustment amount, on the other hand, because the fitting fold line is adopted, nonlinear characteristic of PD curve of the adjustable focus lens can be overcome, and furthermore, and the focusing accuracy of the adjustable focusing lens is improved.
Further, the adjusting the adjustable lens according to the target voltage adjustment amount may be implemented by referring to fig. 9, specifically, fig. 9 is a flowchart of a focus control method in an embodiment. The focus control method in this embodiment will be described by taking an example of operation on the electronic apparatus in fig. 1 or 2, which includes an adjustable-focus lens. As shown in fig. 9, the focus control method includes steps 901 to 903, wherein,
901. An initial voltage value and a reference voltage value of the adjustable lens are obtained.
The adjustable lens refers to a liquid lens, and the variable internal shape of the lens is deformed mainly by using different voltages applied to the lens, so that focusing can be realized through the deformed adjustable lens. When taking a picture by adopting the camera module of the electronic equipment, the camera module needs to be focused. If the camera module includes an adjustable lens, the electronic device needs to acquire an initial voltage value of the adjustable lens and then acquire a reference voltage value of the adjustable lens.
The initial voltage value of the adjustable lens refers to the voltage loaded on the adjustable lens when the image pickup module is started, or the voltage loaded on the adjustable lens before focusing. The reference voltage value of the adjustable lens refers to a voltage calculated by an in-focus algorithm, and the defocus distance of the adjustable lens at the reference voltage value is smaller than a preset defocus distance threshold (for example, a value of 0 or infinitely close to 0). I.e. the closer the focus lens is to the in-focus position at the reference voltage value.
902. Adjusting an initial voltage value of the adjustable lens to a reference voltage value by adopting a reference voltage value adjusting mode; the reference voltage value adjustment mode comprises the same voltage adjustment direction.
After the electronic device obtains the initial voltage value and the reference voltage value of the adjustable focusing lens, since the defocus distance of the adjustable focusing lens under the reference voltage value is smaller than the preset defocus distance threshold, in order to achieve focusing, the initial voltage value of the adjustable focusing lens can be adjusted to the reference voltage value by adopting a reference voltage value adjusting mode.
Wherein the variable inner shape component of the adjustable lens is mainly made of piezoelectric materials. However, since the piezoelectric materials each have hysteresis characteristics, there is a problem that focusing inaccuracy often occurs in focusing through the adjustable lens.
Since the piezoelectric material inside the adjustable lens has hysteresis characteristics, the deformation amount of the piezoelectric material depends not only on the magnitude of the applied voltage but also on the initial shape of the piezoelectric material in the process of deforming with the applied voltage. Therefore, in order to circumvent hysteresis characteristics, the initial voltage value of the adjustable-focus lens is adjusted to a reference voltage value by using a reference voltage value adjustment method, wherein the reference voltage value adjustment method includes the same voltage adjustment direction. And the initial voltage value of the adjustable focusing lens is adjusted to the reference voltage value by adopting the same voltage adjusting direction, so that the deformation amount of the piezoelectric material in the adjustable focusing lens is fixed when the adjustable focusing lens is under the reference voltage value. Furthermore, the piezoelectric film shape in Tlens (adjustable lens) is uniform, so this will result in the same diopter of Tlens, and finally, it can be achieved that the same definition image is acquired by Tlens at the same voltage. The initial voltage value of the adjustable lens is adjusted to the reference voltage value according to the same voltage adjusting direction, so that abnormal situations that two images with different definition are acquired through Tlens under the same voltage can be avoided.
903. The adjustable-focus lens is controlled to focus at the reference voltage value.
In the embodiment of the application, since the defocus distance of the adjustable focusing lens at the reference voltage value is smaller than the preset defocus distance threshold (for example, a value of 0 or infinitely close to 0), that is, the more the adjustable focusing lens is close to the focusing position at the reference voltage value, after the initial voltage value of the adjustable focusing lens is adjusted to the reference voltage value according to the same voltage adjustment direction, the adjustable focusing lens can be controlled to focus at the reference voltage value. Thus, a clear image can be obtained by the adjustable focus lens and the image sensor at the reference voltage value.
In the embodiment of the application, the electronic equipment acquires the initial voltage value and the reference voltage value of the adjustable focusing lens, and the defocusing distance of the adjustable focusing lens under the reference voltage value is smaller than the preset defocusing distance threshold value. And adjusting the initial voltage value of the adjustable lens to a reference voltage value by adopting a reference voltage value adjusting mode, wherein the reference voltage value adjusting mode comprises the same voltage adjusting direction. Finally, the adjustable-focus lens is controlled to focus under the reference voltage value. Since the defocus distance of the adjustable lens at the reference voltage value is smaller than the preset defocus distance threshold, the adjustable lens can achieve focusing at the reference voltage value. However, since the piezoelectric materials inside the adjustable lens have hysteresis characteristics, in order to avoid the hysteresis characteristics, the initial voltage value of the adjustable lens is adjusted to the reference voltage value in the same voltage adjustment direction, so that the deformation amount of the piezoelectric materials inside the adjustable lens is fixed when the adjustable lens is at the reference voltage value. Furthermore, it is possible to acquire images of the same definition by Tlens at the same voltage. Finally, the adjustable focusing lens can be controlled to focus under the reference voltage value, so that the image with the same definition is obtained, and the focusing accuracy is improved.
Further, after step 903, the method may further include the following steps:
determining a reference voltage value adjusting mode according to the magnitude relation between the initial voltage value of the adjustable lens and the reference voltage value and the same voltage adjusting direction; the same voltage adjustment direction includes a voltage increasing direction or a voltage decreasing direction.
In the embodiment of the application, firstly, the magnitude relation between an initial voltage value and a reference voltage value of an adjustable lens is obtained; secondly, determining the same voltage regulation direction as a voltage increase direction or a voltage decrease direction; and finally, determining a reference voltage value adjusting mode according to the magnitude relation between the initial voltage value of the adjustable lens and the reference voltage value and the same voltage adjusting direction.
The magnitude relation between the initial voltage value and the reference voltage value of the adjustable lens can be obtained by comparing the initial voltage value and the reference voltage value of the adjustable lens. And the same voltage adjustment direction may be empirically determined as a voltage increase direction or a voltage decrease direction, which is not limited in the present application. Fig. 10 is a graph of MTF (Modulation Transfer Function ) for the same adjustable focus lens in one embodiment. The abscissa of the MTF graph refers to the voltage applied to the adjustable focus lens and the ordinate refers to the sharpness of the image captured by the adjustable focus lens at that voltage. Wherein the MTF graph includes a forward MTF curve and a reverse MTF curve. For the same type of adjustable focus lens, an MTF curve (e.g., a forward MTF curve in fig. 10) can be obtained by adjusting the voltage applied thereto in the voltage increasing direction. The forward direction here refers to the voltage increasing direction. Similarly, for the same adjustable lens, an MTF curve (e.g., the reverse MTF curve in fig. 10) can be obtained by adjusting the voltage applied thereto in the voltage decreasing direction. The reverse direction here refers to the voltage decreasing direction.
It can be seen that, in the entire adjustable voltage range of Tlens, if Tlens is adjusted from the initial voltage value to the reference voltage value according to different voltage adjustment directions, then Tlens will correspond to two different resolution images at each voltage. Then accurate focusing cannot be achieved.
Therefore, it is necessary to determine the same voltage adjustment direction as the voltage increasing direction or the voltage decreasing direction. After the same voltage adjusting direction is determined to be the voltage increasing direction or the voltage decreasing direction, the reference voltage value adjusting mode can be determined according to the magnitude relation between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjusting direction. For example, if the same voltage adjustment direction is the voltage increasing direction and the initial voltage value of the adjustable lens is greater than the reference voltage value, the reference voltage value adjustment mode is determined to be decreasing and then increasing. If the same voltage adjusting direction is the voltage decreasing direction and the initial voltage value of the adjustable lens is smaller than the reference voltage value, determining that the reference voltage value adjusting mode is a rising and falling mode.
In the embodiment of the application, the specific implementation step of determining the reference voltage value adjusting mode is described, after the same voltage adjusting direction, specifically, the voltage increasing direction or the voltage decreasing direction is determined, how to adjust the initial voltage value of the adjustable lens to the reference voltage value according to the same voltage adjusting direction specifically, namely, the reference voltage value adjusting mode is determined according to the magnitude relation between the initial voltage value of the adjustable lens and the reference voltage value and the same voltage adjusting direction. The reference voltage value adjusting mode is accurately determined from the magnitude relation between the initial voltage value and the reference voltage value and the two dimensions of the same voltage adjusting direction.
Further, in one embodiment, if the same voltage adjustment direction includes a voltage increasing direction, the step of determining the reference voltage value adjustment mode according to the magnitude relation between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction includes:
Judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value;
If the reference voltage value of the adjustable lens is smaller than the initial voltage value, determining that the reference voltage value is adjusted in such a way that the initial voltage value is reduced to a first critical voltage, and increasing the first critical voltage to the reference voltage value after a first preset time period.
Specifically, when determining the reference voltage value adjustment mode, if the same voltage adjustment direction includes a voltage increasing direction, firstly, judging whether the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (a); and secondly, if the reference voltage value (B) of the adjustable focusing lens is smaller than the initial voltage value (A), determining the reference voltage value adjusting mode to reduce the initial voltage value (A) to a first critical voltage (min), and increasing the initial voltage value (A) from the first critical voltage (min) to the reference voltage value (B) after a first preset time period. The first preset time period is used for enabling the adjustable-focus lens to be stable under a first critical voltage (min). Here, the first critical voltage may be a minimum voltage (min) applied to the adjustable-focus lens. Of course, it is also possible to apply a smaller voltage to the adjustable lens, for example, a voltage close to the minimum voltage (min), such as a voltage different from the minimum voltage (min) by a preset difference. It is assumed that the variable range of the voltage applied to the piezoelectric material in the adjustable lens is 0 to 50v, and the operating voltage range of the piezoelectric material in the adjustable lens during focusing is 8 to 50v. Then, the first threshold voltage may be set to 0v, and of course, the first threshold voltage may be set to any value less than 8v, which is not limited by the present application.
In another case, if it is determined that the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (C), the reference voltage value adjustment method is determined to directly increase the initial voltage value (C) to the reference voltage value (B).
In this way, when the reference voltage value (B) of the adjustable lens is smaller than the initial voltage value (a), the piezoelectric film shape of the adjustable lens at the reference voltage value (B) obtained by the voltage adjustment method of decreasing first and then increasing second matches the piezoelectric film shape when the initial voltage value (C) is increased to the reference voltage value (B). Then, at this time, the diopters of Tlens are also uniform, and finally, it is possible to acquire images of the same definition by Tlens at the same voltage. The initial voltage value of the adjustable lens is adjusted to the reference voltage value according to the same voltage adjusting direction, so that abnormal situations that two images with different definition are acquired through Tlens under the same voltage can be avoided.
Referring to fig. 11, a schematic flow chart of adjusting the adjustable lens from an initial voltage value to a reference voltage value according to a voltage increasing direction in one embodiment is shown. If the same voltage adjustment direction is the voltage increasing direction, when the adjustable lens is adjusted from the initial voltage value to the reference voltage value according to the same voltage adjustment direction, the method comprises the following steps:
1101. Judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if it is determined that the reference voltage value of the adjustable lens is smaller than the initial voltage value, step 1102 is entered; if it is determined that the reference voltage value of the adjustable lens is greater than the initial voltage value, step 1105 is entered.
1102. The initial voltage value is reduced to a first threshold voltage.
1103. The adjustable-focus lens is controlled to be maintained at a first critical voltage for a first preset period of time.
1104. The first threshold voltage is increased to a reference voltage value.
1105. The initial voltage value is directly increased to the reference voltage value.
As shown in fig. 12, a voltage variation diagram of adjusting the adjustable lens from an initial voltage value to a reference voltage value according to a voltage increasing direction in one embodiment is shown. Fig. 12 (a) is a schematic diagram of voltage change in the case where the reference voltage value (B) of the adjustable lens is smaller than the initial voltage value (a). Firstly, reducing an initial voltage value (A) to a first critical voltage (min); secondly, controlling the adjustable-focus lens to be kept at a first critical voltage (min) for a first preset time period (5 ms); finally, the first threshold voltage (min) is increased to a reference voltage value (B).
Fig. 12 (B) is a schematic diagram of voltage change in the case where the reference voltage value (B) of the adjustable lens is larger than the initial voltage value (C). The initial voltage value (C) is directly increased to the reference voltage value (B).
In the embodiment of the application, if the same voltage adjusting direction is the voltage increasing direction, when determining the reference voltage value adjusting mode, firstly, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if the reference voltage value of the adjustable lens is smaller than the initial voltage value, determining that the reference voltage value is adjusted in such a way that the initial voltage value is reduced to a first critical voltage, and increasing the first critical voltage to the reference voltage value after a first preset time period. In this way, when the reference voltage value (B) of the adjustable lens is smaller than the initial voltage value (a), the piezoelectric film shape of the adjustable lens at the reference voltage value (B) obtained by the voltage adjustment method of decreasing first and then increasing second matches the piezoelectric film shape when the initial voltage value (C) is directly increased to the reference voltage value (B). Then, it is finally possible to acquire images of the same definition through Tlens at the same voltage. Therefore, the initial voltage value of the adjustable lens is adjusted to the reference voltage value according to the same voltage adjustment direction, so that the abnormal condition that two images with different definition are acquired through Tlens under the same voltage can be avoided. Finally, the focusing accuracy is improved.
In the previous embodiment, a description was given of how the voltage adjustment is performed according to the magnitude relation between the initial voltage value and the reference voltage value of the adjustable-focus lens and the same voltage adjustment direction if the same voltage adjustment direction includes the voltage increase direction. In the present embodiment, it is further described that the first preset time period is greater than or equal to the preset time period threshold, and the first preset time period is related to the amplitude of the adjustable-focus lens and the vibration frequency.
Specifically, if the same voltage adjustment direction is the voltage increasing direction, firstly, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if the reference voltage value of the adjustable lens is smaller than the initial voltage value, determining that the reference voltage value is adjusted in such a way that the initial voltage value is reduced to a first critical voltage, and increasing the first critical voltage to the reference voltage value after a first preset time period. Here, the first preset time period may be set to be greater than or equal to a preset time period threshold, wherein the preset time period threshold may be determined based on an empirical value. For example, the maximum time for which the adjustable lens reaches stability, such as 5ms or 3ms, is determined based on the maximum amplitude and the maximum vibration frequency of the adjustable lens. Then, the maximum time the adjustable-focus lens reaches stability is taken as a preset time period threshold, i.e., the preset time period threshold may be 5ms.
In addition, the first preset time period may be related, in particular positively related, to the amplitude of the adjustable focus lens and the vibration frequency. If the amplitude and the vibration frequency of the adjustable lens are larger when the adjustable lens is reduced from the initial voltage value to the first critical voltage, the longer the first preset time period is required for the adjustable lens to reach stability. Conversely, the shorter the first preset time period that the adjustable focus lens needs to be when stabilized.
In the embodiment of the application, if the same voltage adjusting direction is the voltage increasing direction, firstly, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if the reference voltage value of the adjustable lens is smaller than the initial voltage value, determining that the reference voltage value is adjusted in such a way that the initial voltage value is reduced to a first critical voltage, and increasing the first critical voltage to the reference voltage value after a first preset time period. Specifically, it is described that the first preset time period is greater than or equal to a preset time period threshold, and the first preset time period is related to the amplitude and vibration frequency of the adjustable lens. Therefore, the adjustable lens can be ensured to be stable after being kept at the first critical voltage for a first preset time period. Then, the piezoelectric film shape of the adjustable focusing lens at the reference voltage value is ensured to be consistent with the piezoelectric film shape of the adjustable focusing lens when the adjustable focusing lens is directly increased from a certain initial voltage value to the reference voltage value after the first preset time period is increased from the first critical voltage to the reference voltage value.
In one embodiment, if the same voltage adjustment direction includes a voltage decrease direction, determining the reference voltage value adjustment mode according to the magnitude relation between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction includes:
Judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value;
If the reference voltage value of the adjustable lens is larger than the initial voltage value, the reference voltage value adjusting mode is determined to be that the initial voltage value is increased to a second critical voltage, and the reference voltage value is reduced from the second critical voltage to the reference voltage value in a second preset time period.
Specifically, when determining the reference voltage value adjustment mode, if the same voltage adjustment direction includes a voltage reduction direction, determining whether the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (a); and secondly, if the reference voltage value (B) of the adjustable focusing lens is judged to be larger than the initial voltage value (A), determining the reference voltage value adjusting mode to increase the initial voltage value (A) to a second critical voltage (max) and reduce the initial voltage value (A) from the second critical voltage (max) to the reference voltage value (B) in a second preset time period. Wherein the second preset time period is used for stabilizing the adjustable-focus lens at a second critical voltage (max). In another case, if it is determined that the reference voltage value (B) of the adjustable lens is smaller than the initial voltage value (D), the reference voltage value adjustment mode is determined to be to reduce the initial voltage value (D) to the reference voltage value (B). Here, the second critical voltage may be a maximum voltage (max) applied to the adjustable-focus lens. Of course, it is also possible to apply a larger voltage to the adjustable lens, for example a voltage close to the maximum voltage (max), such as a voltage differing from the maximum voltage (max) by a preset difference.
In this way, when the reference voltage value (B) of the adjustable lens is larger than the initial voltage value (a), the piezoelectric film shape of the adjustable lens at the reference voltage value (B) obtained by the voltage adjustment method of the first generation and the second generation coincides with the piezoelectric film shape when the initial voltage value (D) is reduced to the reference voltage value (B). Then, at this time, the diopters of Tlens are also uniform, and finally, it is possible to acquire images of the same definition by Tlens at the same voltage. The initial voltage value of the adjustable lens is adjusted to the reference voltage value according to the same voltage adjusting direction, so that abnormal situations that two images with different definition are acquired through Tlens under the same voltage can be avoided.
Referring to fig. 13, a flow chart of adjusting the adjustable lens from an initial voltage value to a reference voltage value according to a voltage decreasing direction in another embodiment is shown. If the same voltage adjustment direction is the voltage reduction direction, when the adjustable lens is adjusted from the initial voltage value to the reference voltage value according to the same voltage adjustment direction, the method comprises the following steps:
Step 1301, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if it is determined that the reference voltage value of the adjustable lens is greater than the initial voltage value, step 1302 is performed; if it is determined that the reference voltage value of the adjustable lens is smaller than the initial voltage value, step 1305 is entered;
1302. increasing the initial voltage value to a second critical voltage;
1303. controlling the adjustable-focus lens to be kept at a second critical voltage for a second preset time period;
1304. reducing the second threshold voltage to a reference voltage value;
1305. the initial voltage value is reduced directly to the reference voltage value.
In the embodiment of the application, if the same voltage adjusting direction is the voltage decreasing direction, when determining the reference voltage value adjusting mode, firstly, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if the reference voltage value of the adjustable lens is larger than the initial voltage value, the reference voltage value adjusting mode is determined to be that the initial voltage value is increased to a second critical voltage, and the reference voltage value is reduced from the second critical voltage to the reference voltage value after a second preset time period. In this way, when the reference voltage value (B) of the adjustable lens is larger than the initial voltage value (a), the piezoelectric film shape of the adjustable lens at the reference voltage value (B) obtained by the voltage adjustment method after the rising and the falling is identical to the piezoelectric film shape when the initial voltage value (D) is directly reduced to the reference voltage value (B). Then, it is finally possible to acquire images of the same definition through Tlens at the same voltage. Therefore, the initial voltage value of the adjustable lens is adjusted to the reference voltage value according to the same voltage adjustment direction, so that the abnormal condition that two images with different definition are acquired through Tlens under the same voltage can be avoided. Finally, the focusing accuracy is improved.
In the previous embodiment, a description was given of how the voltage adjustment is performed according to the magnitude relation between the initial voltage value and the reference voltage value of the adjustable-focus lens and the same voltage adjustment direction if the same voltage adjustment direction includes the voltage decrease direction. In the present embodiment, it is further described that the second preset time period is greater than or equal to the preset time period threshold, and the second preset time period is related to the amplitude of the adjustable-focus lens and the vibration frequency.
Specifically, the second preset time period may be set to be greater than or equal to a preset time period threshold, where the preset time period threshold may be determined based on an empirical value. For example, the maximum time for which the adjustable lens reaches stability, such as 5ms or 8ms, is determined based on the maximum amplitude and the maximum vibration frequency of the adjustable lens. Then, the maximum time the adjustable-focus lens reaches stability is taken as a preset time period threshold, i.e., the preset time period threshold may be 5ms.
In addition, the second preset time period may be related, in particular positively related, to the amplitude of the adjustable focus lens and the vibration frequency. If the amplitude and the vibration frequency of the adjustable lens increase from the initial voltage value to the second critical voltage are larger, the second preset time period required by the adjustable lens to reach stability is longer. Conversely, the shorter the second preset time period that is required for the adjustable focus lens to reach stability.
In the embodiment of the application, if the same voltage adjustment direction is the voltage reduction direction, firstly, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if the reference voltage value of the adjustable lens is larger than the initial voltage value, determining that the reference voltage value is adjusted in such a way that the initial voltage value is increased to a second critical voltage, and then the reference voltage value is reduced from the second critical voltage to the reference voltage value after a second preset time period. Specifically, it is described that the second preset time period is greater than or equal to the preset time period threshold, and the second preset time period is related to the amplitude and vibration frequency of the adjustable-focus lens. Therefore, the adjustable lens can be ensured to be stable after being kept under the second critical voltage for a second preset time period. Then, the piezoelectric film shape of the adjustable focusing lens at the reference voltage value is ensured to be consistent with the piezoelectric film shape of the adjustable focusing lens when the adjustable focusing lens is directly reduced from a certain initial voltage value to the reference voltage value after the second preset time period is shortened from the second critical voltage to the reference voltage value.
In the above embodiment, a procedure of acquiring a phase difference by an image sensor using a phase focusing algorithm and then calculating a reference voltage value of the adjustable lens based on a correspondence between a phase difference calibrated in advance and the reference voltage value of the adjustable lens is described. In this embodiment, as shown in fig. 14, step 903 is further described, which includes the detailed implementation steps of controlling the adjustable lens to focus at the reference voltage value, including:
1401. when the adjustable-focus lens is at the reference voltage value, a target image is acquired by the image sensor.
1402. And adjusting the reference voltage value to a first candidate voltage according to a preset adjusting step length by adopting a reference voltage value adjusting mode, and acquiring a first candidate image through an image sensor.
Specifically, when focusing is performed by the image capturing module including the adjustable lens, first, the phase difference is obtained by the image sensor, and then the reference voltage value of the adjustable lens is calculated based on the correspondence between the phase difference calibrated in advance and the reference voltage value of the adjustable lens. Secondly, adjusting the initial voltage value of the adjustable lens to a reference voltage value by adopting a reference voltage value adjusting mode; the reference voltage value adjustment mode comprises the same voltage adjustment direction. Finally, the adjustable-focus lens is controlled to focus under the reference voltage value. Wherein the same voltage regulation direction includes a voltage increase direction or a voltage decrease direction.
Then, when the adjustable-focus lens is controlled to perform focusing at the reference voltage value, the reference voltage value may be directly applied to the adjustable-focus lens to achieve focusing. And when the reference voltage value is applied to the adjustable focusing lens, focusing can be further realized by adopting a contrast focusing mode. Because the phase difference obtained by the phase focusing algorithm through the image sensor is often inaccurate, after the reference voltage value of the adjustable focusing lens is calculated based on the phase difference, and the initial voltage value of the adjustable focusing lens is adjusted to the reference voltage value by adopting a reference voltage value adjusting mode, the voltage of the adjustable focusing lens is further finely adjusted by adopting a contrast focusing mode, so that the focusing accuracy is improved.
Specifically, a target image is acquired by an image sensor when the adjustable lens is at a reference voltage value. And then, adjusting the reference voltage value to a first candidate voltage according to a preset adjusting step by adopting a reference voltage value adjusting mode, and acquiring a first candidate image through an image sensor. For example, assuming a reference voltage value of 30V, a target image is acquired by the image sensor while the adjustable-focus lens is at the reference voltage value of 30V. If the same voltage adjusting direction is the voltage increasing direction, adjusting the reference voltage value to a first candidate voltage according to the voltage increasing direction and a preset adjusting step length (such as 1V), and collecting a first candidate image through an image sensor. For example, the reference voltage value 30V is adjusted to the first candidate voltage 31V. Or, reducing the reference voltage value of 30V to the first critical voltage; controlling the adjustable-focus lens to be kept at a first critical voltage for a first preset time period; the first threshold voltage is increased to a first candidate voltage 29V. Here, the preset adjustment step may be 0.5V, 0.1V, or the like, which is not limited in the present application. Here, the preset adjustment step may be 0.5V, 0.1V, or the like, which is not limited in the present application.
1403. Acquiring a target reference voltage value of the adjustable lens according to the definition of the target image and the definition of the first candidate image; the defocus distance of the adjustable lens under the target reference voltage value is smaller than the defocus distance of the adjustable lens under the reference voltage value;
1404. The adjustable focus lens is controlled to focus at a target reference voltage value.
After the target image and the first candidate image are acquired by the image sensor, the sharpness of the target image and the sharpness of the first candidate image are calculated, respectively. And comparing the definition of the target image with the definition of the first candidate image, and finely adjusting the voltage of the adjustable-focus lens based on the comparison result until the first candidate image with the highest definition is found, and taking the voltage of the adjustable-focus lens corresponding to the first candidate image with the highest definition as a target reference voltage value of the adjustable-focus lens. At this time, the defocus distance of the adjustable-focus lens at the target reference voltage value is smaller than the defocus distance of the adjustable-focus lens at the reference voltage value. I.e. the adjustable focus lens at the target reference voltage value, is closer to the in-focus position. Further, the adjustable-focus lens can be controlled to perform focusing at the target reference voltage value.
In the embodiment of the application, firstly, a phase focusing algorithm is adopted, a phase difference is obtained through an image sensor, and then, a reference voltage value of the adjustable lens is calculated based on a corresponding relation between the phase difference calibrated in advance and the reference voltage value of the adjustable lens. Because the phase difference obtained by the phase focusing algorithm through the image sensor is inaccurate, after the phase focusing algorithm is adopted, a contrast focusing algorithm is further adopted to accurately find a target reference voltage value which is closer to the focusing position near the reference voltage value, so that the adjustable focusing lens is controlled to focus under the target reference voltage value, and finally the focusing accuracy is improved.
Further, in one embodiment, there is also provided a focus control method applied to an electronic device, where the electronic device includes an adjustable lens and an image sensor, as shown in fig. 15, the method includes:
1501. When the adjustable lens is at an initial voltage value, acquiring an initial image through an image sensor;
1502. Adjusting an initial voltage value of the adjustable-focus lens to a second candidate voltage according to a preset adjusting step length by adopting a reference voltage value adjusting mode, and acquiring a second candidate image through an image sensor; the reference voltage value adjustment mode comprises the same voltage adjustment direction.
Specifically, an initial image is acquired by an image sensor when the adjustable lens is at an initial voltage value. And then, adjusting the initial voltage value to a second candidate voltage according to a preset adjusting step by adopting a reference voltage value adjusting mode, and acquiring a second candidate image through an image sensor. For example, assuming an initial voltage value of 40V, an initial image is acquired by the image sensor while the adjustable-focus lens is at the initial voltage value of 40V. If the same voltage regulating direction is the voltage increasing direction, regulating the initial voltage value to a first candidate voltage according to the voltage increasing direction and the initial regulating step length (such as 1V), and collecting a first candidate image through an image sensor. For example, the initial voltage value 40V is increased to the second candidate voltage 41V in the voltage increasing direction. Or, reducing the initial voltage value 40V to a first critical voltage; controlling the adjustable-focus lens to be kept at a first critical voltage for a first preset time period; the first threshold voltage is increased to a second candidate voltage 39V. Here, the preset adjustment step may be 0.5V, 0.1V, or the like, which is not limited in the present application.
1503. Acquiring a reference voltage value of the adjustable lens according to the definition of the initial image and the definition of the second candidate image; the defocusing distance of the adjustable focusing lens under the reference voltage value is smaller than a preset defocusing distance threshold value;
1504. The adjustable-focus lens is controlled to focus at the reference voltage value.
After the initial image and the second candidate image are acquired by the image sensor, the sharpness of the initial image and the sharpness of the second candidate image are calculated, respectively. And comparing the definition of the initial image with the definition of the second candidate image, and finely adjusting the voltage of the adjustable-focus lens based on the comparison result until the second candidate image with the highest definition is found, and taking the voltage of the adjustable-focus lens corresponding to the second candidate image with the highest definition as the reference voltage value of the adjustable-focus lens. At this time, the defocus distance of the adjustable-focus lens at the reference voltage value is smaller than the preset defocus distance threshold. I.e. the adjustable focus lens at the reference voltage value, is closer to the in-focus position. Further, the adjustable-focus lens can be controlled to perform focusing at the reference voltage value.
In the embodiment of the application, when focusing is performed through the image pickup module comprising the adjustable lens, a contrast focusing algorithm is directly adopted, and the voltage of the adjustable lens corresponding to the second candidate image with the highest definition is searched from the vicinity of the initial voltage value of the adjustable lens and is used as the reference voltage value of the adjustable lens. I.e. the adjustable focus lens at the reference voltage value, is closer to the in-focus position. Further, the adjustable-focus lens can be controlled to perform focusing at the reference voltage value. Thus, the focusing accuracy is improved.
Further, in a specific embodiment, as shown in fig. 16, there is provided a focus control method, including:
1601. Acquiring an initial voltage value of the adjustable lens;
1602. acquiring a phase difference by an image sensor when the adjustable lens is at an initial voltage value;
1603. Calculating a reference voltage value of the adjustable lens according to the phase difference; the defocusing distance of the adjustable focusing lens under the reference voltage value is smaller than a preset defocusing distance threshold value;
1604. If the same voltage adjusting direction comprises the voltage increasing direction, judging whether the reference voltage value of the adjustable lens is larger than the initial voltage value; if it is determined that the reference voltage value of the adjustable lens is smaller than the initial voltage value, step 1605 is entered; if it is determined that the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (C), step 1606 is entered;
1605. the reference voltage value adjusting mode is determined to be that the initial voltage value is reduced to a first critical voltage, and the first critical voltage is increased to the reference voltage value after a first preset time period.
1606. Determining a reference voltage value adjusting mode to directly increase an initial voltage value (C) to a reference voltage value (B); step 1610 is entered;
1607. If the same voltage adjusting direction comprises a voltage reducing direction, judging whether the reference voltage value of the adjustable lens is larger than an initial voltage value or not; if the reference voltage value of the adjustable lens is larger than the initial voltage value, the step 1608 is entered; if it is determined that the reference voltage value (B) of the adjustable lens is smaller than the initial voltage value (D), step 1609 is entered;
1608. the reference voltage value adjusting mode is determined to increase the initial voltage value to the second critical voltage and decrease the initial voltage value from the second critical voltage to the reference voltage value in a second preset time period.
1609. Determining a reference voltage value adjustment mode to reduce the initial voltage value (D) to a reference voltage value (B); step 1610 is entered;
1610. Adjusting an initial voltage value of the adjustable lens to a reference voltage value by adopting a reference voltage value adjusting mode;
1611. when the adjustable lens is at a reference voltage value, acquiring a target image through an image sensor;
1612. Adjusting the reference voltage value to a first candidate voltage according to a preset adjusting step length by adopting a reference voltage value adjusting mode, and acquiring a first candidate image through an image sensor;
1613. Acquiring a target reference voltage value of the adjustable lens according to the definition of the target image and the definition of the first candidate image; the defocus distance of the adjustable lens under the target reference voltage value is smaller than the defocus distance of the adjustable lens under the reference voltage value;
1614. the adjustable focus lens is controlled to focus at a target reference voltage value.
In the embodiment of the application, when focusing is performed through an image pickup module comprising an adjustable lens, a phase focusing algorithm is adopted first, a phase difference is obtained through an image sensor, and then a reference voltage value of the adjustable lens is calculated based on a corresponding relation between the phase difference calibrated in advance and the reference voltage value of the adjustable lens. Therefore, the initial voltage value of the adjustable-focus lens can be adjusted to the reference voltage value in a reference voltage value adjusting mode, and the target image is acquired through the image sensor. Because the phase focusing algorithm is faster, but often has the problem of inaccuracy, and the contrast focusing algorithm is combined to accurately find a target reference voltage value which is closer to the focusing position near the reference voltage value, the adjustable focusing lens is controlled to focus under the target reference voltage value, and finally the focusing accuracy is improved.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described above may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with at least a part of the sub-steps or stages of other steps or other steps.
In the embodiment of the application, the focusing adjustment is performed by adopting the mode, so that the interference of Tlens hysteresis on focusing definition can be avoided, tlens focusing is more accurate, fitting fold lines of Tlens modules can be calibrated, nonlinear characteristics of PD curves of Tlens modules are overcome, PD phase differences and focusing positions can be more accurately corresponding, and therefore, in the process of using a camera function, a user can improve focusing accuracy, and focusing can be realized by adopting a PDAF mode, so that quick focusing can be realized.
Referring to fig. 17, fig. 17 is another focusing control method provided by the embodiment of the present application, which is consistent with the embodiment shown in fig. 3, and is applied to the electronic device shown in fig. 1 or fig. 2, wherein the electronic device includes an adjustable focusing lens, and specifically includes the following steps:
1701. Acquiring a voltage adjusting range of the adjustable lens, and sampling the voltage adjusting range to obtain P sampling voltages, wherein P is an integer greater than 1, and the voltage adjusting range comprises a minimum adjustable voltage value and a maximum adjustable voltage value;
1702. Acquiring phase difference source images corresponding to each sampling voltage in the P sampling voltages to obtain P phase difference source images;
1703. Dividing each phase difference source image in the P phase difference source images into M x N areas according to a preset area dividing rule to obtain P x M x N area images, wherein M, N are integers which are larger than or equal to 1, and M x N is larger than 1;
1704. Classifying according to the P.M.N region images to obtain M.N region image sets, wherein each region image set comprises P region images, the spatial positions of the P region images are the same, and each region image corresponds to one sampling voltage;
1705. Fitting each of the M x N regional image sets to obtain M x N sets of fitting data, wherein each set of fitting data comprises P fitting points, and the abscissa of each fitting point is a voltage value and the ordinate of each fitting point is a phase difference;
1706. fitting is carried out according to the M x N group fitting data, and M x N fitting fold lines are obtained;
1707. When the camera is turned on, an initial phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image are obtained;
1708. determining a target focusing position;
1709. Acquiring a target phase difference corresponding to the target focusing position according to the initial phase difference source image;
1710. Obtaining a target fitting broken line, wherein the target fitting broken line comprises a section of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section of fitting straight lines comprises a-1 dividing points, the dividing points are intersection points of different fitting straight lines, and the target fitting broken line is one fitting broken line in the M x N fitting broken lines;
1711. Determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one fitting straight line in the a-section fitting straight line;
1712. determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
1713. And adjusting the adjustable-focus lens according to the target voltage adjustment amount.
The target fitting fold line is one fitting fold line of M x N fitting fold lines. When the camera is turned on, an initial phase difference source image may be acquired, which may be a phase difference source image stored last time the camera function was used, and may correspond to an initial focus position, which may correspond to an initial voltage value.
The specific descriptions of the steps 1701 to 1711 may refer to the related descriptions of the focus control method described in fig. 3, and are not repeated herein.
It can be seen that, in the focus control method described in the embodiment of the present application, firstly, a fitting broken line may be configured for a region based on a partition rule, secondly, after a camera is opened, a corresponding voltage adjustment amount may be determined based on a phase difference of a focus position, an initial voltage value, the fitting broken line (may be a fitting straight line adapted to the region where the focus position is located) and a partition point thereof, that is, a voltage value corresponding to the phase difference may be found from the fitting broken line by using the phase difference, the initial voltage value and the voltage value of the partition point may be compared to determine a best fitting straight line, then a voltage value to be adjusted corresponding to the phase difference may be found based on the fitting straight line, and then compared with the initial voltage value to determine the voltage adjustment amount.
In accordance with the above embodiment, referring to fig. 18, fig. 18 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in the fig. 18, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the electronic device further includes an adjustable lens, and in the embodiment of the present application, the programs include instructions for executing the following steps:
when the camera is turned on, acquiring a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image;
Determining a target focusing position;
Acquiring a target phase difference corresponding to the target focusing position according to the phase difference source image;
Obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section a of fitting straight lines comprises a-1 division points, and the division points are intersection points of different fitting straight lines;
Determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one fitting straight line in the a-section fitting straight line;
Determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
and adjusting the adjustable-focus lens according to the target voltage adjustment amount.
Optionally, in the determining a target voltage adjustment amount according to the target fitting line, the first phase difference, and the initial voltage value, the program includes instructions for:
Determining a reference voltage value corresponding to the target phase difference according to the target fitting line;
and determining the target voltage adjustment amount according to the reference voltage value and the initial voltage value.
Optionally, in the obtaining the target fit polyline, the above procedure includes instructions for:
determining a target area identifier corresponding to the target focusing position;
and determining the target fitting broken line corresponding to the target region identifier according to a mapping relation between the preset region identifier and the fitting broken line.
Optionally, in the determining the target focus position, the program includes instructions for:
Acquiring a preview image;
Performing target recognition on the preview image to obtain a target area;
determining the target focusing position according to the target area;
Or alternatively;
Acquiring a target touch position aiming at the preview image;
And determining the target focusing position according to the target touch position.
Optionally, the above program further comprises instructions for performing the steps of:
acquiring a voltage adjusting range of the adjustable lens, and sampling the voltage adjusting range to obtain P sampling voltages, wherein P is an integer greater than 1, and the voltage adjusting range comprises a minimum adjustable voltage value and a maximum adjustable voltage value;
Acquiring phase difference source images corresponding to each sampling voltage in the P sampling voltages to obtain P phase difference source images;
Dividing each phase difference source image in the P phase difference source images into M x N areas according to a preset area dividing rule to obtain P x M x N area images, wherein M, N are integers which are larger than or equal to 1, and M x N is larger than 1;
classifying according to the P.M.N region images to obtain M.N region image sets, wherein each region image set comprises P region images, the spatial positions of the P region images are the same, and each region image corresponds to one sampling voltage;
Fitting each of the M x N regional image sets to obtain M x N sets of fitting data, wherein each set of fitting data comprises P fitting points, and the abscissa of each fitting point is a voltage value and the ordinate of each fitting point is a phase difference;
and fitting according to the M x N group fitting data to obtain M x N fitting fold lines.
Optionally, in the fitting according to the m×n sets of fitting data, obtaining m×n fitting fold lines, the program includes instructions for:
K fitting points in the ith fitting data are obtained to serve as dividing points, the ith fitting data are any fitting data in the M-with-N fitting data, and k is a positive integer smaller than P;
Dividing the ith set of fitting data into k+1 fitting point sets based on the voltage values of the k fitting points;
Fitting each fitting point set in the k+1 fitting point sets to obtain a k+1 section fitting straight line;
and determining a fitting broken line corresponding to the ith group of fitting data according to the k+1 section of fitting straight line.
Optionally, in the fitting each of the m×n sets of region images to obtain m×n sets of fitting data, the program includes instructions for performing the following steps:
And acquiring a phase difference of each region image in the jth region image set corresponding to a preset focusing position and a voltage value corresponding to the region image, and forming fitting points by the phase difference and the voltage value, so as to obtain the P fitting points, wherein the jth region image set is any region image set in the M x N region image sets.
It can be seen that, in the electronic device described in the embodiment of the present application, the electronic device includes a tunable lens, when the camera is turned on, an initial voltage value corresponding to a phase difference source image and an initial focusing position of the phase difference source image is obtained, a target focusing position is determined, a target fitting broken line is obtained according to the phase difference source image, the target fitting broken line includes a section of fitting straight line, a is an integer greater than 1, and an abscissa of the target fitting broken line is a voltage value and an ordinate is a phase difference, the a section of fitting straight line includes a-1 division points, the division points are intersections of different fitting straight lines, a target fitting line is determined from the target fitting broken line according to the initial voltage value and a-1 division points, the target fitting line is at least one section of fitting straight line in the a section of fitting straight line, a target voltage adjustment quantity is determined according to the target fitting line, the target phase difference and the initial voltage value, and the tunable lens is adjusted according to the target voltage adjustment quantity, on the one hand, after the camera is turned on, the phase difference, the initial voltage value and the voltage adjustment quantity corresponding to the division points are determined, that is the phase difference value and the voltage adjustment value can be compared with the corresponding voltage broken line, and the voltage value can be compared with the initial value by using the phase difference value, and the voltage value is further, the best fitting straight line can be found, and the voltage value is compared with the initial value and the voltage value is compared, and the value is compared with the curve and the value is based on the value on the initial value and the phase difference value and the initial value is compared, and the focusing accuracy of the adjustable focusing lens is improved.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that the electronic device, in order to achieve the above-described functions, includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional units of the electronic device according to the method example, for example, each functional unit can be divided corresponding to each function, and two or more functions can be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
Fig. 19 is a functional block diagram of a focus control apparatus 1900 according to an embodiment of the present application. The focus control apparatus 1900 is applied to an electronic device; applied to an electronic device including an adjustable focus lens, the apparatus 1900 includes: an acquisition unit 1901, a determination unit 1902, and an adjustment unit 1903, wherein,
The acquiring unit 1901 is configured to acquire, when the camera is turned on, a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image;
The determining unit 1902 is configured to determine a target focusing position;
The obtaining unit 1901 is further configured to obtain a target phase difference corresponding to the target focusing position according to the phase difference source image; obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section a of fitting straight lines comprises a-1 division points, and the division points are intersection points of different fitting straight lines;
the determining unit 1902 is configured to determine a target fitting line from the target fitting broken lines according to the initial voltage value and the a-1 division points, where the target fitting line is at least one fitting straight line of the a-section fitting straight lines; determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
The adjusting unit 1903 is configured to adjust the adjustable-focus lens according to the target voltage adjustment amount.
Optionally, in the determining a target voltage adjustment amount according to the target fitting line, the first phase difference, and the initial voltage value, the determining unit 1902 is specifically configured to:
Determining a reference voltage value corresponding to the target phase difference according to the target fitting line;
and determining the target voltage adjustment amount according to the reference voltage value and the initial voltage value.
Optionally, in terms of the obtaining the target fit polyline, the obtaining unit 1901 is specifically configured to:
determining a target area identifier corresponding to the target focusing position;
and determining the target fitting broken line corresponding to the target region identifier according to a mapping relation between the preset region identifier and the fitting broken line.
Optionally, in the aspect of determining the target focusing position, the determining unit 1902 is specifically configured to:
Acquiring a preview image;
Performing target recognition on the preview image to obtain a target area;
determining the target focusing position according to the target area;
Or alternatively;
Acquiring a target touch position aiming at the preview image;
And determining the target focusing position according to the target touch position.
Optionally, the apparatus 1900 is further specifically configured to:
acquiring a voltage adjusting range of the adjustable lens, and sampling the voltage adjusting range to obtain P sampling voltages, wherein P is an integer greater than 1, and the voltage adjusting range comprises a minimum adjustable voltage value and a maximum adjustable voltage value;
Acquiring phase difference source images corresponding to each sampling voltage in the P sampling voltages to obtain P phase difference source images;
Dividing each phase difference source image in the P phase difference source images into M x N areas according to a preset area dividing rule to obtain P x M x N area images, wherein M, N are integers which are larger than or equal to 1, and M x N is larger than 1;
classifying according to the P.M.N region images to obtain M.N region image sets, wherein each region image set comprises P region images, the spatial positions of the P region images are the same, and each region image corresponds to one sampling voltage;
Fitting each of the M x N regional image sets to obtain M x N sets of fitting data, wherein each set of fitting data comprises P fitting points, and the abscissa of each fitting point is a voltage value and the ordinate of each fitting point is a phase difference;
and fitting according to the M x N group fitting data to obtain M x N fitting fold lines.
Optionally, in the fitting according to the m×n sets of fitting data, to obtain m×n fitting fold lines, the apparatus 1900 is specifically configured to:
K fitting points in the ith fitting data are obtained to serve as dividing points, the ith fitting data are any fitting data in the M-with-N fitting data, and k is a positive integer smaller than P;
Dividing the ith set of fitting data into k+1 fitting point sets based on the voltage values of the k fitting points;
Fitting each fitting point set in the k+1 fitting point sets to obtain a k+1 section fitting straight line;
and determining a fitting broken line corresponding to the ith group of fitting data according to the k+1 section of fitting straight line.
Optionally, in the fitting each of the m×n regional image sets to obtain m×n sets of fitting data, the apparatus 1900 is specifically configured to:
And acquiring a phase difference of each region image in the jth region image set corresponding to a preset focusing position and a voltage value corresponding to the region image, and forming fitting points by the phase difference and the voltage value, so as to obtain the P fitting points, wherein the jth region image set is any region image set in the M x N region image sets.
It can be seen that, the focus control device described in the embodiment of the present application is applied to an electronic device, where the electronic device includes an adjustable focus lens, when a camera is turned on, a phase difference source image and an initial voltage value corresponding to an initial focus position of the phase difference source image are obtained, a target focus position is determined, a target phase difference corresponding to the target focus position is obtained according to the phase difference source image, a target fitting broken line is obtained, the target fitting broken line includes a-section fitting straight lines, a is an integer greater than 1, an abscissa of the target fitting broken line is a voltage value, and an ordinate of the target fitting broken line is a phase difference, the a-section fitting straight lines include a-1 division points, the division points are intersections of different fitting straight lines, a target fitting line is determined from the target fitting broken line according to the initial voltage value and the a-1 division points, and the target fitting line is at least one fitting straight line of the a-section fitting straight lines, the method comprises determining target voltage adjustment amount according to target fitting line, target phase difference and initial voltage value, adjusting the adjustable focus lens according to the target voltage adjustment amount, on one hand, after opening the camera, determining corresponding voltage adjustment amount based on phase difference of focusing position, initial voltage value, fitting fold line and dividing point thereof, namely searching voltage value corresponding to the phase difference from the fitting fold line by using the phase difference, comparing the initial voltage value with voltage value of dividing point to determine optimal fitting straight line, searching voltage value corresponding to the phase difference based on the fitting straight line, comparing the voltage value with the initial voltage value to determine voltage adjustment amount, on the other hand, because the fitting fold line is adopted, nonlinear characteristic of PD curve of the adjustable focus lens can be overcome, and furthermore, and the focusing accuracy of the adjustable focusing lens is improved.
It should be noted that the electronic device described in the embodiments of the present application is presented in the form of functional units. The term "unit" as used herein should be understood in the broadest possible sense, and the objects used to implement the functions described by the various "units" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or group) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
The acquiring unit 1901, the determining unit 1902 and the adjusting unit 1903 may be a processor, which may be an artificial intelligent chip, NPU, CPU, GPU, or the like, and the adjusting unit 1903 may also be a tunable lens. The functions or steps of any of the above methods can be implemented based on the above unit modules.
The present embodiment also provides a chip, where the chip may be used to implement any of the methods of the above embodiments.
The present embodiment also provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the embodiment of the present application for implementing any one of the methods of the embodiment.
The present embodiment also provides a computer program product which, when run on a computer, causes the computer to perform the above-described relevant steps to implement any of the methods of the above-described embodiments.
In addition, the embodiment of the application also provides a focusing control device, which can be a chip, a component or a module, and can comprise a processor and a memory which are connected; the memory is configured to store computer-executable instructions that, when the device is operated, are executable by the processor to cause the chip to perform any one of the method embodiments described above.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding methods provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding methods provided above, and will not be described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A focus control method, applied to an electronic device including an adjustable focus lens, comprising:
when the camera is turned on, acquiring a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image;
Determining a target focusing position;
Acquiring a target phase difference corresponding to the target focusing position according to the phase difference source image;
Obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section a of fitting straight lines comprises a-1 division points, and the division points are intersection points of different fitting straight lines;
Determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one fitting straight line in the a-section fitting straight line;
Determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
and adjusting the adjustable-focus lens according to the target voltage adjustment amount.
2. The focus control method according to claim 1, wherein the determining a target voltage adjustment amount from the target fitting line, the first phase difference, and the initial voltage value includes:
Determining a reference voltage value corresponding to the target phase difference according to the target fitting line;
and determining the target voltage adjustment amount according to the reference voltage value and the initial voltage value.
3. The focus control method according to claim 1 or 2, wherein the obtaining a target fitting polyline includes:
determining a target area identifier corresponding to the target focusing position;
and determining the target fitting broken line corresponding to the target region identifier according to a mapping relation between the preset region identifier and the fitting broken line.
4. The focus control method according to claim 1 or 2, characterized in that the determining the target focus position includes:
Acquiring a preview image;
Performing target recognition on the preview image to obtain a target area;
determining the target focusing position according to the target area;
Or alternatively;
Acquiring a target touch position aiming at the preview image;
And determining the target focusing position according to the target touch position.
5. The focus control method according to claim 1 or 2, characterized in that the method further comprises:
acquiring a voltage adjusting range of the adjustable lens, and sampling the voltage adjusting range to obtain P sampling voltages, wherein P is an integer greater than 1, and the voltage adjusting range comprises a minimum adjustable voltage value and a maximum adjustable voltage value;
Acquiring phase difference source images corresponding to each sampling voltage in the P sampling voltages to obtain P phase difference source images;
Dividing each phase difference source image in the P phase difference source images into M x N areas according to a preset area dividing rule to obtain P x M x N area images, wherein M, N are integers which are larger than or equal to 1, and M x N is larger than 1;
classifying according to the P.M.N region images to obtain M.N region image sets, wherein each region image set comprises P region images, the spatial positions of the P region images are the same, and each region image corresponds to one sampling voltage;
Fitting each of the M x N regional image sets to obtain M x N sets of fitting data, wherein each set of fitting data comprises P fitting points, and the abscissa of each fitting point is a voltage value and the ordinate of each fitting point is a phase difference;
and fitting according to the M x N group fitting data to obtain M x N fitting fold lines.
6. The focus control method according to claim 5, wherein said fitting according to said M x N sets of fitting data to obtain M x N fitting fold lines comprises:
K fitting points in the ith fitting data are obtained to serve as dividing points, the ith fitting data are any fitting data in the M-with-N fitting data, and k is a positive integer smaller than P;
Dividing the ith set of fitting data into k+1 fitting point sets based on the voltage values of the k fitting points;
Fitting each fitting point set in the k+1 fitting point sets to obtain a k+1 section fitting straight line;
and determining a fitting broken line corresponding to the ith group of fitting data according to the k+1 section of fitting straight line.
7. The focus control method according to claim 5, wherein fitting each of the M x N sets of region images to obtain M x N sets of fitting data comprises:
And acquiring a phase difference of each region image in the jth region image set corresponding to a preset focusing position and a voltage value corresponding to the region image, and forming fitting points by the phase difference and the voltage value, so as to obtain the P fitting points, wherein the jth region image set is any region image set in the M x N region image sets.
8. A focus control apparatus, characterized by being applied to an electronic device including an adjustable focus lens, comprising: an acquisition unit, a determination unit and an adjustment unit, wherein,
The acquisition unit is used for acquiring a phase difference source image and an initial voltage value corresponding to an initial focusing position of the phase difference source image when the camera is opened;
the determining unit is used for determining a target focusing position;
The acquisition unit is further used for acquiring a target phase difference corresponding to the target focusing position according to the phase difference source image; obtaining a target fitting broken line, wherein the target fitting broken line comprises a section a of fitting straight lines, a is an integer larger than 1, the abscissa of the target fitting broken line is a voltage value, the ordinate of the target fitting broken line is a phase difference, the section a of fitting straight lines comprises a-1 division points, and the division points are intersection points of different fitting straight lines;
The determining unit is used for determining a target fitting line from the target fitting broken line according to the initial voltage value and the a-1 dividing points, wherein the target fitting line is at least one section of fitting straight line in the a section of fitting straight line; determining a target voltage adjustment amount according to the target fitting line, the target phase difference and the initial voltage value;
The adjusting unit is used for adjusting the adjustable-focus lens according to the target voltage adjusting quantity.
9. An electronic device comprising a processor, a memory for storing one or more programs and configured for execution by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-7.
CN202211300163.2A 2022-10-21 2022-10-21 Focusing control method and related device Pending CN117970725A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211300163.2A CN117970725A (en) 2022-10-21 2022-10-21 Focusing control method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211300163.2A CN117970725A (en) 2022-10-21 2022-10-21 Focusing control method and related device

Publications (1)

Publication Number Publication Date
CN117970725A true CN117970725A (en) 2024-05-03

Family

ID=90853633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211300163.2A Pending CN117970725A (en) 2022-10-21 2022-10-21 Focusing control method and related device

Country Status (1)

Country Link
CN (1) CN117970725A (en)

Similar Documents

Publication Publication Date Title
CN105874776B (en) Image processing apparatus and method
CN111553846B (en) Super-resolution processing method and device
US20200244885A1 (en) Photographing method and electronic apparatus
CN111768352B (en) Image processing method and device
CN111103922B (en) Camera, electronic equipment and identity verification method
CN111882642B (en) Texture filling method and device for three-dimensional model
CN111400605A (en) Recommendation method and device based on eyeball tracking
CN117234398B (en) Screen brightness adjusting method and electronic equipment
CN114244655B (en) Signal processing method and related device
EP4366289A1 (en) Photographing method and related apparatus
CN114945019B (en) Data transmission method, device and storage medium
CN111836226B (en) Data transmission control method, device and storage medium
CN116939358A (en) Image processing method and related device
CN117970725A (en) Focusing control method and related device
CN114465852A (en) Signal processing method and related device
CN114630152A (en) Parameter transmission method and device for image processor and storage medium
CN113311380B (en) Calibration method, device and storage medium
CN114519891A (en) Backlight adjusting method and device and storage medium
CN111459271B (en) Gaze offset error determination method and device
CN114596819B (en) Brightness adjusting method and related device
CN114630153B (en) Parameter transmission method and device for application processor and storage medium
CN114510192B (en) Image processing method and related device
CN114339607B (en) Ranging method, ranging device and storage medium
CN114422686B (en) Parameter adjustment method and related device
CN115085757B (en) Radio frequency network optimization method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination