Focus control method and related apparatus
Patent Information
- Application Number
- CN202211300163.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-10-21
AI Technical Summary
一般情况下,可调焦透镜指的是一种液态透镜,主要利用在其上所施加的不同电压,使其内部形状可变化的部件发生形变,从而通过发生形变后的可调焦透镜就可以实现对焦,但是,目前来看,其对焦精准度较低,因此,如何提升可调焦透镜的对焦精准度的问题亟待解决
[0023] As can be seen, the focusing control method and related apparatus described in the embodiments of this application are applied to an electronic device. The electronic device includes an adjustable focusing lens. When the camera is turned on, a phase difference source image and the initial voltage value corresponding to the initial focusing position of the phase difference source image are acquired to determine the target focusing position. The target phase difference corresponding to the target focusing position is obtained based on the phase difference source image. A target fitting polygonal line is obtained, which consists of a segment of fitting straight lines, where a is an integer greater than 1. The horizontal axis of the target fitting polygonal line is the voltage value, and the vertical axis is the phase difference. The segment of fitting straight lines includes a-1 dividing points, which are the intersection points of different fitting straight lines. Based on the initial voltage value and a-1 dividing points, a target fitting line is determined from the target fitting polygonal line. The target fitting line is at least one segment of the a-segment fitting straight lines. A fitted straight line is used to determine the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value. The adjustable lens is then adjusted according to the target voltage adjustment amount. On the one hand, after the camera is turned on, the corresponding voltage adjustment amount can be determined based on the phase difference at the focus position, the initial voltage value, the fitted line, and its division points. That is, the voltage value corresponding to the phase difference can be found on the fitted line using the phase difference. The initial voltage value is compared with the voltage value at the division point to determine the optimal fitted straight line. Then, based on the fitted line, the voltage value that needs to be adjusted corresponding to the phase difference is found, and it is compared with the initial voltage value to determine the voltage adjustment amount. On the other hand, since a fitted line is used, the non-linear characteristics of the PD curve of the adjustable lens can be overcome, thereby improving the focusing accuracy of the adjustable lens.
Smart Images

Figure CN117970725B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a focus control method and related apparatus. Background Technology
[0002] With the widespread use of electronic devices (such as mobile phones, tablets, etc.), electronic devices can support more and more applications and have more and more powerful functions. Electronic devices are developing in a diversified and personalized direction, becoming indispensable electronic products in users' lives.
[0003] Of course, the lenses used in electronic devices are constantly being updated and improved. For example, tunable lenses (Tlens) are increasingly widely used in electronic devices. Generally, a tunable lens refers to a liquid lens that utilizes different voltages applied to it to deform internal components, thus achieving focusing. However, currently, its focusing accuracy is relatively low. Therefore, improving the focusing accuracy of tunable lenses is an urgent problem to be solved. Summary of the Invention
[0004] This application provides a focusing control method and related apparatus, which can improve the focusing accuracy of adjustable lenses.
[0005] In a first aspect, embodiments of this application provide a focusing control method applied to an electronic device, the electronic device including an adjustable focus lens, the method comprising:
[0006] When the camera is turned on, acquire the phase difference source image and the initial voltage value corresponding to the initial focus position of the phase difference source image;
[0007] Determine the target focus position;
[0008] The target phase difference corresponding to the target focus position is obtained from the phase difference source image;
[0009] Obtain the target fitting polyline, which consists of a fitting straight line segment, where a is an integer greater than 1. The horizontal axis of the target fitting polyline is the voltage value and the vertical axis is the phase difference. The a fitting straight line segment includes a-1 dividing points, which are the intersection points of different fitting straight lines.
[0010] Based on the initial voltage value and the a-1 segmentation points, a target fitting line is determined from the target fitting polyline, and the target fitting line is at least one fitting line among the a-segment fitting lines;
[0011] The target voltage adjustment amount is determined based on the target fitted line, the target phase difference, and the initial voltage value.
[0012] The adjustable focus lens is adjusted according to the target voltage adjustment amount.
[0013] Secondly, embodiments of this application provide a focusing control device applied to an electronic device, the electronic device including an adjustable focus lens, the device comprising: an acquisition unit, a determination unit, and an adjustment unit, wherein...
[0014] The acquisition unit is used to acquire a phase difference source image and an initial voltage value corresponding to the initial focus position of the phase difference source image when the camera is turned on.
[0015] The determining unit is used to determine the target focus position;
[0016] The acquisition unit is further configured to acquire the target phase difference corresponding to the target focus position based on the phase difference source image; acquire the target fitting line, which is composed of a fitting straight line segments, where a is an integer greater than 1, and the horizontal axis of the target fitting line is the voltage value and the vertical axis is the phase difference. The a fitting straight line segments include a-1 dividing points, which are the intersection points of different fitting straight lines.
[0017] The determining unit is configured to determine a target fitting line from the target fitting polygonal line based on the initial voltage value and the a-1 segmentation points, wherein the target fitting line is at least one fitting straight line among the a-segment fitting straight lines; and to determine a target voltage adjustment amount based on the target fitting line, the target phase difference, and the initial voltage value.
[0018] The adjustment unit is used to adjust the adjustable focus lens according to the target voltage adjustment amount.
[0019] Thirdly, embodiments of this application provide an electronic device, the electronic device including a processor and a memory, the memory being used to store one or more programs and configured to be executed by the processor, the programs including steps for performing some or all of the steps described in the first application.
[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of embodiments of this application.
[0021] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes 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 embodiments of this application. The computer program product may be a software installation package.
[0022] Implementing the embodiments of this application has the following beneficial effects:
[0023] As can be seen, the focusing control method and related apparatus described in the embodiments of this application are applied to an electronic device. The electronic device includes an adjustable focusing lens. When the camera is turned on, a phase difference source image and the initial voltage value corresponding to the initial focusing position of the phase difference source image are acquired to determine the target focusing position. The target phase difference corresponding to the target focusing position is obtained based on the phase difference source image. A target fitting polygonal line is obtained, which consists of a segment of fitting straight lines, where a is an integer greater than 1. The horizontal axis of the target fitting polygonal line is the voltage value, and the vertical axis is the phase difference. The segment of fitting straight lines includes a-1 dividing points, which are the intersection points of different fitting straight lines. Based on the initial voltage value and a-1 dividing points, a target fitting line is determined from the target fitting polygonal line. The target fitting line is at least one segment of the a-segment fitting straight lines. A fitted straight line is used to determine the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value. The adjustable lens is then adjusted according to the target voltage adjustment amount. On the one hand, after the camera is turned on, the corresponding voltage adjustment amount can be determined based on the phase difference at the focus position, the initial voltage value, the fitted line, and its division points. That is, the voltage value corresponding to the phase difference can be found on the fitted line using the phase difference. The initial voltage value is compared with the voltage value at the division point to determine the optimal fitted straight line. Then, based on the fitted line, the voltage value that needs to be adjusted corresponding to the phase difference is found, and it is compared with the initial voltage value to determine the voltage adjustment amount. On the other hand, since a fitted line is used, the non-linear characteristics of the PD curve of the adjustable lens can be overcome, thereby improving the focusing accuracy of the adjustable lens. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0026] Figure 2This is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0027] Figure 3 This is a schematic flowchart of a focusing control method provided in an embodiment of this application;
[0028] Figure 4 This is a schematic diagram illustrating a focus position provided in an embodiment of this application;
[0029] Figure 5 This is a schematic diagram illustrating a fitted polyline provided in an embodiment of this application;
[0030] Figure 6 This is a schematic diagram illustrating another fitted polyline provided in an embodiment of this application;
[0031] Figure 7 This is a schematic diagram illustrating another fitted polyline provided in an embodiment of this application;
[0032] Figure 8 This is a schematic diagram illustrating another fitted polyline provided in an embodiment of this application;
[0033] Figure 9 This is a flowchart illustrating another focusing control method provided in an embodiment of this application;
[0034] Figure 10 The MTF curve of the same adjustable lens provided in the embodiments of this application;
[0035] Figure 11 This is a schematic diagram of the process of adjusting the adjustable focus lens from the initial voltage to the preset voltage in the direction of voltage increase according to the embodiments of this application;
[0036] Figure 12 This is a schematic diagram of voltage change in which the adjustable focus lens is adjusted from the initial voltage to the preset voltage in the direction of voltage increase, as provided in the embodiments of this application.
[0037] Figure 13 This is a schematic diagram of the process of adjusting the adjustable focus lens from the initial voltage to the preset voltage in the direction of voltage decrease provided in the embodiments of this application;
[0038] Figure 14 This is a flowchart illustrating another focusing control method provided in an embodiment of this application;
[0039] Figure 15 This is a flowchart illustrating another focusing control method provided in an embodiment of this application;
[0040] Figure 16 This is a flowchart illustrating another focusing control method provided in an embodiment of this application;
[0041] Figure 17 This is a flowchart illustrating another focusing control method provided in an embodiment of this application;
[0042] Figure 18 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0043] Figure 19 This is a block diagram of the functional units of a focusing control device provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0045] To better understand the solutions of the embodiments of this application, the relevant terms and concepts that may be involved in the embodiments of this application will be introduced below.
[0046] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first critical voltage may be referred to as a second critical voltage, and similarly, a second critical voltage may be referred to as a first critical voltage. Both the first critical voltage and the second critical voltage are critical voltages, but they are not the same critical voltage.
[0047] In specific implementations, electronic devices may include those with tunable lenses, such as handheld devices (smartphones, tablets, etc.), in-vehicle devices (navigation systems, reversing assistance systems, dashcams, car refrigerators, etc.), wearable devices (smart bracelets, wireless headphones, smartwatches, smart glasses, etc.), customer premise equipment (CPE), computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), virtual reality / augmented reality devices, terminal devices, and so on.
[0048] The electronic devices may also include smart home devices, which may be at least one of the following: smart speakers, smart cameras, smart rice cookers, smart wheelchairs, smart massage chairs, smart furniture, smart dishwashers, smart TVs, smart refrigerators, smart electric fans, smart heaters, smart clothes racks, smart lights, smart routers, smart switches, smart switch panels, smart humidifiers, smart air conditioners, smart doors, smart windows, smart stoves, smart disinfection cabinets, smart toilets, robot vacuum cleaners, etc., without limitation.
[0049] In this embodiment, the PD curve refers to the curve showing how the phase difference of the image of an object changes with the focus position during the focusing process of a camera at a fixed object distance. Phase detection autofocus (PDAF) involves the system detecting the phase difference between the current position and the focus position, directly calculating the focus position, and completing the focusing process. It not only offers fast focusing speed but is also unaffected by the magnitude of the difference between the target position and the current position. In this embodiment, the adjustable lens of the electronic device uses PDAF technology for focus adjustment.
[0050] In this embodiment of the application, contrast auto focus (CAF) detects the image sharpness at multiple focus positions, identifies the position of the image with the highest sharpness, and completes the focusing. However, its focusing speed is relatively slow, especially when the target position differs significantly from the current position.
[0051] With the continuous development of technologies related to electronic devices, the lenses used in these devices are also constantly being updated. For example, adjustable focus lenses are being used more and more widely in electronic devices. Generally speaking, an adjustable focus lens refers to a liquid lens, which mainly utilizes different voltages applied to it to deform internal components, thereby achieving focusing through the deformed adjustable focus lens.
[0052] The adjustable lens's internal components, whose shape can change, are primarily made of piezoelectric materials. However, due to the hysteresis characteristic of piezoelectric materials, the deformation of the material as a result of applied voltage depends not only on the magnitude of the applied voltage but also on its initial shape. For example, when the voltage of the lens is increased from 0 (V) to X (V), or decreased from a higher voltage to X (V), the deformation of the piezoelectric material is completely different in both cases, meaning the piezoelectric film shape differs. This difference in the piezoelectric film shape leads to different refractive powers, resulting in two different levels of image sharpness when the lens is at the same voltage.
[0053] Therefore, extending this to the entire adjustable voltage range of the lens, when focusing through the lens, each voltage level corresponds to two different image sharpnesses. Consequently, focusing algorithms struggle to determine which voltage corresponds to the sharpest image, leading to frequent focusing inaccuracies when focusing through an adjustable lens.
[0054] The first part describes the software and hardware operating environment of the technical solution disclosed in this application.
[0055] As shown in the figure Figure 1 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, 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, a headphone jack 170D, a sensor module 180, a compass 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0056] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0057] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processors (NPUs). Different processing units may be independent components or integrated into one or more processors. In some embodiments, electronic device 100 may also include one or more processors 110. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, processor 110 may also include a memory for storing instructions and data. For example, the memory in processor 110 may be a cache memory. This memory can store instructions or data that processor 110 has just used or is repeatedly used. If processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves the efficiency of electronic device 100 in processing data or executing instructions. The processor may also include an image processor, which can be a preprocessor image signal processor (Pre-ISP), which can be understood as a simplified ISP. It can also perform some image processing operations, such as acquiring image statistical information.
[0058] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. The USB interface 130 is a USB standard-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transfer between the electronic device 100 and peripheral devices. The USB interface 130 can also be used to connect headphones for audio playback.
[0059] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0060] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0061] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0062] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0063] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0064] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G / 6G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0065] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0066] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0067] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), 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 (miniled), a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194.
[0068] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0069] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0070] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or more cameras 193.
[0071] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0072] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0073] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0074] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0075] Internal memory 121 can be used to store one or more computer programs, which include instructions. Processor 110 can execute the instructions stored in internal memory 121, thereby causing electronic device 100 to perform the methods for displaying page elements provided in some embodiments of this application, as well as various applications and data processing. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system; the program storage area may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created during the use of electronic device 100 (such as photos, contacts, etc.). In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, processor 110 can execute instructions stored in internal memory 121 and / or instructions stored in memory disposed in processor 110, thereby causing electronic device 100 to perform the methods for displaying page elements provided in embodiments of this application, as well as other applications and data processing. Electronic device 100 can implement audio functions such as music playback and recording through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0076] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0077] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the touch operation intensity based on the pressure sensor 180A. The electronic device 100 can also calculate the touch position based on the detection signal from the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS message is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS message is executed.
[0078] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 around three axes (i.e., the X, Y, and Z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0079] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0080] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0081] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0082] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0083] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than where it is connected to display screen 194.
[0084] For example, Figure 2 A software architecture block diagram of the electronic device 100 is shown. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.
[0085] like Figure 2 As shown, the application layer can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0086] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0087] like Figure 2 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0088] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0089] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0090] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0091] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0092] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0093] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0094] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0095] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0096] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0097] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0098] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0099] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0100] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0101] A 2D graphics engine is a graphics engine for 2D drawing.
[0102] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0103] The second part, the focusing control method and related apparatus disclosed in the embodiments of this application, are described below.
[0104] Please see Figure 3 , Figure 3 This application provides a focus control method, which is applied to applications such as... Figure 1 or Figure 2 The electronic device shown includes an adjustable focus lens, and the focus control method may include the following steps:
[0105] 301. When the camera is turned on, acquire the phase difference source image and the initial voltage value corresponding to the initial focus position of the phase difference source image.
[0106] In this embodiment, a phase difference source image (PD raw) can be acquired when the camera is turned on. This phase difference source image can be a phase difference source image saved from the last use of the camera function. This phase difference source image can correspond to an initial focus position, which can correspond to an initial voltage value. The aforementioned phase difference source image can include multiple pixels, and each pixel can correspond to a phase difference, meaning that the phase difference is different at different positions.
[0107] 302. Determine the target focus position.
[0108] In this embodiment of the application, the target focus position can be set by the user or by the system default. For example... Figure 4 As shown, users can touch the area within the dashed box in the image to select the target focus position. For example, the center point of the touch operation can be used as the target focus position, allowing users to choose the focus position themselves.
[0109] Optionally, step 302 above, determining the target focus position, may include the following steps:
[0110] A21. Obtain the preview image;
[0111] A22. Perform target recognition on the preview image to obtain the target region;
[0112] A23. Determine the target focus position based on the target area;
[0113] or;
[0114] B21. Obtain the target touch position for the preview image;
[0115] B22. Determine the target focus position based on the target touch position.
[0116] In this embodiment of the application, a preview image can be obtained, and then target recognition can be performed on the preview image to obtain a target area. The target area can be used as the target focus position. The recognized target can be a person or other objects. The other objects can be executed by the user or defaulted by the system. For example, the object can be an animal, food, etc., which is not limited here.
[0117] In addition, in this embodiment of the application, the user can also perform touch operation on the preview image to obtain the target touch position, which can be used as the target focus position. In this way, personalized focus operation can be achieved based on the user's wishes.
[0118] 303. Obtain the target phase difference corresponding to the target focus position based on the phase difference source image.
[0119] In this embodiment of the application, since the target focus position can correspond to a coordinate position, the target phase difference corresponding to the coordinate position can be obtained from the phase difference image based on the coordinate position.
[0120] 304. Obtain the target fitting polyline, which consists of a segment of fitting straight lines, where a is an integer greater than 1, and the horizontal axis of the target fitting polyline is the voltage value and the vertical axis is the phase difference. The segment of fitting straight lines includes a-1 dividing points, which are the intersection points of different fitting straight lines.
[0121] In this embodiment, the target fitting polyline can be preset or set by the system default, or different fitting polylines can correspond to different target focus positions.
[0122] The target fitted line segment can be composed of 'a' fitted straight lines, where 'a' is an integer greater than 1. The x-axis represents the voltage value, and the y-axis represents the phase difference. Each 'a' fitted straight line segment can include 'a-1' dividing points, which are the intersections of different fitted straight lines. Each fitted straight line has its own slope.
[0123] For example, Figure 5 As shown, when the fitted polyline includes one dividing point, the fitted polyline can be composed of the first fitted line and the second fitted line, and the intersection of the two fitted lines is the dividing point.
[0124] Let me give another example, such as Figure 6 As shown, when the fitted polyline includes two dividing points, the fitted polyline can be composed of the first fitted line, the second fitted line, and the third fitted line. The intersection of these fitted polylines is the dividing point, namely dividing point 1 and dividing point 2.
[0125] Optionally, step 304 above, obtaining the target fitted polyline, may include the following steps:
[0126] 41. Determine the target area identifier corresponding to the target focus position;
[0127] 42. Determine the target fitted line corresponding to the target region identifier according to the preset mapping relationship between the region identifier and the fitted line.
[0128] In this embodiment of the application, the preview image can be divided into multiple regions in advance, and different regions can correspond to different region identifiers. In this way, the target region identifier corresponding to the target focus position can be determined.
[0129] Of course, the mapping relationship between preset region identifiers and fitted polylines can also be stored in advance, and the target fitted polyline corresponding to the target region identifier can be determined based on the mapping relationship. In this way, different fitted polylines can be pre-calibrated based on different regions, which helps to improve focusing accuracy.
[0130] 305. Determine a target fitting line from the target fitting polygonal line based on the initial voltage value and the a-1 segmentation points, wherein the target fitting line is at least one fitting straight line among the a-segment fitting straight lines.
[0131] The target fitted line can be a fitted straight line or a fitted polygonal line.
[0132] In this embodiment, the initial voltage value can be compared with the voltage values corresponding to a-1 segmentation points, and the corresponding fitting line can be selected as the target fitting line based on the comparison result.
[0133] For example, Figure 5 Taking the fitted polyline as an example, the initial voltage value can be compared with the voltage value of the segmentation point. If the initial voltage value is less than the voltage value of the segmentation point, the first fitted line can be used as the target fitted line. Conversely, if the initial voltage value is greater than or equal to the voltage value of the segmentation point, the second fitted line can be used as the target fitted line.
[0134] Let me give another example. Figure 6 Taking the fitted polyline as an example, the initial voltage value can be compared with the voltage values of the two dividing points. If the initial voltage value is less than the voltage value of dividing point 1, the first fitted line can be used as the target fitted line. If the initial voltage value is greater than or equal to the voltage value of dividing point 1 and less than the voltage value of dividing point 2, the second fitted line can be used as the target fitted line. If the initial voltage value is greater than or equal to the voltage value of dividing point 2, the third fitted line can be used as the target fitted line, and so on.
[0135] In practical implementation, the target fitting line can also be determined from the target fitting polygonal line based on the initial voltage value, a-1 segmentation points, and the target phase difference. The target fitting line is at least one of the a-segment fitting lines. Specifically, two lines can be drawn: x = initial voltage value, y = target phase difference. The intersection point with the target fitting polygonal line can be determined using these two lines. The line at the intersection point and the lines between the intersection points can be used together as the target fitting line. In practical applications, if the initial voltage value is close to a segmentation point (when the initial voltage value is similar to the voltage value at the segmentation point), the phase difference may cross the segmentation point. In this case, the slopes of the two preceding and following lines will be used to generate the corresponding fitting line.
[0136] 306. Determine the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value.
[0137] In this embodiment of the application, when 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 the difference between the reference voltage value and the initial voltage value can be used to determine the target voltage adjustment amount.
[0138] Optionally, step 306 above, determining the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value, includes:
[0139] 61. Determine the reference voltage value corresponding to the target phase difference based on the target fitting line;
[0140] 62. Determine the target voltage adjustment amount based on the reference voltage value and the initial voltage value.
[0141] In specific implementation, such as Figure 7 As shown, when the target fitting line is determined, a straight line can be drawn, i.e., y = target phase difference, which will intersect the target fitting line at a point C. The horizontal coordinate of the intersection point C is the reference voltage value. Then, the difference between the reference voltage value and the initial voltage value can be used as the target voltage adjustment amount.
[0142] 307. Adjust the adjustable focus lens according to the target voltage adjustment amount.
[0143] In this embodiment, the adjustable lens can be adjusted based on the target voltage adjustment amount. Due to the non-linear characteristics of the PD curve of the Tlens camera, this embodiment uses a fitted piecewise linear curve to achieve focus adjustment, which helps to improve the accuracy of focus adjustment.
[0144] Optionally, before step 301 above, the following steps may also be included:
[0145] A1. Obtain the voltage adjustment range of the adjustable focus lens, and sample the voltage adjustment range to obtain P sampled voltages, where P is an integer greater than 1. The voltage adjustment range includes the minimum adjustable voltage value and the maximum adjustable voltage value.
[0146] A2. Obtain the phase difference source image corresponding to each of the P sampled voltages to obtain P phase difference source images;
[0147] A3. Divide each of the P phase difference source images into M*N regions according to the preset region division rules to obtain P*M*N region images, where M and N are both integers greater than or equal to 1, and M*N is greater than 1.
[0148] A4. Classify the P*M*N region images to obtain M*N region image sets. Each region image set includes P region images with the same spatial position and each region image corresponds to a sampling voltage.
[0149] A5. Fit each of the M*N region image sets to obtain M*N sets of fitting data. Each set of fitting data includes P fitting points. The horizontal axis of each fitting point is the voltage value and the vertical axis is the phase difference.
[0150] A6. Fit the M*N sets of fitted data to obtain M*N fitted polylines.
[0151] In this embodiment of the application, the voltage adjustment range of the adjustable lens can be obtained. The voltage adjustment range may include a minimum adjustable voltage value Min and a maximum adjustable voltage value Max. Then, the voltage adjustment range can be sampled to obtain P sampled voltages, where P is an integer greater than 1. The specific sampling method may include uniform sampling or random sampling.
[0152] Next, the phase difference source image corresponding to each of the P sampled voltages can be acquired, resulting in P phase difference source images. Each sampled voltage corresponds to one phase difference source image. Then, according to a preset region division rule, each of the P phase difference source images is divided into M*N regions, resulting in P*M*N region images, where M and N are integers greater than or equal to 1, and M*N is greater than 1. The preset region division can be pre-set or a system default, for example, a 3x3 grid. Each region image can correspond to a region identifier. For example, using a 3x3 grid, the 9 squares can be numbered. Then, the P*M*N region images are classified to obtain M*N region image sets. Each region image set includes P region images where the P region images are spatially identical and each region image corresponds to one sampled voltage. In other words, region images with the same region identifier can be grouped into one region image set.
[0153] Furthermore, each of the M*N region image sets can be fitted to obtain M*N sets of fitting data. Each set of fitting data can include P fitting points. The x-axis of each fitting point is the voltage value and the y-axis is the phase difference. That is, each region image can be processed into a fitting point. Then, based on the M*N sets of fitting data, M*N fitting polylines are obtained. That is, each region identifier can correspond to a fitting polyline. The target fitting polyline is one of the M*N fitting polylines.
[0154] Further, optionally, step A6 above, fitting the M*N sets of fitted data to obtain M*N fitted polylines, may include the following steps:
[0155] A61. Obtain k fitting points from the i-th group of fitted data as split points, where the i-th group of fitted data is any one of the M*N groups of fitted data, and k is a positive integer less than P.
[0156] A62. Based on the voltage values of the k fitting points, the i-th group of fitting data is divided into a set of k+1 fitting points;
[0157] A63. Fit each set of fitting points in the k+1 fitting point set to obtain k+1 fitting lines;
[0158] A64. Determine the fitted polyline corresponding to the i-th group of fitted data based on the fitted straight line of the k+1 segment.
[0159] In this embodiment of the application, taking the i-th set of fitted data as an example, the i-th set of fitted data is any set of fitted data in the M*N sets of fitted data. The k fitting points in the i-th set of fitted data can be obtained as split points, where k is a positive integer less than P. Then, the i-th set of fitted data can be divided into k+1 sets of fitted points based on the voltage values of the k fitting points. For example, when k is odd, the fitting point with the voltage value in the middle position among the k fitting points can be used as the split point. For example, when k is even, any one of the two fitting points with the voltage value in the middle position among the k fitting points can be used as the split point.
[0160] Next, each set of fitted points in the k+1 fitted point set can be fitted to obtain k+1 fitted straight lines. Finally, the fitted polyline corresponding to the i-th set of fitted data can be determined based on the k+1 fitted straight lines, that is, the k+1 fitted straight lines can be connected based on the split points to obtain the fitted polyline.
[0161] For example, Figure 8 As shown, 10 fitting points are provided, each corresponding to a voltage value and a phase difference. The point P, where the voltage value is in the middle, can be used as the dividing point to divide the 10 fitting points into two sets. The fitting points of these two sets are then fitted to obtain the first and second fitted lines. Finally, these two fitted lines are connected based on point P to obtain the fitted polygonal line, and so on.
[0162] Optionally, step A6 above, which involves fitting each region image set in the M*N region image sets to obtain M*N sets of fitted data, may include the following steps:
[0163] Obtain the phase difference between each region image in the j-th region image set and the preset focus position, as well as the voltage value corresponding to the region image, and combine them to form fitting points to obtain the P fitting points. The j-th region image set is any region image set in the M*N region image sets.
[0164] In the specific implementation, the preset focus position can be set in advance or defaulted to by the system. Taking the j-th region image set as an example, which is any region image set in the M*N region image set, the phase difference between each region image in the j-th region image set and the preset focus position, as well as the voltage value corresponding to that region image, can be obtained and used to form fitting points, resulting in P fitting points.
[0165] To illustrate, taking a mobile phone as an example, in this embodiment of the application, before leaving the factory, during the calibration process, a customized target plate is placed at the object distance position corresponding to the midpoint of the image distance variation range designed for the Tlens camera. For example, the midpoint l (3.33mm) of the image distance variation range designed for a certain Tlens camera corresponds to an object distance of approximately L (30cm), that is, a special target plate is placed at a distance of L (30cm) from the camera; then, the voltage of the Tlens piezoelectric material is increased from the Min voltage to the Max voltage, and the PDraw image output by the image sensor is uniformly acquired. Then, the PD raw image is reasonably divided into regions (for example, divided into 8*6 regions), and the curve relating PD to the focus position (voltage value) of each region is obtained. Then, based on the morphological characteristics of the PD curve, the PD curve is reasonably segmented. For example, the curve from inf (infinity) to 30cm is divided into the first segment, and the curve from 30cm to 15cm is divided into the second segment. Of course, the principle is the same for three or more segments, which will not be elaborated here.
[0166] Next, the two PD curves for each region can be linearly fitted to obtain the segmented slope k1 (slope of the first fitted line), k2 (slope of the second fitted line), and the segmentation point P for each region. Then, the segmentation point P and the segmented slope for each region are recorded in the camera's storage area to complete the calibration, which is then available for retrieval by the mobile device. The segmented calibration slopes k1 and k2 and the recorded segmentation point P are as follows: Figure 8 As shown.
[0167] Furthermore, in practical applications, after the user turns on the camera, the system obtains the sensor PD raw image and a voltage value corresponding to the current focus position. Based on the PD raw image obtained by the image sensor, the system calculates the PD phase difference of the focus target (target focus position). Based on the PD phase difference, the current focus position, and the known positions of k1, k2, and P points, the system calculates the difference between the target focus position and the current focus position, i.e., the voltage difference. Then, based on this voltage difference, the Tlens changes the voltage to complete fast focusing. In this way, the Tlens camera can perform PDAF fast focusing based on the phase difference, and the focusing speed is far superior to the traditional CAF focusing solution.
[0168] As can be seen, the focusing control method described in this application embodiment is applied to an electronic device, which includes an adjustable focusing lens. When the camera is turned on, a phase difference source image and the initial voltage value corresponding to the initial focusing position of the phase difference source image are acquired to determine the target focusing position. Based on the phase difference source image, the target phase difference corresponding to the target focusing position is acquired, and a target fitting polygonal line is acquired. The target fitting polygonal line consists of a segment of fitting straight lines, where a is an integer greater than 1, and the horizontal axis of the target fitting polygonal line is the voltage value and the vertical axis is the phase difference. The a segment of fitting straight lines includes a-1 dividing points, which are the intersection points of different fitting straight lines. Based on the initial voltage value and a-1 dividing points, a target fitting line is determined from the target fitting polygonal line. The target fitting line is at least one segment of the a segment of fitting straight lines. The method involves using a straight line to determine the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value. The adjustable lens is then adjusted according to this target voltage adjustment amount. On one hand, after the camera is turned on, the corresponding voltage adjustment amount can be determined based on the phase difference at the focus position, the initial voltage value, the fitted line, and its segmentation points. Specifically, the voltage value corresponding to the phase difference can be found on the fitted line, and the initial voltage value is compared with the voltage value at the segmentation point to determine the optimal fitted line. Then, based on this fitted line, the voltage value that needs adjustment corresponding to the phase difference is found, and this is compared with the initial voltage value to determine the voltage adjustment amount. On the other hand, using a fitted line overcomes the non-linear characteristics of the adjustable lens's PD curve, thereby improving the focusing accuracy of the adjustable lens.
[0169] Furthermore, the adjustment of the adjustable focus lens based on the target voltage adjustment amount can be implemented as follows, wherein the target voltage adjustment amount is the difference between the initial voltage value and the reference voltage value. For details, please refer to [link to relevant documentation]. Figure 9 , Figure 9 This is a flowchart of a focus control method in one embodiment. The focus control method in this embodiment is designed to operate in... Figure 1 or Figure 2 Taking an electronic device as an example, the electronic device includes an adjustable focus lens. For example... Figure 9 As shown, the focus control method includes steps 901 to 903, wherein,
[0170] 901. Obtain the initial voltage value and reference voltage value of the adjustable focus lens.
[0171] An adjustable-focus lens refers to a liquid lens that utilizes different applied voltages to deform its internal, shape-changing components, thus achieving focusing. When taking photos using a camera module in an electronic device, the camera module needs to focus. If the camera module includes an adjustable-focus lens, the electronic device must first obtain the initial voltage value of the adjustable-focus lens, and then obtain its reference voltage value.
[0172] The initial voltage value of the adjustable focusing lens refers to the voltage applied to the adjustable focusing lens when the camera module is activated, or the voltage applied to the adjustable focusing lens before focusing. The reference voltage value of the adjustable focusing lens refers to the voltage calculated by the focusing algorithm, and the defocus distance of the adjustable focusing lens at the reference voltage value is less than a preset defocus distance threshold (e.g., 0 or a value infinitely close to 0). In other words, the closer the adjustable focusing lens is to the focused position at the reference voltage value, the better.
[0173] 902. The initial voltage value of the adjustable lens is adjusted to the reference voltage value using the reference voltage value adjustment method; the reference voltage value adjustment method includes the same voltage adjustment direction.
[0174] After the electronic device obtains the initial voltage value and reference voltage value of the adjustable lens, since the defocus distance of the adjustable lens at the reference voltage value is less than the preset defocus distance threshold, in order to achieve focusing, the initial voltage value of the adjustable lens can be adjusted to the reference voltage value by means of reference voltage value adjustment.
[0175] The adjustable-focus lens primarily uses piezoelectric materials for its internal components, which allow for variable shapes. However, because piezoelectric materials exhibit magnetic hysteresis, inaccurate focusing often occurs during the focusing process using an adjustable-focus lens.
[0176] Because the piezoelectric materials inside adjustable lenses all exhibit hysteresis, the deformation of these materials as they deform with the applied voltage depends not only on the magnitude of the applied voltage but also on their initial shape. Therefore, to mitigate hysteresis, a reference voltage adjustment method is used to adjust the initial voltage of the adjustable lens to a reference voltage value, where the adjustment direction is the same. By adjusting the initial voltage of the adjustable lens to the reference voltage value in the same direction, the deformation of the piezoelectric material within the lens remains constant at that voltage. Consequently, the piezoelectric film shape within the lens is consistent, resulting in a consistent refractive power. Ultimately, this allows images of the same sharpness to be acquired using a lens operating at the same voltage. Adjusting the initial voltage of the adjustable lens to the reference voltage value in the same direction avoids the anomaly of acquiring two images of different sharpnesses using a lens operating at the same voltage.
[0177] 903. Control the adjustable focus lens to focus at the reference voltage value.
[0178] In this embodiment, since the defocus distance of the adjustable lens at the reference voltage value is less than a preset defocus distance threshold (e.g., 0 or a value infinitely close to 0), the adjustable lens is closer to the focusing position at the reference voltage value. Therefore, after adjusting the initial voltage value of the adjustable lens to the reference voltage value in the same voltage adjustment direction, the adjustable lens can be controlled to focus at the reference voltage value. Thus, a clear image can be obtained through the adjustable lens and image sensor at the reference voltage value.
[0179] In this embodiment, the electronic device acquires the initial voltage value and reference voltage value of the adjustable focusing lens. The defocus distance of the adjustable focusing lens at the reference voltage value is less than a preset defocus distance threshold. The initial voltage value of the adjustable focusing lens is adjusted to the reference voltage value using a reference voltage adjustment method, which includes adjusting the voltage in the same direction. Finally, the adjustable focusing lens is controlled to focus at the reference voltage value. Since the defocus distance of the adjustable focusing lens at the reference voltage value is less than the preset defocus distance threshold, the adjustable focusing lens can achieve focusing at the reference voltage value. However, since the piezoelectric material inside the adjustable focusing lens has hysteresis characteristics, to circumvent these hysteresis characteristics, the initial voltage value of the adjustable focusing lens is adjusted to the reference voltage value using the same voltage adjustment direction. Therefore, the deformation of the piezoelectric material inside the adjustable focusing lens is fixed when it is at the reference voltage value. This allows images of the same sharpness to be acquired by lenses operating at the same voltage. Ultimately, the adjustable focusing lens can be controlled to focus at the reference voltage value, obtaining images of the same sharpness and improving focusing accuracy.
[0180] Furthermore, after step 903, the following steps may also be included:
[0181] The reference voltage adjustment method is determined based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction; the same voltage adjustment direction includes the voltage increase direction or the voltage decrease direction.
[0182] In this embodiment, firstly, the relationship between the initial voltage value and the reference voltage value of the adjustable lens is obtained; secondly, the same voltage adjustment direction is determined to be either the voltage increase direction or the voltage decrease direction; finally, based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction, the reference voltage value adjustment method is determined.
[0183] The relationship between the initial voltage value and the reference voltage value of the adjustable lens can be obtained by comparing them. Furthermore, the direction of voltage adjustment (whether it is an increasing or decreasing direction) can be determined empirically; this application does not impose any limitations on this. Figure 10 This is an example of an MTF (Modulation Transfer Function) curve for the same type of adjustable lens in one embodiment. The horizontal axis of the MTF curve represents the voltage applied to the adjustable lens, and the vertical axis represents the sharpness of the image captured by the adjustable lens at that voltage. The MTF curve includes both forward and reverse MTF curves. For the same type of adjustable lens, adjusting the applied voltage in the direction of voltage increase yields an MTF curve (e.g., ...). Figure 10The positive MTF curve in the image. Here, "positive" refers to the direction of voltage increase. Similarly, for the same adjustable focus lens, by adjusting the applied voltage in the direction of voltage decrease, an MTF curve can be obtained (e.g., the positive MTF curve in the image). Figure 10 (The reverse MTF curve in the figure). Here, "reverse" refers to the direction of voltage decrease.
[0184] It is known that within the entire adjustable voltage range of the Tlens, if the Tlens is adjusted from its initial voltage value to its reference voltage value in different voltage adjustment directions, the Tlens will correspond to two different levels of image sharpness at each voltage. Therefore, accurate focusing cannot be achieved.
[0185] Therefore, it is necessary to determine whether the same voltage adjustment direction is the direction of voltage increase or voltage decrease. After determining this direction, the adjustment method for the reference voltage value can be determined based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens, and the same voltage adjustment direction. For example, if the same voltage adjustment direction is the direction of voltage increase, and the initial voltage value of the adjustable lens is greater than the reference voltage value, then the reference voltage adjustment method is determined to be first decrease and then increase. If the same voltage adjustment direction is the direction of voltage decrease, and the initial voltage value of the adjustable lens is less than the reference voltage value, then the reference voltage adjustment method is determined to be first increase and then decrease.
[0186] This application describes the specific implementation steps for determining the reference voltage adjustment method. After determining whether the same voltage adjustment direction is a voltage increase direction or a voltage decrease direction, the specific method for adjusting the initial voltage value of the adjustable lens to the reference voltage value can be determined based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction. Thus, the reference voltage adjustment method is determined. The reference voltage adjustment method is accurately determined from two dimensions: the relationship between the initial voltage value and the reference voltage value, and the same voltage adjustment direction.
[0187] Furthermore, in one embodiment, if the same voltage adjustment direction includes a voltage increase direction, then the above steps, based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction, determine the reference voltage value adjustment method, including:
[0188] Determine whether the reference voltage value of the adjustable focus lens is greater than the initial voltage value;
[0189] If it is determined that the reference voltage value of the adjustable lens is less than the initial voltage value, then the reference voltage value adjustment method is determined to be to reduce the initial voltage value to the first critical voltage, and then increase it from the first critical voltage to the reference voltage value after a first preset time period.
[0190] Specifically, when determining the reference voltage adjustment method, if the same voltage adjustment direction includes the voltage increase direction, firstly, it is determined whether the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (A); secondly, if it is determined that the reference voltage value (B) of the adjustable lens is less than the initial voltage value (A), then the reference voltage adjustment method is determined to be to reduce the initial voltage value (A) to the first critical voltage (min), and then increase it 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 to allow the adjustable lens to reach stability at the first critical voltage (min). Here, the first critical voltage can be the minimum voltage (min) applied to the adjustable lens. Of course, it can also be a smaller voltage applied to the adjustable lens, such as a voltage close to the minimum voltage (min), or a voltage that differs from the minimum voltage (min) by a preset difference. Assume that the voltage applied to the piezoelectric material in the adjustable lens can vary from 0-50V, while the operating voltage range of the piezoelectric material in the adjustable lens during focusing is 8V to 50V. Therefore, the first critical voltage can be set to 0V. Of course, the first critical voltage can be set to any value less than 8V, and this application does not limit it.
[0191] 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), then the reference voltage value adjustment method is to directly increase the initial voltage value (C) to the reference voltage value (B).
[0192] Thus, when the reference voltage value (B) of the adjustable lens is less than the initial voltage value (A), the piezoelectric film shape of the adjustable lens at the reference voltage value (B), obtained by adjusting the voltage first by decreasing and then increasing it, is consistent with the piezoelectric film shape when the initial voltage value (C) is increased to the reference voltage value (B). Therefore, the refractive power of the lens is also consistent, ultimately enabling the acquisition of images with the same sharpness through a lens operating at the same voltage. By adjusting the initial voltage value of the adjustable lens to the reference voltage value in the same voltage adjustment direction, the abnormal situation of acquiring two images with different sharpnesses through a lens operating at the same voltage can be avoided.
[0193] Combination Figure 11 The diagram illustrates a process for adjusting a focusable lens from an initial voltage value to a reference voltage value in one embodiment, following the direction of voltage increase. If the same voltage adjustment direction is the direction of voltage increase, then adjusting the focusable lens from the initial voltage value to the reference voltage value in the same voltage adjustment direction includes the following steps:
[0194] 1101. Determine whether the reference voltage value of the adjustable lens is greater than the initial voltage value; if it is determined that the reference voltage value of the adjustable lens is less than the initial voltage value, proceed to step 1102; if it is determined that the reference voltage value of the adjustable lens is greater than the initial voltage value, proceed to step 1105.
[0195] 1102. Reduce the initial voltage value to the first critical voltage.
[0196] 1103. Control the adjustable focus lens to maintain a first preset time period under the first critical voltage.
[0197] 1104. Increase the first critical voltage to the reference voltage value.
[0198] 1105. Increase the initial voltage value directly to the reference voltage value.
[0199] like Figure 12 The diagram shown illustrates the voltage change of an adjustable focus lens from an initial voltage value to a reference voltage value in one embodiment, following the direction of voltage increase. Figure 12 (a) shows a schematic diagram of voltage change when the reference voltage value (B) of the adjustable lens is less than the initial voltage value (A). First, the initial voltage value (A) is reduced to the first critical voltage (min); second, the adjustable lens is controlled to maintain the first preset time period (5ms) at the first critical voltage (min); finally, the first critical voltage (min) is increased to the reference voltage value (B).
[0200] Figure 12 Figure (b) shows a schematic diagram of voltage change when the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (C). The initial voltage value (C) is directly increased to the reference voltage value (B).
[0201] In this embodiment, if the same voltage adjustment direction is the voltage increase direction, when determining the reference voltage adjustment method, firstly, it is determined whether the reference voltage value of the adjustable lens is greater than the initial voltage value. If it is determined that the reference voltage value of the adjustable lens is less than the initial voltage value, the reference voltage adjustment method is determined to be to reduce the initial voltage value to a first critical voltage, and then increase it from the first critical voltage to the reference voltage value after a first preset time period. Thus, when the reference voltage value (B) of the adjustable lens is less 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 first decreasing and then increasing is consistent with the piezoelectric film shape when the initial voltage value (C) is directly increased to the reference voltage value (B). Therefore, it is ultimately possible to acquire images of the same sharpness using a lens at the same voltage. Therefore, by adjusting the initial voltage value of the adjustable lens to the reference voltage value according to the same voltage adjustment direction, the abnormal situation of acquiring two images of different sharpness using a lens at the same voltage can be avoided. Ultimately, the focusing accuracy is improved.
[0202] The previous embodiment described how, if the same voltage adjustment direction includes a voltage increase direction, the voltage adjustment process is performed based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction. In this embodiment, it is further 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.
[0203] Specifically, if the voltage adjustment direction is the voltage increase direction, firstly, it is determined whether the reference voltage value of the adjustable focusing lens is greater than the initial voltage value. If it is determined that the reference voltage value of the adjustable focusing lens is less than the initial voltage value, then the reference voltage adjustment method is determined to be to reduce the initial voltage value to a first critical voltage, and then increase it from the first critical voltage to the reference voltage value after a first preset time period. Here, the first preset time period can be set to be greater than or equal to a preset time period threshold, where the preset time period threshold can be determined based on empirical values. For example, the maximum time for the adjustable focusing lens to reach stability can be determined based on the maximum amplitude and maximum vibration frequency of the adjustable focusing lens, such as 5ms or 3ms. Then, the maximum time for the adjustable focusing lens to reach stability is used as the preset time period threshold, i.e., the preset time period threshold can be 5ms.
[0204] Furthermore, the first preset time period can be related to the amplitude and vibration frequency of the adjustable focusing lens, specifically, they are positively correlated. The greater the amplitude and vibration frequency of the adjustable focusing lens when it decreases from the initial voltage value to the first critical voltage, the longer the first preset time period required for the adjustable focusing lens to reach stability. Conversely, the shorter the first preset time period required for the adjustable focusing lens to reach stability, the lower the amplitude and vibration frequency.
[0205] In this embodiment, if the same voltage adjustment direction is the voltage increase direction, firstly, it is determined whether the reference voltage value of the adjustable focusing lens is greater than the initial voltage value. If it is determined that the reference voltage value of the adjustable focusing lens is less than the initial voltage value, then the reference voltage adjustment method is determined to be to reduce the initial voltage value to a first critical voltage, and then increase it from the first critical voltage to the reference voltage value after a first preset time period. Specifically, 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 focusing lens. In this way, it can be ensured that the adjustable focusing lens reaches stability after maintaining the first preset voltage for a first preset time period. Then, subsequently increasing the voltage from the first critical voltage to the reference voltage value after the first preset time period can ensure that the piezoelectric film shape of the adjustable focusing lens at the reference voltage value is consistent with the piezoelectric film shape when the adjustable focusing lens directly increases from a certain initial voltage value to the reference voltage value.
[0206] In one embodiment, if the same voltage adjustment direction includes a voltage decreasing direction, then based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction, the reference voltage value adjustment method is determined, including:
[0207] Determine whether the reference voltage value of the adjustable focus lens is greater than the initial voltage value;
[0208] If it is determined that the reference voltage value of the adjustable lens is greater than the initial voltage value, then the reference voltage value adjustment method is determined to be to increase the initial voltage value to the second critical voltage, and then decrease it from the second critical voltage to the reference voltage value within a second preset time period.
[0209] Specifically, when determining the reference voltage adjustment method, if the same voltage adjustment direction includes the voltage decreasing direction, it is determined whether the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (A). Secondly, if it is determined that the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (A), the reference voltage adjustment method is determined to be increasing the initial voltage value (A) to the second critical voltage (max), and then decreasing it from the second critical voltage (max) to the reference voltage value (B) within a second preset time period. The second preset time period is used to allow the adjustable lens to reach stability at the second critical voltage (max). In another case, if it is determined that the reference voltage value (B) of the adjustable lens is less than the initial voltage value (D), the reference voltage adjustment method is determined to be decreasing the initial voltage value (D) to the reference voltage value (B). Here, the second critical voltage can be the maximum voltage (max) applied to the adjustable lens. Alternatively, it can be a larger voltage applied to the adjustable lens, such as a voltage close to the maximum voltage (max), or a voltage differing from the maximum voltage (max) by a preset difference.
[0210] Thus, when the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (A), the piezoelectric film shape of the adjustable lens at the reference voltage value (B), obtained by adjusting the voltage first and then decreasing it, is consistent with the piezoelectric film shape when the initial voltage value (D) is reduced to the reference voltage value (B). Therefore, the refractive power of the lens is also consistent at this time, ultimately enabling the acquisition of images with the same sharpness through a lens at the same voltage. By adjusting the initial voltage value of the adjustable lens to the reference voltage value in the same voltage adjustment direction, the abnormal situation of acquiring two images with different sharpnesses through a lens at the same voltage can be avoided.
[0211] Combination Figure 13 The diagram illustrates a process for adjusting a focusable lens from an initial voltage value to a reference voltage value in another embodiment, following a voltage decreasing direction. If the same voltage adjustment direction is a voltage decreasing direction, then adjusting the focusable lens from the initial voltage value to the reference voltage value in the same voltage adjustment direction includes the following steps:
[0212] Step 1301: Determine whether the reference voltage value of the adjustable lens is greater than the initial voltage value; if the reference voltage value of the adjustable lens is greater than the initial voltage value, proceed to step 1302; if the reference voltage value of the adjustable lens is less than the initial voltage value, proceed to step 1305.
[0213] 1302. Increase the initial voltage value to the second critical voltage;
[0214] 1303. Control the adjustable focus lens to maintain a second preset time period under the second critical voltage;
[0215] 1304. Reduce the second critical voltage to the reference voltage value;
[0216] 1305. Reduce the initial voltage value directly to the reference voltage value.
[0217] In this embodiment, if the same voltage adjustment direction is a voltage decrease direction, when determining the reference voltage adjustment method, firstly, it is determined whether the reference voltage value of the adjustable lens is greater 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, the reference voltage adjustment method is determined to be to increase the initial voltage value to the second critical voltage, and then decrease it from the second critical voltage to the reference voltage value after a second preset time period. Thus, when the reference voltage value (B) of the adjustable lens is greater 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 first increasing and then decreasing is consistent with the piezoelectric film shape when the initial voltage value (D) is directly decreased to the reference voltage value (B). Therefore, it is ultimately possible to acquire images of the same sharpness using a lens at the same voltage. Therefore, by adjusting the initial voltage value of the adjustable lens to the reference voltage value according to the same voltage adjustment direction, the abnormal situation of acquiring two images of different sharpness using a lens at the same voltage can be avoided. Ultimately, the focusing accuracy is improved.
[0218] The previous embodiment described how, if the same voltage adjustment direction includes a voltage decrease direction, the voltage adjustment process is performed based on the relationship between the initial voltage value and the reference voltage value of the adjustable lens and the same voltage adjustment direction. This embodiment further describes a second preset time period that is greater than or equal to a preset time period threshold, and the second preset time period is related to the amplitude and vibration frequency of the adjustable lens.
[0219] Specifically, a second preset time period can be set to be greater than or equal to a preset time period threshold, where the preset time period threshold can be determined based on empirical values. For example, the maximum time it takes for the adjustable focusing lens to reach stability can be determined based on the maximum amplitude and maximum vibration frequency of the adjustable focusing lens, such as 5ms or 8ms. Then, the maximum time it takes for the adjustable focusing lens to reach stability can be used as the preset time period threshold, i.e., the preset time period threshold can be 5ms.
[0220] Furthermore, the second preset time period can be related to the amplitude and vibration frequency of the adjustable focusing lens, specifically, they are positively correlated. The greater the amplitude and vibration frequency of the adjustable focusing lens as it rises from the initial voltage value to the second critical voltage, the longer the second preset time period required for the lens to reach stability. Conversely, the shorter the second preset time period required for the lens to reach stability, the lower the amplitude and vibration frequency.
[0221] In this embodiment, if the voltage adjustment direction is a voltage decrease direction, firstly, it is determined whether the reference voltage value of the adjustable focusing lens is greater than the initial voltage value. If it is determined that the reference voltage value of the adjustable focusing lens is greater than the initial voltage value, the reference voltage adjustment method is determined to be to raise the initial voltage value to a second critical voltage, and then decrease it from the second critical voltage to the reference voltage value after a second preset time period. Specifically, the second preset time period is greater than or equal to a preset time period threshold, and the second preset time period is related to the amplitude and vibration frequency of the adjustable focusing lens. In this way, it can be ensured that the adjustable focusing lens reaches stability after maintaining the second preset voltage for the second preset time period. Then, subsequently decreasing the voltage from the second critical voltage to the reference voltage value after the second preset time period can ensure that the piezoelectric film shape of the adjustable focusing lens at the reference voltage value is consistent with the piezoelectric film shape when the adjustable focusing lens directly decreases from a certain initial voltage value to the reference voltage value.
[0222] In the previous embodiment, a phase-detection autofocus algorithm was described, which acquires the phase difference through an image sensor and then calculates the reference voltage value of the adjustable lens based on a pre-defined correspondence between the phase difference and the reference voltage value of the adjustable lens. In this embodiment, as... Figure 14 As shown, step 903, which involves controlling the adjustable lens to focus under a reference voltage value, is further described in detail, including:
[0223] 1401. When the adjustable focus lens is at the reference voltage value, the target image is acquired by the image sensor.
[0224] 1402. Using a reference voltage value adjustment method, the reference voltage value is adjusted to the first candidate voltage according to a preset adjustment step size, and the first candidate image is acquired through an image sensor.
[0225] Specifically, when focusing using a camera module containing an adjustable lens, firstly, the phase difference is acquired through the image sensor. Then, based on the pre-calibrated correspondence between the phase difference and the reference voltage value of the adjustable lens, the reference voltage value of the adjustable lens is calculated. Secondly, the initial voltage value of the adjustable lens is adjusted to the reference voltage value using a reference voltage adjustment method; this method includes adjusting the same voltage in the same direction. Finally, the adjustable lens is controlled to focus at the reference voltage value. The same voltage adjustment direction includes either a voltage increase direction or a voltage decrease direction.
[0226] Therefore, when controlling the adjustable focusing lens to focus at a reference voltage value, focusing can be achieved by directly applying the reference voltage value to the adjustable focusing lens. Alternatively, contrast-detection focusing can be further employed when applying the reference voltage value to the adjustable focusing lens. Because the phase difference obtained from the image sensor using phase-detection focusing algorithms often suffers from inaccuracies, after calculating the reference voltage value of the adjustable focusing lens based on the phase difference and adjusting the initial voltage value of the adjustable focusing lens to the reference voltage value, contrast-detection focusing can be further used to fine-tune the voltage of the adjustable focusing lens to improve focusing accuracy.
[0227] Specifically, firstly, when the adjustable focusing lens is at a reference voltage value, an image of the target is acquired by an image sensor. Then, using a reference voltage adjustment method, the reference voltage value is adjusted to a first candidate voltage according to a preset adjustment step size, and the first candidate image is acquired by the image sensor. For example, assuming the reference voltage value is 30V, when the adjustable focusing lens is at a reference voltage value of 30V, the target image is acquired by the image sensor. If the same voltage adjustment direction is the voltage increase direction, then the reference voltage value is adjusted to the first candidate voltage according to the voltage increase direction and a preset adjustment step size (e.g., 1V), and the first candidate image is acquired by the image sensor. For example, the reference voltage value of 30V is adjusted to the first candidate voltage of 31V. Alternatively, the reference voltage value of 30V is reduced to a first critical voltage; the adjustable focusing lens is controlled to remain at the first critical voltage for a first preset time period; the first critical voltage is increased to the first candidate voltage of 29V. Here, the preset adjustment step size can also be 0.5V, 0.1V, etc., and this application does not limit it.
[0228] 1403. Based on the sharpness of the target image and the sharpness of the first candidate image, obtain the target reference voltage value of the adjustable lens; the defocus distance of the adjustable lens under the target reference voltage value is less than the defocus distance of the adjustable lens under the reference voltage value.
[0229] 1404. Control the adjustable lens to focus at the target reference voltage value.
[0230] After acquiring the target image and the first candidate image using an image sensor, the sharpness of the target image and the first candidate image are calculated respectively. The sharpness of the target image and the first candidate image are compared, and the voltage of the adjustable focusing lens is fine-tuned based on the comparison result until the first candidate image with the highest sharpness is found. The voltage of the adjustable focusing lens corresponding to the first candidate image with the highest sharpness is taken as the target reference voltage value of the adjustable focusing lens. At this point, the defocusing distance of the adjustable focusing lens at the target reference voltage value is less than the defocusing distance of the adjustable focusing lens at the reference voltage value. That is, the adjustable focusing lens at the target reference voltage value is closer to the focusing position. Therefore, the adjustable focusing lens can be controlled to focus at the target reference voltage value.
[0231] In this embodiment, firstly, a phase-detection autofocus algorithm is used to acquire the phase difference through an image sensor. Then, based on the pre-defined correspondence between the phase difference and the reference voltage value of the adjustable lens, the reference voltage value of the adjustable lens is calculated. Because the phase difference acquired by the image sensor using the phase-detection autofocus algorithm often has inaccuracies, a contrast-detection autofocus algorithm is further employed after the phase-detection autofocus algorithm. This algorithm precisely finds a target reference voltage value closer to the focusing position near the reference voltage value, thereby controlling the adjustable lens to focus at the target reference voltage value, ultimately improving the focusing accuracy.
[0232] Furthermore, in one embodiment, a focus control method is also provided, applied to an electronic device, the electronic device including a focusable lens and an image sensor, such as... Figure 15 As shown, the method includes:
[0233] 1501. When the adjustable focus lens is at the initial voltage value, the initial image is acquired through the image sensor;
[0234] 1502. Using a reference voltage value adjustment method, the initial voltage value of the adjustable lens is adjusted to the second candidate voltage according to a preset adjustment step size, and the second candidate image is acquired through the image sensor; the reference voltage value adjustment method includes the same voltage adjustment direction.
[0235] Specifically, firstly, when the adjustable focusing lens is at its initial voltage value, an initial image is acquired using an image sensor. Then, using a reference voltage value adjustment method, the initial voltage value is adjusted to a second candidate voltage according to a preset adjustment step size, and a second candidate image is acquired using the image sensor. For example, assuming the initial voltage value is 40V, the initial image is acquired using the image sensor when the adjustable focusing lens is at its initial voltage value of 40V. If the same voltage adjustment direction is the voltage increase direction, then the initial voltage value is adjusted to a first candidate voltage according to the voltage increase direction and the initial adjustment step size (e.g., 1V), and a first candidate image is acquired using the image sensor. For example, the initial voltage value of 40V is increased to the second candidate voltage of 41V according to the voltage increase direction. Alternatively, the initial voltage value of 40V is decreased to a first critical voltage; the adjustable focusing lens is controlled to remain at the first critical voltage for a first preset time period; and the first critical voltage is increased to the second candidate voltage of 39V. Here, the preset adjustment step size can also be 0.5V, 0.1V, etc., and this application does not limit it.
[0236] 1503. Based on the sharpness of the initial image and the sharpness of the second candidate image, obtain the reference voltage value of the adjustable lens; the defocus distance of the adjustable lens at the reference voltage value is less than the preset defocus distance threshold.
[0237] 1504. Control the adjustable focus lens to focus at the reference voltage value.
[0238] After acquiring an initial image and a second candidate image using an image sensor, the sharpness of the initial image and the second candidate image are calculated respectively. The sharpness of the initial image and the second candidate image are compared, and the voltage of the adjustable focusing lens is fine-tuned based on the comparison result until the second candidate image with the highest sharpness is found. The voltage of the adjustable focusing lens corresponding to the second candidate image with the highest sharpness is used as the reference voltage value of the adjustable focusing lens. At this point, the defocus distance of the adjustable focusing lens under the reference voltage value is less than a preset defocus distance threshold. That is, the adjustable focusing lens is closer to the focusing position under the reference voltage value. Therefore, the adjustable focusing lens can be controlled to focus under the reference voltage value.
[0239] In this embodiment, when focusing using a camera module containing an adjustable lens, a contrast-detection focusing algorithm is directly employed. The voltage of the adjustable lens corresponding to the second candidate image with the highest sharpness near the initial voltage value of the adjustable lens is searched and used as a reference voltage value for the adjustable lens. That is, the adjustable lens at the reference voltage value is closer to the focusing position. Therefore, the adjustable lens can be controlled to focus at the reference voltage value, thereby improving focusing accuracy.
[0240] Furthermore, in a specific embodiment, such as Figure 16 As shown, a focus control method is provided, including:
[0241] 1601. Obtain the initial voltage value of the adjustable focus lens;
[0242] 1602. When the adjustable focus lens is at its initial voltage value, the phase difference is obtained through the image sensor;
[0243] 1603. Calculate the reference voltage value of the adjustable lens based on the phase difference; the defocus distance of the adjustable lens at the reference voltage value is less than the preset defocus distance threshold.
[0244] 1604. If the same voltage adjustment direction includes the voltage increase direction, determine whether the reference voltage value of the adjustable lens is greater than the initial voltage value; if it is determined that the reference voltage value of the adjustable lens is less than the initial voltage value, proceed to step 1605; if it is determined that the reference voltage value (B) of the adjustable lens is greater than the initial voltage value (C), proceed to step 1606.
[0245] 1605. The reference voltage value adjustment method is determined to be to reduce the initial voltage value to the first critical voltage, and then increase it from the first critical voltage to the reference voltage value after a first preset time period.
[0246] 1606. Determine the reference voltage adjustment method as directly increasing the initial voltage value (C) to the reference voltage value (B); Proceed to step 1610;
[0247] 1607. If the same voltage adjustment direction includes the voltage decrease direction, determine whether the reference voltage value of the adjustable lens is greater 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, proceed to step 1608; if it is determined that the reference voltage value (B) of the adjustable lens is less than the initial voltage value (D), proceed to step 1609.
[0248] 1608. The reference voltage value adjustment method is determined to be to increase the initial voltage value to the second critical voltage, and then decrease it from the second critical voltage to the reference voltage value within a second preset time period.
[0249] 1609. Determine the reference voltage adjustment method as reducing the initial voltage value (D) to the reference voltage value (B); Proceed to step 1610;
[0250] 1610. Adjust the initial voltage value of the adjustable focus lens to the reference voltage value using the reference voltage value adjustment method;
[0251] 1611. When the adjustable focus lens is at the reference voltage value, the target image is acquired through the image sensor;
[0252] 1612. Using a reference voltage value adjustment method, the reference voltage value is adjusted to the first candidate voltage according to a preset adjustment step size, and the first candidate image is acquired through an image sensor;
[0253] 1613. Based on the sharpness of the target image and the sharpness of the first candidate image, obtain the target reference voltage value of the adjustable lens; the defocus distance of the adjustable lens under the target reference voltage value is less than the defocus distance of the adjustable lens under the reference voltage value.
[0254] 1614. Control the adjustable lens to focus at the target reference voltage value.
[0255] In this embodiment, when focusing using a camera module containing an adjustable lens, a phase-detection autofocus algorithm is first employed to acquire the phase difference via an image sensor. Then, based on a pre-defined correspondence between the phase difference and the reference voltage value of the adjustable lens, a reference voltage value for the adjustable lens is calculated. Subsequently, the initial voltage value of the adjustable lens can be adjusted to the reference voltage value using a reference voltage adjustment method, and the target image can be acquired via the image sensor. While phase-detection autofocus is fast, it often suffers from inaccuracies. Therefore, combining it with a contrast-detection autofocus algorithm precisely locates a target reference voltage value closer to the focus position near the reference voltage value. This allows the adjustable lens to focus at the target reference voltage value, ultimately improving focusing accuracy.
[0256] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart above may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0257] In this embodiment, the above-described method for focus adjustment not only avoids the interference of the Tlens hysteresis phenomenon on focus sharpness, making Tlens focus more accurate, but also calibrates the fitting polygonal line of the Tlens module, overcoming the nonlinear characteristics of the Tlens module PD curve, so that the PD phase difference and focus position can correspond more accurately. Thus, the user can improve focus accuracy when using the camera function, and because PDAF is used to achieve focus, fast focusing can be achieved.
[0258] With the Figure 3 The embodiments shown are consistent; please refer to [link / reference]. Figure 17 , Figure 17This is another focusing control method provided in the embodiments of this application, applied to, for example... Figure 1 or Figure 2 The electronic device shown includes an adjustable focus lens and specifically includes the following steps:
[0259] 1701. Obtain the voltage adjustment range of the adjustable focus lens, and sample the voltage adjustment range to obtain P sampled voltages, where P is an integer greater than 1. The voltage adjustment range includes the minimum adjustable voltage value and the maximum adjustable voltage value.
[0260] 1702. Obtain the phase difference source image corresponding to each of the P sampled voltages to obtain P phase difference source images;
[0261] 1703. According to the preset region division rules, each of the P phase difference source images is divided into M*N regions to obtain P*M*N region images, where M and N are both integers greater than or equal to 1, and M*N is greater than 1.
[0262] 1704. Classify the P*M*N region images to obtain M*N region image sets. Each region image set includes P region images, and the P region images are in the same spatial position and each region image corresponds to a sampling voltage.
[0263] 1705. Fit each of the M*N region image sets to obtain M*N sets of fitting data. Each set of fitting data includes P fitting points. The horizontal axis of each fitting point is the voltage value and the vertical axis is the phase difference.
[0264] 1706. Fit the M*N sets of fitted data to obtain M*N fitted polylines;
[0265] 1707. When the camera is turned on, acquire the initial phase difference source image and the initial voltage value corresponding to the initial focus position of the phase difference source image;
[0266] 1708. Determine the target focus position;
[0267] 1709. Obtain the target phase difference corresponding to the target focus position based on the initial phase difference source image;
[0268] 1710. Obtain the target fitting polyline, which consists of a segment of fitting straight lines, where a is an integer greater than 1, and the horizontal axis of the target fitting polyline is the voltage value and the vertical axis is the phase difference. The a segment of fitting straight lines includes a-1 dividing points, which are the intersection points of different fitting straight lines. The target fitting polyline is one of the M*N fitting polylines.
[0269] 1711. Determine a target fitting line from the target fitting polygonal line based on the initial voltage value and the a-1 segmentation points, wherein the target fitting line is at least one fitting line among the a-segment fitting lines;
[0270] 1712. Determine the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value;
[0271] 1713. Adjust the adjustable focus lens according to the target voltage adjustment amount.
[0272] The target fitted polyline is one of the M*N fitted polylines. When the camera is turned on, an initial phase difference source image can be acquired. This initial phase difference source image can be a phase difference source image saved from the last time the camera function was used. This phase difference source image can correspond to an initial focus position, and this initial focus position can correspond to an initial voltage value.
[0273] The specific descriptions of steps 1701-1711 above can be found in the above descriptions. Figure 3 The description of the focus control method will not be repeated here.
[0274] As can be seen, the focusing control method described in this application embodiment has the following advantages: First, it can configure a fitted polyline for a region based on zoning rules. Second, after the camera is turned on, it can determine the corresponding voltage adjustment amount based on the phase difference of the focusing position, the initial voltage value, the fitted polyline (which can be a fitted straight line adapted to the region where the focusing position is located), and its division point. That is, it can use the phase difference to find the voltage value corresponding to the phase difference from the fitted polyline, compare the initial voltage value with the voltage value of the division point to determine the optimal fitted straight line, and then find the voltage value that needs to be adjusted corresponding to the phase difference based on the fitted straight line, and then compare it with the initial voltage value to determine the voltage adjustment amount. Third, since a fitted polyline is used, the nonlinear characteristics of the PD curve of the adjustable focusing lens can be overcome, thereby improving the focusing accuracy of the adjustable focusing lens.
[0275] Consistent with the above embodiments, please refer to Figure 18 , Figure 18 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. As shown in the figure, the electronic device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. The electronic device also includes an adjustable focusing lens. In this embodiment, the program includes instructions for performing the following steps:
[0276] When the camera is turned on, acquire the phase difference source image and the initial voltage value corresponding to the initial focus position of the phase difference source image;
[0277] Determine the target focus position;
[0278] The target phase difference corresponding to the target focus position is obtained from the phase difference source image;
[0279] Obtain the target fitting polyline, which consists of a fitting straight line segment, where a is an integer greater than 1. The horizontal axis of the target fitting polyline is the voltage value and the vertical axis is the phase difference. The a fitting straight line segment includes a-1 dividing points, which are the intersection points of different fitting straight lines.
[0280] Based on the initial voltage value and the a-1 segmentation points, a target fitting line is determined from the target fitting polyline, and the target fitting line is at least one fitting line among the a-segment fitting lines;
[0281] The target voltage adjustment amount is determined based on the target fitted line, the target phase difference, and the initial voltage value.
[0282] The adjustable focus lens is adjusted according to the target voltage adjustment amount.
[0283] Optionally, in determining the target voltage adjustment amount based on the target fitted line, the first phase difference, and the initial voltage value, the above procedure includes instructions for performing the following steps:
[0284] The reference voltage value corresponding to the target phase difference is determined based on the target fitted line.
[0285] The target voltage adjustment amount is determined based on the reference voltage value and the initial voltage value.
[0286] Optionally, in obtaining the target fitted polyline, the above procedure includes instructions for performing the following steps:
[0287] Determine the target area identifier corresponding to the target focus position;
[0288] Based on the preset mapping relationship between region identifiers and fitted polylines, the target fitted polyline corresponding to the target region identifier is determined.
[0289] Optionally, in determining the target focus position, the above procedure includes instructions for performing the following steps:
[0290] Get a preview image;
[0291] Target recognition is performed on the preview image to obtain the target region;
[0292] The target focus position is determined based on the target area;
[0293] or;
[0294] Obtain the target touch position for the preview image;
[0295] The target focus position is determined based on the target touch position.
[0296] Optionally, the above procedure may also include instructions for performing the following steps:
[0297] Obtain the voltage adjustment range of the adjustable focus lens, and sample the voltage adjustment range to obtain P sampled voltages, where P is an integer greater than 1. The voltage adjustment range includes the minimum adjustable voltage value and the maximum adjustable voltage value.
[0298] Obtain the phase difference source image corresponding to each of the P sampled voltages to obtain P phase difference source images;
[0299] According to the preset region division rules, each of the P phase difference source images is divided into M*N regions, resulting in P*M*N region images, where M and N are both integers greater than or equal to 1, and M*N is greater than 1.
[0300] Based on the P*M*N region images, M*N region image sets are obtained. Each region image set includes P region images with the same spatial location and each region image corresponds to a sampling voltage.
[0301] Each of the M*N region image sets is fitted to obtain M*N sets of fitted data. Each set of fitted data includes P fitted points. The horizontal axis of each fitted point is the voltage value and the vertical axis is the phase difference.
[0302] Based on the M*N sets of fitted data, M*N fitted polylines are obtained.
[0303] Optionally, in the step of fitting the M*N sets of fitted data to obtain M*N fitted polylines, the above procedure includes instructions for performing the following steps:
[0304] Obtain k fitting points from the i-th group of fitted data as split points, where the i-th group of fitted data is any one of the M*N groups of fitted data, and k is a positive integer less than P.
[0305] Based on the voltage values of the k fitting points, the i-th set of fitting data is divided into a set of k+1 fitting points;
[0306] Each set of fitted points in the k+1 fitted point set is fitted to obtain k+1 fitted straight lines.
[0307] The fitted polyline corresponding to the i-th set of fitted data is determined based on the k+1 fitted straight lines.
[0308] Optionally, in fitting each of the M*N region image sets to obtain M*N sets of fitted data, the above procedure includes instructions for performing the following steps:
[0309] Obtain the phase difference between each region image in the j-th region image set and the preset focus position, as well as the voltage value corresponding to the region image, and combine them to form fitting points to obtain the P fitting points. The j-th region image set is any region image set in the M*N region image sets.
[0310] As can be seen, the electronic device described in this application embodiment includes an adjustable focus lens. When the camera is turned on, it acquires a phase difference source image and the initial voltage value corresponding to the initial focus position of the phase difference source image to determine the target focus position. Based on the phase difference source image, it acquires the target phase difference corresponding to the target focus position and obtains a target fitting polygonal line. The target fitting polygonal line consists of a segment of fitting straight lines, where a is an integer greater than 1. The horizontal axis of the target fitting polygonal line is the voltage value, and the vertical axis is the phase difference. The a segment of fitting straight lines includes a-1 dividing points, which are the intersection points of different fitting straight lines. Based on the initial voltage value and a-1 dividing points, a target fitting line is determined from the target fitting polygonal line. The target fitting line is at least one segment of the fitting straight lines in the a segment of fitting straight lines. The target voltage adjustment amount is determined by the target fitted line, target phase difference, and initial voltage value. Based on the target voltage adjustment amount, the adjustable lens is adjusted. On the one hand, after the camera is turned on, the corresponding voltage adjustment amount can be determined based on the phase difference at the focus position, the initial voltage value, the fitted line, and its division points. That is, the voltage value corresponding to the phase difference can be found from the fitted line using the phase difference. The initial voltage value is compared with the voltage value at the division point to determine the optimal fitted line. Then, based on the fitted line, the voltage value that needs to be adjusted corresponding to the phase difference is found, and it is compared with the initial voltage value to determine the voltage adjustment amount. On the other hand, since a fitted line is used, the non-linear characteristics of the PD curve of the adjustable lens can be overcome, thereby improving the focusing accuracy of the adjustable lens.
[0311] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0312] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0313] Figure 19 This is a functional unit block diagram of the focusing control device 1900 involved in the embodiments of this application. The focusing control device 1900 is applied to an electronic device; the electronic device includes an adjustable focus lens, and the device 1900 includes: an acquisition unit 1901, a determination unit 1902, and an adjustment unit 1903, wherein...
[0314] The acquisition unit 1901 is used to acquire a phase difference source image and an initial voltage value corresponding to the initial focus position of the phase difference source image when the camera is turned on.
[0315] The determining unit 1902 is used to determine the target focus position;
[0316] The acquisition unit 1901 is further configured to acquire the target phase difference corresponding to the target focus position based on the phase difference source image; acquire the target fitting line, which is composed of a fitting straight line segments, where a is an integer greater than 1, and the horizontal axis of the target fitting line is the voltage value and the vertical axis is the phase difference. The a fitting straight line segments include a-1 dividing points, which are the intersection points of different fitting straight lines.
[0317] The determining unit 1902 is configured to determine a target fitting line from the target fitting polygonal line based on the initial voltage value and the a-1 segmentation points, wherein the target fitting line is at least one fitting straight line among the a-segment fitting straight lines; and to determine a target voltage adjustment amount based on the target fitting line, the target phase difference, and the initial voltage value.
[0318] The adjustment unit 1903 is used to adjust the adjustable focus lens according to the target voltage adjustment amount.
[0319] Optionally, in determining the target voltage adjustment amount based on the target fitted line, the first phase difference, and the initial voltage value, the determining unit 1902 is specifically used for:
[0320] The reference voltage value corresponding to the target phase difference is determined based on the target fitted line.
[0321] The target voltage adjustment amount is determined based on the reference voltage value and the initial voltage value.
[0322] Optionally, in acquiring the target fitted polyline, the acquisition unit 1901 is specifically used for:
[0323] Determine the target area identifier corresponding to the target focus position;
[0324] Based on the preset mapping relationship between region identifiers and fitted polylines, the target fitted polyline corresponding to the target region identifier is determined.
[0325] Optionally, in determining the target focus position, the determining unit 1902 is specifically used for:
[0326] Get a preview image;
[0327] Target recognition is performed on the preview image to obtain the target region;
[0328] The target focus position is determined based on the target area;
[0329] or;
[0330] Obtain the target touch position for the preview image;
[0331] The target focus position is determined based on the target touch position.
[0332] Optionally, the device 1900 is further specifically used for:
[0333] Obtain the voltage adjustment range of the adjustable focus lens, and sample the voltage adjustment range to obtain P sampled voltages, where P is an integer greater than 1. The voltage adjustment range includes the minimum adjustable voltage value and the maximum adjustable voltage value.
[0334] Obtain the phase difference source image corresponding to each of the P sampled voltages to obtain P phase difference source images;
[0335] According to the preset region division rules, each of the P phase difference source images is divided into M*N regions, resulting in P*M*N region images, where M and N are both integers greater than or equal to 1, and M*N is greater than 1.
[0336] Based on the P*M*N region images, M*N region image sets are obtained. Each region image set includes P region images with the same spatial location and each region image corresponds to a sampling voltage.
[0337] Each of the M*N region image sets is fitted to obtain M*N sets of fitted data. Each set of fitted data includes P fitted points. The horizontal axis of each fitted point is the voltage value and the vertical axis is the phase difference.
[0338] Based on the M*N sets of fitted data, M*N fitted polylines are obtained.
[0339] Optionally, in the process of fitting the M*N sets of fitted data to obtain M*N fitted polylines, the device 1900 is specifically used for:
[0340] Obtain k fitting points from the i-th group of fitted data as split points, where the i-th group of fitted data is any one of the M*N groups of fitted data, and k is a positive integer less than P.
[0341] Based on the voltage values of the k fitting points, the i-th set of fitting data is divided into a set of k+1 fitting points;
[0342] Each set of fitted points in the k+1 fitted point set is fitted to obtain k+1 fitted straight lines.
[0343] The fitted polyline corresponding to the i-th set of fitted data is determined based on the k+1 fitted straight lines.
[0344] Optionally, in the process of fitting each region image set in the M*N region image sets to obtain M*N sets of fitted data, the device 1900 is specifically used for:
[0345] Obtain the phase difference between each region image in the j-th region image set and the preset focus position, as well as the voltage value corresponding to the region image, and combine them to form fitting points to obtain the P fitting points. The j-th region image set is any region image set in the M*N region image sets.
[0346] As can be seen, the focusing control device described in this application embodiment is applied to an electronic device. The electronic device includes an adjustable focusing lens. When the camera is turned on, it acquires a phase difference source image and the initial voltage value corresponding to the initial focusing position of the phase difference source image to determine the target focusing position. Based on the phase difference source image, it acquires the target phase difference corresponding to the target focusing position and obtains a target fitting line. The target fitting line consists of a fitting straight line segment, where a is an integer greater than 1. The horizontal axis of the target fitting line is the voltage value, and the vertical axis is the phase difference. The fitting straight line segment includes a-1 dividing points, which are the intersection points of different fitting straight lines. Based on the initial voltage value and a-1 dividing points, it determines the target fitting line from the target fitting line. The target fitting line is at least one fitting line segment from the fitting straight line segment a. The method involves using a straight line to determine the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value. The adjustable lens is then adjusted according to this target voltage adjustment amount. On one hand, after the camera is turned on, the corresponding voltage adjustment amount can be determined based on the phase difference at the focus position, the initial voltage value, the fitted line, and its segmentation points. Specifically, the voltage value corresponding to the phase difference can be found on the fitted line, and the initial voltage value is compared with the voltage value at the segmentation point to determine the optimal fitted line. Then, based on this fitted line, the voltage value that needs adjustment corresponding to the phase difference is found, and this is compared with the initial voltage value to determine the voltage adjustment amount. On the other hand, using a fitted line overcomes the non-linear characteristics of the adjustable lens's PD curve, thereby improving the focusing accuracy of the adjustable lens.
[0347] It should be noted that the electronic devices described in the embodiments of this application are presented in the form of functional units. The term "unit" as used herein should be understood in the broadest possible sense, and the object used to implement the functions described in each "unit" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or chipset) and memory for executing one or more software or firmware programs, combinational logic circuits, and / or other suitable components that provide the above functions.
[0348] The acquisition unit 1901, determination unit 1902, and adjustment unit 1903 can be processors, such as artificial intelligence chips, NPUs, CPUs, GPUs, etc., without limitation. The adjustment unit 1903 can also be an adjustable focus lens. Based on the above unit modules, the functions or steps of any of the above methods can be implemented.
[0349] This embodiment also provides a chip, which can be used to implement any of the methods in the above embodiments.
[0350] This embodiment also provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to execute, as described in the embodiments of this application, to implement any of the methods in the above embodiments.
[0351] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement any of the methods in the above embodiments.
[0352] In addition, embodiments of this application also provide a focus control device, which may specifically be a chip, component or module. The device may include a connected processor and a memory; wherein, the memory is used to store computer execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute any of the methods in the above method embodiments.
[0353] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0354] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0355] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0356] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0357] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0358] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0359] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A focusing control method, characterized in that, Applied to an electronic device, the electronic device including a focusable lens, the method includes: When the camera is turned on, acquire the phase difference source image and the initial voltage value corresponding to the initial focus position of the phase difference source image; Determine the target focus position; The target phase difference corresponding to the target focus position is obtained from the phase difference source image; Obtain the target fitting polyline, which consists of a fitting straight line segment, where a is an integer greater than 1. The horizontal axis of the target fitting polyline is the voltage value and the vertical axis is the phase difference. The a fitting straight line segment includes a-1 dividing points, which are the intersection points of different fitting straight lines. Based on the initial voltage value and the a-1 segmentation points, a target fitting line is determined from the target fitting polyline, and the target fitting line is at least one fitting line among the a-segment fitting lines; The target voltage adjustment amount is determined based on the target fitted line, the target phase difference, and the initial voltage value. The adjustable focus lens is adjusted according to the target voltage adjustment amount.
2. The focusing control method according to claim 1, characterized in that, The step of determining the target voltage adjustment amount based on the target fitted line, the target phase difference, and the initial voltage value includes: The reference voltage value corresponding to the target phase difference is determined based on the target fitted line. The target voltage adjustment amount is determined based on the reference voltage value and the initial voltage value.
3. The focusing control method according to claim 1 or 2, characterized in that, The process of obtaining the target fitted polyline includes: Determine the target area identifier corresponding to the target focus position; Based on the preset mapping relationship between region identifiers and fitted polylines, the target fitted polyline corresponding to the target region identifier is determined.
4. The focusing control method according to claim 1 or 2, characterized in that, Determining the target focus position includes: Get a preview image; Target recognition is performed on the preview image to obtain the target region; The target focus position is determined based on the target area; or; Obtain the target touch position for the preview image; The target focus position is determined based on the target touch position.
5. The focusing control method according to claim 1 or 2, characterized in that, The method further includes: Obtain the voltage adjustment range of the adjustable focus lens, and sample the voltage adjustment range to obtain P sampled voltages, where P is an integer greater than 1. The voltage adjustment range includes the minimum adjustable voltage value and the maximum adjustable voltage value. Obtain the phase difference source image corresponding to each of the P sampled voltages to obtain P phase difference source images; According to a preset region division rule, each of the P phase difference source images is divided into M... Given N regions, obtain P M There are N regions in the image, where M and N are both integers greater than or equal to 1, and M... N is greater than 1; According to the P M Classify N region images to obtain M There are N regional image sets, each regional image set includes P regional images with the same spatial location and each regional image corresponds to a sampling voltage; M Fitting each region image set in the N region image sets yields M. N sets of fitted data, each set of fitted data includes P fitted points, and the horizontal axis of each fitted point is the voltage value and the vertical axis is the phase difference; According to the M N sets of fitting data were used to obtain M. N fitted polylines.
6. The focusing control method according to claim 5, characterized in that, According to the M N sets of fitting data were used to obtain M. N fitted line segments, including: Obtain k fitting points from the i-th set of fitted data as split points, where the i-th set of fitted data is the M. Any set of fitted data from N sets of fitted data, where k is a positive integer less than P; Based on the voltage values of the k fitting points, the i-th set of fitting data is divided into a set of k+1 fitting points; Each set of fitted points in the k+1 fitted point set is fitted to obtain k+1 fitted straight lines. The fitted polyline corresponding to the i-th set of fitted data is determined based on the k+1 fitted straight lines.
7. The focusing control method according to claim 5, characterized in that, The M Fitting each region image set in the N region image sets yields M. N sets of fitted data, including: Obtain the phase difference between each region image in the j-th region image set and the preset focus position, as well as the voltage value corresponding to that region image, and combine them to form fitting points to obtain the P fitting points. The j-th region image set is the M-th region image set. Any region image set in N region image sets.
8. A focusing control device, characterized in that, Applied to an electronic device, the electronic device including an adjustable focus lens, the device includes: an acquisition unit, a determination unit, and an adjustment unit, wherein... The acquisition unit is used to acquire a phase difference source image and an initial voltage value corresponding to the initial focus position of the phase difference source image when the camera is turned on. The determining unit is used to determine the target focus position; The acquisition unit is further configured to acquire the target phase difference corresponding to the target focus position based on the phase difference source image; acquire the target fitting line, which is composed of a fitting straight line segments, where a is an integer greater than 1, and the horizontal axis of the target fitting line is the voltage value and the vertical axis is the phase difference. The a fitting straight line segments include a-1 dividing points, which are the intersection points of different fitting straight lines. The determining unit is configured to determine a target fitting line from the target fitting polygonal line based on the initial voltage value and the a-1 segmentation points, wherein the target fitting line is at least one fitting straight line among the a-segment fitting straight lines; and to determine a target voltage adjustment amount based on the target fitting line, the target phase difference, and the initial voltage value. The adjustment unit is used to adjust the adjustable focus lens according to the target voltage adjustment amount.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory for storing one or more programs and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program for storing electronic data interchange, wherein the computer program causes a computer to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Stabilizing operation of high speed variable focal length tunable acoustic gradient lens in imaging system
CN109581786A
Systems and methods for adjusting focus based on focus target information
CN109792478A