Anti-shake control method and device
By acquiring the pose data of electronic devices, the image stabilization mode is dynamically selected to match the shaking scene, which solves the problem of insufficient adaptability of optical image stabilization, realizes high precision and large stroke adaptive matching, and improves imaging stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2026-01-06
- Publication Date
- 2026-05-01
AI Technical Summary
Existing optical image stabilization technology is not adaptable enough to mobile devices, resulting in a small stabilization angle and easy introduction of compensation errors, which affects the imaging effect.
By acquiring the pose data of the electronic device, including acceleration and angular velocity data, the system dynamically selects the first or second stabilization mode and controls the optical image stabilization motor to operate in different modes to match the shaking scene, achieving adaptive matching of high precision and large stroke.
It improves the adaptability of optical image stabilization, ensuring that the motor's range of motion matches the actual required image stabilization accuracy and travel, thereby improving imaging stability and adapting to complex handheld shooting scenarios.
Smart Images

Figure CN121967884A_ABST
Abstract
Description
Anti-shake control methods and devices Technical Field
[0001] This application belongs to the field of data processing technology, specifically relating to a stabilization control method and device. Background Technology
[0002] Optical image stabilization (OIS) is a key component of mobile imaging systems, designed to compensate for handheld shooting shake through physical compensation, thereby improving image clarity and success rate. As smartphone photography capabilities continue to improve, users are demanding higher stability in high-quality images and videos, making OIS a standard feature in the main cameras and telephoto lenses of mid-to-high-end smartphones.
[0003] Currently, optical image stabilization primarily relies on sensors such as gyroscopes and accelerometers to detect device shake in real time. Algorithms calculate the corresponding compensation angle and drive a micro-motor to move the lens or image sensor in the opposite direction, thus canceling out the shake. However, in the confined internal space of mobile devices, the size of the camera module is strictly limited, resulting in a very limited physical travel available for motor movement. This leads to generally small optical image stabilization angles, typically within ±1°. Simply increasing the stabilization angle not only wastes motion margin in most scenarios but may also introduce compensation errors due to decreased motor control precision, ultimately affecting the actual effectiveness of image stabilization.
[0004] Therefore, the current image stabilization control is not adaptable enough. Summary of the Invention
[0005] The purpose of this application is to provide a stabilization control method and device that can solve the problem of insufficient adaptability of current stabilization control.
[0006] In a first aspect, embodiments of this application provide a stabilization control method, the method comprising: acquiring pose data of an electronic device within a first time window, the pose data including at least one of acceleration data, angular velocity data, and stabilization feedback angle; the stabilization feedback angle being obtained by optical image stabilization processing based on the acceleration data and angular velocity data; determining a target stabilization mode based on the pose data; wherein the target stabilization mode is a first stabilization mode or a second stabilization mode, the maximum stabilization angle corresponding to the first stabilization mode being less than the maximum stabilization angle corresponding to the second stabilization mode; and controlling the optical stabilization motor of the electronic device to operate according to the target stabilization mode.
[0007] Secondly, embodiments of this application provide an image stabilization control device, comprising: an acquisition module for acquiring pose data of an electronic device within a first time window, the pose data including at least one of acceleration data, angular velocity data, and image stabilization feedback angle; the image stabilization feedback angle being obtained by optical image stabilization processing based on the acceleration data and angular velocity data; a determination module for determining a target image stabilization mode based on the pose data; wherein the target image stabilization mode is a first image stabilization mode or a second image stabilization mode, the maximum image stabilization angle corresponding to the first image stabilization mode being less than the maximum image stabilization angle corresponding to the second image stabilization mode; and a control module for controlling the optical image stabilization motor of the electronic device to operate according to the target image stabilization mode.
[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.
[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0012] In the embodiments of this application, pose data of the electronic device within a first time window is acquired. The pose data includes at least one of acceleration data, angular velocity data, and anti-shake feedback angle. The anti-shake feedback angle is obtained by optical image stabilization processing based on the acceleration data and angular velocity data. A target anti-shake mode is determined based on the pose data. The target anti-shake mode is either a first anti-shake mode or a second anti-shake mode, where the maximum anti-shake angle corresponding to the first anti-shake mode is smaller than the maximum anti-shake angle corresponding to the second anti-shake mode. Dynamic selection between a high-precision first anti-shake mode and a second anti-shake mode with a larger stroke is possible, achieving adaptive matching for shaky scenarios. Controlling the optical anti-shake motor of the electronic device to operate according to the target anti-shake mode ensures that the actual range of motion of the motor is aligned with the actual required anti-shake precision or stroke in real time, thereby improving the adaptability of the anti-shake control. Attached Figure Description
[0013] Figure 1 is a flowchart of a stabilization control method provided in an embodiment of this application; Figure 2 is a flowchart of a method for determining a stabilization mode provided in an embodiment of this application; Figure 3 is a structural diagram of a stabilization control device provided in an embodiment of this application; Figure 4 is one of the hardware structure diagrams of an electronic device in an embodiment of this application; Figure 5 is another of the hardware structure diagrams of an electronic device in an embodiment of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0015] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0016] The following explains the technical terms used in the embodiments of this application: Gyroscope (Gyro): A sensor used to measure the angular velocity of a device, providing real-time angular velocity data of the device's rotation around its X, Y, and Z axes. It is the core input information for calculating the jitter angle and direction. Its data accuracy is easily affected by factors such as temperature drift.
[0017] Accelerometer (Acc): A sensor used to measure the linear acceleration of a device. In OIS (Optical Information System), it supplements the determination of the device's motion acceleration data. Its data is susceptible to high-frequency noise interference.
[0018] Optical Image Stabilization (OIS) refers to a technology that uses sensors such as gyroscopes and accelerometers to detect device shake and drive the lens or image sensor to make a reverse physical displacement in order to compensate for the shake and stabilize the image.
[0019] In view of the problems in the related technologies, the embodiments of this application provide a stabilization control method and device, which can solve the problem of insufficient adaptability of the current stabilization control in the related technologies.
[0020] The image stabilization control method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0021] Figure 1 is a flowchart of a stabilization control method provided in an embodiment of this application.
[0022] As shown in Figure 1, the image stabilization control method may include steps 110-130. This method is applied to an image stabilization control device, as follows: Step 110: Acquire the pose data of the electronic device within a first time window. The pose data includes at least one of acceleration data, angular velocity data, and image stabilization feedback angle. The image stabilization feedback angle is obtained by optical image stabilization processing based on the acceleration data and angular velocity data. Step 120: Determine the target image stabilization mode based on the pose data. The target image stabilization mode is either a first image stabilization mode or a second image stabilization mode. The maximum image stabilization angle corresponding to the first image stabilization mode is less than the maximum image stabilization angle corresponding to the second image stabilization mode. Step 130: Control the optical image stabilization motor of the electronic device to operate according to the target image stabilization mode.
[0023] Acceleration data refers to a data sequence measured by an accelerometer sensor, reflecting the linear acceleration of an electronic device along a spatial coordinate axis. Angular velocity data refers to a data sequence measured by a gyroscope sensor, reflecting the angular velocity of an electronic device rotating around a spatial coordinate axis. Anti-shake feedback angle refers to the angle information output by the optical image stabilization (OIS) algorithm, calculated based on real-time acquired acceleration and angular velocity data, representing the current position to which the OIS motor has moved to compensate for shake. The first time window refers to a continuous time period set for data analysis, during which sensor data generated within that time period is acquired and cached.
[0024] In step 110, the length of the first time window can be set according to the frame rate of the image sensor or the stabilization control cycle, with the aim of covering a meaningful motion cycle to analyze trends. For example, the window can be set to thirty-three milliseconds. Alternatively, the window can be set to fifty milliseconds to cover a longer motion analysis cycle.
[0025] The image stabilization feedback angle is calculated in real time by the optical image stabilization processing module. This calculation process uses sensor data to determine the motor compensation angle required to counteract shaking. For example, the stabilization processing module can use a complementary filter to fuse acceleration and angular velocity data to estimate the current device attitude change angle and use it as the stabilization feedback angle. Alternatively, the stabilization processing module can employ a proportional-integral-derivative (PID) controller, integrating angular velocity data and correcting it with acceleration data to output the stabilization feedback angle.
[0026] Step 120 aims to intelligently determine current and future shaking conditions and select the most suitable stabilization angle range accordingly. Different shaking amplitudes require different stabilization capabilities to match, and this need can be more accurately assessed through multi-dimensional data.
[0027] There are several ways to determine the target image stabilization mode. For example, the maximum value of the stabilization feedback angle within a first time window can be calculated and compared with a preset angle threshold. If it exceeds the threshold, the target image stabilization mode is determined to be the second image stabilization mode; otherwise, it is the first image stabilization mode. Another example is to analyze the volatility of angular velocity data over a short period, i.e., the variance. If the variance exceeds a certain threshold, it is determined that there is a significant risk of shaking, thus determining the target image stabilization mode as the second image stabilization mode.
[0028] Step 130 involves adjusting the motor control parameters according to the selected mode, essentially changing the allowable angle range limit of the motor's movement. When the target anti-shake mode is the first anti-shake mode, the motor is controlled with a smaller maximum angle limit, keeping it within a precise range. When the target anti-shake mode is the second anti-shake mode, this angle limit is relaxed, allowing the motor to move within a larger physical stroke to track and compensate for more severe vibrations.
[0029] The specific way to control the motor to operate according to the target mode can be manifested in different control commands. For example, a maximum current limit command corresponding to the first anti-shake mode can be sent to the motor driver. This limit determines the maximum thrust that the motor can generate, thereby indirectly limiting its range of motion angles. Alternatively, the parameters of the motor control loop can be directly configured, such as setting the target angle allowable range of the position loop to a wider range corresponding to the second anti-shake mode, enabling the motor to respond to and execute compensation commands with larger angles.
[0030] Step 110 acquires the pose data of the electronic device within the first time window, providing an information foundation for accurate judgment. Step 120 dynamically decides the target stabilization mode based on multi-dimensional data, enabling automatic activation of the small-angle working range in scenarios requiring high-precision compensation for small-amplitude shaking, and automatic switching to the large-angle working range when facing the risk of large-amplitude shaking, thus balancing high-precision stabilization with the ability to prevent motor movement from exceeding physical limits. Step 130 executes mode switching to achieve adaptive control of the optical image stabilization motor's operating range. Within a limited physical travel, stabilization resources can be allocated and used more intelligently, effectively improving the ability to cope with large-amplitude shaking without sacrificing the accuracy of small-amplitude shaking compensation, thereby enhancing the overall adaptability of optical image stabilization.
[0031] In one possible embodiment, step 120 may specifically include the following steps: step 210, determining the variance and differential information of acceleration data and angular velocity data; step 220, analyzing the directional relationship information between the vector directions of acceleration data and angular velocity data and the direction of the anti-shake feedback angle; step 230, determining the current motion state and future motion trend based on the variance information, differential information, and directional relationship information; and step 240, determining the target anti-shake mode based on the current motion state and future motion trend.
[0032] Variance information refers to the value obtained by calculating the dispersion of acceleration or angular velocity data within a first time window. It quantifies the magnitude of fluctuation of sensor data around its average value and is a key indicator for measuring the intensity or stability of motion. Differential information refers to the information obtained by calculating the rate of change of acceleration or angular velocity data over time. It reflects whether the motion speed or angular velocity is accelerating, decelerating, or remaining constant, and is used to determine the acceleration trend of motion.
[0033] Directional relationship information refers to the comparison and analysis of the average vector direction of acceleration data or angular velocity data at the current moment or over a period of time with the motor compensation displacement direction represented by the anti-shake feedback angle in the same coordinate system. The resulting description of whether the two are in the same direction, opposite directions, or have a specific angle reveals the real-time geometric relationship between equipment vibration and compensation motion.
[0034] Current motion state refers to the intensity and stability of the device's immediate motion, determined based on sensor data from a recent period. It describes whether the device is currently relatively stationary, experiencing slight shaking, or significant vibration. Future motion trend refers to the predicted direction of the device's motion over the next short period, based on the changing patterns and directions of sensor data. For example, it may predict whether the motion will level off, remain the same, or intensify.
[0035] The motion state and inertial trend of the device are reflected through the time series characteristics and vector direction relationships of sensor data. By performing real-time analysis and pattern recognition on this data, a judgment can be made. Specifically, by analyzing whether the changes in acceleration data are periodic and whether the image stabilization feedback angle fluctuates slightly near zero, a comprehensive judgment can be made as to whether the current state is a breathing-like slight movement state of handheld shooting or an irregular large-amplitude shaking state.
[0036] Key parameters representing the macroscopic statistical characteristics and instantaneous changes of motion are extracted from the raw sensor data stream to provide input for higher-level judgments. For example, for variance information, the variance of the three-axis angular velocity over the most recent one hundred sampling points can be calculated separately, yielding three scalar values to independently assess the jitter stability of each axis. As another example, the vector amplitudes of the three-axis accelerometers can be calculated first to obtain a sequence reflecting the overall linear acceleration magnitude, and then the variance of this amplitude sequence within a preset window can be calculated as a basis for judging the overall severity of the device's movement.
[0037] For differential information, for example, the backward difference method can be used, subtracting the value of the previous moment from the current angular velocity value and then dividing by the sampling interval to obtain an approximate instantaneous angular acceleration. Another example is linear fitting of a short, continuous acceleration data sequence, using the slope of the fitted line as the average rate of change of acceleration within that time period, i.e., an estimate of the differential information.
[0038] By analyzing the directional relationship between the vector directions of acceleration and angular velocity data and the direction of the anti-shake feedback angle, we can infer the persistence of jitter and the effectiveness of compensation, thereby predicting future dynamics. This directional relationship can be analyzed using different methods. For example, we can calculate the average vector direction of the angular velocity data over several past sampling periods, and the average change direction of the anti-shake feedback angle over the same period. We can then calculate the cosine of the angle between these two vectors. If this value consistently approaches positive one, it indicates that the jitter and compensation are consistently in the same direction. Another example is comparing the sign of the current accelerometer Y-axis data with the trend of the anti-shake feedback angle along the Y-axis. If the sign matches the trend, the directional relationship along that axis is determined to be in the same direction at the current moment.
[0039] Qualitative judgments about the motion of equipment can be made based on variance, differential, and directional relationship information using pre-defined rules or models. Specifically, for example, if the variance of the angular velocity of all axes is below a low threshold and the differential value of the angular velocity hovers around zero, the current motion state is determined to be stationary. If, simultaneously, the directional relationship information shows that the jitter and compensation directions often reverse, the future motion trend can be further determined to be towards stability. Another example: using variance, differential information of each axis, and the number of consecutive cycles in the same direction as input features, a pre-trained lightweight classification model can directly output classification labels for the current motion state and future motion trend.
[0040] By parallel computation of variance and differential information, key features describing the essence of motion were efficiently extracted. By analyzing the directional relationship between the vector direction of angular velocity data and the direction of the stabilization feedback angle, features concerning motion persistence and compensation phase—which cannot be revealed by amplitude information alone—were obtained. By fusing these three types of heterogeneous information for comprehensive judgment, the accuracy of recognizing complex user hand movement patterns and the reliability of motion trend prediction were improved. This lays a solid and accurate perceptual foundation for subsequently selecting the most suitable stabilization mode, enabling more sensitive capture of the device's motion posture and intent.
[0041] Predicting future motion trends can also be based on various data characteristics. For example, the first derivative of angular velocity over time can be calculated. If the value remains consistently positive or negative, it indicates that the angular velocity is continuously changing in a single direction, suggesting a potential for intensification of the motion. If the value oscillates around zero, it predicts that the motion will tend towards stabilization. Another example is analyzing the consistency between the direction of angular velocity data and the direction of change in the stabilization feedback angle over multiple consecutive moments. If the directions remain the same, it indicates that the current compensation motion direction is consistent with the jitter direction, and a larger stabilization travel may be needed to keep up in the future. If the directions are opposite, it indicates that the compensation motion is effectively counteracting the jitter, and the motion may revert to an equilibrium point in the future.
[0042] This involves mapping qualitative state and trend judgments to the optimal image stabilization strategy, i.e., selecting the most suitable stabilization angle range. For example, a direct mapping rule is that when the current motion state is judged to be stable or a small-amplitude motion, and the future motion trend is predicted to tend towards stabilization or maintain a small amplitude, then the target image stabilization mode is determined to be the first image stabilization mode, which is more beneficial to accuracy. Another example is that if the future motion trend is predicted to be one where the motion may intensify, regardless of the current state, the target image stabilization mode is pre-determined to be the second image stabilization mode, which provides a greater range, to cope with the impending large-amplitude shake.
[0043] By analyzing acceleration, angular velocity, and stabilization feedback angles, the current motion state and future motion trend of the electronic device are determined. This not only characterizes the current shake intensity but also predicts the direction of shake evolution, providing richer and more forward-looking data for decision-making. Based on the current motion state and future motion trend, the target stabilization mode is determined, and a more precise and adaptive stabilization mode selection logic is executed. This facilitates understanding the user's shooting scenario intent, such as whether to hold the device stably or follow the movement, thus making a more reasonable and timely trade-off between stabilization accuracy and range. Overall, this improves the intelligence level and scene adaptability of optical image stabilization.
[0044] In one possible embodiment, step 120 may specifically include the following steps: when at least one of the following conditions is met, the second image stabilization mode is determined as the target image stabilization mode: the variance of the angular velocity data in any coordinate axis direction exceeds a first variance threshold; the absolute value of the angular velocity data in any coordinate axis direction exceeds a first amplitude threshold; the differential value of the angular velocity data in any coordinate axis direction continuously increases for N consecutive acquisition frames, and the direction of change of the angular velocity data is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the direction of change of the angular velocity data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the variance of the acceleration data in any coordinate axis direction exceeds a second variance threshold; the direction of change of the acceleration data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the image stabilization feedback angle is greater than a preset angle value within a preset time period.
[0045] Variance refers to the degree to which a data sequence deviates from its mean, used to quantify the severity of fluctuations; absolute value refers to the scalar magnitude of the data; differential value refers to the rate of change of the data over time, reflecting how fast the change is; direction of change refers to the vector direction represented by the positive or negative data value; N consecutive acquisition frames refer to a continuous time slice or data acquisition period; preset duration refers to a pre-set time length.
[0046] If the variance of angular velocity data in any coordinate axis direction exceeds a first variance threshold, a significant increase in angular velocity variance indicates that the device's rotational motion around that axis has become highly unstable and irregular. This is a typical characteristic of severe handheld shaking, and a small-angle image stabilization travel may not be able to cover such irregular and large-amplitude shaking. This first variance threshold can be calibrated based on experimental data from typical shaking scenarios. For example, it can be set to 1.5 times the statistical value of angular velocity variance corresponding to normal walking shooting, or it can be set to a value that floats an order of magnitude upward from the variance baseline in a stationary state.
[0047] If the absolute value of the angular velocity data in any coordinate axis direction exceeds the first amplitude threshold, the instantaneous absolute value of the angular velocity is too large, directly indicating that the device has undergone very rapid rotation at a certain moment. Even if this rotation is instantaneous, it may require the motor to perform large-scale rapid compensation, necessitating a large-angle mode to provide sufficient travel margin to prevent "collision with the edge". This first amplitude threshold needs to take into account sensor noise and normal motion range, and can be set to 50 degrees per second for example.
[0048] If the differential value of the angular velocity data continuously increases over N consecutive acquisition frames along any coordinate axis, and its direction of change is the same as the direction of change of the anti-shake feedback angle along that axis, the continuous increase in the differential value indicates that the rotation is accelerating. Since its direction is the same as the direction of change of the anti-shake angle, it means that the current compensation motion direction is consistent with the direction of jitter acceleration, the compensation has not yet been able to offset the jitter, and the required angle may be increasing. For example, N can be set to 3, indicating that this phenomenon has been observed for three consecutive calculation cycles; it can also be set to 5 to require more continuous evidence and avoid misjudgment.
[0049] The angular velocity data shows that the direction of change of N consecutive acquisition frames along any coordinate axis is the same as the direction of change of the anti-shake feedback angle along that axis, identifying a "co-directional following" state where the jitter direction and the compensation direction are in the same direction for a long time. This indicates that on that axis, the motor's compensation motion is always in the same direction as the jitter, failing to achieve reverse cancellation, and may have already consumed a large amount of stroke in that direction, while the jitter continues. Therefore, it is necessary to switch to a mode with a larger stroke. For example, this N value can be the same as the aforementioned condition, or it can be set independently to 4.
[0050] If the variance of acceleration data in any coordinate axis exceeds the second variance threshold, a large acceleration variance indicates that the linear motion of the device in that axis (such as up-and-down swaying or rapid back-and-forth movement) is very violent. Although this violent linear motion does not directly produce rotation, it may couple into or foreshadow the start of large-angle rotation, and therefore serves as a basis for switching to large-angle mode.
[0051] The direction of change of acceleration data in any coordinate axis direction for N consecutive acquisition frames is the same as the direction of change of the anti-shake feedback angle in that axis direction. Similar to angular velocity, it detects the "following in the same direction" state from the perspective of linear motion, as an early warning signal that may face complex compound motion.
[0052] If the stabilization feedback angle is greater than the preset angle value within the preset duration, and remains at a high level for an extended period, it indicates that the travel margin of the small-angle mode is already very small and is nearing saturation. It may "hit the edge" at any time due to the next shake, so you should actively switch to the larger-angle mode with more resources. For example, the preset angle value can be set to 80% of the maximum angle of the first stabilization mode (e.g., 1.2 degrees), and the preset duration can be set to 200 milliseconds.
[0053] Through the above-described implementation method of parallel judgment based on multiple conditions, the need for a larger stabilization travel can be assessed in real time and comprehensively from multiple key dimensions such as the current intensity of the shake, the dynamic development trend of the shake, the interaction between shake and compensation, and the user's own state. This enhances the robustness and predictability of mode switching decisions, ensuring that the second stabilization mode can be switched in a timely and accurate manner in various scenarios, such as when the user's hand changes from stationary to moving, when a small shake develops into a large shake, or when a continuous unidirectional shaking occurs. This provides sufficient travel space for the optical image stabilization motor to meet the challenges, effectively avoiding compensation saturation or edge collisions caused by insufficient travel, and ensuring the continuity of the stabilization function.
[0054] In one possible embodiment, when the target image stabilization mode switches from the second image stabilization mode to the first image stabilization mode, step 130 may specifically include the following steps: if the image stabilization feedback angle is greater than the maximum image stabilization angle corresponding to the first image stabilization mode, then determine the angle adjustment step size strategy based on the relationship between the vector direction of the angular velocity data and acceleration data and the direction of the image stabilization feedback angle; according to the angle adjustment step size strategy, gradually adjust the upper limit of the image stabilization angle range of the optical image stabilization motor from the range corresponding to the second image stabilization mode to the range corresponding to the first image stabilization mode.
[0055] Angle adjustment step size strategy refers to a set of predefined rules used to determine the angle value or speed change that should be made in each adjustment step when the range of motion of the optical image stabilization motor is gradually reduced from its current larger upper limit to the smaller upper limit specified by the first image stabilization mode. The purpose of angle adjustment step size strategy is to achieve a smooth and stable mode transition.
[0056] When the stabilization feedback angle indicator shows that the motor has stopped at a position that exceeds the maximum angle range of the first stabilization mode, if the upper limit of the allowed motion angle is forcibly switched to a smaller range instantly, it will cause two problems: First, the motor is suddenly restricted, which will cause the image to jump violently; second, if the motor is forced to quickly return to the center, it will be misjudged as reverse shaking, thus triggering unnecessary reverse compensation and causing image drift.
[0057] Therefore, a controlled, gradual convergence process must be adopted. First, the necessity of the transition is determined by checking if the current stabilization feedback angle is greater than the maximum stabilization angle of the first stabilization mode. If it is not exceeded, it means the motor's current position is already within the target range, and the new range can be applied directly without special transition. If it is exceeded, the intelligent step size strategy determination and execution process is initiated.
[0058] The orientation of sensor data reveals the real-time trend of external jitter. Comparing this to the current position and orientation of the motor allows for the determination of the convergence speed that best aligns with the physical motion trend, thereby minimizing interference with the image while restoring accuracy. There are various designs for the specific rules governing this strategy. For example, when the orientation of the sensor data is the same as the orientation of the stabilization feedback angle, it indicates that external jitter is attempting to push the motor further away from the center. In this case, a smaller adjustment step size should be used to slowly shrink the upper limit of the angle range.
[0059] When the direction of the sensor data is opposite to the direction of the anti-shake feedback angle, it indicates that external vibration is pushing the motor back to the center position. In this case, a larger adjustment step size should be used to quickly shrink the upper limit of the angle range, following the natural flow, which can efficiently and seamlessly complete the transition. For example, differential information can be introduced for finer control, that is, calculating the derivative of the sensor data to determine whether the motion is accelerating or decelerating. If the direction is the same and the derivative value indicates that the motion is accelerating, a smaller step size or even a temporary halt to adjustment should be used; if the direction is the same but the derivative value indicates that the motion is decelerating, the step size can be appropriately increased.
[0060] Based on a defined angle adjustment step size strategy, the range adjustment is performed gradually over multiple control cycles. This decomposes a total change in the angle range into a series of tiny incremental changes, performing only one adjustment in each control cycle, thus ensuring a smooth and consistent response from the optical image stabilization motor control. Different implementation methods can be used for this purpose.
[0061] For example: Assume the upper limit of the second stabilization mode is 3 degrees, the first stabilization mode is 1.2 degrees, and the current stabilization feedback angle is 2 degrees. If the step size strategy is determined to be a 5-step pullback, then the amount to be adjusted in each step will be calculated as (3-1.2) / 5 = 0.36 degrees. In the next 5 control cycles, regardless of the real-time jitter command, the upper limit of the maximum allowable angle range will successively become 2.64 degrees, 2.28 degrees, 1.92 degrees, 1.56 degrees, and 1.2 degrees. Another example: The execution method can also be proportional contraction, for example, each control cycle uses a fixed proportion of the difference between the current upper limit and the target upper limit as the adjustment amount, achieving a smooth convergence curve that is faster at the beginning and slower as it gets closer to the target.
[0062] This ensures a smooth physical transition from wide-angle stabilization mode to narrow-angle high-precision mode, effectively avoiding potential motor command jumps or saturation caused by abrupt changes in the permissible range of motion. Secondly, by intelligently and dynamically adjusting the convergence step size based on the directional relationship between sensor data and motor position, the transition process adapts to the real-time trend of external vibrations, minimizing interference with active image stabilization performance during the transition period, making the mode switch imperceptible to the user. This guarantees a safe and smooth switching between high-precision and long-stroke operating modes in dynamically changing scenarios.
[0063] In one possible embodiment, the step of determining the angle adjustment step size strategy based on the relationship between the vector direction of the angular velocity data and acceleration data and the direction of the anti-shake feedback angle may specifically include the following steps: when the vector direction is the same as the direction of the anti-shake feedback angle, a first adjustment step size is adopted so that the upper limit of the anti-shake angle range is adjusted within M adjustment cycles; when the vector direction is opposite to the direction of the anti-shake feedback angle, a second adjustment step size is adopted so that the upper limit of the anti-shake angle range is adjusted within N adjustment cycles; M is greater than N, and both M and N are positive integers; wherein, the second adjustment step size is greater than the first adjustment step size.
[0064] The vector direction refers to the direction of the instantaneous motion or vibration of the equipment as represented by angular velocity and acceleration data. It is a vector information with positive and negative signs, used to determine which spatial direction the equipment is moving or rotating in.
[0065] The direction of the stabilization feedback angle refers to the angular vector direction corresponding to the actual position moved by the optical image stabilization motor to compensate for shake; it reflects the direction of the current compensation motion in space. The adjustment step size refers to the absolute value by which the upper limit of the stabilization angle range of the optical image stabilization motor is changed within one control cycle. The adjustment cycle refers to the time interval or control loop corresponding to one execution of the above step size adjustment.
[0066] Qualitative judgments of directional relationships are mapped to quantified convergence speed control parameters. When the external jitter trend aligns with the motor's current position direction, it means the motion has inertia to continue along the current direction. Rapidly pulling back to the limiting range may counteract this inertia, introducing control conflicts. Therefore, a slow convergence strategy with small step sizes and multiple cycles is chosen. When the external jitter trend is opposite to the motor's current position direction, it means the physical motion itself is helping the motor position return to the center. In this case, a fast convergence strategy with large step sizes and few cycles can efficiently and conflict-freely complete the range switching.
[0067] The first adjustment step size can be determined in different ways. For example, the difference between the current upper limit of the stabilization angle range and the target upper limit can be calculated, and then this difference can be divided by a large fixed number of cycles M (e.g., M=10), with the quotient used as the first adjustment step size. Alternatively, the first adjustment step size can be set to a small, fixed value, such as 0.15 degrees per cycle, so that the entire convergence process takes multiple cycles to complete, thus ensuring a smooth transition. The number of cycles M can be a preset value, such as 10 control cycles or 15 control cycles, with the aim of making the convergence process slow enough to avoid interference.
[0068] The determination of the second adjustment step size can also be done in different ways. For example, the difference between the current value and the target upper limit can be calculated and then divided by a small fixed number of cycles N (e.g., N=3) to obtain a second adjustment step size larger than the first adjustment step size. Alternatively, the second adjustment step size can be dynamically calculated based on the amplitude of the sensor data. Given the opposite direction, if the absolute value of the angular velocity is large, a larger step size can be used, such as 0.8 degrees per cycle, to achieve faster convergence. The number of cycles N is always a positive integer less than M, such as 3 or 5 control cycles, to achieve rapid adjustment.
[0069] When the motion trend is in the same direction as the current position, slow adjustments in small steps effectively avoid instantaneous degradation of stabilization performance or motor command saturation caused by excessively rapid contraction of the motion range, ensuring the smoothness and stability of the switching process. When the motion trend is in the opposite direction to the current position, rapid adjustments in large steps efficiently converge the working range to the high-precision mode, minimizing the transition time required for mode switching and any potential image disturbances. This makes the switching between stabilization modes an intelligent, gradual process, significantly improving the consistency of optical image stabilization behavior and the user's visual experience in complex motion scenarios.
[0070] In the embodiments of this application, pose data of the electronic device within a first time window is acquired. The pose data includes at least one of acceleration data, angular velocity data, and anti-shake feedback angle. The anti-shake feedback angle is obtained by optical image stabilization processing based on the acceleration data and angular velocity data. A target anti-shake mode is determined based on the pose data. The target anti-shake mode is either a first anti-shake mode or a second anti-shake mode, where the maximum anti-shake angle corresponding to the first anti-shake mode is smaller than the maximum anti-shake angle corresponding to the second anti-shake mode. Dynamic selection between a high-precision first anti-shake mode and a second anti-shake mode with a larger stroke is possible, achieving adaptive matching for shaky scenarios. Controlling the optical anti-shake motor of the electronic device to operate according to the target anti-shake mode ensures that the actual range of motion of the motor is aligned with the actual required anti-shake precision or stroke in real time, thereby improving the adaptability of the anti-shake control.
[0071] The image stabilization control method provided in this application can be executed by an image stabilization control device. This application uses an image stabilization control device executing the image stabilization control method as an example to illustrate the image stabilization control device provided in this application.
[0072] Figure 3 is a block diagram of a stabilization control device provided in an embodiment of this application. The device 300 includes: an acquisition module 310, used to acquire pose data of an electronic device within a first time window, the pose data including at least one of acceleration data, angular velocity data, and stabilization feedback angle; the stabilization feedback angle is obtained by optical image stabilization processing based on the acceleration data and angular velocity data; a determination module 320, used to determine a target stabilization mode based on the pose data; wherein the target stabilization mode is a first stabilization mode or a second stabilization mode, and the maximum stabilization angle corresponding to the first stabilization mode is less than the maximum stabilization angle corresponding to the second stabilization mode; and a control module 330, used to control the optical stabilization motor of the electronic device to operate according to the target stabilization mode.
[0073] In one possible embodiment, the determining module 320 is specifically used to: determine the variance and differential information of the acceleration data and angular velocity data; analyze the directional relationship information between the vector direction of the acceleration data and angular velocity data and the direction of the anti-shake feedback angle; determine the current motion state and future motion trend based on the variance information, differential information and directional relationship information; and determine the target anti-shake mode based on the current motion state and future motion trend.
[0074] In one possible embodiment, the determining module 320 is specifically configured to: determine the second anti-shake mode as the target anti-shake mode when at least one of the following conditions is met: the variance of the angular velocity data in any coordinate axis direction exceeds a first variance threshold; the absolute value of the angular velocity data in any coordinate axis direction exceeds a first amplitude threshold; the differential value of the angular velocity data in any coordinate axis direction continuously increases for N consecutive acquisition frames, and the direction of change of the angular velocity data is the same as the direction of change of the anti-shake feedback angle in that coordinate axis direction; the direction of change of the angular velocity data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the anti-shake feedback angle in that coordinate axis direction; the variance of the acceleration data in any coordinate axis direction exceeds a second variance threshold; the direction of change of the acceleration data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the anti-shake feedback angle in that coordinate axis direction; and the anti-shake feedback angle is greater than a preset angle value within a preset time period.
[0075] In one possible embodiment, when the target image stabilization mode switches from the second image stabilization mode to the first image stabilization mode, the control module 330 is specifically configured to: if the image stabilization feedback angle is greater than the maximum image stabilization angle corresponding to the first image stabilization mode, determine an angle adjustment step size strategy based on the relationship between the vector direction of the angular velocity data and the acceleration data and the direction of the image stabilization feedback angle; and, based on the angle adjustment step size strategy, gradually adjust the upper limit of the image stabilization angle range of the optical image stabilization motor from the range corresponding to the second image stabilization mode to the range corresponding to the first image stabilization mode.
[0076] In one possible embodiment, the control module 330 is specifically configured to: when the vector direction is the same as the direction of the anti-shake feedback angle, adopt a first adjustment step size to adjust the upper limit of the anti-shake angle range within M adjustment cycles; when the vector direction is opposite to the direction of the anti-shake feedback angle, adopt a second adjustment step size to adjust the upper limit of the anti-shake angle range within N adjustment cycles; M is greater than N, and both M and N are positive integers; wherein, the second adjustment step size is greater than the first adjustment step size. In the embodiments of this application, the pose data of the electronic device within a first time window is obtained, the pose data including at least one of acceleration data, angular velocity data, and anti-shake feedback angle; the anti-shake feedback angle is obtained by optical image anti-shake processing based on the acceleration data and angular velocity data; based on the pose data, a target anti-shake mode is determined; wherein, the target anti-shake mode is a first anti-shake mode or a second anti-shake mode, the maximum anti-shake angle corresponding to the first anti-shake mode is less than the maximum anti-shake angle corresponding to the second anti-shake mode; dynamic selection can be made between the high-precision first anti-shake mode and the second anti-shake mode with a larger stroke, realizing adaptive matching for shaking scenes. The optical image stabilization motor of the control electronic device operates according to the target image stabilization mode, so that the actual range of motion of the motor is aligned with the actual required image stabilization accuracy or stroke in real time, thereby improving the adaptability of image stabilization control.
[0077] The image stabilization control device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0078] The image stabilization control device in this application embodiment can be a device with a motion system. The motion system can be an Android motion system, an iOS motion system, or other possible motion systems; this application embodiment does not specifically limit it.
[0079] The image stabilization control device provided in this application embodiment can realize the various processes implemented in the above method embodiments, and will not be described again here to avoid repetition.
[0080] Optionally, as shown in FIG4, this application embodiment also provides an electronic device 610, including a processor 611, a memory 612, and a program or instructions stored in the memory 612 and executable on the processor 611. When the program or instructions are executed by the processor 611, they implement the various steps of any of the above anti-shake control method embodiments and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0081] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0082] Figure 5 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of this application. The electronic device 700 includes, but is not limited to, components such as: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
[0083] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for powering various components. The power supply can be logically connected to the processor 710 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The electronic device structure shown in Figure 5 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, which will not be elaborated here.
[0084] The processor 710 is used to acquire pose data of the electronic device within a first time window. The pose data includes at least one of acceleration data, angular velocity data, and anti-shake feedback angle. The anti-shake feedback angle is obtained by optical image stabilization processing based on the acceleration data and angular velocity data. The processor 710 is also used to determine a target anti-shake mode based on the pose data. The target anti-shake mode is either a first anti-shake mode or a second anti-shake mode, and the maximum anti-shake angle corresponding to the first anti-shake mode is less than the maximum anti-shake angle corresponding to the second anti-shake mode. The processor 710 is also used to control the optical anti-shake motor of the electronic device to operate according to the target anti-shake mode.
[0085] Optionally, the processor 710 is further configured to determine the variance and differential information of the acceleration and angular velocity data; the processor 710 is further configured to analyze the directional relationship information between the vector direction of the acceleration and angular velocity data and the direction of the anti-shake feedback angle; the processor 710 is further configured to determine the current motion state and future motion trend based on the variance information, differential information and directional relationship information; and the processor 710 is further configured to determine the target anti-shake mode based on the current motion state and future motion trend.
[0086] Optionally, the processor 710 is further configured to determine the second image stabilization mode as the target image stabilization mode when at least one of the following conditions is met: the variance of the angular velocity data in any coordinate axis direction exceeds a first variance threshold; the absolute value of the angular velocity data in any coordinate axis direction exceeds a first amplitude threshold; the differential value of the angular velocity data in any coordinate axis direction continuously increases for N consecutive acquisition frames, and the direction of change of the angular velocity data is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the direction of change of the angular velocity data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the variance of the acceleration data in any coordinate axis direction exceeds a second variance threshold; the direction of change of the acceleration data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; and the image stabilization feedback angle is greater than a preset angle value within a preset time period.
[0087] Optionally, when the target image stabilization mode is switched from the second image stabilization mode to the first image stabilization mode, the processor 710 is further configured to determine an angle adjustment step size strategy based on the relationship between the vector direction of the angular velocity data and acceleration data and the direction of the image stabilization feedback angle if the image stabilization feedback angle is greater than the maximum image stabilization angle corresponding to the first image stabilization mode; and gradually adjust the upper limit of the image stabilization angle range of the optical image stabilization motor from the range corresponding to the second image stabilization mode to the range corresponding to the first image stabilization mode according to the angle adjustment step size strategy.
[0088] Optionally, the processor 710 is further configured to, when the vector direction is the same as the direction of the anti-shake feedback angle, adopt a first adjustment step size to adjust the upper limit of the anti-shake angle range within M adjustment cycles; when the vector direction is opposite to the direction of the anti-shake feedback angle, adopt a second adjustment step size to adjust the upper limit of the anti-shake angle range within N adjustment cycles; M is greater than N, and both M and N are positive integers; wherein, the second adjustment step size is greater than the first adjustment step size. In the embodiments of this application, the pose data of the electronic device within a first time window is obtained, the pose data including at least one of acceleration data, angular velocity data, and anti-shake feedback angle; the anti-shake feedback angle is obtained by optical image anti-shake processing based on the acceleration data and angular velocity data; a target anti-shake mode is determined based on the pose data; wherein, the target anti-shake mode is a first anti-shake mode or a second anti-shake mode, the maximum anti-shake angle corresponding to the first anti-shake mode is less than the maximum anti-shake angle corresponding to the second anti-shake mode; dynamic selection can be made between the high-precision first anti-shake mode and the second anti-shake mode with a larger stroke, realizing adaptive matching for shaking scenes. The optical image stabilization motor of the control electronic device operates according to the target image stabilization mode, so that the actual range of motion of the motor is aligned with the actual required image stabilization accuracy or stroke in real time, thereby improving the adaptability of image stabilization control.
[0089] It should be understood that, in this embodiment, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or video images obtained by an image capture device (such as a camera) in video image capture mode or image capture mode. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here. The memory 709 can be used to store software programs and various data, including but not limited to applications and motion systems. Processor 710 can integrate an application processor and a modem processor. The application processor mainly handles the action system, user page, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 710.
[0090] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 709 may include volatile memory or non-volatile memory, or it may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0091] Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 710.
[0092] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described anti-shake control method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0093] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0094] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described anti-shake control method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0095] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0096] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the anti-shake control method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0097] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0099] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An optical image stabilization control method, characterized in that, The method includes: acquiring pose data of an electronic device within a first time window, the pose data including at least one of acceleration data, angular velocity data, and anti-shake feedback angle; the anti-shake feedback angle being obtained by optical image stabilization processing based on the acceleration data and angular velocity data; determining a target anti-shake mode based on the pose data; wherein the target anti-shake mode is a first anti-shake mode or a second anti-shake mode, the maximum anti-shake angle corresponding to the first anti-shake mode being less than the maximum anti-shake angle corresponding to the second anti-shake mode; and controlling the optical anti-shake motor of the electronic device to operate according to the target anti-shake mode.
2. The method according to claim 1, characterized in that, The step of determining the target stabilization mode based on the pose data includes: determining the variance and differential information of the acceleration data and the angular velocity data; analyzing the directional relationship information between the vector directions of the acceleration data and the angular velocity data and the direction of the stabilization feedback angle; determining the current motion state and the future motion trend based on the variance information, the differential information, and the directional relationship information; and determining the target stabilization mode based on the current motion state and the future motion trend.
3. The method according to claim 1, characterized in that, The step of determining the target image stabilization mode based on the pose data includes: determining the second image stabilization mode as the target image stabilization mode when at least one of the following conditions is met: the variance of the angular velocity data in any coordinate axis direction exceeds a first variance threshold; the absolute value of the angular velocity data in any coordinate axis direction exceeds a first amplitude threshold; the differential value of the angular velocity data in any coordinate axis direction continuously increases for N consecutive acquisition frames, and the direction of change of the angular velocity data is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the direction of change of the angular velocity data in any coordinate axis direction for N consecutive acquisition frames is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; the variance of the acceleration data in any coordinate axis direction exceeds a second variance threshold; the direction of change of the acceleration data in any coordinate axis direction for N consecutive acquisition frames is the same as the direction of change of the image stabilization feedback angle in that coordinate axis direction; and the image stabilization feedback angle is greater than a preset angle value within a preset time period.
4. The method according to claim 1, characterized in that, When the target image stabilization mode switches from the second image stabilization mode to the first image stabilization mode, controlling the optical image stabilization motor to operate according to the target image stabilization mode includes: if the image stabilization feedback angle is greater than the maximum image stabilization angle corresponding to the first image stabilization mode, then determining an angle adjustment step size strategy based on the relationship between the vector directions of the angular velocity data and acceleration data and the direction of the image stabilization feedback angle; and adjusting the upper limit of the image stabilization angle range of the optical image stabilization motor from the range corresponding to the second image stabilization mode to the range corresponding to the first image stabilization mode according to the angle adjustment step size strategy.
5. The method according to claim 4, characterized in that, The step of determining the angle adjustment step size strategy based on the relationship between the vector directions of the angular velocity data and acceleration data and the direction of the anti-shake feedback angle includes: when the vector direction is the same as the direction of the anti-shake feedback angle, a first adjustment step size is adopted so that the upper limit of the anti-shake angle range is adjusted within M adjustment cycles; when the vector direction is opposite to the direction of the anti-shake feedback angle, a second adjustment step size is adopted so that the upper limit of the anti-shake angle range is adjusted within N adjustment cycles; where M is greater than N, and both M and N are positive integers; wherein, the second adjustment step size is greater than the first adjustment step size.
6. A shake-resistant control device, characterized in that, The device includes: an acquisition module for acquiring pose data of an electronic device within a first time window, the pose data including at least one of acceleration data, angular velocity data, and anti-shake feedback angle; the anti-shake feedback angle is obtained by optical image stabilization processing based on the acceleration data and angular velocity data; a determination module for determining a target anti-shake mode based on the pose data; wherein the target anti-shake mode is a first anti-shake mode or a second anti-shake mode, the maximum anti-shake angle corresponding to the first anti-shake mode is less than the maximum anti-shake angle corresponding to the second anti-shake mode; and a control module for controlling the optical anti-shake motor of the electronic device to operate according to the target anti-shake mode.
7. The apparatus according to claim 6, characterized in that, The determining module is specifically used to: determine the variance and differential information of the acceleration data and the angular velocity data; and analyze the directional relationship information between the vector directions of the acceleration data and the angular velocity data and the direction of the anti-shake feedback angle. The current motion state and the future motion trend are determined based on the variance information, the differential information, and the directional relationship information. The target stabilization mode is determined based on the current motion state and the future motion trend.
8. The apparatus according to claim 6, characterized in that, The determining module is specifically configured to: determine the second anti-shake mode as the target anti-shake mode when at least one of the following conditions is met: the variance of the angular velocity data in any coordinate axis direction exceeds a first variance threshold; the absolute value of the angular velocity data in any coordinate axis direction exceeds a first amplitude threshold; the differential value of the angular velocity data in any coordinate axis direction continuously increases for N consecutive acquisition frames, and the direction of change of the angular velocity data is the same as the direction of change of the anti-shake feedback angle in that coordinate axis direction; the direction of change of the angular velocity data in any consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the anti-shake feedback angle in that coordinate axis direction; the variance of the acceleration data in any coordinate axis direction exceeds a second variance threshold. The direction of change of the acceleration data in any N consecutive acquisition frames in any coordinate axis direction is the same as the direction of change of the anti-shake feedback angle in that coordinate axis direction; The anti-shake feedback angle is greater than a preset angle value within a preset time period.
9. The apparatus according to claim 6, characterized in that, When the target image stabilization mode switches from the second image stabilization mode to the first image stabilization mode, the control module is specifically configured to: if the image stabilization feedback angle is greater than the maximum image stabilization angle corresponding to the first image stabilization mode, determine an angle adjustment step size strategy based on the relationship between the vector directions of the angular velocity data and acceleration data and the direction of the image stabilization feedback angle; and, based on the angle adjustment step size strategy, gradually adjust the upper limit of the image stabilization angle range of the optical image stabilization motor from the range corresponding to the second image stabilization mode to the range corresponding to the first image stabilization mode within multiple control cycles.
10. The apparatus according to claim 6, characterized in that, The control module is specifically used to: when the vector direction is the same as the direction of the anti-shake feedback angle, adopt a first adjustment step size so that the upper limit of the anti-shake angle range is adjusted within M adjustment cycles; When the vector direction is opposite to the direction of the anti-shake feedback angle, a second adjustment step size is adopted so that the upper limit of the anti-shake angle range is adjusted within N adjustment cycles. M is greater than N, and both M and N are positive integers; wherein the second adjustment step size is greater than the first adjustment step size.