A lens focusing method and device, storage medium and electronic device

CN117395506BActive Publication Date: 2026-09-08ANKER INNOVATIONS TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210759096.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2026-09-08
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

[0003]本申请实施例提供了一种镜头对焦方法、装置、存储介质及电子设备,可以通过获取镜头相对于初始姿态的变化角度,结合初始姿态时的初始角度和初始姿势差计算移动镜头所需的驱动电流实现镜头对焦,克服重力影响像距的问题,提高输出图像的清晰度

Benefits of technology

[0044] Thirdly, embodiments of this application provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and to execute the above-described method steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117395506B_ABST
    Figure CN117395506B_ABST
Patent Text Reader

Abstract

The application discloses a lens focusing method and device, a storage medium and an electronic device. The method comprises the following steps: when it is detected that a camera lens is in a target posture, the change angle of the lens from an initial posture to the target posture is obtained; based on initial data and the change angle, a first driving current corresponding to the target posture is obtained; and the lens is focused based on the first driving current, wherein the initial data is data corresponding to the initial posture of the lens, and the initial data comprises an initial angle and an initial posture difference corresponding to the initial posture. According to the application, the change angle of the lens relative to the initial posture is obtained, the initial angle and the initial posture difference at the initial posture are combined to calculate the driving current required for moving the lens to realize lens focusing, the problem of gravity affecting the image distance is overcome, and the definition of the output image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera focusing technology, and in particular to a lens focusing method, device, storage medium and electronic device. Background Technology

[0002] Camera devices need to focus their lenses to output clearer images. In existing technologies, camera devices measure the distance between the lens and the object and then calculate the distance the lens needs to move to focus. However, when the lens rotates up or down, its position changes due to gravity, which alters the image distance and blurs the output image. Therefore, a lens focusing method is needed to make the output image of the camera device clearer. Summary of the Invention

[0003] This application provides a lens focusing method, apparatus, storage medium, and electronic device. By acquiring the angle change of the lens relative to its initial orientation, and combining this with the initial angle and initial orientation difference at the initial orientation, the driving current required to move the lens is calculated to achieve lens focusing. This overcomes the problem of gravity affecting image distance and improves the clarity of the output image. The technical solution is as follows:

[0004] In a first aspect, embodiments of this application provide a lens focusing method, the method comprising:

[0005] When the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is obtained;

[0006] Based on the initial data and the changing angle, the first driving current corresponding to the target attitude is obtained;

[0007] The lens is focused based on the first driving current;

[0008] The initial data refers to the data corresponding to the lens being in the initial posture, and the initial data includes the initial angle and the initial posture difference corresponding to the initial posture.

[0009] Based on the above embodiments, by obtaining the change angle of the lens relative to the initial posture, and combining the initial angle and the initial posture difference at the initial posture, the driving current required to move the lens is calculated, thereby achieving lens focusing, overcoming the problem of gravity affecting image distance, and improving the clarity of the output image.

[0010] Optionally, before obtaining the angle of change of the lens from its initial posture to the target posture when the camera lens is detected to be in the target posture, the method further includes:

[0011] When the camera device is detected to be started for the first time, the initial orientation of the lens of the camera device is obtained so that the output image of the camera device meets the maximum resolution.

[0012] Obtain the initial drive current required for the lens to move to the initial posture, obtain the initial angle corresponding to the initial posture, and obtain the initial posture difference of the lens.

[0013] Based on the above embodiments, initial data corresponding to the initial posture during the first startup is obtained, and the first driving current is calculated using the initial data to complete the focusing process, thereby improving the focusing efficiency of the camera device.

[0014] Optionally, the focusing process of the lens based on the first driving current includes:

[0015] The lens is moved to the first position according to the first driving current.

[0016] Based on the above embodiments, the lens is moved to the first position by using the first driving current, which improves the efficiency and accuracy of the focusing process.

[0017] Optionally, the method further includes:

[0018] The lens is adjusted by moving it from the first position to the second position, whereby the output image of the camera device achieves maximum clarity.

[0019] Based on the above embodiments, while using the first driving current for focusing, the lens is further fine-tuned until the output image meets the maximum sharpness at a second position, thereby improving the sharpness of the output image while increasing the focusing speed of the camera device.

[0020] Optionally, the method further includes:

[0021] Obtain the second driving current corresponding to the lens being in the second position;

[0022] The initial angle and the initial posture difference are corrected based on the second driving current.

[0023] Based on the above embodiments, the initial angle and initial posture difference are corrected by the second driving current, enabling the camera device to acquire more accurate initial data during use, thereby further improving the focusing efficiency and accuracy of the camera device.

[0024] Optionally, the step of correcting the initial angle and the initial attitude difference based on the second driving current includes:

[0025] Obtain correction processing instructions;

[0026] If the correction processing instruction corresponds to the initial angle, then the initial angle is corrected based on the second drive current;

[0027] If the correction processing instruction corresponds to the initial posture difference, then the initial posture difference is corrected based on the second drive current.

[0028] Based on the above embodiments, and based on the principle of controlling variables, only one of the data, the initial angle and the initial pose difference, is corrected at a time, which improves the learning efficiency of the lens focusing device.

[0029] Optionally, the step of correcting the initial attitude difference based on the second driving current includes:

[0030] The average pose difference corresponding to the lens is obtained, and the corrected pose difference is calculated based on the second driving current and the initial pose difference;

[0031] If the difference between the corrected pose difference and the average pose difference is less than or equal to the correction threshold, then the initial pose difference is corrected based on the corrected pose difference.

[0032] Based on the above embodiments, the initial pose difference is corrected only if the difference between the corrected pose difference and the average pose difference is less than the correction threshold, thus ensuring the accuracy of the corrected pose difference data.

[0033] Optionally, the method further includes:

[0034] If the difference between the corrected posture difference and the average posture difference is greater than the correction threshold, the corrected posture difference is discarded, and the initial angle is corrected based on the second driving current.

[0035] Based on the above embodiments, if the difference between the corrected pose difference and the average pose difference is too large, the initial pose difference will not be corrected, and the data with excessive error will be discarded, thereby further improving the accuracy of lens focusing.

[0036] Optionally, the step of correcting the initial angle and the initial attitude difference based on the second driving current includes:

[0037] If neither the initial angle nor the initial posture difference has been corrected, then the initial angle is corrected based on the second driving current.

[0038] Based on the above embodiments, since the error of the initial angle has a greater impact than the error of the initial posture difference, the initial angle is corrected for the first time, which further improves the accuracy of lens focusing.

[0039] Secondly, embodiments of this application provide a lens focusing device, the device comprising:

[0040] An angle acquisition module is used to acquire the angle of change of the lens from the initial posture to the target posture when the camera lens is detected to be in the target posture.

[0041] The current acquisition module is used to acquire the first driving current corresponding to the target attitude based on the initial data and the changing angle;

[0042] A focusing processing module is used to focus the lens based on the first driving current;

[0043] The initial data refers to the data corresponding to the lens being in the initial posture, and the initial data includes the initial angle and the initial posture difference corresponding to the initial posture.

[0044] Thirdly, embodiments of this application provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and to execute the above-described method steps.

[0045] In one or more embodiments of this application, when the camera lens is detected to be in a target posture, the angle of change of the lens from the initial posture to the target posture is obtained. Based on the initial data and the angle of change, a first driving current corresponding to the target posture is obtained. The lens is then focused based on the first driving current. The initial data refers to the data corresponding to the lens in the initial posture, including the initial angle and the initial posture difference. By obtaining the angle of change of the lens relative to the initial posture, and combining the initial angle and the initial posture difference at the initial posture, the driving current required to move the lens is calculated, thereby achieving lens focusing. This overcomes the problem of gravity affecting image distance and improves the clarity of the output image. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is an example schematic diagram of lens rotation provided in an embodiment of this application;

[0048] Figure 2 This is a schematic flowchart of a lens focusing method provided in an embodiment of this application;

[0049] Figure 3This is a schematic flowchart of a lens focusing method provided in an embodiment of this application;

[0050] Figure 4 This is a schematic diagram of the structure of a lens focusing device provided in an embodiment of this application;

[0051] Figure 5 This is a schematic diagram of the structure of a lens focusing device provided in an embodiment of this application;

[0052] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] The lens focusing device in this application embodiment can be a camera device or a module within a camera device used to implement a lens focusing method. The lens focusing device can control the movement of the camera device's lens to achieve focusing, resulting in a clear image output by the camera device. It is understood that the camera focusing device can use a voice coil motor (VCM) to adjust the camera device's lens. The main principle of a VCM motor is that within a permanent magnetic field, by changing the magnitude of the driving current of the coil inside the motor, the tension position of a spring sheet is controlled, thereby driving its up-and-down movement. The camera focusing device can adjust the tension position of the spring sheet by adjusting the magnitude of the driving current, thereby adjusting the position of the lens connected to the spring sheet, achieving lens focusing. Please refer to [link to relevant documentation]. Figure 1 This embodiment of the application provides an example of lens rotation. When the camera device is in a horizontal state, i.e., the angle between the lens and the horizontal line is 0°, focusing on an object at a certain distance, the lens focusing device can use a certain driving current to move the lens a distance D1, enabling the lens to focus and the camera device to output a clear image. If the camera device lens changes its posture and rotates by a certain angle, creating an angle between the lens and the horizontal line, but still using the same driving current to move the lens, the distance the lens moves is D2. Because the lens's own weight will exert a certain force on the spring plate of the VCM motor, D2 is not the same as D1, and the camera device cannot output a clear image. Figure 1 As shown, if the lens rotates upward, it will exert a certain pressure on the spring plate, and D2 will be less than D1. It can be understood that if the lens rotates downward, it will exert a certain pulling force on the spring plate, and D2 will be greater than D1.

[0055] The lens focusing device can acquire initial data of the lens in its initial posture. The initial state is the state when the camera device can output an image with maximum resolution after its first startup. Initial data can include the initial angle and initial posture deviation corresponding to the initial state. The initial angle is the angle between the lens and the horizontal line in the initial posture, and the initial posture deviation is the posture deviation (Posture Deviation) of the lens in the initial posture. The lens posture deviation is the absolute value of the difference between the distance the lens moves when focusing on an object at the same distance and when the angle between the lens and the horizontal line is 90° and the angle is 0°. For example... Figure 1 In the diagram, when the lens is at a 0° angle to the horizontal, the distance the lens needs to move to focus is D1. When the lens is at a 90° angle to the horizontal, the distance the lens needs to move to focus on an object at the same distance is D3. The absolute value of the difference between D1 and D3 is the pose difference. Initial data may also include the initial drive current required when the lens is in the target state.

[0056] Understandably, several lenses of the same model and batch as the camera equipment's lens can be obtained, their pose differences can be measured, and the average pose difference of these lenses can be calculated to obtain the average pose difference. The lens focusing device can set the initial pose difference of the lens to the average pose difference value when the camera equipment is first started.

[0057] Understandably, a lens focusing device can focus the lens to ensure that the output image of the camera meets the maximum sharpness requirement. The output image is the image that the camera can capture. During the focusing process, the lens focusing device can move the lens, and the sharpness of the output image of the camera will also change. The maximum sharpness is the maximum sharpness that the output image can achieve during the focusing process.

[0058] The lens focusing method provided in this application will be described in detail below with reference to specific embodiments.

[0059] Please see Figure 2 This is a schematic flowchart illustrating a lens focusing method provided in an embodiment of this application. Figure 2 As shown, the method described in this application embodiment may include the following steps S101-S103.

[0060] S101, when the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is obtained.

[0061] Specifically, when the lens focusing device detects that the camera lens is in the target posture, it can obtain the angle of rotation of the lens from the initial posture to the target posture. The target posture is any posture in which the camera can capture a stable image. When using the camera, the user moves the camera to find a suitable shooting position. Once the user finds a suitable shooting position to capture an object, they stop moving the camera. At this point, the camera can capture a stable image, and the lens focusing device confirms that the camera lens is in the target posture. The angle of rotation is the difference between the angle between the lens and the horizontal line in the initial state and the angle between the lens and the horizontal line in the target state. The lens focusing device can use image algorithms or neural networks to calculate the angle of rotation.

[0062] S102, based on the initial data and the changing angle, obtain the first driving current corresponding to the target attitude.

[0063] Specifically, the initial data refers to the data corresponding to the lens of the camera device in its initial posture. The initial data may include the initial angle and the initial posture difference at the initial posture. The lens focusing device can calculate the first driving current for controlling the movement of the lens based on the changing angle and the initial posture difference. For example, the lens focusing device can calculate the current difference between the first driving current required for focusing in the target posture and the initial driving current required for focusing in the initial posture. Based on the current difference and the initial driving current, the first driving current can be obtained.

[0064] S103 performs focusing on the lens based on the first driving current.

[0065] Specifically, the lens focusing device can control the VCM motor to move the lens according to the first drive current, so that the lens can focus and the output image of the camera device can meet the maximum sharpness. It is understandable that after moving the lens using the first drive current, the output image may not yet meet the maximum sharpness, and the drive current can be increased or decreased to fine-tune the lens position so that the output image meets the maximum sharpness.

[0066] In this embodiment, when the camera lens is detected to be in a target posture, the angle of change of the lens from the initial posture to the target posture is obtained. Based on the initial data and the angle of change, the first driving current corresponding to the target posture is obtained. The lens is then focused based on the first driving current. The initial data refers to the data corresponding to the lens in the initial posture, including the initial angle and the initial posture difference. By obtaining the angle of change of the lens relative to the initial posture, and combining the initial angle and the initial posture difference at the initial posture, the driving current required to move the lens is calculated, thus achieving lens focusing. This overcomes the problem of gravity affecting the distance and improves the clarity of the output image.

[0067] Please see Figure 3 This is a schematic flowchart illustrating a lens focusing method provided in an embodiment of this application. Figure 3 As shown, the method described in this application embodiment may include the following steps S201-S207.

[0068] S201, when the camera device is detected to be started for the first time, the initial orientation of the camera lens is obtained so that the output image of the camera device meets the maximum resolution;

[0069] Specifically, when the lens focusing device detects that the camera device is started for the first time, it can enable the lens of the camera device to focus on an object at a certain distance, and obtain the initial posture of the lens of the camera device when the output image of the camera device meets the maximum sharpness.

[0070] S202, obtain the initial drive current required for the lens to move to the initial posture, obtain the initial angle corresponding to the initial posture, and obtain the initial posture difference of the lens.

[0071] Specifically, the lens focusing device can acquire initial data corresponding to the lens in its initial posture. This initial data may include the initial drive current, initial angle, and initial pose difference corresponding to the initial posture. The lens focusing device can acquire the initial drive current required by the VCM motor to move the lens to the initial posture, and it can also acquire the initial angle corresponding to the lens in the initial posture. The initial angle can be the angle between the lens and the horizontal line in the initial posture. The lens focusing device can also directly set the initial angle to an initial value, such as 0°. This initial value can be the initial setting of the lens focusing device, or it can be set by the user or relevant personnel and saved in the lens focusing device.

[0072] The lens focusing device can also obtain the initial attitude difference of the lens. Understandably, the lens focusing device can set the value of the initial attitude difference to the value of the average attitude difference, which is the average of the attitude differences of several lenses of the same model and batch as the lens of the camera device.

[0073] S203, when the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is acquired.

[0074] Specifically, when the lens focusing device detects that the camera lens is in the target posture, it can obtain the angle of rotation of the lens from the initial posture to the target posture. The target posture is any posture in which the camera can capture a stable image. When using the camera, the user moves the camera to find a suitable shooting position. Once the user finds a suitable shooting position to capture an object, they stop moving the camera. At this point, the camera can capture a stable image, and the lens focusing device confirms that the camera lens is in the target posture. The angle of rotation is the difference between the angle between the lens and the horizontal line in the initial state and the angle between the lens and the horizontal line in the target state. The lens focusing device can use image algorithms or neural networks to calculate the angle of rotation.

[0075] S204: Based on the initial data and the changing angle, obtain the first driving current corresponding to the target attitude.

[0076] Specifically, the initial data refers to the data corresponding to the lens of the camera device in its initial posture. The initial data may include the initial angle and the initial posture difference at the initial posture. The lens focusing device can calculate the first driving current for controlling the movement of the lens based on the changing angle and the initial posture difference. For example, the lens focusing device can calculate the current difference between the first driving current required for focusing in the target posture and the initial driving current required for focusing in the initial posture. Based on the current difference and the initial driving current, the first driving current can be obtained.

[0077] Optionally, the initial drive current is C0, the initial pose difference is PD, the initial angle of the lens when it is in the initial pose is x, and the angle of change of the lens from the initial pose to the target pose is Δx. The formula for calculating the first drive current C1 is as follows:

[0078] C1 = C0 + PD × sin(x + Δx)

[0079] S205, control the lens to move to the first position according to the first driving current. Control the lens to move from the first position to the second position.

[0080] Specifically, the lens focusing device can use a first drive current to move the lens to a first position using the VCM motor. When the lens is in the first position, the output image may not yet meet the maximum sharpness requirement. It is understandable that the initial angle and initial pose difference obtained by the lens focusing device may have errors. The lens focusing device will correct the initial angle and initial pose difference in each lens use and focusing process, so that the initial angle and initial pose difference gradually become more accurate with the increase of use. Therefore, when the lens is in the first position calculated based on the initial angle and initial pose difference, the output image may not yet meet the maximum sharpness requirement. The lens focusing device can continue to increase or decrease the drive current to adjust the lens position.

[0081] S206 adjusts the lens, controlling it to move from the first position to the second position.

[0082] Specifically, the lens focusing device can adjust the lens, controlling it to move from a first position to a second position. The second position is the position where the output image of the camera device achieves maximum sharpness. The adjustment process can involve repeatedly increasing or decreasing the drive current until the second position that results in maximum sharpness for the output image is found.

[0083] S207, acquire the second driving current corresponding to the second position of the lens, and perform correction processing on the initial angle and initial posture difference based on the second driving current.

[0084] Specifically, the lens focusing device can obtain the second drive current required when the VCM motor controls the lens to move to the second position, and correct the initial angle and initial posture difference based on the second drive current and the changed angle.

[0085] Optionally, the initial driving current is C0, the first driving current is C1, the second driving current is C2, the initial pose difference is PD, the initial angle of the lens when it is in the initial pose is x, and the angle of change of the lens from the initial pose to the target pose is Δx. The difference between the pose difference required to achieve maximum sharpness of the output image under the second driving current and the initial pose difference can be calculated, i.e., the corrected pose difference. The corrected pose difference PD1 can be obtained according to the following formula:

[0086]

[0087] The lens focusing device can correct the initial attitude difference based on the corrected attitude difference PD1 to obtain the corrected initial attitude difference, as shown in the following formula:

[0088] PD = PD + a × PD1

[0089] Here, 'a' is a standard factor, which can represent the learning rate in machine learning. It is a parameter in machine learning statistics. It can be understood that a∈[0,1]. The larger the value of a, the faster the lens focusing device learns the pose difference, but the less accurate the value obtained. Conversely, the smaller the value of a, the slower the lens focusing device learns, but the more accurate the value obtained.

[0090] It is understandable that the initial angle obtained by the lens focusing device in the initial state may not be accurate due to factors such as measuring tools. The lens focusing device can calculate the difference between the accurate initial angle and the current initial angle based on the second driving current, i.e., the correction angle. The correction angle x1 can be obtained using the following formula:

[0091]

[0092] The lens focusing device can correct the initial angle based on the desired initial angle x1 to obtain the corrected initial angle, as shown in the following formula:

[0093] x=x+a×x1

[0094] Optionally, the lens focusing device can simultaneously correct the initial angle and the initial pose difference based on the second driving current. However, for the sake of controlling variables, it is more beneficial for the lens focusing device to learn by correcting only one data point at a time. That is, the lens focusing device can correct either the initial angle or the initial pose difference based solely on the second driving current. After obtaining the second driving current, the lens focusing device can obtain a correction processing command. The correction processing command instructs the lens focusing device to correct either the initial angle or the initial pose difference. If the correction processing command corresponds to the initial angle, the lens focusing device corrects the initial angle based on the second driving current without changing the initial pose difference; if the correction processing command corresponds to the initial pose difference, the lens focusing device corrects the initial pose difference based on the second driving current without changing the initial angle.

[0095] Optionally, the correction instruction can be issued by relevant personnel on the lens focusing device, who can then control whether the correction is applied to the initial angle or the initial pose difference. Alternatively, the correction instruction can be automatically generated by the lens focusing device. The focusing device can acquire the object of the previous correction and generate the correction instruction based on that object. If the object of the previous correction was the initial angle, a correction instruction corresponding to the initial pose difference is generated; otherwise, a correction instruction corresponding to the initial angle is generated.

[0096] Optionally, the correction processing command can also be randomly generated by the lens focusing device. The lens focusing device can generate a random number 0 or 1. If the random number is 0, a correction processing command corresponding to the initial angle is generated. If the random number is 1, a correction processing command corresponding to the initial pose difference is generated.

[0097] Optionally, since the error of the initial angle may have a greater impact than the error of the initial pose difference, if the camera device is being corrected for the first time, that is, if neither the initial angle nor the initial pose difference has been corrected, the lens focusing device can correct the initial angle based on the second driving current without changing the initial pose difference.

[0098] Optionally, not all corrected pose differences calculated based on the second drive current are suitable for correcting the initial pose difference. If the corrected pose difference differs too much from the lens's average pose difference, it means the corrected pose difference differs too much from the actual measured pose difference data, and therefore it is not suitable for correcting the initial pose difference. Therefore, the lens focusing device can calculate the difference between the corrected pose difference and the average pose difference. If the difference is less than or equal to a correction threshold, the initial pose difference is corrected based on the corrected pose difference; if the difference is greater than the correction threshold, the calculated corrected pose difference is discarded, and the initial pose difference is not corrected using the second drive current. Instead, the initial angle is corrected using the second drive current. The correction threshold is used to determine whether the corrected pose difference needs to be used to correct the initial pose difference. The correction threshold can be an initial setting of the lens focusing device, or it can be set by relevant personnel and stored in the lens focusing device. For example, the value of the correction threshold can be set to the value of the initial pose difference.

[0099] It is understandable that the first object distance between the camera device and the object in the initial posture and the second object distance between the camera device and the object in the target posture can be the same. The lens focusing device can measure the initial data of the camera device under different first object distances. When the lens is in the target posture, the lens focusing device can obtain the second object distance between the camera device and the object, find the initial data corresponding to the first object distance that is the same as the second object distance, and perform focusing and correction processing on the camera device.

[0100] Optionally, the first object distance between the camera and the object in the initial posture and the second object distance between the camera and the object in the target posture can be different. When the lens is in the target posture, the lens focusing device can obtain the second object distance between the camera and the object, calculate the object distance difference between the second and first object distances, look up the corresponding compensation drive current in the object distance difference lookup table, and control the VCM motor to move the lens to complete the focusing process based on the compensation drive current. The object distance difference lookup table stores how much compensation drive current is required for the lens to achieve focusing under different object distance differences. The object distance difference lookup table is related to the physical characteristics of the lens itself and can be obtained by testing several lenses of the same model and batch, or it can be obtained from the lens manufacturer.

[0101] In this embodiment, when the camera device is first started, initial data in the initial posture is acquired. When the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is acquired. Based on the initial data and the angle of change, the first driving current corresponding to the target posture is acquired. The lens is then focused based on the first driving current. The initial data is the data corresponding to the lens in the initial posture, including the initial angle and the initial posture difference. By acquiring the angle of change of the lens relative to the initial posture, and combining the initial angle and the initial posture difference in the initial posture, the driving current required to move the lens is calculated, thereby achieving lens focusing. This overcomes the problem of gravity affecting the image distance and improves the clarity of the output image. The lens is moved to a second position that allows the output image to meet the maximum clarity, and the second driving current corresponding to the second position is acquired. The second driving current is used to correct the initial angle and the initial posture difference. This allows the camera device to continuously correct the initial angle and the initial posture difference during use, providing more accurate data to improve the focusing efficiency of the camera device. Furthermore, based on the principle of controlling variables, only one of the initial angle and the initial posture difference is corrected at a time, improving the learning efficiency of the lens focusing device.

[0102] The following will be combined with the appendix Figure 4 -Appendix Figure 5 This application provides a detailed description of the lens focusing device provided in its embodiments. It should be noted that the appendix... Figure 4 -Appendix Figure 5 The lens focusing device in the present application is used to perform the following functions. Figure 2 and Figure 3 The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figure 2 and Figure 3 The example shown.

[0103] Please see Figure 4This illustration shows a schematic diagram of a lens focusing device provided in an exemplary embodiment of this application. The lens focusing device can be implemented as all or part of a device through software, hardware, or a combination of both. The device 1 includes an angle acquisition module 11, a current acquisition module 12, and a focusing processing module 13.

[0104] Angle acquisition module 11 is used to acquire the angle of change of the lens from the initial posture to the target posture when the camera lens is detected to be in the target posture.

[0105] The current acquisition module 12 is used to acquire the first driving current corresponding to the target attitude based on the initial data and the changing angle;

[0106] The focusing processing module 13 is used to perform focusing processing on the lens based on the first driving current;

[0107] The initial data refers to the data corresponding to the lens being in the initial posture, and the initial data includes the initial angle and the initial posture difference corresponding to the initial posture.

[0108] In this embodiment, when the camera lens is detected to be in a target posture, the angle of change of the lens from the initial posture to the target posture is acquired. Based on the initial data and the angle of change, the first driving current corresponding to the target posture is acquired. The lens is then focused based on the first driving current. The initial data refers to the data corresponding to the lens in the initial posture, including the initial angle and the initial posture difference. By acquiring the angle of change of the lens relative to the initial posture, and combining the initial angle and the initial posture difference, the driving current required to move the lens is calculated, thus achieving lens focusing. This overcomes the problem of gravity affecting image distance and improves the clarity of the output image.

[0109] Please see Figure 5 This illustration shows a schematic diagram of a lens focusing device provided in an exemplary embodiment of this application. The lens focusing device can be implemented as all or part of a device through software, hardware, or a combination of both. The device 1 includes an initial attitude acquisition module 14, an initial data acquisition module 15, an angle acquisition module 11, a current acquisition module 12, a focusing processing module 13, a first correction module 16, and a second correction module 17.

[0110] The initial posture acquisition module 14 is used to acquire the initial posture of the lens of the camera device when the camera device is detected to be started for the first time, so that the output image of the camera device meets the maximum sharpness.

[0111] The initial data acquisition module 15 is used to acquire the initial driving current required for the lens to move to the initial posture, acquire the initial angle corresponding to the initial posture, and acquire the initial posture difference of the lens.

[0112] Angle acquisition module 11 is used to acquire the angle of change of the lens from the initial posture to the target posture when the camera lens is detected to be in the target posture.

[0113] The current acquisition module 12 is used to acquire the first driving current corresponding to the target attitude based on the initial data and the changing angle;

[0114] The focusing processing module 13 is used to perform focusing processing on the lens based on the first driving current;

[0115] The initial data refers to the data corresponding to the lens being in the initial posture, and the initial data includes the initial angle and the initial posture difference corresponding to the initial posture;

[0116] Optionally, the focusing processing module 13 is specifically used to control the lens to move to a first position according to the first driving current.

[0117] Optionally, the focusing processing module 13 is further configured to perform adjustment processing on the lens, controlling the lens to move from the first position to the second position, wherein the second position enables the output image of the camera device to meet the maximum sharpness.

[0118] The first correction module 16 is used to obtain the second driving current corresponding to the lens being in the second position;

[0119] The initial angle and the initial posture difference are corrected based on the second driving current;

[0120] Optionally, the first correction module 16 is specifically used to obtain the average pose difference corresponding to the lens, and calculate the corrected pose difference based on the second driving current and the initial pose difference;

[0121] If the difference between the corrected pose difference and the average pose difference is less than or equal to the correction threshold, then the initial pose difference is corrected based on the corrected pose difference.

[0122] Optionally, the first correction module 16 is specifically used to correct the initial angle based on the second driving current if neither the initial angle nor the initial posture difference has been corrected.

[0123] The second correction module 17 is used to discard the corrected posture difference and correct the initial angle based on the second driving current if the difference between the corrected posture difference and the average posture difference is greater than the correction threshold.

[0124] In this embodiment, upon detecting the first startup of the camera device, initial data in the initial posture is acquired. When the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is acquired. Based on the initial data and the angle of change, the first driving current corresponding to the target posture is acquired. Focusing processing of the lens is performed based on the first driving current. The initial data refers to the data corresponding to the lens in the initial posture, including the initial angle and the initial posture difference. By acquiring the angle of change of the lens relative to the initial posture, and combining the initial angle and the initial posture difference in the initial posture, the driving current required to move the lens is calculated, thereby achieving lens focusing. This overcomes the problem of gravity affecting the image distance and improves the clarity of the output image. The lens is moved to a second position that allows the output image to meet the maximum clarity, and the second driving current corresponding to the second position is acquired. The second driving current is used to correct the initial angle and the initial posture difference, so that the camera device can continuously correct the initial angle and the initial posture difference during use. More accurate data facilitates the improvement of the focusing efficiency of the camera device. Furthermore, based on the principle of controlling variables, only one of the initial angle and the initial posture difference is corrected at a time, improving the learning efficiency of the lens focusing device.

[0125] It should be noted that the lens focusing device provided in the above embodiments is only illustrated by the division of the above functional modules when performing the lens focusing method. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the lens focusing device and the lens focusing method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0126] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0127] This application also provides a computer storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figures 1-3 The lens focusing method described in the illustrated embodiment can be found in the following documentation for its specific execution process. Figures 1-3 The specific details of the illustrated embodiments will not be elaborated here.

[0128] This application also provides a computer program product storing at least one instruction, which is loaded and executed by the processor as described above. Figures 1-3 The lens focusing method described in the illustrated embodiment can be found in the following documentation for its specific execution process. Figures 1-3 The specific details of the illustrated embodiments will not be elaborated here.

[0129] Please refer to Figure 6 This diagram illustrates a structural block diagram of an electronic device provided in an exemplary embodiment of this application. The electronic device in this application may include one or more components such as a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected via the bus 150.

[0130] Processor 110 may include one or more processing cores. Processor 110 connects to various parts of the electronic device using various interfaces and lines, and executes various functions of terminal 100 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 110 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user page, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately using a communication chip.

[0131] The memory 120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 120 may include non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described above, etc. The operating system may be the Android system, including systems deeply developed based on the Android system, the iOS system developed by Apple Inc., including systems deeply developed based on the iOS system, or other systems.

[0132] The memory 120 can be divided into operating system space and user space. The operating system runs in the operating system space, while native and third-party applications run in user space. To ensure that different third-party applications can achieve good running performance, the operating system allocates corresponding system resources for each application. However, different application scenarios within the same third-party application have different requirements for system resources. For example, in local resource loading scenarios, third-party applications have high requirements for disk read speed; in animation rendering scenarios, third-party applications have high requirements for GPU performance. Since the operating system and third-party applications are independent of each other, the operating system often cannot promptly perceive the current application scenario of a third-party application, resulting in the operating system's inability to adapt system resources accordingly.

[0133] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to establish data communication between the third-party applications and the operating system. This would allow the operating system to obtain the current scenario information of the third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0134] The input device 130 is used to receive input instructions or data, and includes, but is not limited to, a keyboard, mouse, camera, microphone, or touch device. The output device 140 is used to output instructions or data, and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 can be a touch display screen.

[0135] The touch display screen can be designed as a full-screen, curved screen, or irregularly shaped screen. It can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen; however, this application does not limit the specific design in this regard.

[0136] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the electronic device may also include radio frequency circuits, input units, sensors, audio circuits, Wireless Fidelity (WiFi) modules, power supplies, Bluetooth modules, etc., which will not be described in detail here.

[0137] exist Figure 6 In the illustrated electronic device, the processor 110 can be used to call the lens focusing application stored in the memory 120 and specifically perform the following operations:

[0138] When the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is obtained;

[0139] Based on the initial data and the changing angle, the first driving current corresponding to the target attitude is obtained;

[0140] The lens is focused based on the first driving current;

[0141] The initial data refers to the data corresponding to the lens being in the initial posture, and the initial data includes the initial angle and the initial posture difference corresponding to the initial posture.

[0142] In one embodiment, before the processor 110 performs the operation of acquiring the angle of change of the lens from its initial posture to the target posture when the camera lens is detected to be in the target posture, the processor 110 also performs the following operations:

[0143] When the camera device is detected to be started for the first time, the initial orientation of the lens of the camera device is obtained so that the output image of the camera device meets the maximum resolution.

[0144] Obtain the initial drive current required for the lens to move to the initial posture, obtain the initial angle corresponding to the initial posture, and obtain the initial posture difference of the lens.

[0145] In one embodiment, when the processor 110 performs focusing processing on the lens based on the first driving current, it specifically performs the following operations:

[0146] The lens is moved to the first position according to the first driving current.

[0147] In one embodiment, when executing the lens focusing method, the processor 110 also performs the following operations:

[0148] The lens is adjusted by moving it from the first position to the second position, whereby the output image of the camera device achieves maximum clarity.

[0149] In one embodiment, when executing the lens focusing method, the processor 110 also performs the following operations:

[0150] Obtain the second driving current corresponding to the lens being in the second position;

[0151] The initial angle and the initial posture difference are corrected based on the second driving current.

[0152] In one embodiment, when the processor 110 performs the correction processing based on the second drive current to the initial angle and the initial posture difference, it specifically performs the following operations:

[0153] Obtain correction processing instructions;

[0154] If the correction processing instruction corresponds to the initial angle, then the initial angle is corrected based on the second drive current;

[0155] If the correction processing instruction corresponds to the initial posture difference, then the initial posture difference is corrected based on the second drive current.

[0156] In one embodiment, when the processor 110 performs the correction process for the initial posture difference based on the second drive current, it specifically performs the following operations:

[0157] The average pose difference corresponding to the lens is obtained, and the corrected pose difference is calculated based on the second driving current and the initial pose difference;

[0158] If the difference between the corrected pose difference and the average pose difference is less than or equal to the correction threshold, then the initial pose difference is corrected based on the corrected pose difference.

[0159] In one embodiment, when executing the lens focusing method, the processor 110 also performs the following operations:

[0160] If the difference between the corrected posture difference and the average posture difference is greater than the correction threshold, the corrected posture difference is discarded, and the initial angle is corrected based on the second driving current.

[0161] In one embodiment, when the processor 110 performs the correction processing based on the second drive current to the initial angle and the initial posture difference, it specifically performs the following operations:

[0162] If neither the initial angle nor the initial posture difference has been corrected, then the initial angle is corrected based on the second driving current.

[0163] In this embodiment, upon detecting the first startup of the camera device, initial data in the initial posture is acquired. When the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is acquired. Based on the initial data and the angle of change, the first driving current corresponding to the target posture is acquired. Focusing processing of the lens is performed based on the first driving current. The initial data refers to the data corresponding to the lens in the initial posture, including the initial angle and the initial posture difference. By acquiring the angle of change of the lens relative to the initial posture, and combining the initial angle and the initial posture difference in the initial posture, the driving current required to move the lens is calculated, thereby achieving lens focusing. This overcomes the problem of gravity affecting the image distance and improves the clarity of the output image. The lens is moved to a second position that allows the output image to meet the maximum clarity, and the second driving current corresponding to the second position is acquired. The second driving current is used to correct the initial angle and the initial posture difference, so that the camera device can continuously correct the initial angle and the initial posture difference during use. More accurate data facilitates the improvement of the focusing efficiency of the camera device. Furthermore, based on the principle of controlling variables, only one of the initial angle and the initial posture difference is corrected at a time, improving the learning efficiency of the lens focusing device.

[0164] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.

[0165] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A lens focusing method, characterized in that, The method includes: When the camera lens is detected to be in the target posture, the angle of change of the lens from the initial posture to the target posture is obtained; Based on the initial data and the changed angle, the first driving current corresponding to the target attitude is obtained; The lens is focused based on the first driving current; The lens is adjusted to move to a second position, which ensures that the output image of the camera device has maximum clarity. Obtain the second driving current corresponding to the lens being in the second position; The initial angle and initial posture difference are corrected based on the second driving current; Wherein, the initial data is the data corresponding to the lens when it is in the initial posture. The initial data includes the initial angle and initial posture difference corresponding to the initial posture. The initial posture difference is the posture difference of the lens in the initial posture. The posture difference is the absolute value of the difference between the distance the lens moves when focusing on an object at the same distance and when the angle between the lens and the horizontal line is 0° and 90°.

2. The method according to claim 1, characterized in that, Before obtaining the angle of change of the lens from its initial posture to the target posture when the camera lens is detected to be in the target posture, the method further includes: When the camera device is detected to be started for the first time, the initial orientation of the lens of the camera device is obtained so that the output image of the camera device meets the maximum resolution. Obtain the initial drive current required for the lens to move to the initial posture, obtain the initial angle corresponding to the initial posture, and obtain the initial posture difference of the lens.

3. The method according to claim 1, characterized in that, The focusing process of the lens based on the first driving current includes: The lens is moved to the first position according to the first driving current.

4. The method according to claim 1, characterized in that, The correction process for the initial angle and the initial posture difference based on the second driving current includes: Obtain correction processing instructions; If the correction processing instruction corresponds to the initial angle, then the initial angle is corrected based on the second drive current; If the correction processing instruction corresponds to the initial posture difference, then the initial posture difference is corrected based on the second drive current.

5. The method according to claim 4, characterized in that, The correction process for the initial attitude difference based on the second driving current includes: The average pose difference corresponding to the lens is obtained, and the corrected pose difference is calculated based on the second driving current and the initial pose difference. The average pose difference is the average of the pose differences of multiple lenses. If the difference between the corrected pose difference and the average pose difference is less than or equal to the correction threshold, then the initial pose difference is corrected based on the corrected pose difference.

6. The method according to claim 5, characterized in that, The method further includes: If the difference between the corrected posture difference and the average posture difference is greater than the correction threshold, the corrected posture difference is discarded, and the initial angle is corrected based on the second driving current.

7. The method according to claim 1, characterized in that, The correction process for the initial angle and the initial posture difference based on the second driving current includes: If neither the initial angle nor the initial posture difference has been corrected, then the initial angle is corrected based on the second driving current.

8. A lens focusing device, characterized in that, The device includes: An angle acquisition module is used to acquire the angle of change of the lens from the initial posture to the target posture when the camera lens is detected to be in the target posture. The current acquisition module is used to acquire the first driving current corresponding to the target attitude based on the initial data and the changed angle; A focusing processing module is used to focus the lens based on the first driving current; The lens is adjusted to move to a second position, which ensures that the output image of the camera device has maximum clarity. Obtain the second driving current corresponding to the lens being in the second position; The initial angle and initial posture difference are corrected based on the second driving current; Wherein, the initial data is the data corresponding to the lens when it is in the initial posture. The initial data includes the initial angle and initial posture difference corresponding to the initial posture. The initial posture difference is the posture difference of the lens in the initial posture. The posture difference is the absolute value of the difference between the distance the lens moves when focusing on an object at the same distance and when the angle between the lens and the horizontal line is 0° and 90°.

9. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Focusing method and device for mobile device and mobile device

    CN102147556A