Focus control method, device, electronic device, storage medium, and product

By obtaining the initial and preset voltages in the adjustable focus lens and adjusting them with the same voltage adjustment direction, the problem of inaccuracy caused by piezoelectric material hysteresis is solved, and higher focus accuracy is achieved.

CN115550553BActive Publication Date: 2025-05-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211222877.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-08
Publication Date
2025-05-23
Estimated Expiration
2042-10-08

AI Technical Summary

Technical Problem

The piezoelectric material inside the adjustable focus lens has hysteresis characteristics, resulting in inaccurate focus.

Method used

By obtaining the initial voltage and preset voltage of the adjustable focus lens and using the preset voltage adjustment method, the initial voltage is adjusted to the preset voltage to ensure focus at the same voltage to avoid the hysteresis characteristics.

Benefits of technology

The image of the same sharpness is captured through the adjustable focus lens at the same voltage, improving the accuracy of focus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550553B_ABST
    Figure CN115550553B_ABST
Patent Text Reader

Abstract

The present application relates to a focus control method, device, electronic device, storage medium, and product, the method comprising: by obtaining the initial voltage and preset voltage of the adjustable focus lens, the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. And the initial voltage of the adjustable focus lens is adjusted to the preset voltage by a preset voltage adjustment method, wherein the preset voltage adjustment method includes the same voltage adjustment direction. Finally, the adjustable focus lens is controlled to focus at a preset voltage. Since the piezoelectric materials inside the adjustable focus lens have hysteresis characteristics, in order to avoid the hysteresis characteristics, the initial voltage of the adjustable focus lens is adjusted to the preset voltage by the same voltage adjustment direction, so that the deformation of the piezoelectric material inside the adjustable focus lens is fixed when the adjustable focus lens is under the preset voltage. Finally, the adjustable focus lens can be controlled to focus at a preset voltage to obtain an image with the same clarity, thereby improving the accuracy of focusing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a focus control method, device, electronic device, storage medium, and product. Background Art

[0002] With the continuous development of electronic equipment related technologies, the lenses of electronic equipment are also constantly iterating and updating. For example, tunable lenses (Tlens) are also increasingly widely used in electronic equipment. Generally speaking, a tunable lens refers to a liquid lens, which mainly uses different voltages applied to it to deform its internal shape-changing parts, so that focusing can be achieved through the deformed tunable lens.

[0003] Among them, the parts with changeable shapes inside the adjustable focus lens are mainly piezoelectric materials. However, since piezoelectric materials all have the characteristic of hysteresis, the problem of inaccurate focusing often occurs during the process of focusing through the adjustable focus lens. Summary of the invention

[0004] The embodiments of the present application provide a focus control method, device, electronic device, and computer-readable storage medium, which can improve the accuracy of focus.

[0005] In one aspect, a focus control method is provided, which is applied to an electronic device, wherein the electronic device includes a focus-adjustable lens, and the method includes:

[0006] Acquiring an initial voltage and a preset voltage of the focus-adjustable lens; the defocus distance of the focus-adjustable lens at the preset voltage is less than a preset defocus distance threshold;

[0007] The initial voltage of the adjustable focus lens is adjusted to the preset voltage by using a preset voltage adjustment method; the preset voltage adjustment method includes the same voltage adjustment direction;

[0008] The adjustable focus lens is controlled to focus under the preset voltage.

[0009] In another aspect, a focus control method is applied to an electronic device, wherein the electronic device includes a focus-adjustable lens and an image sensor, and the method includes:

[0010] When the focus-adjustable lens is at an initial voltage, collecting an initial image through the image sensor;

[0011] Using a preset voltage adjustment method, adjusting the initial voltage of the adjustable focus lens to a second candidate voltage according to a preset adjustment step, and collecting a second candidate image through the image sensor; the preset voltage adjustment method includes the same voltage adjustment direction;

[0012] According to the clarity of the initial image and the clarity of the second candidate image, a preset voltage of the adjustable focus lens is obtained; the defocus distance of the adjustable focus lens under the preset voltage is less than a preset defocus distance threshold;

[0013] The adjustable focus lens is controlled to focus under the preset voltage.

[0014] In another aspect, a focus control device is provided, which is applied to an electronic device, wherein the electronic device includes a focus-adjustable lens, and the device includes:

[0015] An acquisition module, used for acquiring an initial voltage and a preset voltage of the adjustable focus lens; the defocus distance of the adjustable focus lens under the preset voltage is less than a preset defocus distance threshold;

[0016] A voltage regulating module, used to adjust the initial voltage of the adjustable focus lens to the preset voltage by using a preset voltage regulating method; the preset voltage regulating method includes the same voltage regulating direction;

[0017] A focus control module is used to control the focus-adjustable lens to focus under the preset voltage.

[0018] On the other hand, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the focus control method as described above.

[0019] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the focus control method described above are implemented.

[0020] On the other hand, a computer program product is provided, comprising a computer program, which implements the steps of the focus control method as described above when executed by a processor.

[0021] The above-mentioned focusing control method, device, electronic device, storage medium, and product, the electronic device obtains the initial voltage and preset voltage of the adjustable focus lens, and the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. And the initial voltage of the adjustable focus lens is adjusted to the preset voltage by a preset voltage adjustment method, wherein the preset voltage adjustment method includes the same voltage adjustment direction. Finally, the adjustable focus lens is controlled to focus at the preset voltage. Since the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold, the adjustable focus lens can achieve focusing at the preset voltage. However, since the piezoelectric materials inside the adjustable focus lens have hysteresis characteristics, in order to avoid the hysteresis characteristics, the initial voltage of the adjustable focus lens is adjusted to the preset voltage by the same voltage adjustment direction, then the deformation amount of the piezoelectric material inside the adjustable focus lens is fixed when the adjustable focus lens is at the preset voltage. Furthermore, it can be achieved that images of the same clarity are collected by Tlens at the same voltage. Finally, the adjustable focus lens can be controlled to focus at the preset voltage to obtain images of the same clarity, thereby improving the accuracy of focusing. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 A diagram showing an application environment of a focus control method in an embodiment;

[0024] Figure 2 is a flow chart of a focus control method in one embodiment;

[0025] Figure 3 is a flow chart of a focus control method in another embodiment;

[0026] Figure 4 is an MTF curve diagram of the same focus-adjustable lens in one embodiment;

[0027] Figure 5 It is a schematic diagram of a process of adjusting a focus-adjustable lens from an initial voltage to a preset voltage according to a voltage increasing direction in one embodiment;

[0028] Figure 6 A schematic diagram of voltage variation of adjusting a focus-adjustable lens from an initial voltage to a preset voltage according to a voltage increasing direction in one embodiment;

[0029] Figure 7It is a schematic diagram of a process of adjusting the focus-adjustable lens from an initial voltage to a preset voltage according to a voltage reduction direction in another embodiment;

[0030] Figure 8 A flowchart of a method for obtaining a preset voltage of a focus-adjustable lens in one embodiment;

[0031] Fig. 9 is a partial structural schematic diagram of an image sensor in one embodiment;

[0032] Fig.10 is a schematic diagram of the structure of a pixel in an embodiment;

[0033] Fig.11 It is a flow chart of a method for controlling a focus-adjustable lens to focus under a preset voltage in one embodiment;

[0034] Fig.12 is a flow chart of a focus control method in yet another embodiment;

[0035] Fig.13 is a schematic diagram of a focus control method in a specific embodiment;

[0036] Fig.14 is a structural block diagram of a focus control device in one embodiment;

[0037] Fig.15 is a structural block diagram of a focus control device in another embodiment;

[0038] Fig.16 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0040] 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 a first element from another element. 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.

[0041] With the continuous development of electronic equipment related technologies, the lenses of electronic equipment are also constantly iterating and updating. For example, tunable lenses (Tlens) are also increasingly widely used in electronic equipment. Generally speaking, a tunable lens refers to a liquid lens, which mainly uses different voltages applied to it to deform its internal shape-changing parts, so that focusing can be achieved through the deformed tunable lens.

[0042] Among them, the components whose internal shapes can be changed in the adjustable focus lens are mainly piezoelectric materials. However, since piezoelectric materials all have the characteristics of hysteresis, the deformation amount of the piezoelectric material in the process of deformation with the applied voltage depends not only on the magnitude of the applied voltage, but also on the initial shape of the piezoelectric material. For example, when the voltage of Tlens (adjustable focus lens) is increased from 0 (V) to X (V), or reduced from a higher voltage to X (V), since piezoelectric materials all have the characteristics of hysteresis, although Tlens (adjustable focus lens) is at the same voltage X (V) at this time, it is obvious that the deformation amount of the piezoelectric material in Tlens (adjustable focus lens) in these two cases is completely different, that is, there is a difference in the shape of the piezoelectric film. Since there is a difference in the shape of the piezoelectric film in Tlens (adjustable focus lens) in these two cases, this will result in different refractive powers of Tlens, and then, two images of different clarity will be collected through Tlens at the same voltage.

[0043] Then, if the entire adjustable voltage range of the Tlens is extended, when focusing through the Tlens, the Tlens will correspond to two images with different sharpness at each voltage. Therefore, it is difficult to determine which voltage corresponds to the image with the highest sharpness using the focusing algorithm, which leads to the problem of inaccurate focusing during focusing through the adjustable focus lens.

[0044] Figure 1 FIG. 1 is a schematic diagram of an application environment of a focus control method in an embodiment. Figure 1 As shown, the application environment includes an electronic device 120, the electronic device includes an adjustable focus lens, the electronic device 120 obtains the initial voltage and preset voltage of the adjustable focus lens; the initial voltage of the adjustable focus lens is adjusted to the preset voltage by a preset voltage adjustment method; the preset voltage adjustment method includes the same voltage adjustment direction; the adjustable focus lens is controlled to focus under the preset voltage. Among them, the electronic device 120 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, smart cars, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.

[0045] Figure 2 FIG. 1 is a flow chart of a focus control method in an embodiment. The focus control method in this embodiment is operated at Figure 1 The electronic device in the embodiment is described as an example, and the electronic device includes a focus-adjustable lens. Figure 2 As shown, the focus control method includes steps 220 to 260, wherein:

[0046] Step 220, obtaining an initial voltage and a preset voltage of the focus-adjustable lens.

[0047] A focus-adjustable lens refers to a liquid lens that mainly uses different voltages applied to it to deform its internal shape-adjustable parts, so that focusing can be achieved through the deformed focus-adjustable lens. When taking pictures using a camera module of an electronic device, the camera module needs to be focused. If the camera module includes a focus-adjustable lens, then the electronic device needs to first obtain the initial voltage of the focus-adjustable lens, and then obtain the preset voltage of the focus-adjustable lens.

[0048] Among them, the initial voltage of the adjustable focus lens refers to the voltage loaded on the adjustable focus lens when the camera module is started, or the voltage loaded on the adjustable focus lens before focusing. The preset voltage of the adjustable focus lens refers to the voltage calculated by the focusing algorithm, and the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold (for example, 0 or a value infinitely close to 0). That is, the closer the adjustable focus lens is to the focus position at the preset voltage.

[0049] Step 240, adjusting the initial voltage of the focus-adjustable lens to a preset voltage using a preset voltage adjustment method; the preset voltage adjustment method includes the same voltage adjustment direction.

[0050] After the electronic device obtains the initial voltage and the preset voltage of the adjustable focus lens, since the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold, in order to achieve focusing, the preset voltage adjustment method can be used to adjust the initial voltage of the adjustable focus lens to the preset voltage.

[0051] Since the piezoelectric materials inside the adjustable focus lens all have the characteristics of hysteresis, the deformation amount of the piezoelectric material in the process of deformation with the applied voltage depends not only on the magnitude of the applied voltage, but also on the initial shape of the piezoelectric material. Therefore, in order to avoid the hysteresis characteristics, the initial voltage of the adjustable focus lens is adjusted to the preset voltage by a preset voltage adjustment method, wherein the preset voltage adjustment method includes the same voltage adjustment direction. The initial voltage of the adjustable focus lens is adjusted to the preset voltage by the same voltage adjustment direction, so the deformation amount of the piezoelectric material inside the adjustable focus lens is fixed when the adjustable focus lens is under the preset voltage. Furthermore, the shape of the piezoelectric film in the Tlens (adjustable focus lens) is consistent, so this will cause the refractive power of the Tlens to be consistent, and finally, it can be achieved that the same clarity of images can be collected through the Tlens at the same voltage. By adjusting the initial voltage of the adjustable focus lens to the preset voltage in the same voltage adjustment direction, the abnormal situation of collecting two images of different clarity through the Tlens at the same voltage can be avoided.

[0052] Step 260: Control the focus-adjustable lens to focus at a preset voltage.

[0053] Since the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold (for example, 0 or a value infinitely close to 0), the closer the adjustable focus lens is to the focus position at the preset voltage, so after the initial voltage of the adjustable focus lens is adjusted to the preset voltage in the same voltage adjustment direction, the adjustable focus lens can be controlled to focus at the preset voltage. Thus, a clear image can be obtained through the adjustable focus lens and the image sensor at the preset voltage.

[0054] In the embodiment of the present application, the electronic device obtains the initial voltage and the preset voltage of the adjustable focus lens, and the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. And the initial voltage of the adjustable focus lens is adjusted to the preset voltage by a preset voltage adjustment method, wherein the preset voltage adjustment method includes the same voltage adjustment direction. Finally, the adjustable focus lens is controlled to focus at the preset voltage. Since the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold, the adjustable focus lens can achieve focus at the preset voltage. However, since the piezoelectric materials inside the adjustable focus lens have hysteresis characteristics, in order to avoid the hysteresis characteristics, the initial voltage of the adjustable focus lens is adjusted to the preset voltage by the same voltage adjustment direction, so that the deformation amount of the piezoelectric material inside the adjustable focus lens is fixed when the adjustable focus lens is at the preset voltage. Furthermore, it is possible to collect images of the same clarity through the Tlens at the same voltage. Finally, the adjustable focus lens can be controlled to focus at the preset voltage to obtain images of the same clarity, thereby improving the accuracy of focusing.

[0055] In the above embodiment, a focus control method is proposed, which can adjust the initial voltage of the focus-adjustable lens to a preset voltage by using the same voltage adjustment direction. Figure 3 As shown, in this embodiment, the focus control method is further described, and further includes:

[0056] Step 280, determining a preset voltage adjustment method according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction; the same voltage adjustment direction includes a voltage increase direction or a voltage decrease direction.

[0057] First, the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage is obtained; secondly, the same voltage adjustment direction is determined to be a voltage increase direction or a voltage decrease direction; finally, the preset voltage adjustment method is determined according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction.

[0058] Among them, the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage can be obtained by comparing the initial voltage of the adjustable focus lens and the preset voltage. And based on experience, the same voltage adjustment direction can be determined as a voltage increase direction or a voltage decrease direction, which is not limited in this application. Figure 4 : is an MTF (Modulation Transfer Function) curve diagram of the same adjustable focus lens in an embodiment. The horizontal axis of the MTF curve diagram refers to the voltage applied to the adjustable focus lens, and the vertical axis refers to the clarity of the image captured by the adjustable focus lens under the voltage. Among them, the MTF curve diagram includes a forward MTF curve and a reverse MTF curve. For the same adjustable focus lens, by adjusting the voltage applied thereto according to the direction of voltage increase, an MTF curve (such as Figure 4 Here, the positive direction refers to the direction of voltage increase. Similarly, for the same type of adjustable focus lens, by adjusting the voltage applied to it in the direction of voltage decrease, an MTF curve can be obtained (such as Figure 4 The reverse MTF curve in Figure 1). The reverse here refers to the direction of voltage reduction.

[0059] It can be seen that within the entire adjustable voltage range of Tlens, if Tlens is adjusted from the initial voltage to the preset voltage according to different voltage adjustment directions, Tlens at each voltage will correspond to two images with different clarity. Then, accurate focusing cannot be achieved.

[0060] Therefore, it is necessary to determine whether the same voltage adjustment direction is a voltage increase direction or a voltage decrease direction. After determining that the same voltage adjustment direction is a voltage increase direction or a voltage decrease direction, the preset voltage adjustment method can be determined according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction. For example, if the same voltage adjustment direction is a voltage increase direction, and the initial voltage of the adjustable focus lens is greater than the preset voltage, then the preset voltage adjustment method is determined to be first decreased and then increased. If the same voltage adjustment direction is a voltage decrease direction, and the initial voltage of the adjustable focus lens is less than the preset voltage, then the preset voltage adjustment method is determined to be first increased and then decreased.

[0061] In the embodiment of the present application, the specific implementation steps for determining the preset voltage adjustment method are described. After determining whether the same voltage adjustment direction is specifically the voltage increase direction or the voltage decrease direction, it is possible to determine how to adjust the initial voltage of the adjustable focus lens to the preset voltage according to the same voltage adjustment direction based on the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction, that is, determine the preset voltage adjustment method. The preset voltage adjustment method is accurately determined from the two dimensions of the magnitude relationship between the initial voltage and the preset voltage and the same voltage adjustment direction.

[0062] In one embodiment, if the same voltage adjustment direction includes a voltage increasing direction, step 280, according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction, determines the preset voltage adjustment mode, including:

[0063] Determining whether a preset voltage of the focus-adjustable lens is greater than an initial voltage;

[0064] If it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, the preset voltage adjustment method is determined to reduce the initial voltage to a first critical voltage and increase it from the first critical voltage to the preset voltage after a first preset time period.

[0065] Specifically, when determining the preset voltage adjustment mode, if the same voltage adjustment direction includes the voltage increase direction, first, determine whether the preset voltage (B) of the adjustable focus lens is greater than the initial voltage (A); secondly, if it is determined that the preset voltage (B) of the adjustable focus lens is less than the initial voltage (A), then determine that the preset voltage adjustment mode is to reduce the initial voltage (A) to a first critical voltage (min), and increase from the first critical voltage (min) to the preset voltage (B) after a first preset time period. Among them, the first preset time period is used to make the adjustable focus lens reach stability at the first critical voltage (min). Here, the first critical voltage can be the minimum voltage (min) applied to the adjustable focus lens. Of course, it can also be a smaller voltage applied to the adjustable focus lens, such as a voltage close to the minimum voltage (min), such as a voltage with a preset difference from the minimum voltage (min). Assume that the variable range of the voltage applied to the piezoelectric material in the adjustable focus lens is 0-50v, and the working voltage range of the piezoelectric material in the adjustable focus lens during the focusing process is 8v~50v. Then, at this time, 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 this.

[0066] In another case, if it is determined that the preset voltage (B) of the focus-adjustable lens is greater than the initial voltage (C), the preset voltage adjustment method is determined to directly increase the initial voltage (C) to the preset voltage (B).

[0067] In this way, when the preset voltage (B) of the adjustable focus lens is less than the initial voltage (A), the shape of the piezoelectric film of the adjustable focus lens under the preset voltage (B) obtained by the voltage adjustment method of first decreasing and then increasing is consistent with the shape of the piezoelectric film when the initial voltage (C) is increased to the preset voltage (B). Then, the refractive power of the Tlens is also consistent at this time, and finally, it is possible to capture images of the same clarity through the Tlens at the same voltage. By adjusting the initial voltage of the adjustable focus lens to the preset voltage in the same voltage adjustment direction, the abnormal situation of capturing two images of different clarity through the Tlens at the same voltage can be avoided.

[0068] Combination Figure 5 As shown, it is a schematic diagram of a process of adjusting the focus-adjustable lens from an initial voltage to a preset voltage according to a voltage increasing direction in one embodiment. If the same voltage adjustment direction is a voltage increasing direction, when adjusting the focus-adjustable lens from an initial voltage to a preset voltage according to the same voltage adjustment direction, the following steps are included:

[0069] Step 502, determining whether the preset voltage of the focus-adjustable lens is greater than the initial voltage; if it is determined that the preset voltage of the focus-adjustable lens is less than the initial voltage, proceeding to step 504; if it is determined that the preset voltage of the focus-adjustable lens is greater than the initial voltage, proceeding to step 510;

[0070] Step 504, reducing the initial voltage to a first critical voltage;

[0071] Step 506, controlling the focus-adjustable lens to maintain a first preset time period at a first critical voltage;

[0072] Step 508, increasing the first critical voltage to a preset voltage;

[0073] Step 510, directly increasing the initial voltage to a preset voltage.

[0074] like Figure 6 , which is a schematic diagram of voltage change of adjusting the focus-adjustable lens from an initial voltage to a preset voltage according to a voltage increasing direction in an embodiment. Figure 6 (a) is a schematic diagram of voltage change when the preset voltage (B) of the adjustable focus lens is less than the initial voltage (A). First, the initial voltage (A) is reduced to a first critical voltage (min); second, the adjustable focus lens is controlled to maintain a first preset time period (5ms) at the first critical voltage (min); finally, the first critical voltage (min) is increased to a preset voltage (B).

[0075] Figure 6 (b) is a schematic diagram of voltage variation when the preset voltage (B) of the focus-adjustable lens is greater than the initial voltage (C). The initial voltage (C) is directly increased to the preset voltage (B).

[0076] In the embodiment of the present application, if the same voltage adjustment direction is the voltage increase direction, when determining the preset voltage adjustment method, first, it is determined whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, the preset voltage adjustment method is determined to reduce the initial voltage to a first critical voltage, and increase from the first critical voltage to the preset voltage after a first preset time period. In this way, when the preset voltage (B) of the adjustable focus lens is less than the initial voltage (A), the shape of the piezoelectric film of the adjustable focus lens under the preset voltage (B) obtained by the voltage adjustment method of first decreasing and then increasing is consistent with the shape of the piezoelectric film when the initial voltage (C) is directly increased to the preset voltage (B). Then, it is finally possible to collect images of the same clarity through the Tlens at the same voltage. Therefore, by adjusting the initial voltage of the adjustable focus lens to the preset voltage in the same voltage adjustment direction, the abnormal situation of collecting two images of different clarity through the Tlens at the same voltage can be avoided. Finally, the accuracy of focusing is improved.

[0077] In the previous embodiment, it is described how to adjust the voltage according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction if the same voltage adjustment direction includes the voltage increasing direction. In this embodiment, it is further described that the first preset time period is greater than or equal to the preset time period threshold, and the first preset time period is related to the amplitude and vibration frequency of the adjustable focus lens.

[0078] Specifically, if the same voltage adjustment direction is the voltage increase direction, first, determine whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, determine that the preset voltage adjustment method is to reduce the initial voltage to a first critical voltage, and increase from the first critical voltage to the preset voltage 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, wherein the preset time period threshold can be determined based on an empirical value. For example, the maximum time for the adjustable focus lens to reach stability is determined based on the maximum amplitude and maximum vibration frequency of the adjustable focus lens, such as 5ms or 3ms. Then, the maximum time for the adjustable focus lens to reach stability is used as the preset time period threshold, that is, the preset time period threshold can be 5ms.

[0079] In addition, the first preset time period may be related to the amplitude and vibration frequency of the focus-adjustable lens, specifically a positive correlation. If the amplitude and vibration frequency of the focus-adjustable lens when the initial voltage is reduced to the first critical voltage are larger, the first preset time period required for the focus-adjustable lens to reach stability is longer. Conversely, the first preset time period required for the focus-adjustable lens to reach stability is shorter.

[0080] In the embodiment of the present application, if the same voltage adjustment direction is the voltage increase direction, first, it is determined whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, it is determined that the preset voltage adjustment method is to reduce the initial voltage to a first critical voltage, and increase from the first critical voltage to the preset voltage after a first preset time period. It is specifically described that the first preset time period is greater than or equal to the preset time period threshold, and the first preset time period is related to the amplitude and vibration frequency of the adjustable focus lens. In this way, it can be ensured that the adjustable focus lens reaches stability after the first preset time period at the first critical voltage. Then, the subsequent increase from the first critical voltage to the preset voltage after the first preset time period can ensure that the shape of the piezoelectric film of the adjustable focus lens at the preset voltage is consistent with the shape of the piezoelectric film when the adjustable focus lens directly increases from a certain initial voltage to the preset voltage.

[0081] In one embodiment, if the same voltage adjustment direction includes a voltage reduction direction, the preset voltage adjustment mode is determined according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction, including:

[0082] Determining whether a preset voltage of the focus-adjustable lens is greater than an initial voltage;

[0083] If it is determined that the preset voltage of the adjustable focus lens is greater than the initial voltage, the preset voltage adjustment method is determined to increase the initial voltage to a second critical voltage and then decrease from the second critical voltage to the preset voltage after a second preset time period.

[0084] Specifically, when determining the preset voltage adjustment method, if the same voltage adjustment direction includes a voltage reduction direction, it is determined whether the preset voltage (B) of the adjustable focus lens is greater than the initial voltage (A); secondly, if it is determined that the preset voltage (B) of the adjustable focus lens is greater than the initial voltage (A), it is determined that the preset voltage adjustment method is to increase the initial voltage (A) to a second critical voltage (max), and reduce it from the second critical voltage (max) to the preset voltage (B) after a second preset time period. Among them, the second preset time period is used to make the adjustable focus lens reach stability at the second critical voltage (max). In another case, if it is determined that the preset voltage (B) of the adjustable focus lens is less than the initial voltage (D), it is determined that the preset voltage adjustment method is to reduce the initial voltage (D) to the preset voltage (B). Here, the second critical voltage can be the maximum voltage (max) applied to the adjustable focus lens. Of course, it can also be a larger voltage applied to the adjustable focus lens, such as a voltage close to the maximum voltage (max), such as a voltage with a preset difference from the maximum voltage (max).

[0085] In this way, when the preset voltage (B) of the adjustable focus lens is greater than the initial voltage (A), the shape of the piezoelectric film of the adjustable focus lens under the preset voltage (B) obtained by the voltage adjustment method of first increasing and then decreasing is consistent with the shape of the piezoelectric film when the initial voltage (D) is reduced to the preset voltage (B). Then, the refractive power of the Tlens is also consistent at this time, and finally, it is possible to capture images of the same clarity through the Tlens at the same voltage. By adjusting the initial voltage of the adjustable focus lens to the preset voltage in the same voltage adjustment direction, the abnormal situation of capturing two images of different clarity through the Tlens at the same voltage can be avoided.

[0086] Combination Figure 7 FIG. 1 is a flow chart of adjusting the focus lens from the initial voltage to the preset voltage according to the voltage reduction direction in another embodiment. If the same voltage adjustment direction is the voltage reduction direction, when adjusting the focus lens from the initial voltage to the preset voltage according to the same voltage adjustment direction, the following steps are included:

[0087] Step 702: Determine whether the preset voltage of the focus-adjustable lens is greater than the initial voltage. If it is determined that the preset voltage of the focus-adjustable lens is greater than the initial voltage, proceed to Step 704; if it is determined that the preset voltage of the focus-adjustable lens is less than the initial voltage, proceed to Step 710.

[0088] Step 704: Increase the initial voltage to the second critical voltage.

[0089] Step 706: Control the focus-adjustable lens to maintain at the second critical voltage for a second preset time period.

[0090] Step 708: Decrease the second critical voltage to the preset voltage.

[0091] Step 710: Directly decrease the initial voltage to the preset voltage.

[0092] In the embodiment of the present application, if the same voltage adjustment direction is the voltage decrease direction, when determining the preset voltage adjustment method, first, determine whether the preset voltage of the focus-adjustable lens is greater than the initial voltage. If it is determined that the preset voltage of the focus-adjustable lens is greater than the initial voltage, determine that the preset voltage adjustment method is to increase the initial voltage to the second critical voltage and then decrease it from the second critical voltage to the preset voltage after the second preset time period. In this way, when the preset voltage (B) of the focus-adjustable lens is greater than the initial voltage (A), the shape of the piezoelectric film of the focus-adjustable lens obtained by the voltage adjustment method of first increasing and then decreasing is the same as the shape of the piezoelectric film when directly decreasing the initial voltage (D) to the preset voltage (B). Then, finally, it can be achieved that images with the same clarity are captured by the Tlens at the same voltage. Therefore, by adjusting the initial voltage of the focus-adjustable lens to the preset voltage in accordance with the same voltage adjustment direction, the abnormal situation of capturing two different clarity images by the Tlens at the same voltage can be avoided. Finally, the accuracy of focusing is improved.

[0093] In the previous embodiment, it was described how to perform voltage adjustment according to the magnitude relationship between the initial voltage and the preset voltage of the focus-adjustable lens and the same voltage adjustment direction when the same voltage adjustment direction includes the voltage decrease direction. In this embodiment, it is further described that the second preset time period is greater than or equal to the preset time period threshold, and the second preset time period is related to the amplitude and vibration frequency of the focus-adjustable lens.

[0094] Specifically, the second preset time period may be set to be greater than or equal to a preset time period threshold, wherein the preset time period threshold may be determined based on an empirical value. For example, the maximum time for the adjustable focus lens to reach stability is determined based on the maximum amplitude and maximum vibration frequency of the adjustable focus lens, such as 5ms or 8ms. Then, the maximum time for the adjustable focus lens to reach stability is used as the preset time period threshold, that is, the preset time period threshold may be 5ms.

[0095] In addition, the second preset time period may be related to the amplitude and vibration frequency of the adjustable focus lens, specifically a positive correlation. If the amplitude and vibration frequency of the adjustable focus lens when the initial voltage is increased to the second critical voltage are larger, the second preset time period required for the adjustable focus lens to reach stability is longer. Conversely, the second preset time period required for the adjustable focus lens to reach stability is shorter.

[0096] In an embodiment of the present application, if the same voltage adjustment direction is a voltage reduction direction, first, it is determined whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is greater than the initial voltage, the preset voltage adjustment method is determined to increase the initial voltage to a second critical voltage, and reduce it from the second critical voltage to the preset voltage after a second preset time period. It is specifically described that the second preset time period is greater than or equal to the preset time period threshold, and the second preset time period is related to the amplitude and vibration frequency of the adjustable focus lens. In this way, it can be ensured that the adjustable focus lens reaches stability after the second preset time period is maintained at the second critical voltage. Then, the subsequent reduction from the second critical voltage to the preset voltage after the second preset time period can ensure that the shape of the piezoelectric film of the adjustable focus lens at the preset voltage is consistent with the shape of the piezoelectric film when the adjustable focus lens is directly reduced from a certain initial voltage to the preset voltage.

[0097] In one embodiment, the electronic device further comprises an image sensor; Figure 8 As shown, step 220, obtaining a preset voltage of the focus-adjustable lens, includes:

[0098] Step 222: when the focus-adjustable lens is at an initial voltage, obtain the phase difference through the image sensor.

[0099] Some phase detection pixels may be arranged in pairs among the pixels included in the image sensor, such as Fig. 9 As shown, the image sensor may be provided with phase detection pixel pairs (hereinafter referred to as pixel pairs) A, pixel pairs B and pixel pairs C. In each pixel pair, one phase detection pixel performs left shielding (English: Left Shield) and the other phase detection pixel performs right shielding (English: Right Shield).

[0100] When the adjustable focus lens is at the initial voltage, for the phase detection pixel point on the image sensor that is blocked on the left side, only the right side of the imaging light beam directed to the phase detection pixel point can form an image on the photosensitive part of the phase detection pixel point (that is, the unblocked part), and for the phase detection pixel point on the image sensor that is blocked on the right side, only the left side of the imaging light beam directed to the phase detection pixel point can form an image on the photosensitive part of the phase detection pixel point (that is, the unblocked part). In this way, the imaging light beam can be divided into two parts, the left and the right, and the phase difference can be obtained by comparing the images formed by the left and the right imaging light beams.

[0101] Of course, the phase difference can also be calculated by other forms of image sensors. In another case, Fig. 9 : is a structural schematic diagram of a part of an image sensor in an embodiment. The image sensor includes a plurality of pixel point groups Z arranged in an array, each pixel point group Z includes a plurality of pixel points D arranged in an array, and each pixel point D corresponds to a photosensitive unit. The plurality of pixel points include M*N pixel points, wherein M and N are both natural numbers greater than or equal to 2. Each pixel point D includes a plurality of sub-pixel points d arranged in an array. That is, each photosensitive unit can be composed of a plurality of photosensitive elements arranged in an array. Among them, the photosensitive element is an element that can convert a light signal into an electrical signal. In one embodiment, the photosensitive element can be a photodiode. In this embodiment, each pixel point group Z includes 4 pixel points D arranged in a 2*2 array, and each pixel point may include 4 sub-pixel points d arranged in a 2*2 array. Among them, each pixel point D includes 2*2 photodiodes, and the 2*2 photodiodes are arranged corresponding to the 4 sub-pixel points d arranged in a 2*2 array. Each photodiode is used to receive a light signal and perform photoelectric conversion, thereby converting the light signal into an electrical signal for output. The four sub-pixel points d included in each pixel point D are arranged corresponding to the filters of the same color, so each pixel point D corresponds to a color channel, such as the red R channel, the green channel G, or the blue channel B.

[0102] like Fig.10As shown, taking each pixel point D including sub-pixel point 1, sub-pixel point 2, sub-pixel point 3 and sub-pixel point 4 as an example, the signals of sub-pixel point 1 and sub-pixel point 2 can be combined and output, and the signals of sub-pixel point 3 and sub-pixel point 4 can be combined and output, so as to construct two PD pixel pairs along the second direction (i.e., the vertical direction), and the PD value (phase difference value) of each sub-pixel point in the pixel point D along the second direction can be determined according to the phase values ​​of the two PD pixel pairs. The signals of sub-pixel point 1 and sub-pixel point 3 are combined and output, and the signals of sub-pixel point 2 and sub-pixel point 4 are combined and output, so as to construct two PD pixel pairs along the first direction (i.e., the horizontal direction), and the PD value (phase difference value) of each sub-pixel point in the pixel point D along the first direction can be determined according to the phase values ​​of the two PD pixel pairs.

[0103] Step 224, calculating a preset voltage of the focus-adjustable lens according to the phase difference; the defocus distance of the focus-adjustable lens at the preset voltage is less than a preset defocus distance threshold.

[0104] After the phase difference is calculated by the above-mentioned method of calculating the phase difference, the preset voltage of the adjustable focus lens can be calculated according to the phase difference. The defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. That is, when the adjustable focus lens is at the preset voltage, the adjustable focus lens is in a focused state.

[0105] Specifically, when the preset voltage of the adjustable focus lens is calculated according to the phase difference, the calculated phase difference can be matched to the preset voltage of the adjustable focus lens corresponding thereto based on the calculated phase difference and the correspondence between the phase difference and the preset voltage of the adjustable focus lens. Here, the correspondence between the phase difference and the preset voltage of the adjustable focus lens can be calibrated by experiments. For example, for each phase difference, it is calibrated that when the adjustable focus lens is adjusted from the initial voltage to a certain preset voltage, the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. That is, when the adjustable focus lens is at the preset voltage, the adjustable focus lens is in a focused state. At this point, it is obtained that there is a correspondence between the phase difference and the certain preset voltage. In this way, the correspondence between the phase difference and the preset voltage of the adjustable focus lens is calibrated.

[0106] In an embodiment of the present application, obtaining a preset voltage of the adjustable focus lens includes: first, when the adjustable focus lens is at an initial voltage, obtaining a phase difference through an image sensor. Secondly, calculating the preset voltage of the adjustable focus lens based on the phase difference, and the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. Using a phase focusing algorithm, the phase difference is obtained through an image sensor, and then the preset voltage of the adjustable focus lens is calculated based on the correspondence between the pre-calibrated phase difference and the preset voltage of the adjustable focus lens. Thus, the preset voltage adjustment method can be used to adjust the initial voltage of the adjustable focus lens to the preset voltage, thereby achieving control of the adjustable focus lens to focus at the preset voltage. Ultimately, the accuracy of focusing is improved.

[0107] In the previous embodiment, a process is described in which a phase focusing algorithm is used to obtain a phase difference through an image sensor, and then a preset voltage of the adjustable focus lens is calculated based on the correspondence between the pre-calibrated phase difference and the preset voltage of the adjustable focus lens. Fig.11 As shown, the detailed implementation steps of step 260, which control the focus-adjustable lens to focus under a preset voltage, include:

[0108] Step 262: When the focus-adjustable lens is at a preset voltage, a target image is captured by an image sensor.

[0109] Step 264 , using a preset voltage adjustment method, adjusting the preset voltage to a first candidate voltage according to a preset adjustment step, and capturing a first candidate image through an image sensor.

[0110] Specifically, when focusing is performed through a camera module including a focus-adjustable lens, first, a phase difference is obtained through an image sensor, and then a preset voltage of the focus-adjustable lens is calculated based on the correspondence between the pre-calibrated phase difference and the preset voltage of the focus-adjustable lens. Secondly, the initial voltage of the focus-adjustable lens is adjusted to a preset voltage using a preset voltage adjustment method; the preset voltage adjustment method includes a same voltage adjustment direction. Finally, the focus-adjustable lens is controlled to focus at a preset voltage. Among them, the same voltage adjustment direction includes a voltage increase direction or a voltage decrease direction.

[0111] Then, when controlling the adjustable focus lens to focus under a preset voltage, the preset voltage can be directly applied to the adjustable focus lens to achieve focusing. It is also possible to further use contrast focusing to achieve focusing when applying a preset voltage to the adjustable focus lens. Because the phase difference obtained by the image sensor using the phase focusing algorithm often has inaccurate problems, after calculating the preset voltage of the adjustable focus lens based on the phase difference and adjusting the initial voltage of the adjustable focus lens to the preset voltage using the preset voltage adjustment method, the contrast focusing method is further used to fine-tune the voltage of the adjustable focus lens to improve the accuracy of focusing.

[0112] Specifically, first, when the focus-adjustable lens is at a preset voltage, a target image is collected by the image sensor. Then, using a preset voltage adjustment method, the preset voltage is adjusted to a first candidate voltage according to a preset adjustment step. A first candidate image is collected by the image sensor. For example, assume the preset voltage is 30V. When the focus-adjustable lens is at the preset voltage of 30V, a target image is collected by the image sensor. If the same voltage adjustment direction is the voltage increasing direction, then in the voltage increasing direction, the preset voltage is adjusted to the first candidate voltage according to the preset adjustment step (such as 1V), and a first candidate image is collected by the image sensor. For example, the preset voltage of 30V is adjusted to the first candidate voltage of 31V. Or, the preset voltage of 30V is reduced to a first critical voltage; the focus-adjustable lens is controlled to maintain the first preset time period at the first critical voltage; the first critical voltage is increased to the first candidate voltage of 29V. Here, the preset adjustment step can also be 0.5V, 0.1V, etc., and the present application does not limit this. Here, the preset adjustment step can also be 0.5V, 0.1V, etc., and the present application does not limit this.

[0113] Step 266: Obtain the target preset voltage of the focus-adjustable lens according to the clarity of the target image and the clarity of the first candidate image; the defocus distance of the focus-adjustable lens at the target preset voltage is less than the defocus distance of the focus-adjustable lens at the preset voltage.

[0114] Step 268: Control the focus-adjustable lens to focus at the target preset voltage.

[0115] After collecting the target image and the first candidate image through the image sensor, calculate the clarity of the target image and the clarity of the first candidate image respectively. Compare the clarity of the target image and the clarity of the first candidate image, and based on the comparison result, finely adjust the voltage of the focus-adjustable lens until the first candidate image with the highest clarity is found. The voltage of the focus-adjustable lens corresponding to the first candidate image with the highest clarity is used as the target preset voltage of the focus-adjustable lens. At this time, the defocus distance of the focus-adjustable lens at the target preset voltage is less than the defocus distance of the focus-adjustable lens at the preset voltage. That is, the focus-adjustable lens at the target preset voltage is closer to the in-focus position. Furthermore, the focus-adjustable lens can be controlled to focus at the target preset voltage.

[0116] In the embodiment of the present application, first, a phase focusing algorithm is used to obtain a phase difference through an image sensor, and then the preset voltage of the adjustable focus lens is calculated based on the correspondence between the pre-calibrated phase difference and the preset voltage of the adjustable focus lens. Because the phase difference obtained by the image sensor using the phase focusing algorithm often has inaccurate problems, after using the phase focusing algorithm, a contrast focusing algorithm is further used to accurately find a target preset voltage that is closer to the focus position near the preset voltage, thereby controlling the adjustable focus lens to focus at the target preset voltage, and ultimately improving the accuracy of focusing.

[0117] In one embodiment, a focus control method is also provided, which is applied to an electronic device, wherein the electronic device includes a focus-adjustable lens and an image sensor, such as Fig.12 As shown, the method includes:

[0118] Step 1220, when the focus-adjustable lens is at an initial voltage, collecting an initial image through an image sensor;

[0119] Step 1240, using a preset voltage adjustment method, adjusting the initial voltage of the adjustable focus lens to a second candidate voltage according to a preset adjustment step, and collecting a second candidate image through an image sensor; the preset voltage adjustment method includes the same voltage adjustment direction.

[0120] Specifically, when the adjustable focus lens is at an initial voltage, an initial image is first collected by an image sensor. Then, a preset voltage adjustment method is adopted to adjust the initial voltage to a second candidate voltage according to a preset adjustment step, and the second candidate image is collected by an image sensor. For example, assuming that the initial voltage is 40V, when the adjustable focus lens is at an initial voltage of 40V, an initial image is collected by an image sensor. If the same voltage adjustment direction is a voltage increase direction, the initial voltage is adjusted to a first candidate voltage according to an initial adjustment step (such as 1V) in the voltage increase direction, and the first candidate image is collected by an image sensor. For example, according to the voltage increase direction, the initial voltage 40V is increased to a second candidate voltage 41V. Or, the initial voltage 40V is reduced to a first critical voltage; the adjustable focus lens is controlled to maintain a first preset time period at the first critical voltage; and the first critical voltage is increased to a second candidate voltage of 39V. Here, the preset adjustment step can also be 0.5V, 0.1V, etc., which is not limited in this application.

[0121] Step 1260, obtaining a preset voltage of the focus-adjustable lens according to the clarity of the initial image and the clarity of the second candidate image; the defocus distance of the focus-adjustable lens at the preset voltage is less than a preset defocus distance threshold;

[0122] Step 1280, controlling the adjustable focus lens to focus under a preset voltage.

[0123] After the initial image and the second candidate image are captured by the image sensor, the clarity of the initial image and the clarity of the second candidate image are calculated respectively. The clarity of the initial image and the clarity of the second candidate image are compared, and the voltage of the adjustable focus lens is fine-tuned based on the comparison result until the second candidate image with the highest clarity is found, and the voltage of the adjustable focus lens corresponding to the second candidate image with the highest clarity is used as the preset voltage of the adjustable focus lens. At this time, the defocus distance of the adjustable focus lens at the preset voltage is less than the preset defocus distance threshold. That is, the adjustable focus lens at the preset voltage is closer to the focus position. Then, the adjustable focus lens can be controlled to focus at the preset voltage.

[0124] In the embodiment of the present application, when focusing is performed by a camera module including a focus-adjustable lens, a contrast focus algorithm is directly used to find the voltage of the focus-adjustable lens corresponding to the second candidate image with the highest clarity near the initial voltage of the focus-adjustable lens, which is used as the preset voltage of the focus-adjustable lens. That is, the focus-adjustable lens at the preset voltage is closer to the focus position. Then, the focus-adjustable lens can be controlled to focus at the preset voltage. Thereby, the accuracy of focusing is improved.

[0125] In a specific embodiment, Fig.13 As shown, a focus control method is provided, comprising:

[0126] Step 1302, obtaining an initial voltage of the focus-adjustable lens;

[0127] Step 1304, when the focus-adjustable lens is at an initial voltage, acquiring a phase difference through an image sensor;

[0128] Step 1306, calculating a preset voltage of the focus-adjustable lens according to the phase difference; the defocus distance of the focus-adjustable lens at the preset voltage is less than a preset defocus distance threshold;

[0129] Step 1308, if the same voltage adjustment direction includes a voltage increasing direction, determine whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, proceed to step 1310; if it is determined that the preset voltage (B) of the adjustable focus lens is greater than the initial voltage (C), proceed to step 1312;

[0130] Step 1310 , determining that the preset voltage regulation method is to reduce the initial voltage to a first critical voltage, and then increase the voltage from the first critical voltage to the preset voltage after a first preset time period.

[0131] Step 1312, determining that the preset voltage adjustment method is to directly increase the initial voltage (C) to the preset voltage (B); proceeding to step 1320;

[0132] Step 1314, if the same voltage adjustment direction includes a voltage reduction direction, determine whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is greater than the initial voltage, proceed to step 1316; if it is determined that the preset voltage (B) of the adjustable focus lens is less than the initial voltage (D), proceed to step 1318;

[0133] Step 1316, determining that the preset voltage regulation method is to increase the initial voltage to a second critical voltage, and then decrease the initial voltage from the second critical voltage to the preset voltage after a second preset time period.

[0134] Step 1318, determining that the preset voltage adjustment method is to reduce the initial voltage (D) to the preset voltage (B); proceeding to step 1320;

[0135] Step 1320, adjusting the initial voltage of the focus-adjustable lens to a preset voltage using a preset voltage adjustment method;

[0136] Step 1322, when the adjustable focus lens is at a preset voltage, collecting a target image through an image sensor;

[0137] Step 1324, using a preset voltage adjustment method, adjusting the preset voltage to a first candidate voltage according to a preset adjustment step, and acquiring a first candidate image through an image sensor;

[0138] Step 1326, obtaining a target preset voltage of the focus lens according to the clarity of the target image and the clarity of the first candidate image; the defocus distance of the focus lens at the target preset voltage is smaller than the defocus distance of the focus lens at the preset voltage;

[0139] Step 1328, controlling the adjustable focus lens to focus at a target preset voltage.

[0140] In an embodiment of the present application, when focusing is performed through a camera module including a focus-adjustable lens, a phase focusing algorithm is first used to obtain a phase difference through an image sensor, and then the preset voltage of the focus-adjustable lens is calculated based on the correspondence between the pre-calibrated phase difference and the preset voltage of the focus-adjustable lens. Thus, the initial voltage of the focus-adjustable lens can be adjusted to a preset voltage using a preset voltage adjustment method, and the target image can be captured through the image sensor. Since the phase focusing algorithm is fast, but often has inaccuracies, it is combined with a contrast focusing algorithm to accurately find a target preset voltage that is closer to the focus position near the preset voltage, thereby controlling the focus-adjustable lens to focus at the target preset voltage, thereby ultimately improving the accuracy of focusing.

[0141] It should be understood that, although the various steps in the above-mentioned flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0142] In one embodiment, Fig.14 As shown, a focus control device 1400 is provided, which is applied to an electronic device, and the electronic device includes a focus-adjustable lens. The device includes:

[0143] An acquisition module 1420 is used to acquire an initial voltage and a preset voltage of the focus-adjustable lens; the defocus distance of the focus-adjustable lens at the preset voltage is less than a preset defocus distance threshold;

[0144] The voltage regulating module 1440 is used to adjust the initial voltage of the adjustable focus lens to a preset voltage by using a preset voltage regulating method; the preset voltage regulating method includes the same voltage regulating direction;

[0145] The first focus control module 1460 is used to control the focus-adjustable lens to focus under a preset voltage.

[0146] In one embodiment, a focus control device 1400 is provided, further comprising:

[0147] The preset voltage adjustment mode determination module 1480 is used to determine the preset voltage adjustment mode according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction; the same voltage adjustment direction includes a voltage increase direction or a voltage decrease direction.

[0148] In one embodiment, if the same voltage adjustment direction includes a voltage increasing direction, the preset voltage adjustment method determination module 1480 is also used to determine whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, the preset voltage adjustment method is determined to reduce the initial voltage to a first critical voltage, and increase it from the first critical voltage to the preset voltage after a first preset time period.

[0149] In one embodiment, 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 focus-adjustable lens.

[0150] In one embodiment, the preset voltage adjustment mode determining module 1480 is further used to determine the preset voltage adjustment mode as increasing the initial voltage to the preset voltage if it is determined that the preset voltage of the adjustable focus lens is greater than the initial voltage.

[0151] In one embodiment, if the same voltage adjustment direction includes a voltage reduction direction, the preset voltage adjustment method determination module 1480 is also used to determine whether the preset voltage of the adjustable focus lens is greater than the initial voltage; if it is determined that the preset voltage of the adjustable focus lens is greater than the initial voltage, the preset voltage adjustment method is determined to increase the initial voltage to a second critical voltage, and reduce it from the second critical voltage to the preset voltage after a second preset time period.

[0152] In one embodiment, the preset voltage adjustment mode determining module 1480 is further used to determine the preset voltage adjustment mode as reducing the initial voltage to the preset voltage if it is determined that the preset voltage of the focus-adjustable lens is less than the initial voltage.

[0153] In one embodiment, the electronic device further includes an image sensor; the acquisition module 1420 includes:

[0154] A phase difference acquisition unit, used for acquiring a phase difference through an image sensor when the focus-adjustable lens is at an initial voltage;

[0155] The preset voltage calculation unit is used to calculate the preset voltage of the focus-adjustable lens according to the phase difference; the defocus distance of the focus-adjustable lens under the preset voltage is less than a preset defocus distance threshold.

[0156] In one embodiment, the first focus control module 1460 includes:

[0157] A target image acquisition unit, used for acquiring a target image through an image sensor when the adjustable focus lens is at a preset voltage;

[0158] A first candidate image acquisition unit, configured to use a preset voltage adjustment method to adjust the preset voltage to a first candidate voltage according to a preset adjustment step length, and to acquire a first candidate image through an image sensor;

[0159] A target preset voltage acquisition unit, used to acquire a target preset voltage of the focus-adjustable lens according to the clarity of the target image and the clarity of the first candidate image; the defocus distance of the focus-adjustable lens at the target preset voltage is smaller than the defocus distance of the focus-adjustable lens at the preset voltage;

[0160] The focus control unit is used to control the focus-adjustable lens to focus under a target preset voltage.

[0161] In one embodiment, Fig.15As shown, a focus control device 1500 is provided, which is applied to an electronic device, and the electronic device includes a focus-adjustable lens and an image sensor. The device includes:

[0162] An initial image acquisition module 1520, configured to acquire an initial image through an image sensor when the focus-adjustable lens is at an initial voltage;

[0163] The second candidate image acquisition module 1540 is used to adjust the initial voltage of the adjustable focus lens to the second candidate voltage according to the preset adjustment step length by using a preset voltage adjustment method, and to acquire the second candidate image through the image sensor; the preset voltage adjustment method includes the same voltage adjustment direction;

[0164] The preset voltage acquisition module 1560 is used to acquire a preset voltage of the focus-adjustable lens according to the clarity of the initial image and the clarity of the second candidate image; the defocus distance of the focus-adjustable lens under the preset voltage is less than a preset defocus distance threshold;

[0165] The second focus control module 1580 is used to control the focus-adjustable lens to focus under a preset voltage.

[0166] The division of the various modules in the above focus control device is only for illustration. In other embodiments, the focus control device may be divided into different modules as needed to complete all or part of the functions of the above focus control device.

[0167] For the specific definition of the focus control device, please refer to the definition of the focus control method above, which will not be repeated here. Each module in the above-mentioned focus control device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0168] Fig.16Schematic diagram of the internal structure of an electronic device in an embodiment. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a car computer, a wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. Among them, the processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement a focus control method provided in each of the following embodiments. The internal memory provides a cache operating environment for the operating system computer program in the non-volatile storage medium.

[0169] The implementation of each module in the focus control device provided in the embodiment of the present application can be in the form of a computer program. The computer program can be run on an electronic device. The program module constituted by the computer program can be stored in the memory of the electronic device. When the computer program is executed by the processor, the steps of the method described in the embodiment of the present application are implemented.

[0170] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the focus control method.

[0171] An embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute a focus control method.

[0172] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0173] Any reference to memory, storage, database or other medium used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-only Memory) or flash memory. Volatile memory may include RAM (Random Access Memory), which is used as an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDRSDRAM (Double Data Rate Synchronous Dynamic Random Access memory), ESDRAM (Enhanced Synchronous Dynamic Random Access memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).

[0174] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A focus control method, It is characterized in that Applied to an electronic device, the electronic device includes a focus-adjustable lens and an image sensor, and the method includes: Obtaining the initial voltage and preset voltage of the adjustable focus lens; the defocus distance of the adjustable focus lens under the preset voltage is less than the preset defocus distance threshold; obtaining the preset voltage of the adjustable focus lens, including: when the adjustable focus lens is at the initial voltage, obtaining the phase difference through the image sensor; calculating the preset voltage of the adjustable focus lens according to the phase difference; wherein, the image sensor includes pixels in which phase detection pixels are arranged in pairs, and in each pixel pair, one phase detection pixel is blocked on the left side, and the other phase detection pixel is blocked on the right side; comparing the imaging of the imaging light beam emitted to the phase detection pixel blocked on the left side at the photosensitive part of the phase detection pixel blocked on the left side with the imaging light beam emitted to the phase detection pixel blocked on the right side at the photosensitive part of the phase detection pixel blocked on the right side, to obtain the phase difference; The initial voltage of the adjustable focus lens is adjusted to the preset voltage by using a preset voltage adjustment method; the preset voltage adjustment method includes the same voltage adjustment direction; The adjustable focus lens is controlled to focus under the preset voltage.

2. The method according to claim 1, It is characterized in that The method further comprises: The preset voltage adjustment mode is determined according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction; the same voltage adjustment direction includes a voltage increase direction or a voltage decrease direction.

3. The method according to claim 2, It is characterized in that If the same voltage adjustment direction includes a voltage increasing direction, then determining the preset voltage adjustment mode according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction includes: Determining whether the preset voltage of the focus-adjustable lens is greater than the initial voltage; If it is determined that the preset voltage of the adjustable focus lens is less than the initial voltage, the preset voltage adjustment method is determined to reduce the initial voltage to a first critical voltage and increase it from the first critical voltage to the preset voltage after a first preset time period.

4. The method according to claim 3, It is characterized in 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 focus-adjustable lens.

5. The method according to claim 3 or 4, It is characterized in that The method further comprises: If it is determined that the preset voltage of the focus-adjustable lens is greater than the initial voltage, then the preset voltage adjustment method is determined to be increasing the initial voltage to the preset voltage.

6. The method according to claim 2, It is characterized in that If the same voltage adjustment direction includes a voltage reduction direction, then determining the preset voltage adjustment mode according to the magnitude relationship between the initial voltage of the adjustable focus lens and the preset voltage and the same voltage adjustment direction includes: Determining whether the preset voltage of the focus-adjustable lens is greater than the initial voltage; If it is determined that the preset voltage of the adjustable focus lens is greater than the initial voltage, the preset voltage adjustment method is determined to increase the initial voltage to a second critical voltage and decrease from the second critical voltage to the preset voltage after a second preset time period.

7. The method according to claim 6, It is characterized in that The method further comprises: If it is determined that the preset voltage of the focus-adjustable lens is less than the initial voltage, the preset voltage adjustment method is determined to be reducing the initial voltage to the preset voltage.

8. The method according to claim 1, It is characterized in that The initial voltage of the adjustable focus lens refers to the voltage loaded on the adjustable focus lens when the camera module is started, or the voltage loaded on the adjustable focus lens before focusing; the preset voltage of the adjustable focus lens refers to the voltage calculated by the focusing algorithm.

9. The method according to claim 1, It is characterized in that The controlling the focus-adjustable lens to focus under the preset voltage comprises: When the adjustable focus lens is at the preset voltage, collecting a target image through the image sensor; Adopting the preset voltage adjustment method, adjusting the preset voltage to a first candidate voltage according to a preset adjustment step, and acquiring a first candidate image through the image sensor; According to the clarity of the target image and the clarity of the first candidate image, a target preset voltage of the adjustable focus lens is obtained; the defocus distance of the adjustable focus lens at the target preset voltage is smaller than the defocus distance of the adjustable focus lens at the preset voltage; The focus-adjustable lens is controlled to focus under the target preset voltage.

10. A focus control device, It is characterized in that Applied to an electronic device, the electronic device includes a focus-adjustable lens, and the device includes: An acquisition module, used for acquiring an initial voltage and a preset voltage of the adjustable focus lens; the defocus distance of the adjustable focus lens at the preset voltage is less than a preset defocus distance threshold; the acquisition module, specifically used for: acquiring a phase difference through the image sensor when the adjustable focus lens is at the initial voltage; calculating the preset voltage of the adjustable focus lens according to the phase difference; wherein the image sensor includes pixels in which phase detection pixels are arranged in pairs, and in each pixel pair, one phase detection pixel is blocked on the left side, and the other phase detection pixel is blocked on the right side; the imaging of an imaging light beam directed to the phase detection pixel blocked on the left side at the photosensitive part of the phase detection pixel blocked on the left side is compared with the imaging light beam directed to the phase detection pixel blocked on the right side at the photosensitive part of the phase detection pixel blocked on the right side, so as to obtain a phase difference; A voltage regulating module, used to adjust the initial voltage of the adjustable focus lens to the preset voltage by using a preset voltage regulating method; the preset voltage regulating method includes the same voltage regulating direction; A focus control module is used to control the focus-adjustable lens to focus under the preset voltage.

11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the computer program is executed by the processor, the processor is caused to perform the steps of the focus control method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the focus control method according to any one of claims 1 to 9 are implemented.

13. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the focus control method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Variable-focus 3-D capsule endoscope system based on liquid lens

    CN104939793A

  • Focusing method and device, electronic equipment and storage medium

    CN115150553A