Focus position adjustment method and device, equipment and storage medium

By acquiring the actual focus and quasi-focus positions of the lens module and calculating the data, and combining the sensor information to determine the focus shift and make step-by-step adjustments, the problem of focus shift of the lens module under non-scene change factors is solved, achieving high-definition imaging effect and efficient shooting experience.

CN122120612APending Publication Date: 2026-05-29BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING XIAOMI MOBILE SOFTWARE CO LTD
Filing Date
2024-11-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

During shooting, factors such as OIS offset, changes in ambient temperature, or slight deformation of the lens itself can cause focus shift, resulting in a slow shift in the focal point of the lens module after focusing, which affects image quality.

Method used

By acquiring the actual focus position and near-focus position calculation data of the lens module, using sensor information and preset conditions to determine focus shift, and using a step-by-step adjustment of the actual focus position of the lens module to achieve the theoretically accurate focus position.

Benefits of technology

It improves the real-time performance, accuracy, and stability of focusing, ensuring high-definition images, reducing the complexity of manual adjustments for users, and enhancing shooting efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120612A_ABST
    Figure CN122120612A_ABST
Patent Text Reader

Abstract

The present disclosure provides a focus position adjustment method and device, equipment and storage medium, and relates to the technical field of cameras. The method comprises: in response to the end of focusing of a lens module, acquiring actual focusing position and focusing position calculation data of the lens module; and in response to determination that the lens module has focus point deviation, adjusting the actual focusing position of the lens module according to the focusing position calculation data. The method can effectively deal with focus point deviation problems caused by various non-scene change factors, such as ois deviation, environmental temperature change, etc., and improve the real-time performance, accuracy and stability of focusing. The dynamic adjustment capability of the focus position can make the captured image have high definition, greatly improving the imaging quality of photography. Moreover, the present scheme also has high automation and intelligent characteristics, reduces the complexity of manual adjustment of focusing by the user, and improves the shooting efficiency and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of camera technology, and in particular to a method, apparatus, device and storage medium for adjusting focus position. Background Technology

[0002] With the rapid development and widespread adoption of smart terminal devices, camera modules have become standard equipment, greatly facilitating users' photography needs. During the shooting process, the accuracy and timeliness of focusing have become key factors affecting image quality. Ensuring quick and precise focusing for every shot is crucial for enhancing the photography experience on smart terminal devices.

[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] The purpose of this disclosure is to provide a method, apparatus, device, and storage medium for adjusting the focus position.

[0005] According to a first aspect of the present disclosure, a method for adjusting a focus position is provided, comprising: in response to the end of focusing of a lens module, acquiring actual focus position and collimation position calculation data of the lens module; and in response to determining that the lens module has experienced a focus shift, adjusting the actual focus position of the lens module according to the collimation position calculation data.

[0006] In some implementations, determining that the lens module has experienced a focus shift includes: acquiring sensor information of the lens module; determining whether a preset condition is met based on the sensor information, the actual focus position, and the pre-focus position calculation data; and determining that the lens module has experienced a focus shift in response to meeting the preset condition. The preset condition includes: the sensor information falling within a first range threshold; the pre-focus position calculation data meeting a confidence condition; and the focus shift data between the actual focus position and the pre-focus position calculation data falling within a second range threshold.

[0007] In some implementations, the sensing information includes gyroscope acceleration; wherein the sensing information is a range threshold, including: the gyroscope acceleration is less than the acceleration threshold.

[0008] In some embodiments, the focus position calculation data includes focus position calculation values ​​at multiple times; wherein the focus position calculation data satisfies confidence conditions, including: the confidence level of each focus position calculation value is greater than a confidence level threshold; and the variance of the focus position calculation values ​​at multiple times is less than a variance threshold.

[0009] In some embodiments, the focus position calculation data includes multiple focus position calculation values ​​at various times; the focus offset data includes multiple focus offsets determined based on the actual focus position and the focus position calculation values ​​at various times; wherein the focus offset data between the actual focus position and the focus position calculation data belongs to a second range threshold, including: each focus offset is greater than the offset threshold.

[0010] In some embodiments, the focus position calculation data includes focus position calculation values ​​at a first number of time points; the focus offset data includes: a focus offset amount at a second number of time points determined based on the actual focus position and the focus position calculation values ​​at a second number of time points; wherein the focus position calculation values ​​at the second number of time points are at least a portion of the focus position calculation values ​​at the first number of time points.

[0011] In some implementations, adjusting the actual focus position of the lens module based on the focus position calculation data includes: determining a target focus position based on the focus position calculation data; and adjusting the actual focus position of the lens module to the target focus position in steps according to a preset step value.

[0012] In some embodiments, the focus position adjustment method further includes: stopping the adjustment of the actual focus position of the lens module in response to a preset time elapsed since the lens module finished focusing.

[0013] According to a second aspect of the present disclosure, a focus position adjustment device is provided, comprising: an acquisition unit, configured to acquire actual focus position and collimation position calculation data of the lens module in response to the end of focusing of the lens module; and a focus adjustment unit, configured to adjust the actual focus position of the lens module according to the collimation position calculation data in response to determining that a focus shift has occurred in the lens module.

[0014] In some embodiments, the focus position adjustment device further includes an offset determination unit, and the acquisition unit is further configured to acquire the sensing information of the lens module; the offset determination unit is configured to: determine whether a preset condition is met based on the sensing information, the actual focus position, and the calculated data of the near-focus position; and determine that the lens module has experienced a focus offset in response to meeting the preset condition; wherein the preset condition includes: the sensing information belongs to a first range threshold; the calculated data of the near-focus position meets a confidence condition; and the focus offset data between the actual focus position and the calculated data of the near-focus position belongs to a second range threshold.

[0015] In some implementations, the sensing information includes gyroscope acceleration; wherein the sensing information is a range threshold, including: the gyroscope acceleration is less than the acceleration threshold.

[0016] In some embodiments, the focus position calculation data includes focus position calculation values ​​at multiple times; wherein the focus position calculation data satisfies confidence conditions, including: the confidence level of each focus position calculation value is greater than a confidence level threshold; and the variance of the focus position calculation values ​​at multiple times is less than a variance threshold.

[0017] In some embodiments, the focus position calculation data includes multiple focus position calculation values ​​at various times; the focus offset data includes multiple focus offsets determined based on the actual focus position and the focus position calculation values ​​at various times; wherein the focus offset data between the actual focus position and the focus position calculation data belongs to a second range threshold, including: each focus offset is greater than the offset threshold.

[0018] In some embodiments, the focus position calculation data includes focus position calculation values ​​at a first number of time points; the focus offset data includes: a focus offset amount at a second number of time points determined based on the actual focus position and the focus position calculation values ​​at a second number of time points; wherein the focus position calculation values ​​at the second number of time points are at least a portion of the focus position calculation values ​​at the first number of time points.

[0019] In some implementations, the focus adjustment unit adjusts the actual focus position of the lens module based on the focus position calculation data, including: determining a target focus position based on the focus position calculation data; and adjusting the actual focus position of the lens module to the target focus position in steps according to a preset step value.

[0020] In some embodiments, the focus adjustment unit is further configured to: stop adjusting the actual focus position of the lens module in response to a preset time elapsed since the lens module finished focusing.

[0021] According to a third aspect of the present disclosure, an electronic device is provided, characterized in that it includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the focus position adjustment method described above.

[0022] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform a focus position adjustment method, the method comprising: in response to the end of focusing of a lens module, acquiring actual focus position and collimation position calculation data of the lens module; and in response to determining that a focus shift has occurred in the lens module, adjusting the actual focus position of the lens module according to the collimation position calculation data.

[0023] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described focus position adjustment method.

[0024] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0025] This disclosure effectively addresses focus shift issues caused by various non-scene-related factors, such as OIS shift, ambient temperature changes, or minor lens deformation, improving the real-time performance, accuracy, and stability of focusing. This dynamic adjustment capability of the focus position results in high-resolution images, significantly enhancing the image quality of photography. Furthermore, this solution features a high degree of automation and intelligence, reducing the complexity of manual focus adjustments for users and improving shooting efficiency and user experience.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0028] Figure 1 This is a flowchart illustrating a focus position adjustment method according to some embodiments of the present disclosure.

[0029] Figure 2 This is a flowchart illustrating a focus position adjustment method for determining a focus shift in a lens module, according to some embodiments of the present disclosure.

[0030] Figure 3 This is a flowchart illustrating yet another method for adjusting the focus position according to some embodiments of the present disclosure.

[0031] Figure 4 This is a flowchart illustrating yet another method for adjusting the focus position according to some embodiments of the present disclosure.

[0032] Figure 5 This is a schematic diagram illustrating focus position adjustment in a focus position adjustment method according to some embodiments of the present disclosure.

[0033] Figure 6 This is a block diagram illustrating a focus position adjustment device according to some embodiments of the present disclosure.

[0034] Figure 7 This is a block diagram illustrating an apparatus for adjusting focus position according to some embodiments of the present disclosure. Detailed Implementation

[0035] Exemplary embodiments of this disclosure will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. Various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a particular order. Furthermore, for clarity and brevity, descriptions of features known in the art may be omitted.

[0036] The embodiments described below, which are examples of some of the embodiments of this disclosure, do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0037] In related technologies, when a user takes a handheld photo, if the lens detects a change in the scene and the motor is not currently in focus, it will trigger the lens module to focus. After focusing is complete, the motor will not drive the lens to focus again unless further changes in the scene are detected. However, in practical applications, OIS (Optical Image Stabilizer) shift or temperature drift (i.e., temperature changes) often cause the lens to slowly shift its focus point after focusing ends, resulting in a discrepancy between the actual focus position and the calculated focus position. Since this situation does not trigger a scene change, i.e., it does not trigger refocusing, when capturing frames, the current motor position is not the sharpest, leading to out-of-focus photos.

[0038] The specific implementation methods of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0039] Figure 1 This is a flowchart illustrating a focus position adjustment method according to some embodiments of the present disclosure, such as... Figure 1 As shown, the focus position adjustment method can be applied to terminal devices and may include the following steps.

[0040] In step S110, in response to the end of focusing of the lens module, the actual focus position and the collimation position calculation data of the lens module are obtained.

[0041] In this embodiment of the disclosure, the end of focusing by the lens module can refer to the end of the focusing action triggered by the lens module in response to a change in the scene. Specifically, when the lens detects a change in the scene and the motor is not currently in the focus position, focusing is triggered. After focusing is initiated, the lens module can switch to focusing mode to control the motor through a preset algorithm to drive the lens module to the focus position. When the scene is stable and the motor is confirmed to be in the focus position, the focusing action can end.

[0042] The actual focus position is the position of the lens module after focusing, and can be derived from readings of relevant sensors on the lens module. The focus position calculation data can be the ideal focus position calculated in real time through a series of algorithms (such as those provided by the chip platform).

[0043] In this embodiment of the disclosure, the actual focus position and the calculated focus position data obtained after the lens module finishes focusing can be used for focus shift detection in subsequent steps; and, after determining that a focus shift has occurred, the calculated focus position data can also be used to adjust the lens module from the actual focus position to an ideal position that can produce a clear photo.

[0044] In step S120, in response to determining that the lens module has experienced a focus shift, the actual focus position of the lens module is adjusted based on the focus position calculation data.

[0045] In an exemplary embodiment, due to OIS (Optical Image Stabilizer) offset or temperature drift (i.e., temperature change), the lens may experience a slow shift in focus (i.e., focus shift) after focusing ends.

[0046] In this embodiment of the present disclosure, when it is determined that the lens module has experienced a focus shift, the distance that the motor should drive the lens module to move along the z-axis can be calculated based on the actual focus position and the collimation position calculation data. Then, the lens module is driven by the motor to move accordingly, thereby adjusting the focus position of the lens module so that the adjusted actual focus position reaches the theoretically accurate focus position, thus making the captured image clear and eliminating the blurring phenomenon.

[0047] In an exemplary embodiment, focus shift detection can be performed in a preset manner to determine whether the lens module has experienced focus shift. If focus shift occurs, it means that the focus position of the lens module needs to be adjusted. It is evident that the logic for triggering focus position adjustment in this embodiment differs from the logic for autofocus actions typically triggered by scene changes (such as switching from a close-up to a distant view). Focus position adjustment can be performed when focus shift occurs without scene changes, ensuring high-precision focus of the lens module even in static shooting environments, thereby avoiding image blurring or out-of-focus phenomena caused by focus shift.

[0048] As can be seen from the above steps, the focus position adjustment method provided in this disclosure can obtain the actual focus position and collimation position calculation data of the lens module after focusing is completed. Then, when it is determined that the lens module has experienced focus shift, the actual focus position of the lens module can be adjusted to the theoretically accurate focus position using the collimation position calculation data. Therefore, this solution can effectively address focus shift problems caused by various non-scene-related factors, such as OIS shift, ambient temperature changes, or minor lens deformation, improving the real-time performance, accuracy, and stability of focusing. This dynamic focus position adjustment capability enables high-resolution images, significantly improving the image quality of photography. Furthermore, this solution also features a high degree of automation and intelligence, reducing the complexity of manual focus adjustment for users and improving shooting efficiency and user experience.

[0049] Figure 2 This is a flowchart illustrating a focus position adjustment method for determining a focus shift in a lens module, according to some embodiments of this disclosure. Figure 2 As shown, determining that the lens module has experienced a focus shift can include the following steps.

[0050] Step S210: Obtain the sensing information of the lens module.

[0051] In this embodiment of the disclosure, real-time sensing information can be obtained from the lens module. This sensing information can be data that characterizes changes in the lens module itself or its environment, such as temperature change data, vibration state, speed change, acceleration value, angle deflection amount, angle deflection speed, etc.

[0052] Step S220: Determine whether the preset conditions are met based on the sensor information, the actual focus position, and the quasi-focus position calculation data.

[0053] The preset conditions may include: the sensing information belongs to a first range threshold; the calculated focus position data meets the reliability condition; and the focus offset data between the actual focus position and the calculated focus position data belongs to a second range threshold.

[0054] In an exemplary embodiment, when the lens is in a state of slow focus shift after focusing ends, the data recorded by the sensor will show a small data change.

[0055] In this embodiment of the disclosure, the sensing information within the first range threshold can be matched with the sensing information of the "lens module under non-scene change". Therefore, determining whether the sensing information belongs to the first range threshold can be used to determine whether the lens module is in a specified type of focus shift state, that is, it can be used to determine whether the lens is in a slow focus shift state after the end of focusing.

[0056] In this embodiment of the disclosure, determining whether the calculated focus position data meets the reliability criteria ensures that the focus position data used for comparison and adjustment is accurate and reliable. This determination may involve checking the integrity, volatility, and consistency of the data, or comparing it with other reliable data sources.

[0057] In an exemplary embodiment, when the offset between the calculated value of the actual focus position and the near-focus position exceeds a threshold, the resulting photo will exhibit a noticeable out-of-focus effect. Therefore, in this embodiment, by determining whether the focus offset data falls within a second threshold range, it is possible to promptly detect whether the offset data has become large enough to cause out-of-focus photography, thereby triggering timely adjustments to the lens module's focus position.

[0058] Step S230: In response to the satisfaction of the preset condition, it is determined that the lens module has experienced a focus shift.

[0059] In this embodiment of the present disclosure, when the above-mentioned preset conditions are met, it can be responsively determined that the lens module has shifted its focus and trigger the subsequent focus position adjustment process.

[0060] The embodiments disclosed herein provide an accurate and multi-dimensional determination method for complex and ever-changing shooting environments, which can accurately identify and handle the focus shift problem of lens modules, thereby improving the overall performance and stability of photography and video equipment.

[0061] In an exemplary embodiment, after the lens module finishes focusing, it can continuously record sensing information and continuously acquire focus position calculation data. Determining whether a preset condition is met based on the sensing information, the actual focus position, and the focus position calculation data can be as follows:

[0062] During the period from the end of focusing to the current moment, it is determined whether the accumulated sensor information has exceeded the first time period and is within the first range threshold. If so, it is determined whether the accumulated focus position calculation data has exceeded the second time period and meets the confidence condition. If so, it is determined whether the accumulated focus shift data has exceeded the third time period and is within the second range threshold. If the determination result is still "yes", it is determined that the preset condition has been met, and it can be determined that the lens module has shifted focus, which can trigger the subsequent focus position adjustment process.

[0063] In an exemplary embodiment, the first duration, the second duration, and the third duration can decrease sequentially.

[0064] Figure 3 This is a flowchart illustrating yet another focus position adjustment method according to some embodiments of the present disclosure, such as... Figure 3 As shown, the focus position adjustment method may include the following steps.

[0065] Step S310: In response to the end of focusing of the lens module, the actual focusing position, the calculated focusing position, and the sensing information of the lens module are obtained.

[0066] Step S320: Determine whether preset conditions are met based on the sensor information, the actual focus position, and the calculated data of the near-focus position; wherein the preset conditions include: the sensor information belongs to a first range threshold; the calculated data of the near-focus position meets the confidence condition; and the focus offset data between the actual focus position and the calculated data of the near-focus position belongs to a second range threshold.

[0067] Step S330: If the preset conditions are met, it is determined that the lens module has experienced a focus shift.

[0068] Step S340: Adjust the actual focus position of the lens module according to the focus position calculation data.

[0069] The specific implementation methods for each of the above steps have been described in detail in the relevant embodiments, and will not be elaborated here.

[0070] In some embodiments of this disclosure, the sensing information includes gyroscope acceleration; wherein, the sensing information belongs to a range threshold, including: the gyroscope acceleration is less than the acceleration threshold.

[0071] In this embodiment of the disclosure, the gyroscope acceleration may include acceleration information in the x, y, and z axes. A gyroscope acceleration less than an acceleration threshold can be defined as follows: the angular velocity information in each axis direction is less than the acceleration threshold, or the sum of the acceleration vectors in the three axes is less than the acceleration threshold.

[0072] In an exemplary embodiment, the acceleration threshold can be set relatively small to distinguish focus shifts not caused by scene changes. The acceleration threshold can be set based on actual measurement results; for example, it can be set to values ​​such as 5, 6, or 7.

[0073] Through the embodiments of this disclosure, data recorded by a sensor such as a gyroscope can be used as sensing information and combined with a preset acceleration threshold for judgment. This enables accurate identification of the focus shift of the lens module and timely adjustment measures to improve the accuracy and stability of focusing.

[0074] In some embodiments of this disclosure, the focus position calculation data includes focus position calculation values ​​at multiple times; wherein, the focus position calculation data satisfies confidence conditions, including: the confidence level of each focus position calculation value is greater than a confidence level threshold; and the variance of the focus position calculation values ​​at multiple times is less than a variance threshold.

[0075] In this embodiment, the calculated focus position value can be the value output by the algorithm provided by the chip platform (such as the MTK platform or Qualcomm platform). Along with obtaining each individual calculated focus position value, an associated confidence value can also be obtained. The confidence value indicates the probability that the calculated focus position value accurately reflects the true focus position. When this confidence value is higher than a confidence threshold, the calculated focus position value can be considered reliable.

[0076] Furthermore, variance is a statistic that measures the degree of difference between data points. In this embodiment of the disclosure, the variance of the calculated focus position values ​​at multiple times can be used to assess whether the calculated focus position values ​​at different times are close enough to indicate that they may all be describing the same true focus position. If the variance is less than a variance threshold, the consistency and stability among these data points can be considered good, thereby increasing the confidence in these calculated focus position values.

[0077] This disclosure introduces information on the multi-time-time focus position calculation value, and combines confidence threshold and variance threshold to determine the credibility condition, thereby more accurately filtering out reliable focus position calculation data, thus improving the focusing accuracy and stability.

[0078] In an exemplary embodiment, the confidence threshold and variance threshold can be determined based on the measured results. For example, if the confidence range of the calculated focus position is (0-100), the confidence threshold can be set to values ​​such as 30, 50, or 60. Furthermore, the variance threshold can be set to values ​​such as 4 or 5.

[0079] In some embodiments of this disclosure, the focus position calculation data includes multiple focus position calculation values ​​at various times; the focus offset data includes multiple focus offsets determined based on the actual focus position and the focus position calculation values ​​at various times; wherein the focus offset data between the actual focus position and the focus position calculation data belongs to a second range threshold, including: each focus offset is greater than the offset threshold.

[0080] In this embodiment, the focus offset at multiple moments can be determined by first calculating the values ​​based on the actual focus position and the focus position at multiple moments, and then determining the relationship between each focus offset and an offset threshold. The offset threshold can be used to assess the severity of the focus offset. When the focus offset exceeds the offset threshold, it means that the lens module has a significant focus offset problem, and the photo may have a blurry effect, requiring timely adjustment of the focus position.

[0081] In an exemplary embodiment, the focus offset is the distance the lens needs to move driven by the motor. Since the distance the lens moves is linearly related to the motor's drive current, and the magnitude of the drive current is controlled by the output value of the DAC (Digital to Analog Converter), the DAC value can be used as the unit when describing data related to the lens focus position (including focus offset, actual focus position, and calculated focus position). The effective actual stroke of the motor can be quantized into an integer (0-1024) to facilitate data transmission in the software system.

[0082] In an exemplary embodiment, the offset threshold can be determined based on actual test results. For example, it can be set based on whether or not a blurry photo easily noticeable to the user will be taken. For example, the offset threshold can be set to 3 to 5 DAC.

[0083] This disclosure allows for the introduction of multi-moment focus shift data, which, combined with a focus shift threshold, enables range threshold determination. This allows for more accurate identification of focus shift issues in the lens module during focusing and timely adjustment measures. This approach not only improves focusing accuracy and stability but also enhances the adaptability and reliability of photographic and video equipment in various scenarios.

[0084] In some embodiments of this disclosure, the focus position calculation data includes focus position calculation values ​​at a first number of time points; the focus offset data includes: a focus offset amount at a second number of time points determined based on the actual focus position and the focus position calculation values ​​at a second number of time points; wherein the focus position calculation values ​​at the second number of time points are at least a portion of the focus position calculation values ​​at the first number of time points.

[0085] In this embodiment of the disclosure, the second quantity is less than the first quantity, and the multiple moments corresponding to the focus offset are included in the multiple moments corresponding to the calculated focus position. Since the calculated focus position at the first quantity of moments can meet the reliability condition, it can be guaranteed that the focus offset used is reliable when determining the range of focus offset.

[0086] The present invention improves the accuracy of focus offset calculation, thereby improving the accuracy of determining whether preset conditions are met, and providing a reliable basis for subsequent focus position adjustment.

[0087] Figure 4 This is a flowchart illustrating yet another method for adjusting the focus position according to some embodiments of the present disclosure.

[0088] In this embodiment of the disclosure, Figure 4 In the focus position adjustment method shown, step S410 and... Figure 1 The steps corresponding to S110 in the focus position adjustment method shown will not be repeated here.

[0089] In this embodiment of the disclosure, Figure 1 Based on the focus position adjustment method shown, Figure 4 The focus position adjustment method shown may also include the following steps.

[0090] Step S420: In response to determining that the lens module has experienced a focus shift, the target focus position is determined based on the focus position calculation data.

[0091] In this embodiment of the disclosure, the focus position calculation data can be analyzed and compared to find the optimal focus position that best matches the current shooting scene. This optimal focus position is the target focus position, which is the position that the lens module should be adjusted to ensure that a clear and sharp image is captured.

[0092] In an exemplary embodiment, the focus position calculation data may include focus position calculation values ​​at multiple times. The average of these multiple focus position calculation values ​​may be used as the target focus position, or the value that appears most frequently among these multiple focus position calculation values ​​may be used as the target focus position, or the value at the most recent time among these multiple focus position calculation values ​​may be used as the target focus position.

[0093] Step S430: According to the preset step value, the actual focus position of the lens module is adjusted to the target focus position in a stepwise manner.

[0094] In this embodiment, a step-by-step adjustment method can be used to adjust the focus position, that is, adjusting by a preset step value each time. The size of this step value can be preset according to the performance of the lens module, the focusing speed, and the shooting requirements, or adjusted according to the actual situation to find the best balance between adjustment speed and accuracy.

[0095] In an exemplary embodiment, the step value can be set to a value close to the offset threshold. For example, the step value can be set to 5 to determine the time when adjustment is needed as frame 0. Assuming the actual focus position in frame 0 is 100 and the target focus position is 120, then the actual focus position can be adjusted from 100 to 105 in frame 1, from 105 to 110 in frame 2, from 110 to 115 in frame 3, and from 115 to the target focus position of 120 in frame 4. Thus, the focus position adjustment is completed.

[0096] The present disclosure provides a step-by-step adjustment method to ensure that the lens module does not suddenly jump to the target position during the adjustment process, but gradually approaches the target position in a smooth and stable manner. This helps to reduce vibration and noise during the focusing process and can improve the accuracy and stability of focusing.

[0097] In some embodiments of this disclosure, the focus position adjustment method further includes: stopping the adjustment of the actual focus position of the lens module in response to a preset time elapsed since the lens module finished focusing.

[0098] In an exemplary embodiment, the amount of focus shift (i.e., focus shift) that occurs slowly after the lens has finished focusing is limited, so the duration for detecting focus shift and the duration for adjustment can be limited to a certain range.

[0099] Based on this, in this embodiment of the disclosure, the time point at which the lens module finishes focusing can be recorded. Within a preset time period after this time point, the focus shift detection and focus position adjustment are performed. After this time period, focus shift detection can be stopped to avoid continuous computing power consumption and hardware adjustments.

[0100] In an exemplary embodiment, the preset duration can be set with reference to the time from the end of focusing to the user taking a picture and the actual offset in actual testing. For example, the preset duration can be set by adding the offset Δois_shift of the parameter ois. If Δois_shift is greater than the threshold, the preset duration can be set to about 60 (frames). If Δois_shift is less than or equal to the threshold, the preset duration can be set to a value greater than 60 (frames).

[0101] Through the embodiments of the present disclosure, a preset duration can be set to limit the time for focus shift detection and fine-tuning of the focus position. While ensuring the timeliness and effectiveness of focus position adjustment, continuous computing power consumption and hardware adjustment can be avoided, thereby optimizing resource utilization.

[0102] Figure 5 It is a schematic diagram of focus position adjustment in a focus position adjustment method shown according to some embodiments of the present disclosure.

[0103] As Figure 5 shown, the horizontal axis is the time axis, and the vertical axis is the DAC value (digital-to-analog conversion value, representing the lens focus position). Among them, the dotted line is formed by connecting the calculated values of the quasi-focus positions at multiple moments, and the solid line is the actual focus position of the lens module. The moment t1 is the moment when the focus adjustment ends, and the moment t6 is the moment when the preset duration is reached from the moment t1.

[0104] Referring to Figure 5 , between the moment t1 and the moment t2, focus shift detection is performed on the lens module, and it is determined at the moment t2 that the lens module has a focus shift. Therefore, the focus position is adjusted between the moment t2 and the moment t3; between the subsequent moment t3 and the moment t4, focus shift detection is performed again, and it is determined at the moment t4 that the lens module has a focus shift. Therefore, the focus position is adjusted between the moment t4 and the moment t5; between the moment t5 and the moment t6, no focus shift of the lens module is detected again, so the focus position is not adjusted again.

[0105] In addition, referring to Figure 5 , it can be seen that at the moment t6, the actual focus position of the lens module is very close to the calculated value of the quasi-focus position, and at this time, taking a photo will not generate a defocused photo.

[0106] In an exemplary embodiment, the focus position adjustment method may include the following steps.

[0107] In the first step, use fn to record the number of frames from the end of focus adjustment, and use m (frames) to represent the preset duration, which is used to limit the time range for focus shift detection (detecting whether it is in the state of quasi-focus shift).

[0108] In the second step, determine whether the following event occurs: gyro < thr1 for consecutive fn frames; where gyro is the sum of the acceleration vectors in the three-axis directions recorded by the gyroscope, and thr1 is the acceleration threshold.

[0109] Through this step, the situation of quasi-focus position shift caused only by ois shift or temperature drift can be filtered out.

[0110] If the judgment result is "yes", the judgment of the next step can be continued.

[0111] In the third step, it is judged whether the following event occurs: for n consecutive frames, PD conf > thr2 and PD variance < thr3, where PD conf and PD variance are the information messages output by the platform algorithm. PD conf represents the confidence level of the calculated value of the focus position output by pd (Phase Detection), and pd variance represents the stability (i.e., variance) of the calculated values of the focus position for n consecutive frames. Thr2 is the confidence threshold, and thr3 is the variance threshold.

[0112] In this step, if the calculated values of the focus position satisfy these two conditions, it indicates that the calculated values of the focus position obtained at this time are accurate and can be further used to compare and judge whether the current actual focusing position deviates from the focus point (i.e., the calculated value of the focus position). Here, n is less than m, and in this step, the frames from the (fn - n + 1)-th frame to the fn-th frame, a total of n frames, can be taken for judgment.

[0113] If the judgment result is "yes", the judgment of the next step can be continued.

[0114] In the fourth step, it is judged whether the following event occurs: for p consecutive frames, |PD target – cur position| > thr4, where PD target is the calculated value of the focus position, cur position is the actual focusing position, and thr4 is the offset threshold. Here, p is less than n, and in this step, the frames from the (fn - p + 1)-th frame to the fn-th frame, a total of p frames, can be taken for judgment.

[0115] In this step, if this condition is satisfied, it indicates that the focus point is in a slow offset state at this time, and a large offset will cause defocus. At this time, the actual focusing position of the lens module can be adjusted, and the moving step (i.e., the stepping value) can be set to thr4. Usually, thr4 can be set relatively small (3 - 5 DAC) to avoid unstable motor movement steps caused by too large thr4 setting and defocus of the photo due to failure to adjust the focusing position in time.

[0116] It should be noted that the above-mentioned drawings are only schematic illustrations of the processes included in the methods according to some embodiments of the present disclosure, rather than for restrictive purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.

[0117] The following is an embodiment of the apparatus of the present disclosure, which can be used to execute the embodiment of the method of the present disclosure. For the details not disclosed in the embodiment of the apparatus of the present disclosure, please refer to the embodiment of the method of the present disclosure.

[0118] Figure 6 This is a block diagram illustrating a focus position adjustment device according to some embodiments of the present disclosure. (Refer to...) Figure 6 The device includes: an acquisition unit 601, a focus adjustment unit 602, and an offset determination unit 603.

[0119] The acquisition unit 601 is used to acquire the actual focus position and the calculated focus position of the lens module in response to the end of focusing of the lens module; the focus adjustment unit 602 is used to adjust the actual focus position of the lens module according to the calculated focus position data in response to determining that the lens module has shifted focus.

[0120] In some embodiments of this disclosure, the acquisition unit 601 is further configured to acquire the sensing information of the lens module; the offset determination unit 603 is configured to: determine whether a preset condition is met based on the sensing information, the actual focus position, and the calculated data of the quasi-focus position; and determine that the lens module has experienced a focus shift in response to meeting the preset condition; wherein the preset condition includes: the sensing information belongs to a first range threshold; the calculated data of the quasi-focus position meets a confidence condition; and the focus shift data between the actual focus position and the calculated data of the quasi-focus position belongs to a second range threshold.

[0121] In some embodiments of this disclosure, the sensing information includes gyroscope acceleration; wherein, the sensing information belongs to a range threshold, including: the gyroscope acceleration is less than the acceleration threshold.

[0122] In some embodiments of this disclosure, the focus position calculation data includes focus position calculation values ​​at multiple times; wherein, the focus position calculation data satisfies confidence conditions, including: the confidence level of each focus position calculation value is greater than a confidence level threshold; and the variance of the focus position calculation values ​​at multiple times is less than a variance threshold.

[0123] In some embodiments of this disclosure, the focus position calculation data includes multiple focus position calculation values ​​at various times; the focus offset data includes multiple focus offsets determined based on the actual focus position and the focus position calculation values ​​at various times; wherein the focus offset data between the actual focus position and the focus position calculation data belongs to a second range threshold, including: each focus offset is greater than the offset threshold.

[0124] In some embodiments of this disclosure, the focus position calculation data includes focus position calculation values ​​at a first number of time points; the focus offset data includes: a focus offset amount at a second number of time points determined based on the actual focus position and the focus position calculation values ​​at a second number of time points; wherein the focus position calculation values ​​at the second number of time points are at least a portion of the focus position calculation values ​​at the first number of time points.

[0125] In some embodiments of this disclosure, the focus adjustment unit 602 adjusts the actual focus position of the lens module according to the focus position calculation data, including: determining the target focus position according to the focus position calculation data; and adjusting the actual focus position of the lens module to the target focus position in steps according to a preset step value.

[0126] In some embodiments of this disclosure, the focus adjustment unit 602 is further configured to: stop adjusting the actual focus position of the lens module in response to a preset time elapsed since the lens module finished focusing.

[0127] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0128] Figure 7 This is a block diagram illustrating a device 700 for adjusting focus position according to some embodiments of the present disclosure. For example, device 700 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0129] Reference Figure 7 The device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.

[0130] Processing component 702 typically controls the overall operation of device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.

[0131] Memory 704 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0132] The power supply component 706 provides power to the various components of the device 700. The power supply component 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 700.

[0133] Multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0134] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.

[0135] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0136] Sensor assembly 714 includes one or more sensors for providing status assessments of various aspects of device 700. For example, sensor assembly 714 may detect the on / off state of device 700, the relative positioning of components such as the display and keypad of device 700, changes in the position of device 700 or a component of device 700, the presence or absence of user contact with device 700, the orientation or acceleration / deceleration of device 700, and temperature changes of device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0137] Communication component 716 is configured to facilitate wired or wireless communication between device 700 and other devices. Device 700 can access wireless networks based on communication standards, such as WiFi, 3G, 4G, 5G, other communication standards, or combinations thereof. In some embodiments of this disclosure, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In some embodiments of this disclosure, communication component 716 further includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0138] In some embodiments of this disclosure, the apparatus 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0139] In some embodiments of this disclosure, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of device 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0140] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to perform a focus position adjustment method, the method comprising: in response to the end of focusing of a lens module, acquiring actual focus position and collimation position calculation data of the lens module; and in response to determining that the lens module has experienced a focus shift, adjusting the actual focus position of the lens module according to the collimation position calculation data.

[0141] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0142] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for adjusting the focus position, characterized in that, include: In response to the end of focusing of the lens module, the actual focusing position and collimation position calculation data of the lens module are obtained; In response to determining that the lens module has experienced a focus shift, the actual focus position of the lens module is adjusted based on the focus position calculation data.

2. The method according to claim 1, characterized in that, Determining that the lens module has experienced a focus shift includes: Acquire the sensing information of the lens module; Based on the sensor information, the actual focus position, and the near-focus position, the data is calculated to determine whether the preset conditions are met. In response to the fulfillment of the preset condition, it is determined that the lens module has experienced a focus shift; The preset conditions include: The sensing information belongs to the first range threshold; The calculated quasi-focus position data meets the reliability criteria; The focus offset data between the actual focus position and the calculated focus position falls within the second range threshold.

3. The method according to claim 2, characterized in that, The sensing information includes gyroscope acceleration; wherein, the sensing information belongs to a range threshold, including: The gyroscope acceleration is less than the acceleration threshold.

4. The method according to claim 2, characterized in that, The focus position calculation data includes focus position calculation values ​​at multiple times; The calculated focus position data satisfies certain reliability conditions, including: The confidence level of the calculated value at each focus position is greater than the confidence threshold; The variance of the calculated focus position values ​​at the multiple times is less than the variance threshold.

5. The method according to claim 2, characterized in that, The focus position calculation data includes focus position calculation values ​​at multiple times; The focus offset data includes: focus offsets at multiple moments, calculated based on the actual focus position and the focus position at each moment; Wherein, the focus offset data between the actual focus position and the calculated focus position belongs to the second range threshold, including: Each focus offset is greater than the offset threshold.

6. The method according to claim 2, characterized in that, The focus position calculation data includes the focus position calculation value at the first number of time points; The focus offset data includes: the focus offset amount at the second number of times, determined based on the calculated value of the actual focus position and the focus position at the second number of times; Wherein, the calculated value of the collimation position at the second number of time moments is at least a portion of the calculated value of the collimation position at the first number of time moments.

7. The method according to claim 1, characterized in that, Adjusting the actual focus position of the lens module based on the calculated focus position data includes: The target focus position is determined based on the data calculated from the aforementioned focus position. Based on a preset step value, the actual focus position of the lens module is adjusted stepwise to the target focus position.

8. The method according to claim 1, characterized in that, The method further includes: In response to the preset time elapsed since the lens module finished focusing, the adjustment of the actual focus position of the lens module is stopped.

9. A focus position adjustment device, characterized in that, include: The acquisition unit is used to acquire the actual focus position and collimation position calculation data of the lens module in response to the end of lens module focusing; A focus adjustment unit is used to adjust the actual focus position of the lens module based on the focus position calculation data in response to determining that the lens module has experienced a focus shift.

10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the steps of the method according to any one of claims 1-8.

11. A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform a focus position adjustment method, the method comprising: In response to the end of focusing of the lens module, the actual focusing position and collimation position calculation data of the lens module are obtained; In response to determining that the lens module has experienced a focus shift, the actual focus position of the lens module is adjusted based on the focus position calculation data.