Lens control method and apparatus, electronic device, storage medium
By acquiring the available homing time and dynamic homing displacement curve of the Hall effect sensor, and combining it with gyroscope speed data, the Hall effect sensor is controlled to move towards the center position within the reserved homing time. This solves the problem of the lens hitting the edge when moving significantly, and improves the image stabilization effect and shooting success rate of the camera module.
Patent Information
- Application Number
- CN202310671404.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-06-07
AI Technical Summary
Existing optical image stabilization technology is prone to exceeding its stabilization range when the lens moves significantly, causing the lens to hit the edge and malfunction, and cannot effectively compensate for large-scale lens movements.
By acquiring the available homing time and dynamic homing displacement curve of the Hall device, the Hall device is controlled to move towards the center position within the reserved homing time to avoid the lens hitting the edge. Combined with the speed data of the gyroscope, the state is switched to optimize the lens control.
It effectively avoids lens collisions, ensures optical image stabilization, improves the success rate of camera module photography, increases the stabilization range, solves the stabilization problem in small frame shake scenarios, and alleviates image drift.
Smart Images

Figure CN119110151B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of control technology, and in particular to a lens control method and apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, Optical Image Stabilization (OIS) compensates for lens motion in real time by controlling the translation of the lens module to achieve image stabilization and improve image sharpness. Considering the small size of the lens module and the limitations of installation volume, OIS typically compensates for 1 to 1.5° angles on each coordinate axis. When the lens movement is large, it is easy to exceed the stabilization range, causing edge collisions and resulting in OIS failure. Summary of the Invention
[0003] This disclosure provides a lens control method and apparatus, electronic device, and storage medium to address the shortcomings of related technologies.
[0004] According to a first aspect of the present disclosure, a lens control method is provided, suitable for an electronic device, the electronic device including a camera module, the camera module including a lens and a Hall effect device for adjusting the position of the lens, the electronic device further including a gyroscope, the method comprising:
[0005] In response to the detection of a frame synchronization signal, the start information of the current acquisition cycle and the available return-to-center time of the Hall device are obtained; the available return-to-center time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle.
[0006] The reserved return time for the current acquisition cycle is determined based on the starting information and the available return time.
[0007] The dynamic centering displacement curve of the Hall device is obtained, and the displacement curve represents the mapping relationship between each centering time and the centering step size;
[0008] Within the reserved centering time, the Hall device is controlled to move toward the center position based on the centering step size corresponding to the dynamic centering displacement curve.
[0009] Optionally, the available homing time of the Hall device is obtained, including:
[0010] Obtain exposure data reading time and exposure time;
[0011] The available backhaul time corresponding to the current acquisition period is calculated based on the current acquisition period, the exposure data reading time, and the exposure time.
[0012] Optionally, obtaining the dynamic centering displacement curve of the Hall device includes:
[0013] Obtain the initial dynamic centering displacement curve;
[0014] The initial dynamic centering displacement curve is adjusted to obtain the dynamic centering displacement curve.
[0015] Optionally, the initial dynamic homing displacement curve is obtained, including:
[0016] Obtain the ratio of each midpoint time to the available midpoint duration; the midpoint time is greater than or equal to 0 and less than or equal to the available midpoint duration.
[0017] Obtain the difference between the ratio and the first preset value;
[0018] The first product is obtained by multiplying the difference by the second preset value.
[0019] Obtain the sine value of the first product;
[0020] The product of the sine value and the third preset value is obtained to obtain the second product, which is the displacement corresponding to each syncline time of the initial dynamic syncline displacement curve.
[0021] Optionally, the method further includes:
[0022] The current state of the Hall device is determined; the current state is one of the following: a first state, a second state, a third state, and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope.
[0023] When it is determined that the state switching condition is met, the Hall device is controlled to switch from the current state to the next state, which is one of the following: first state, second state, third state, and fourth state.
[0024] Optionally, when the current state is the third state and the next state is the first state, determining that the state transition condition is met includes:
[0025] Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position;
[0026] When the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the state switching condition is determined to be met.
[0027] Optionally, when the current state is the third state and the next state is the fourth state, determining that the state transition condition is met includes:
[0028] The actual displacement change of the Hall device and the homing change of the Hall device are obtained; the actual displacement change is the displacement change of the Hall device controlled according to a preset step size, and the homing change is the displacement change of the Hall device controlled according to the velocity data of the gyroscope.
[0029] When the actual displacement change is less than or equal to the return-to-center change, the state switching condition is determined to be met.
[0030] Optionally, when the current state is the fourth state and the next state is the first state, determining that the state transition condition is met includes:
[0031] Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position;
[0032] When the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the state switching condition is determined to be met.
[0033] Optionally, when the conditions are not met—the frame synchronization signal is true, the current frame synchronization signal has ended, and the distance is less than a preset distance threshold—the method further includes:
[0034] Obtain the distance between the Hall effect sensor and the center position, the current speed output by the gyroscope, and the duration of the speed output;
[0035] When the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold, the state switching condition is determined to be met.
[0036] Optionally, when the current state is the second state and the next state is the third state, determining that the state transition condition is met includes:
[0037] Obtain the frame synchronization signal identifier;
[0038] When the frame synchronization signal flag is true, it is determined that the state switching condition is met.
[0039] Optionally, when the frame synchronization signal flag is not true, the method further includes:
[0040] The number of times the Hall device hits the edge is obtained;
[0041] When the number of times is determined to be greater than a preset threshold, the state switching condition is determined to be met.
[0042] Optionally, when the current state is the second state and the next state is the fourth state, determining that the state transition condition is met includes:
[0043] When the frame synchronization signal flag is not true, obtain the displacement of the Hall device relative to the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge;
[0044] When it is determined that the sign of the displacement is different from that of the current velocity and the number of times is greater than a preset number threshold, it is determined that the state switching condition is met.
[0045] Optionally, when the current state is the fourth state and the next state is the second state, determining that the state transition condition is met includes:
[0046] Obtain the displacement of the Hall device relative to the center position;
[0047] When it is determined that the displacement of the Hall device relative to the center position exceeds the maximum displacement value, the state switching condition is satisfied.
[0048] Optionally, when the current state is the first state and the next state is the second state, determining that the state transition condition is met includes:
[0049] Obtain the displacement of the Hall device relative to the center position;
[0050] When the displacement of the Hall device relative to the center position exceeds a preset displacement threshold, the state switching condition is determined to be met.
[0051] According to a second aspect of the present disclosure, a lens control device is provided, suitable for an electronic device, the electronic device including a camera module, the camera module including a lens and a Hall effect device for adjusting the position of the lens, the electronic device further including a gyroscope, the device comprising:
[0052] The start signal acquisition module is used to acquire the start information of the current acquisition cycle in response to the detection of the frame synchronization signal;
[0053] The available time acquisition module is used to acquire the available return time of the Hall device; the available return time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle.
[0054] The reserved time acquisition module is used to determine the reserved return time of the current collection cycle based on the start information and the available return time.
[0055] The mapping relationship acquisition module is used to acquire the dynamic centering displacement curve of the Hall device, wherein the displacement curve represents the mapping relationship between each centering time and the centering step size;
[0056] The Hall device acquisition module is used to control the Hall device to move towards the center position based on the centering step size corresponding to the dynamic centering displacement curve within the reserved centering time.
[0057] Optionally, the available time acquisition module includes:
[0058] The time acquisition submodule is used to acquire the exposure data reading time and the exposure time;
[0059] The duration acquisition submodule is used to calculate the available backhaul duration corresponding to the current acquisition period based on the current acquisition period, the exposure data reading time, and the exposure time.
[0060] Optionally, the mapping relationship acquisition module includes:
[0061] The initial curve acquisition submodule is used to acquire the initial dynamic return-to-center displacement curve;
[0062] The dynamic curve acquisition submodule is used to adjust the initial dynamic centering displacement curve to obtain the dynamic centering displacement curve.
[0063] Optionally, the initial curve acquisition submodule includes:
[0064] A ratio acquisition unit is used to acquire the ratio of each midpoint time to the available midpoint duration; the midpoint time is greater than or equal to 0 and less than or equal to the available midpoint duration.
[0065] A difference acquisition unit is used to acquire the difference between the ratio and a first preset value;
[0066] The first product acquisition unit is used to acquire the product of the difference and the second preset value to obtain the first product;
[0067] A sine value acquisition unit is used to acquire the sine value of the first product;
[0068] The displacement acquisition unit is used to acquire the product of the sine value and the third preset value to obtain the second product, which is the displacement corresponding to each syncline time of the initial dynamic syncline displacement curve.
[0069] Optionally, the device further includes:
[0070] The current state determination module is used to determine the current state of the Hall device; the current state is one of the following: a first state, a second state, a third state, and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope;
[0071] The current state switching module is used to control the Hall device to switch from the current state to the next state when it is determined that the state switching conditions are met. The next state is one of the following: first state, second state, third state, and fourth state.
[0072] Optionally, when the current state is the third state and the next state is the first state, the current state switching module includes:
[0073] The identifier acquisition submodule is used to acquire the frame synchronization signal identifier and the distance between the Hall device and the center position;
[0074] The distance acquisition submodule is used to obtain the distance between the Hall device and the center position;
[0075] The condition determination submodule is used to determine that the state switching conditions are met when the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.
[0076] Optionally, when the current state is the third state and the next state is the fourth state, the current state switching module includes:
[0077] The actual displacement acquisition submodule is used to acquire the actual displacement change of the Hall device.
[0078] The homing change acquisition submodule is used to acquire the homing change of the Hall device; the actual displacement change is the displacement change of the Hall device controlled according to a preset step size, and the homing change is the displacement change of the Hall device controlled according to the speed data of the gyroscope.
[0079] The condition determination submodule is used to determine whether the state switching condition is met when the actual displacement change is less than or equal to the return change.
[0080] Optionally, when the current state is the fourth state and the next state is the first state, the current state switching module includes:
[0081] The identifier acquisition submodule is used to acquire the frame synchronization signal identifier;
[0082] The distance acquisition submodule is used to obtain the distance between the Hall device and the center position;
[0083] The condition determination submodule is used to determine that the state switching conditions are met when the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.
[0084] Optionally, when the conditions are not met—the frame synchronization signal is true, the current frame synchronization signal has ended, and the distance is less than a preset distance threshold—the current state switching module further includes:
[0085] The distance acquisition submodule is used to obtain the distance between the Hall device and the center position;
[0086] The speed acquisition submodule is used to acquire the current speed and duration output by the gyroscope;
[0087] The time acquisition submodule is used to obtain the duration.
[0088] The condition determination submodule is further configured to determine that the state switching condition is met when the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold.
[0089] Optionally, when the current state is the second state and the next state is the third state, the current state switching module includes:
[0090] The identifier acquisition submodule is used to acquire the frame synchronization signal identifier;
[0091] The condition determination submodule is used to determine whether the state switching condition is met when the frame synchronization signal identifier is true.
[0092] Optionally, when the frame synchronization signal flag is not true, the current state switching module includes:
[0093] The duration acquisition submodule is used to acquire the number of times the Hall device hits the edge;
[0094] The condition determination submodule is used to determine that the state switching condition is met when the number of determinations exceeds a preset number threshold.
[0095] Optionally, when the current state is the second state and the next state is the fourth state, the current state switching module includes:
[0096] The data acquisition submodule is used to acquire the displacement of the Hall device relative to the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge when the frame synchronization signal flag is not true.
[0097] The condition determination submodule is used to determine that the state switching condition is met when the sign of the displacement is different from that of the current velocity and the number of times is greater than a preset number threshold.
[0098] Optionally, when the current state is the fourth state and the next state is the second state, the current state switching module includes:
[0099] The displacement acquisition submodule is used to acquire the displacement of the Hall device relative to the center position;
[0100] The condition determination submodule is used to determine that the state switching condition is met when the displacement of the Hall device relative to the center position exceeds the maximum displacement value.
[0101] Optionally, when the current state is a first state and the next state is a second state, the current state switching module includes:
[0102] The displacement acquisition submodule is used to acquire the displacement of the Hall device relative to the center position;
[0103] The condition determination submodule is used to determine that the state switching condition is met when the displacement of the Hall device from the center position exceeds a preset displacement threshold.
[0104] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0105] A camera module and a lens module; the interface of the camera module is electrically connected to the hardware synchronization signal pin of the lens module.
[0106] Memory and processor;
[0107] The memory is used to store computer programs that can be executed by the processor;
[0108] The processor is configured to execute a computer program in the memory to implement the method as described in any of the first aspects.
[0109] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which, when an executable computer program in the storage medium is executed by a processor, enables the implementation of the method as described in any of the first aspects.
[0110] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0111] The solution provided in this embodiment can, in response to the detection of a frame synchronization signal, acquire the start information of the current acquisition cycle and the available centering time of the Hall device; the available centering time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle; then, based on the start information and the available centering time, determine the reserved centering time for the current acquisition cycle; subsequently, acquire the dynamic centering displacement curve of the Hall device, the displacement curve representing the mapping relationship between each centering moment and the centering step size; finally, within the reserved centering time, control the Hall device to move towards the center position based on the centering step size corresponding to the dynamic centering displacement curve. Thus, by controlling the Hall device to move towards the center position within the reserved centering time, this embodiment can avoid lens collisions, ensure optical image stabilization, and improve the success rate of camera module photography.
[0112] 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
[0113] 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.
[0114] Figure 1 This is a flowchart illustrating a lens control method according to an exemplary embodiment.
[0115] Figure 2 This is a schematic diagram illustrating a frame synchronization signal according to an exemplary embodiment.
[0116] Figure 3 This is a flowchart illustrating an example of obtaining the available return time, according to an exemplary embodiment.
[0117] Figure 4 This is a flowchart illustrating a method for obtaining a dynamic centering displacement curve according to an exemplary embodiment.
[0118] Figure 5 This is a schematic diagram illustrating the speed matching of a Hall effect device and a gyroscope according to an exemplary embodiment.
[0119] Figure 6 This is a schematic diagram of the state switching logic of a Hall device according to an exemplary embodiment.
[0120] Figure 7 This is a block diagram illustrating a lens control device according to an exemplary embodiment.
[0121] Figure 8 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0122] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described below by way of example do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatus consistent with some aspects of this disclosure as detailed in the appended claims. It should be noted that, without conflict, the following embodiments and features in the implementation methods can be combined with each other.
[0123] To address the aforementioned technical problems, this disclosure provides a lens control method and apparatus, an electronic device, and a storage medium. The lens control method is applicable to an electronic device, which may include a camera module. The camera module includes a lens and a Hall effect device for adjusting the lens position.
[0124] In one example, the lens may include a wide-angle lens (WIDE) and / or an ultra-wide-angle lens (UW). Taking a wide-angle lens as an example, it includes a hardware synchronization signal pin. In this example, the hardware synchronization signal pin of the wide-angle lens can be electrically connected to the interface of the camera module. Specifically, the hardware synchronization signal pin of the wide-angle lens can be connected to an unused GPIO port of the camera module's smart sensor hub via a wire, allowing the camera module to receive the frame synchronization signal (Vsync) output by the wide-angle lens. Understandably, the processing method is similar when the lens is an ultra-wide-angle lens or other lenses. Furthermore, when there are multiple lenses, the camera module's smart sensor hub can be connected to the hardware synchronization signal pin of one of the lenses, making the solution simple and easy to implement.
[0125] It should be noted that the wide-angle lens sends a frame synchronization signal (Vsync) according to a preset image acquisition period. For example, with a frame rate of 30fps, the preset image acquisition period is (1 / 30 =) 33ms. Alternatively, the preset image acquisition period can be adjusted according to the camera module's frame rate; this is not limited here.
[0126] In one embodiment, after receiving the frame synchronization signal, the camera module's processor will treat the frame synchronization signal as an interrupt event and prioritize it, that is, the camera module will prioritize executing the lens control method provided in this disclosure.
[0127] In this embodiment, the electronic device also includes a gyroscope, which can detect the spatial attitude of the electronic device and output the speed data of the electronic device (hereinafter referred to as the current speed). This speed data can control the movement of the Hall effect device in certain states to achieve the effect of adjusting the lens focal length.
[0128] Based on the aforementioned electronic device, this disclosure also provides a lens control method. Figure 1 This is a flowchart illustrating a lens control method according to an exemplary embodiment. See also... Figure 1 A lens control method, comprising steps 11 to 14.
[0129] In step 11, in response to the detection of a frame synchronization signal, the start information of the current acquisition cycle and the available return-to-center time of the Hall device are obtained; the available return-to-center time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle.
[0130] In this step, after detecting the frame synchronization signal, the camera module of the electronic device can obtain the start information of the current acquisition cycle. The camera module acquires preview images according to pre-configured information. This configuration information includes the frame rate, which refers to the number of images acquired by the camera module per second. Alternatively, since each acquisition cycle is inversely related to the frame rate, the reciprocal of the frame rate can be used as the length of each acquisition cycle after obtaining it.
[0131] Understandably, each acquisition cycle includes a start time, duration, and end time. In one example, the camera module can use the start time of each acquisition cycle as the aforementioned Start of Frame (SOF). Since the frame synchronization signal (Vsync) is located at the beginning of each acquisition cycle, this example uses the frame synchronization signal as the aforementioned start information. The camera module can acquire the frame synchronization signal sent by the lens and can use the time of receiving the frame synchronization signal as the aforementioned start information.
[0132] See Figure 2 Each acquisition cycle includes a frame synchronization signal. In one example, this frame synchronization signal can be a pulse signal, which includes a rising edge and a falling edge. Either the rising edge or the falling edge can be selected as the valid trigger signal. In this example, the falling edge of the pulse signal is selected as the valid trigger signal.
[0133] In this step, the camera module can obtain the available sync time Tsync of the Hall device in the camera module, see [link / reference]. Figure 3 This includes steps 31 to 32.
[0134] In step 31, the exposure read data time and exposure time are obtained.
[0135] In this step, the electronic device stores configuration information, including the camera exposure readout time (Trot) and the camera exposure time (Texp). The camera module can read the above configuration information from a specified location (local memory, cache, etc.) to obtain the exposure readout time and the exposure time.
[0136] In step 32, the available backtracking time corresponding to the current acquisition period is calculated based on the current acquisition period, the exposure data reading time, and the exposure time.
[0137] In this step, the camera module can calculate the available backtracking time corresponding to the current acquisition period based on the current acquisition period, the exposure data reading time, and the exposure time. The formula for calculating the available backtracking time is shown in formula (1).
[0138] (1)
[0139] Taking a frame rate of 30fps as an example, the exposure data reading time Trot = 10ms, the exposure time Texp = 10ms, and combining with equation (1), we can see that... ms.
[0140] It is understandable that the available return-to-center time mentioned above refers to the time required for the Hall device to return to the center position (i.e., return-to-center) within the current acquisition cycle. The aforementioned center position refers to the default position of the Hall device. The Hall device can move forward or backward in a certain direction from this center position, with a movement range of [-B, B], where B (i.e., Bonud) is the maximum displacement.
[0141] In step 12, the reserved back-center time for the current acquisition cycle is determined based on the starting information and the available back-center duration.
[0142] In this step, the camera module can determine the reserved return-to-center time for the current acquisition cycle based on the start information and the available return-to-center duration. Specifically, it uses the start signal as the starting point and the available return-to-center duration as the duration to determine the reserved return-to-center time for the Hall effect device in the current acquisition of the barbershop. Alternatively, the camera module can control the Hall effect device to perform return-to-center movement within the reserved return-to-center time after receiving the frame synchronization signal.
[0143] In step 13, the dynamic centering displacement curve of the Hall device is obtained, and the displacement curve represents the mapping relationship between each centering time and the centering step size.
[0144] In this step, the camera module can acquire the dynamic centering displacement curve of the Hall device, see [link / reference]. Figure 4 This includes steps 41 to 42.
[0145] In step 41, the initial dynamic return-to-center displacement curve is obtained.
[0146] In this step, the camera module can acquire the initial dynamic homing displacement curve, including: acquiring the ratio of each homing moment to the available homing duration (Tsync), where each homing moment is greater than or equal to 0 and less than or equal to the homing duration. Since the homing moment ranges from [0, Tsync], this ratio can be understood as the relative position of the homing moment within the range [0, Tsync]. Then, the difference between the above ratio and a first preset value is acquired. This first preset value can be 0.25. Next, the product of the above difference and a second preset value is acquired to obtain the first product. This second preset value can be [value missing]. Furthermore, the sine value of the first product can be obtained. Finally, the product of the sine value and the third preset value can be obtained to get the second product, which is the displacement corresponding to each syncline time of the initial dynamic syncline displacement curve. The third preset value can be 0.05.
[0147] In step 42, the initial dynamic centering displacement curve is adjusted to obtain a dynamic centering displacement curve. For example, a third preset value is added to each displacement of the initial dynamic centering displacement curve.
[0148] In this step, the expression for the dynamic return-to-center displacement curve is shown in equation (2).
[0149] (2)
[0150] In equation (2), x represents the time of return to center, and its value ranges from [0, Tsync]. Tsync represents the available time of return to center, and offset represents the offset displacement.
[0151] It should be noted that equation (2) illustrates a scenario for obtaining a normalized centering step size, i.e., the size of the centering step size is within [0, 1]. In practice, the value of the third preset value in equation (2) can be adjusted, for example, the actual step size change rate (center_ratio) in the subsequent embodiment, so that the calculated step size can be used directly. Of course, the normalized step size can also be multiplied by the actual step size change rate (center_ratio) to obtain the actual centering step size, and the Hall device can be controlled to move within the range of [-B, B] according to the actual centering step size.
[0152] In step 14, within the reserved centering time, the Hall device is controlled to move toward the center position based on the centering step size corresponding to the dynamic centering displacement curve.
[0153] In this step, within the reserved centering time, the camera module can control the Hall effect device to move towards the center position based on the centering step size corresponding to the dynamic centering displacement curve, with the effect as follows: Figure 5 As shown. See also Figure 5 Curve 2 represents the displacement of the Hall device, curve 1 represents the differential curve of the Hall device, i.e. the velocity curve, and curve 3 represents the velocity data output by the gyroscope. At the three positions of point P, the velocity of the Hall device and the output velocity of the gyroscope are very close, which means that it has a good anti-shake effect.
[0154] Thus, by controlling the Hall effect device to move towards the center position within the reserved return time, this embodiment can avoid the lens hitting the edge (i.e., the lens displacement is outside the Bound), ensuring the optical image stabilization effect and improving the success rate of the camera module taking pictures.
[0155] In one embodiment, the camera module can nest the above-described centering process into a state machine, thereby performing centering compensation for the Hall effect device globally. The state machine logic diagram is as follows: Figure 6 As shown.
[0156] The camera module can receive frame positive signals and initialize them. The initialization process includes, but is not limited to, updating the count or timing duration, the frame synchronization signal flag, and the actual step size change rate (center_ratio). After initialization, the camera module can enter the return-to-center processing, the specific process of which is as follows: Figure 1 The example solution.
[0157] The camera module can determine the current state of the Hall device, which can be one of the following: a first state, a second state, a third state, or a fourth state. The first state refers to the Hall device following the movement of the gyroscope. The second state refers to the Hall device being in a continuous edge collision state. The third state refers to the Hall device being controlled to perform out-of-frame centering. The fourth state refers to the Hall device of the lens module performing out-of-frame centering based on the speed data output by the gyroscope.
[0158] Then, the camera module acquires parameter data and determines whether the state switching conditions are met based on the parameter data. If it is determined that the state switching conditions are not met, it remains in the current state. If it is determined that the state switching conditions are met, it controls the Hall device to switch from the current state to the next state, which can be one of the following: a first state, a second state, a third state, or a fourth state.
[0159] See Figure 6 The current state is the first state, and the next state is the second state. The camera module determines that the state switching conditions are met, including: the camera module can acquire the displacement of the Hall device relative to the intermediate position. When the displacement of the Hall device relative to the intermediate position is greater than or equal to a preset displacement position, the camera module determines that the state switching conditions are met, and at this time, the camera module controls the Hall device to switch from the first state to the second state. The preset displacement position can be between 0.95B and 0.99B; in one example, the preset displacement position is 0.99B.
[0160] See also Figure 6 If the current state is the second state and the next state is the third state, the camera module determines that the state switching conditions are met, including: the camera module can acquire the frame synchronization signal flag. When the frame synchronization signal flag is true, the camera module can determine that the state switching conditions are met, and at this time the camera module controls the Hall device to switch from the second state to the third state.
[0161] When the frame synchronization signal flag is not true, the camera module can obtain the number of times the Hall device hits the edge. When the number is determined to be greater than a preset threshold, the camera module can determine that the state switching condition is met. At this time, the camera module controls the Hall device to switch from the second state to the third state. The preset threshold ranges from 10 to 1000. In one example, the preset threshold is set to 100.
[0162] When the frame synchronization signal flag is not true, the camera module can determine the state switching condition by measuring the displacement of the Hall effect sensor relative to the center position, the current velocity output by the gyroscope, and the number of times the Hall effect sensor has collided with the edge. If the number of collisions exceeds a preset threshold and the signs of the displacement and current velocity are different, the camera module controls the Hall effect sensor to switch from the second state to the fourth state. Specifically, the difference in sign between the Hall effect sensor's displacement relative to the center position and the current velocity indicates that the Hall effect sensor is moving towards the center position, i.e., in a centering-back state, thus triggering the switch to the fourth state.
[0163] See also Figure 6 The current state is the third state and the next state is the first state. The camera module determines that the state switching conditions are met, including: the camera module can acquire the frame synchronization signal identifier and the distance between the Hall device and the center position. When the frame synchronization signal is true, the distance is less than a preset distance threshold, and the current frame synchronization signal ends, the camera module determines that the state switching conditions are met. At this time, the camera module controls the Hall device to switch from the third state to the first state. The end of the current frame synchronization signal can be understood as the end of the current acquisition cycle. The preset distance threshold ranges from 0.01B to 0.1B; in one example, the preset distance threshold is 0.05B.
[0164] See also Figure 6 The current state is the third state, and the next state is the fourth state. The camera module determines that the state switching conditions are met, including: the camera module can acquire the actual displacement change of the Hall device and the homing change of the Hall device; the actual displacement change is controlled by a preset step size, and the homing change is controlled by the velocity data of the gyroscope. When the actual displacement change is less than or equal to the homing change, the camera module determines that the state switching conditions are met, and at this time, the camera module controls the Hall device to switch from the third state to the fourth state.
[0165] It should be noted that in the third state, the Hall device is in an active homing state. At this time, the Hall device moves towards the center position according to the homing step size; that is, the Hall device does not move following the velocity data output by the gyroscope. This process allows us to obtain the actual displacement change of the Hall device. However, the camera module still calculates the displacement change of the Hall device (i.e., the aforementioned homing change) based on the velocity data output by the gyroscope. In the early stages of the third state, the actual displacement change is greater than the homing change. Theoretically, there exists a scenario where the actual displacement change equals the homing change, indicating that controlling the Hall device to move towards the center position according to the homing step size is equivalent to following the gyroscope. Continuing to the next moment, the actual displacement change is less than the homing change. At this point, following the gyroscope to move towards the center is more effective than controlling the Hall device to move towards the center according to the homing step size. At this point, we can switch to the state of following the gyroscope to move towards the center, i.e., the fourth state.
[0166] See also Figure 6 The current state is the fourth state and the next state is the first state. The camera module determines that the state switching conditions are met, including: the camera module can acquire the frame synchronization signal identifier and the distance between the Hall device and the center position. Then, when the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the camera module can determine that the state switching conditions are met. At this time, the camera module controls the Hall device to switch from the fourth state to the first state.
[0167] When the frame synchronization signal is not true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the camera module can obtain the distance between the Hall device and the center position, the current speed output by the gyroscope, and the duration. When the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold, it is determined that the state switching conditions are met. At this time, the camera module controls the Hall device to switch from the fourth state to the first state.
[0168] See also Figure 6 The current state is the fourth state and the next state is the second state. The camera module determines that the state switching conditions are met, including: the camera module can acquire the displacement of the Hall device relative to the center position. When the displacement of the Hall device relative to the center position exceeds a preset displacement threshold, the state switching conditions are met, and the camera module controls the Hall device to switch from the fourth state to the first state.
[0169] In this embodiment, by Figure 1The example scheme, nested within a state machine, ensures maximum centering while maintaining continuous and stable speed of the Hall effect sensor. Furthermore, this embodiment's scheme can increase the stabilization range in scenarios with small frame jitter, mitigating edge-hitting issues, ensuring stabilization effectiveness, and improving the success rate of the camera module's output images by approximately 30%. Additionally, this embodiment's scheme can also resolve image drift issues caused by using filters and eliminate temperature drift errors.
[0170] It should be noted that, Figure 6 The state transitions indicated by dashed lines have higher priority than those indicated by solid lines. Taking the transition from the second state to the third state as an example, the priority of the transition condition where the frame synchronization signal is true is higher than the priority of the condition where the number of collisions exceeds a preset threshold. Thus, the embodiments of this disclosure can enrich the state transition paths of the state machine and improve the control accuracy of the Hall effect device.
[0171] Based on the lens control method provided in the embodiments of this disclosure, the embodiments of this disclosure also provide a lens control device suitable for electronic devices. The electronic device includes a camera module, which includes a lens and a Hall effect device for adjusting the position of the lens. The electronic device also includes a gyroscope. See [link to relevant documentation]. Figure 7 The device includes:
[0172] The start signal acquisition module 71 is used to acquire the start information of the current acquisition cycle in response to the detection of the frame synchronization signal;
[0173] The available time acquisition module 72 is used to acquire the available return time of the Hall device; the available return time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle.
[0174] The reserved time acquisition module 73 is used to determine the reserved return time of the current collection cycle based on the start information and the available return time.
[0175] The mapping relationship acquisition module 74 is used to acquire the dynamic centering displacement curve of the Hall device, wherein the displacement curve represents the mapping relationship between each centering time and the centering step size;
[0176] The Hall device acquisition module 75 is used to control the Hall device to move towards the center position based on the centering step size corresponding to the dynamic centering displacement curve within the reserved centering time.
[0177] Optionally, the available time acquisition module includes:
[0178] The time acquisition submodule is used to acquire the exposure data reading time and the exposure time;
[0179] The duration acquisition submodule is used to calculate the available backhaul duration corresponding to the current acquisition period based on the current acquisition period, the exposure data reading time, and the exposure time.
[0180] Optionally, the mapping relationship acquisition module includes:
[0181] The initial curve acquisition submodule is used to acquire the initial dynamic return-to-center displacement curve;
[0182] The dynamic curve acquisition submodule is used to adjust the initial dynamic centering displacement curve to obtain the dynamic centering displacement curve.
[0183] Optionally, the initial curve acquisition submodule includes:
[0184] A ratio acquisition unit is used to acquire the ratio of each midpoint time to the available midpoint duration; the midpoint time is greater than or equal to 0 and less than or equal to the available midpoint duration.
[0185] A difference acquisition unit is used to acquire the difference between the ratio and a first preset value;
[0186] The first product acquisition unit is used to acquire the product of the difference and the second preset value to obtain the first product;
[0187] A sine value acquisition unit is used to acquire the sine value of the first product;
[0188] The displacement acquisition unit is used to acquire the product of the sine value and the third preset value to obtain the second product, which is the displacement corresponding to each syncline time of the initial dynamic syncline displacement curve.
[0189] Optionally, the device further includes:
[0190] The current state determination module is used to determine the current state of the Hall device; the current state is one of the following: a first state, a second state, a third state, and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope;
[0191] The current state switching module is used to control the Hall device to switch from the current state to the next state when it is determined that the state switching conditions are met. The next state is one of the following: first state, second state, third state, and fourth state.
[0192] Optionally, when the current state is the third state and the next state is the first state, the current state switching module includes:
[0193] The identifier acquisition submodule is used to acquire the frame synchronization signal identifier and the distance between the Hall device and the center position;
[0194] The distance acquisition submodule is used to obtain the distance between the Hall device and the center position;
[0195] The condition determination submodule is used to determine that the state switching conditions are met when the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.
[0196] Optionally, when the current state is the third state and the next state is the fourth state, the current state switching module includes:
[0197] The actual displacement acquisition submodule is used to acquire the actual displacement change of the Hall device.
[0198] The homing change acquisition submodule is used to acquire the homing change of the Hall device; the actual displacement change is the displacement change of the Hall device controlled according to a preset step size, and the homing change is the displacement change of the Hall device controlled according to the speed data of the gyroscope.
[0199] The condition determination submodule is used to determine whether the state switching condition is met when the actual displacement change is less than or equal to the return change.
[0200] Optionally, when the current state is the fourth state and the next state is the first state, the current state switching module includes:
[0201] The identifier acquisition submodule is used to acquire the frame synchronization signal identifier;
[0202] The distance acquisition submodule is used to obtain the distance between the Hall device and the center position;
[0203] The condition determination submodule is used to determine that the state switching conditions are met when the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.
[0204] Optionally, when the conditions are not met—the frame synchronization signal is true, the current frame synchronization signal has ended, and the distance is less than a preset distance threshold—the current state switching module further includes:
[0205] The distance acquisition submodule is used to obtain the distance between the Hall device and the center position;
[0206] The speed acquisition submodule is used to acquire the current speed and duration output by the gyroscope;
[0207] The time acquisition submodule is used to obtain the duration.
[0208] The condition determination submodule is further configured to determine that the state switching condition is met when the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold.
[0209] Optionally, when the current state is the second state and the next state is the third state, the current state switching module includes:
[0210] The identifier acquisition submodule is used to acquire the frame synchronization signal identifier;
[0211] The condition determination submodule is used to determine whether the state switching condition is met when the frame synchronization signal identifier is true.
[0212] Optionally, when the frame synchronization signal flag is not true, the current state switching module includes:
[0213] The duration acquisition submodule is used to acquire the number of times the Hall device hits the edge;
[0214] The condition determination submodule is used to determine that the state switching condition is met when the number of determinations exceeds a preset number threshold.
[0215] Optionally, when the current state is the second state and the next state is the fourth state, the current state switching module includes:
[0216] The data acquisition submodule is used to acquire the displacement of the Hall device relative to the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge when the frame synchronization signal flag is not true.
[0217] The condition determination submodule is used to determine that the state switching condition is met when the sign of the displacement is different from that of the current velocity and the number of times is greater than a preset number threshold.
[0218] Optionally, when the current state is the fourth state and the next state is the third state, the current state switching module includes:
[0219] The displacement acquisition submodule is used to acquire the displacement of the Hall device relative to the center position;
[0220] The condition determination submodule is used to determine that the state switching condition is met when the displacement of the Hall device relative to the center position exceeds the maximum displacement value.
[0221] Optionally, when the current state is a first state and the next state is a second state, the current state switching module includes:
[0222] The displacement acquisition submodule is used to acquire the displacement of the Hall device relative to the center position;
[0223] The condition determination submodule is used to determine that the state switching condition is met when the displacement of the Hall device from the center position exceeds a preset displacement threshold.
[0224] It should be noted that the device embodiment shown in this embodiment matches the content of the above method embodiment, and the content of the above method embodiment can be referred to, and will not be repeated here.
[0225] Figure 8 This is a block diagram illustrating an electronic device according to an exemplary embodiment. For example, the electronic device 800 may be a smartphone, computer, digital broadcasting terminal, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0226] Reference Figure 8 The electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, communication component 816, and image acquisition component 818.
[0227] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute computer programs. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0228] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of such data include computer programs for any application or method operating on electronic device 800, contact data, phone book data, messages, pictures, videos, etc. Memory 804 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.
[0229] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800. Power supply component 806 may include a power chip, and a controller may communicate with the power chip to control the power chip to turn on or off a first switching device, thereby enabling or disabling the battery from supplying power to the motherboard circuitry.
[0230] Multimedia component 808 includes a screen that provides an output interface between electronic device 800 and target object. 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 information from the target object. 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 touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.
[0231] Audio component 810 is configured to output and / or input audio file information. For example, audio component 810 includes a microphone (MIC) configured to receive external audio file information when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio file information may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio file information.
[0232] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc.
[0233] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in the position of electronic device 800 or a component, the presence or absence of a target object in contact with electronic device 800, the orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800.
[0234] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also 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. Furthermore, the electronic device also includes multiple sets of antennas disposed in different locations.
[0235] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital information processors (DSPs), digital information processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0236] In an exemplary embodiment, this disclosure also provides a non-transitory computer-readable storage medium that, when an executable computer program in the storage medium is executed by a processor, enables the implementation of the method described above.
[0237] In an exemplary embodiment, a chip is also provided, the chip including a processor and an interface for reading a computer program through the interface to implement the method described above. The chip can be a conventional CPU (central processing unit) chip, GPU (graphics processing unit) chip, etc., or an acceleration chip specifically designed for artificial intelligence technology, such as an AI (Artificial Intelligence) accelerator.
[0238] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any variations, uses, or adaptations 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.
[0239] 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 lens control method, characterized in that, Suitable for an electronic device, the electronic device including a camera module, the camera module including a lens and a Hall effect device for adjusting the position of the lens, the electronic device further including a gyroscope, the method comprising: In response to the detection of a frame synchronization signal, the start information of the current acquisition cycle and the available return-to-center time of the Hall device are obtained; the available return-to-center time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle. The reserved return time for the current acquisition cycle is determined based on the starting information and the available return time. The dynamic centering displacement curve of the Hall device is obtained, and the displacement curve represents the mapping relationship between each centering time and the centering step size; Within the reserved centering time, the Hall device is controlled to move toward the center position based on the centering step size corresponding to the dynamic centering displacement curve; Obtaining the dynamic centering displacement curve of the Hall device includes: Obtaining the initial dynamic homing displacement curve includes: obtaining the ratio of each homing time to the available homing duration; the homing time is greater than or equal to 0 and less than or equal to the homing duration; obtaining the difference between the ratio and a first preset value; obtaining the product of the difference and a second preset value to obtain a first product; obtaining the sine value of the first product; obtaining the product of the sine value and a third preset value to obtain a second product, wherein the second product is the displacement corresponding to each homing time of the initial dynamic homing displacement curve; The initial dynamic centering displacement curve is adjusted to obtain the dynamic centering displacement curve.
2. The method according to claim 1, characterized in that, Obtain the available homing time of the Hall device, including: Obtain exposure data reading time and exposure time; The available backhaul time corresponding to the current acquisition period is calculated based on the current acquisition period, the exposure data reading time, and the exposure time.
3. The method according to claim 1, characterized in that, The method further includes: The current state of the Hall device is determined; the current state is one of the following: a first state, a second state, a third state, and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope. When it is determined that the state switching condition is met, the Hall device is controlled to switch from the current state to the next state, which is one of the following: first state, second state, third state, and fourth state.
4. The method according to claim 3, characterized in that, When the current state is the third state and the next state is the first state, it is determined that the state transition conditions are met, including: Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position; When the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the state switching condition is determined to be met.
5. The method according to claim 3, characterized in that, When the current state is the third state and the next state is the fourth state, it is determined that the state transition conditions are met, including: The actual displacement change of the Hall device and the homing change of the Hall device are obtained; the actual displacement change is the displacement change of the Hall device controlled according to a preset step size, and the homing change is the displacement change of the Hall device controlled according to the velocity data of the gyroscope. When the actual displacement change is less than or equal to the return-to-center change, the state switching condition is determined to be met.
6. The method according to claim 3, characterized in that, When the current state is the fourth state and the next state is the first state, it is determined that the state transition conditions are met, including: Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position; When the frame synchronization signal is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the state switching condition is determined to be met.
7. The method according to claim 6, characterized in that, When the conditions are not met—the frame synchronization signal is true, the current frame synchronization signal has ended, and the distance is less than a preset distance threshold—the method further includes: Obtain the distance between the Hall effect sensor and the center position, the current speed output by the gyroscope, and the duration of the speed output; When the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold, the state switching condition is determined to be met.
8. The method according to claim 3, characterized in that, When the current state is the second state and the next state is the third state, it is determined that the state transition conditions are met, including: Obtain the frame synchronization signal identifier; When the frame synchronization signal flag is true, it is determined that the state switching condition is met.
9. The method according to claim 8, characterized in that, When the frame synchronization signal flag is not true, the method further includes: The number of times the Hall device hits the edge is obtained; When the number of times is determined to be greater than a preset threshold, the state switching condition is determined to be met.
10. The method according to claim 3, characterized in that, When the current state is the second state and the next state is the fourth state, it is determined that the state transition conditions are met, including: When the frame synchronization signal flag is not true, obtain the displacement of the Hall device relative to the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge; When it is determined that the sign of the displacement is different from that of the current velocity and the number of times is greater than a preset number threshold, it is determined that the state switching condition is met.
11. The method according to claim 3, characterized in that, When the current state is the fourth state and the next state is the second state, it is determined that the state transition conditions are met, including: Obtain the displacement of the Hall device relative to the center position; When it is determined that the displacement of the Hall device relative to the center position exceeds the maximum displacement value, the state switching condition is satisfied.
12. The method according to claim 3, characterized in that, When the current state is the first state and the next state is the second state, it is determined that the state transition condition is met, including: Obtain the displacement of the Hall device relative to the center position; When the displacement of the Hall device relative to the center position exceeds a preset displacement threshold, the state switching condition is determined to be met.
13. A lens control device, characterized in that, Suitable for an electronic device, the electronic device including a camera module, the camera module including a lens and a Hall effect device for adjusting the position of the lens, the electronic device further including a gyroscope, the device comprising: The start signal acquisition module is used to acquire the start information of the current acquisition cycle in response to the detection of the frame synchronization signal; The available time acquisition module is used to acquire the available return time of the Hall device; the available return time refers to the time taken for the Hall device to return to the center position within the current acquisition cycle. The reserved time acquisition module is used to determine the reserved return time of the current collection cycle based on the start information and the available return time. The mapping relationship acquisition module is used to acquire the dynamic centering displacement curve of the Hall device, wherein the displacement curve represents the mapping relationship between each centering time and the centering step size; The Hall device acquisition module is used to control the Hall device to move towards the center position based on the centering step size corresponding to the dynamic centering displacement curve within the reserved centering time. The mapping relationship acquisition module includes: The initial curve acquisition submodule is used to acquire the initial dynamic return-to-center displacement curve; The dynamic curve acquisition submodule is used to adjust the initial dynamic return-to-center displacement curve to obtain the dynamic return-to-center displacement curve. The initial curve acquisition submodule includes: A ratio acquisition unit is used to acquire the ratio of each midpoint time to the available midpoint duration; the midpoint time is greater than or equal to 0 and less than or equal to the available midpoint duration. A difference acquisition unit is used to acquire the difference between the ratio and a first preset value; The first product acquisition unit is used to acquire the product of the difference and the second preset value to obtain the first product; A sine value acquisition unit is used to acquire the sine value of the first product; The displacement acquisition unit is used to acquire the product of the sine value and the third preset value to obtain the second product, which is the displacement corresponding to each syncline time of the initial dynamic syncline displacement curve.
14. An electronic device, characterized in that, include: A camera module and a lens module; the interface of the camera module is electrically connected to the hardware synchronization signal pin of the lens module. Memory and processor; The memory is used to store computer programs that can be executed by the processor; The processor is configured to execute a computer program in the memory to implement the method as described in any one of claims 1 to 12.
15. A non-transitory computer-readable storage medium, characterized in that, When the executable computer program in the storage medium is executed by a processor, it can implement the method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Optical Image Stabilization Module And Camera Module
CN106921832A
Antishake focus lens module and control method thereof
CN109683428A