OIS anti-shake compensation calculation method and system and storage medium
By initializing and calibrating the gyroscope data, combined with high-frequency filtering and multi-stage integral angle compensation, the problem of insufficient accuracy in jitter compensation is solved, and higher image stability and user experience are achieved.
Patent Information
- Application Number
- CN202411820321.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-14
AI Technical Summary
The existing OIS algorithms lack accuracy in jitter compensation, resulting in inaccurate lens offset and affecting image clarity.
Through the initialization and calibration of gyroscope data, combined with high-frequency filtering and multi-stage integral angle compensation, the target position of the lens is calculated in real time and the lens is adjusted to improve the accuracy of jitter compensation.
It improves the accuracy of lens positioning, effectively suppresses lens jitter, enhances image stability and user experience, reduces the demand for computing resources, and ensures real-time and efficientness.
Smart Images

Figure CN119629479A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical image stabilization, and in particular to an OIS anti-shake compensation calculation method, system and storage medium. Background Art
[0002] In modern camera equipment, as the demand for image capture continues to grow, anti-shake technology is particularly important. OIS technology greatly improves image clarity by adjusting the lens position in real time to compensate for lens shift caused by device shaking.
[0003] However, due to irregular motion in the shooting environment and long-term shooting requirements, the existing OIS system still has problems such as inaccurate jitter compensation and lens offset caused by filtering delay in practical applications.
[0004] Therefore, there is an urgent need for an OIS anti-shake compensation calculation method, system and storage medium that can solve the problem of insufficient accuracy of the existing OIS algorithm in jitter compensation, improve accuracy, reduce the demand for computing resources, and ensure real-time and high efficiency. Summary of the invention
[0005] One of the purposes of the present invention is to provide an OIS anti-shake compensation calculation method, which can solve the problem of insufficient accuracy of the existing OIS algorithm in shake compensation, improve accuracy, and at the same time reduce the demand for computing resources, ensure real-time and high efficiency, so as to further improve the stability and quality of image shooting.
[0006] The present invention provides a basic solution 1: an OIS anti-shake compensation calculation method, including the following contents:
[0007] Initialization step: Initialize the device and data settings;
[0008] Gyroscope calibration steps: calibrate the gyroscope and obtain the calibration value;
[0009] Compensation calculation steps: perform compensation calculation according to the calibration value, obtain the target position of the lens, and calculate the adjustment data required for the lens;
[0010] Compensation steps: adjust the lens to the target position according to the adjustment data;
[0011] The gyroscope calibration step includes: S2, calculating the zero drift value: when the vibration table is turned off, obtaining the gyroscope data in a static state for a preset time length, and taking the average value of all the gyroscope data as the zero drift value z;
[0012] S3. Read the gyroscope data at a fixed frequency, subtract the zero drift value from the currently read gyroscope data, and obtain the calibration value: g c =gz;
[0013] The compensation calculation steps, executed in the loop of S3, include:
[0014] S4, after calibrating g, calculate the offset angle of the current lens relative to the initial position by integration;
[0015] S5, using a plurality of IIR filters to filter the integral angle;
[0016] S6, converting the integral angle into a target position;
[0017] S7. According to the target position, the lens is calculated and adjusted, and the gyroscope adjusts the data on the coordinate axis.
[0018] Furthermore, the fixed frequency is 1000 Hz.
[0019] Further, the initialization step includes: S1, initialization settings:
[0020] Initialize the gyroscope, set the frequency and range of the gyroscope, and enable the filter inside the gyroscope;
[0021] Driver IC is initialized and the lens is pushed to the center point M of the motor range;
[0022] MCU initialization, configuration frequency, peripherals.
[0023] Furthermore, the gyroscope needs to perform S2 every time it is powered on:
[0024]
[0025] Among them, g i Represents the i-th gyroscope data, N represents the total number of gyroscope data obtained, i∈[1,N].
[0026] Further, the S4 comprises:
[0027] a current =a previous +g c ×Δt;
[0028] a previous =a current ;
[0029] Among them, a current Indicates the offset angle of the current lens, a previous Indicates the offset angle of the lens at the last moment, the initial a previous is 0, and Δt is the time interval for reading the gyroscope data each time.
[0030] Further, the S5 comprises:
[0031] Use a first-order Chebyshev high-pass filter and set the cutoff frequency to 0.1-0.15Hz to quickly eliminate the accumulated error caused by integration:
[0032]
[0033] Among them, F1 is a first-order Chebyshev high-pass filter;
[0034] The process of passing through multiple filters is:
[0035]
[0036] Where i∈[2,n], n represents the number of high-pass filters;
[0037] or
[0038] Among them, i∈[2,n], n represents the number of filters, and b represents the impact factor.
[0039] Further, target = M + tan (a f )×G;
[0040] Among them, G represents the adjustable coefficient, target represents the target position of the lens, and the adjustment of G will change the lens compensation amplitude to obtain the best compensation value.
[0041] Furthermore, the compensation step comprises:
[0042] S8, MCU generates and sends the control motor according to the adjustment data to move the lens to the target position to compensate for the camera's jitter displacement.
[0043] The second purpose of the present invention is to provide an OIS anti-shake compensation calculation system, which can solve the problem of insufficient accuracy of the existing OIS algorithm in shake compensation, improve accuracy, and at the same time reduce the demand for computing resources, ensure real-time and high efficiency, so as to further improve image shooting stability and quality.
[0044] The present invention provides a second basic solution: an OIS anti-shake compensation calculation system, which adopts the above-mentioned OIS anti-shake compensation calculation method.
[0045] The third object of the present invention is to provide a storage medium that can solve the problem of insufficient accuracy of the existing OIS algorithm in jitter compensation, improve accuracy, and at the same time reduce the demand for computing resources, ensure real-time and high efficiency, so as to further improve the stability and quality of image shooting.
[0046] The present invention provides a third basic solution: a storage medium storing a computer program, wherein the computer program implements the steps of the above-mentioned OIS anti-shake compensation calculation method when executed by a processor.
[0047] Beneficial effect: The present invention sets up an OIS anti-shake method for real-time updating of the zero drift value and the integral offset angle, which solves the shortcomings of the traditional OIS algorithm in the jitter compensation accuracy. Specifically, through the initialization and calibration of gyroscope data, combined with high-frequency filtering and multi-level integral angle compensation, the lens can be adjusted to the target position in real time, reducing the error of lens movement, and can more accurately eliminate the irregular offset caused by the movement of the device. At the same time, it reduces the algorithm's demand for computing resources, ensuring real-time and high efficiency.
[0048] Specifically include:
[0049] Improved accuracy: Multiple filters are used to filter the integral angle, especially high-pass filters to eliminate low-frequency drift, making the integral angle more stable and reliable, thereby improving the accuracy of lens positioning; it can effectively suppress lens shake, has a good anti-shake effect, and the compression rate (Suppression Rate, SR) reaches at least 30dB;
[0050] Enhanced real-time performance: Through high-frequency sampling and fast calculation of gyroscope data, the response speed of the OIS system is improved, so that the lens can respond to device jitter in real time and achieve smoother lens compensation;
[0051] Reduce error: This solution provides a way to dynamically adjust the zero drift value to reduce the impact of factors such as ambient temperature and time changes on the zero drift value, significantly reducing the cumulative error and ensuring the stability of the anti-shake effect;
[0052] System stability: By precisely controlling the lens position in the MCU, the stability of the system is ensured during long-term operation;
[0053] Low cost and flexibility: You can flexibly choose low-cost MCU and Driver IC, which is lower than the cost of dedicated OISDriver IC.
[0054] In summary, this solution can solve the problem of insufficient accuracy of the existing OIS algorithm in jitter compensation, improve accuracy, and at the same time reduce the demand for computing resources, ensure real-time and high efficiency, so as to further improve the stability and quality of image shooting. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 The present invention provides an OIS module control block diagram in an embodiment of an OIS anti-shake compensation calculation method. DETAILED DESCRIPTION
[0056] The following is further described in detail through specific implementation methods:
[0057] This embodiment basically provides an OIS anti-shake compensation calculation method, including the following contents:
[0058] Initialization step: Perform device and data initialization settings, including:
[0059] S1, initialization settings;
[0060] Specifically, the initialization settings include:
[0061] Initialize the gyroscope, set the frequency and range of the gyroscope, and enable the filter inside the gyroscope;
[0062] Driver IC is initialized and the lens is pushed to the center point M of the motor range;
[0063] MCU initialization, configuration frequency, peripherals, etc.;
[0064] After all initialization and calibration are completed, proceed to the subsequent steps.
[0065] Gyroscope calibration steps: calibrate the gyroscope and obtain the calibration value, including;
[0066] S2, calculate zero drift value;
[0067] When the vibration table is turned off, the gyroscope data in the static state of the preset time length is obtained, wherein the preset time length is 3-5s, and the obtained gyroscope data is around 0;
[0068] According to all the gyroscope data, the average value is taken as the zero drift value;
[0069] The specific calculation method is as follows, and S2 needs to be performed every time the power is turned on:
[0070]
[0071] Among them, g i Represents the i-th gyroscope data, N represents the total number of gyroscope data obtained, i∈[1,N].
[0072] S3. Read the gyroscope data at a fixed frequency (1000Hz) in a loop, subtract the zero drift value from the currently read gyroscope data, and obtain the calibration value:
[0073] g c =gz;
[0074] And continue to execute the compensation calculation step and the compensation step in the loop, i.e. S4-S8;
[0075] Compensation calculation steps: Perform compensation calculation based on the calibration value, obtain the target position of the lens, and calculate the adjustment data required for the lens, including:
[0076] S4. After calibrating g, calculate the offset angle of the current lens relative to the initial position by integration:
[0077] a current =a previous +g c ×Δt;
[0078] a previous =a current ;
[0079] Among them, a current Indicates the offset angle of the current lens, a previous Indicates the offset angle of the lens at the last moment, the initial a previous is 0, Δt is the time interval for reading gyroscope data each time, and in this embodiment, the gyroscope rate is set to 1000 Hz, then Δt is 0.001s;
[0080] S5, using a plurality of IIR filters to filter the integral angle (i.e., the offset angle obtained by integral calculation);
[0081] Because there will be some drift in the integral angle calculated in S4, which will have a great impact on subsequent calculations and affect the compensation effect, multiple IIR filters are used to filter the integral angle. The functions of these filters are not exactly the same, as follows:
[0082] First, use a first-order Chebyshev high-pass filter and set the cutoff frequency to 0.1-0.15Hz to quickly eliminate the accumulated error caused by integration:
[0083]
[0084] Among them, F1 is a first-order Chebyshev high-pass filter;
[0085] Then, because the integral angle will have a phase shift after passing through the previous filter, multiple first-order Chebyshev high-pass filters can be used continuously to adjust the phase of the integral angle by adjusting its cutoff frequency;
[0086] The process of passing through multiple filters is:
[0087]
[0088] Where i∈[2,n], n represents the number of high-pass filters;
[0089] To get the final output a of the filter at this stagef There are two methods. The first one is The second is that all the above formulas are obtained Fusion to get a more appropriate result:
[0090]
[0091] Among them, i∈[2,n], n represents the number of filters, and b represents the impact factor.
[0092] S6. Convert the integral angle to the target position:
[0093] target=M+tan(a f )×G;
[0094] Where G represents the adjustable coefficient, target represents the target position of the lens, and the adjustment of G will change the lens compensation amplitude to obtain the best compensation value;
[0095] S7, according to the target position, the lens is calculated and adjusted, and the gyroscope adjusts the data on the coordinate axis;
[0096] Specifically, the gyroscope adjustment data on the coordinate axis includes: data on the gyroscope x and y axes. The gyroscope x-axis data can obtain the target position target_x of the lens x axis through steps S2-S6, and the gyroscope y-axis data can obtain the target position target_y of the lens y axis through steps S2-S6.
[0097] Compensation steps: According to the adjustment data, adjust the lens to the target position, including:
[0098] S8. The MCU generates and sends control instructions based on the adjustment data to control the motor to move the lens to the target position to compensate for the camera's jitter displacement.
[0099] This solution can be widely used in electronic devices that require optical image stabilization functions, such as smart phones, camera modules, and drone photography. The OIS anti-shake method of this solution can adapt to various complex shooting environments, help to significantly improve image stability and user experience, provide higher anti-shake capabilities for imaging, and has broad market application prospects.
[0100] like Figure 1 As shown, when this solution is implemented, an OIS module control block diagram is constructed, in which the Hall sensor is optional, the closed-loop OIS has a Hall sensor, and the open-loop OIS does not; Figure 1 The names of the components are as follows:
[0101] Lens: Lens;
[0102] Hall Sensor: Hall sensor;
[0103] VCM: Voice Coil Motor;
[0104] OISDriver / MCU: Optical image stabilization driver / microcontroller unit;
[0105] CMOS Sensor: Complementary Metal Oxide Semiconductor Sensor;
[0106] Gyro Sensor: gyroscope sensor;
[0107] AF Driver: Autofocus driver;
[0108] AP / ISP: Image Signal Processor.
[0109] This embodiment further provides an OIS anti-shake compensation calculation system, which adopts the above OIS anti-shake compensation calculation method.
[0110] This embodiment further provides a storage medium storing a computer program, which implements the steps of the above-mentioned OIS anti-shake compensation calculation method when executed by a processor.
[0111] If the above-mentioned introduction text method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiment when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0112] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is not described in detail here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can obtain all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. An OIS anti-shake compensation calculation method, characterized in that: It includes the following: Initialization step: Initialize the device and data settings; Gyroscope calibration steps: calibrate the gyroscope and obtain the calibration value; Compensation calculation steps: perform compensation calculation according to the calibration value, obtain the target position of the lens, and calculate the adjustment data required for the lens; Compensation steps: adjust the lens to the target position according to the adjustment data; The gyroscope calibration step includes: S2, calculating the zero drift value: when the vibration table is turned off, obtaining the gyroscope data in a static state for a preset time length, and taking the average value of all the gyroscope data as the zero drift value z; S3. Read the gyroscope data at a fixed frequency, subtract the zero drift value from the currently read gyroscope data, and obtain the calibration value: g c =gz; The compensation calculation steps, executed in the loop of S3, include: S4, after calibrating g, calculate the offset angle of the current lens relative to the initial position by integration; S5, using a plurality of IIR filters to filter the integral angle; S6, converting the integral angle into a target position; S7. According to the target position, the lens is calculated and adjusted, and the gyroscope adjusts the data on the coordinate axis.
2. The OIS anti-shake compensation calculation method according to claim 1, characterized in that: The fixed frequency is 1000 Hz.
3. The OIS anti-shake compensation calculation method according to claim 1, characterized in that: The initialization step includes: S1, initialization setting: Initialize the gyroscope, set the frequency and range of the gyroscope, and enable the filter inside the gyroscope; Driver IC is initialized and the lens is pushed to the center point M of the motor range; MCU initialization, configuration frequency, peripherals.
4. The OIS anti-shake compensation calculation method according to claim 1, characterized in that: The gyroscope needs to perform S2 every time it is powered on: Among them, g i Represents the i-th gyroscope data, N represents the total number of gyroscope data obtained, i∈[1,N].
5. The OIS anti-shake compensation calculation method according to claim 4, characterized in that: The S4 comprises: a current =a previous +g c ×Δt; a previous =a current ; Among them, a current Indicates the offset angle of the current lens, a previous Indicates the offset angle of the lens at the last moment, the initial a previous is 0, and Δt is the time interval for reading the gyroscope data each time.
6. The OIS anti-shake compensation calculation method according to claim 5, characterized in that: The S5 comprises: Use a first-order Chebyshev high-pass filter and set the cutoff frequency to 0.1-0.15Hz to quickly eliminate the accumulated error caused by integration: Among them, F1 is a first-order Chebyshev high-pass filter; The process of passing through multiple filters is: Where i∈[2,n], n represents the number of high-pass filters; or Among them, i∈[2,n], n represents the number of filters, and b represents the impact factor.
7. The OIS anti-shake compensation calculation method according to claim 6, characterized in that: target=M+tan(a f )×G; Among them, G represents the adjustable coefficient, target represents the target position of the lens, and the adjustment of G will change the lens compensation amplitude to obtain the best compensation value.
8. The OIS anti-shake compensation calculation method according to claim 7, characterized in that: The compensation step comprises: S8. The MCU generates and sends control instructions based on the adjustment data to control the motor to move the lens to the target position to compensate for the camera's jitter displacement.
9. An OIS anti-shake compensation calculation system, characterized in that: The OIS anti-shake compensation calculation method as described in any one of claims 1 to 8 is adopted.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the OIS anti-shake compensation calculation method according to any one of claims 1 to 8 are implemented.