Anti-shake method and device, camera module, electronic equipment and readable storage medium

By receiving jitter waveform signals in the camera module and calibrating the signal to compensate for the phase difference, the problem of poor image stabilization caused by the delay of the image stabilization algorithm is solved, and a more efficient optical image stabilization effect is achieved.

CN119603557BActive Publication Date: 2026-07-21VIVO MOBILE COMM CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VIVO MOBILE COMM CO LTD
Filing Date
2024-11-27
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing camera module image stabilization algorithms suffer from latency, resulting in poor image stabilization performance.

Method used

By receiving the jitter waveform signal in the camera module, the motor assembly is controlled to perform optical image stabilization according to the target image stabilization gain, and the amplitude and timing error of the jitter are calibrated by signal compensation phase difference to improve the image stabilization effect.

Benefits of technology

It effectively eliminates time delay errors in the optical image stabilization process, improving the image stabilization effect of the camera module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603557B_ABST
    Figure CN119603557B_ABST
Patent Text Reader

Abstract

The application discloses a kind of anti-shake method, device, camera module, electronic equipment and readable storage medium, belong to electronic equipment technical field.Anti-shake method is applied to camera module, camera module includes lens assembly and motor assembly, anti-shake method includes: in the case where first waveform signal is received, control motor assembly according to target anti-shake gain optical anti-shake is carried out to lens assembly, first waveform signal is the waveform signal that analog lens assembly is subjected to first jitter;According to first waveform signal and first driving signal, determine signal compensation phase difference, first driving signal is the signal that motor assembly drives lens assembly according to target anti-shake gain and prevents the first jitter;In the case where lens assembly shoots image, according to target anti-shake gain and signal compensation phase difference, control motor assembly is carried out optical anti-shake to lens assembly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electronic equipment technology, and specifically relates to a stabilization method, device, camera module, electronic device and readable storage medium. Background Technology

[0002] As people's demand for taking pictures with mobile phones and other electronic devices increases, cameras with image stabilization are becoming more and more popular.

[0003] In related technologies, in the actual image stabilization system of the camera module, at time t0, the shaking signal is input to the camera, the image stabilization algorithm processes it and calculates the target compensation value. After a period of time t1, the target value instruction is sent to the image stabilization motor to move to the designated position. After another period of time t2, this means that the compensation displacement moved by the image stabilization motor is compensation for the shaking signal at time t0. However, the signal has changed at this time. Due to the delay in the image stabilization algorithm, the image stabilization effect of the camera module is poor. Summary of the Invention

[0004] The purpose of this application is to provide a stabilization method, device, camera module, electronic device, and readable storage medium, which solves the problem of deteriorated stabilization effect caused by the delay in the stabilization algorithm.

[0005] In a first aspect, embodiments of this application provide a stabilization method applied to a camera module, the camera module including a lens assembly and a motor assembly. The stabilization method includes: upon receiving a first waveform signal, controlling the motor assembly to perform optical stabilization on the lens assembly according to a target stabilization gain, the first waveform signal being a waveform signal simulating a first shake experienced by the lens assembly; determining a signal compensation phase difference based on the first waveform signal and a first drive signal, the first drive signal being a signal used by the motor assembly to drive the lens assembly to stabilize the first shake according to the target stabilization gain; and when the lens assembly is capturing an image, controlling the motor assembly to perform optical stabilization on the lens assembly according to the target stabilization gain and the signal compensation phase difference.

[0006] Secondly, embodiments of this application provide an image stabilization device applied to a camera module. The camera module includes a lens assembly and a motor assembly. The image stabilization device includes: a control module, configured to control the motor assembly to perform optical image stabilization on the lens assembly according to a target image stabilization gain upon receiving a first waveform signal, wherein the first waveform signal is a waveform signal simulating a first shake experienced by the lens assembly; a determination module, configured to determine a signal compensation phase difference based on the first waveform signal and a first drive signal, wherein the first drive signal is a signal in which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain; and a control module, configured to control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain and the signal compensation phase difference when the lens assembly is capturing an image.

[0007] Thirdly, embodiments of this application provide a camera module, including: a lens assembly; a motor assembly, the output terminal of which is connected to the lens assembly; and a control assembly connected to the lens assembly and the motor assembly, configured to, upon receiving a first waveform signal, control the motor assembly to perform optical image stabilization on the lens assembly according to a target image stabilization gain, wherein the first waveform signal is a waveform signal simulating a first shake experienced by the lens assembly; determine a signal compensation phase difference based on the first waveform signal and a first drive signal, wherein the first drive signal is a signal in which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain; and, when the lens assembly captures an image, control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain and the signal compensation phase difference.

[0008] Fourthly, embodiments of this application provide an electronic device, including: a camera output device; a camera module as described in any of the above embodiments, disposed in the camera output device; and a waveform output device connected to the camera module for transmitting jitter signals to the camera module.

[0009] Fifthly, 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 as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a chip including a processor and a communication interface coupled to the processor, the processor being used to run programs or instructions to implement the steps of the method as described in the first aspect.

[0011] In a seventh 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 as described in the first aspect.

[0012] In this embodiment, after determining the target image stabilization gain of the camera module, a first waveform signal is transmitted to the camera module, and a first drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained. Then, the signal compensation phase difference is determined by comparing the first waveform signal and the first drive signal. When the camera module captures an image, the amplitude of the shake is calibrated using the target image stabilization gain, and the image stabilization timing error is calibrated using the signal compensation phase difference, thereby improving the image stabilization effect of the camera module. Attached Figure Description

[0013] Figure 1 A flowchart illustrating the anti-shake method provided in some embodiments of this application is shown;

[0014] Figure 2This illustration shows one of the structural schematic diagrams of the camera module provided in some embodiments of this application;

[0015] Figure 3 Waveform diagrams of the first waveform signal provided in some embodiments of this application are shown;

[0016] Figure 4 The waveform diagram of the first drive signal provided in some embodiments of this application is shown;

[0017] Figure 5 The waveform diagrams of the second drive signal provided in some embodiments of this application are shown;

[0018] Figure 6 The following are waveforms of the input jitter signal provided in some embodiments of this application;

[0019] Figure 7 This paper illustrates a phase compensation diagram of an input jitter signal provided in some embodiments of this application;

[0020] Figure 8 The image shows a waveform diagram of the lens assembly shake trajectory provided in some embodiments of this application;

[0021] Figure 9 Schematic block diagrams of the image stabilization devices provided in some embodiments of this application are shown;

[0022] Figure 10 The present application shows a schematic diagram of the structure of a motor assembly provided in some embodiments;

[0023] Figure 11 This illustration shows one of the structural schematic diagrams of the electronic device provided in some embodiments of this application;

[0024] Figure 12 This is a second schematic diagram of the structure of an electronic device provided in some embodiments of this application;

[0025] Figure 13 A structural block diagram of an electronic device according to an embodiment of this application is shown;

[0026] Figure 14 The diagram shows a schematic representation of the hardware structure of an electronic device provided in some embodiments of this application.

[0027] The attached figures are labeled as follows:

[0028] 200 Camera module, 210 Lens assembly, 220 Motor assembly, 221 Housing, 2212 Outer shell, 2214 Base, 222 Drive unit, 2221 Focusing mechanism, 2222 Image stabilization mechanism, 223 Motor, 224 Guide rail bracket, 230 Control component, 240 Hall sensor, 300 Electronic equipment, 301 Camera output device, 302 Waveform output device, 303 Signal transmission line, 304 Circuit board, 305 Hinge. Detailed Implementation

[0029] 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.

[0030] 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 terms can be used interchangeably 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.

[0031] The following is in conjunction with the appendix Figures 1 to 14 The present application provides a detailed description of the image stabilization method, device, camera module, electronic device, and readable storage medium through specific embodiments and application scenarios.

[0032] In some embodiments of this application, an image stabilization method is provided, applied to a camera module, the camera module including a lens assembly and a motor assembly. Figure 1 A flowchart illustrating the anti-shake method provided in some embodiments of this application is shown. For example... Figure 1 As shown, the image stabilization methods include:

[0033] Step 102: Upon receiving the first waveform signal, control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain. The first waveform signal is a waveform signal that simulates the first shake experienced by the lens assembly.

[0034] Figure 2 This document shows one of the structural schematic diagrams of a camera module provided in some embodiments of this application, such as... Figure 2As shown in the embodiment of this application, the image stabilization method is applied to a camera module 200, which includes a lens assembly 210, a Hall sensor 240, and a motor assembly 220 for driving the lens assembly 210 to move. Specifically, when the camera module 200 experiences shaking while capturing an image, the motor assembly 220 can drive the lens assembly 210 in the opposite direction of the shaking, thereby canceling out the shaking of the lens assembly 210 and improving the image quality of the image captured by the camera module 200.

[0035] In this embodiment, the first waveform signal is an electrical signal input to the camera module. This first waveform signal is a preset first jitter signal, and its frequency is a fixed frequency. Specifically, the camera module and the waveform output device are connected via a signal transmission line, and the waveform output device can transmit the first waveform signal to the camera module via the signal transmission line.

[0036] For example, the first waveform signal can be a standard sine wave signal, and the signal frequency of the first waveform signal is greater than 0Hz and less than 10Hz, specifically 4Hz.

[0037] In this embodiment of the application, the camera module also includes a control device. When the control device receives the first waveform signal, it can control the motor assembly to drive the lens assembly to move according to the target image stabilization gain, so as to perform optical image stabilization on the lens assembly.

[0038] Specifically, when the motor assembly is not driving the lens assembly for optical image stabilization, the image displacement expression (1) acquired by the lens assembly is as follows:

[0039] Dt = A × sin(w × t); (1)

[0040] Where Dt is the displacement waveform of the camera without image stabilization, A is the amplitude of the jitter, t is time, and w is the angular velocity.

[0041] When the motor assembly performs optical image stabilization on the lens assembly according to the target image stabilization gain, the image displacement expression (2) corresponding to the target image stabilization gain is as follows:

[0042] Dt'_n = Dt×Ggain_n; (2)

[0043] Where Dt'_n is the displacement waveform of the camera during image stabilization, and Ggain_n is the target image stabilization gain.

[0044] Step 104: Determine the signal compensation phase difference based on the first waveform signal and the first driving signal. The first driving signal is the signal by which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain.

[0045] Figure 3 The following are waveform diagrams of the first waveform signal provided in some embodiments of this application. Figure 4 The following diagram illustrates waveforms of the first drive signal provided in some embodiments of this application, such as... Figure 3 and Figure 4 As shown, the first driving signal is the shaking signal generated by the motor assembly driving the lens assembly to move. Since the first waveform signal is an electrical signal input to the camera module, the first driving signal obtained is the shaking signal generated by the motor assembly driving the lens assembly to move. It can be understood that the shaking generated by the lens assembly under the drive of the motor assembly can cancel the first shaking and is used to stabilize the lens assembly.

[0046] For example, a Hall signal is acquired by a Hall sensor when the lens assembly moves, and a corresponding first driving signal is obtained by fitting the Hall signal, so that both the first waveform signal and the first driving signal are in the form of a sine wave.

[0047] For example, the lens assembly captures images under the drive of the motor assembly, and a corresponding first driving signal can be fitted based on the position information of the target object in the captured image, so that both the first waveform signal and the first driving signal are sinusoidal signals.

[0048] In this embodiment of the application, after acquiring the first waveform signal and the first drive signal, the phase difference between the first waveform signal and the first drive signal can be determined by comparing the first waveform signal and the first drive signal. The phase difference is the phase difference caused by the time spent by the control device to calculate the target value of compensation and the time spent by the motor component to respond to the command. The phase difference can reflect the delay of the camera module when performing optical image stabilization based on the target image stabilization gain. Therefore, the phase difference is used as the signal compensation phase difference.

[0049] Step 106: When the lens assembly is capturing an image, the motor assembly is controlled to perform optical image stabilization on the lens assembly based on the target image stabilization gain and the signal compensation phase difference.

[0050] In this embodiment of the application, after obtaining the signal compensation phase difference and the target image stabilization gain, when the lens assembly captures an image, the amplitude of the shaking signal generated when the lens assembly shakes is compensated by the target image stabilization gain, and the delay generated during optical image stabilization is compensated by the signal compensation phase difference.

[0051] In this embodiment, after determining the target image stabilization gain of the camera module, a first waveform signal is transmitted to the camera module, and a first drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained. Then, the signal compensation phase difference is determined by comparing the first waveform signal and the first drive signal. When the camera module captures an image, the amplitude of the shake is calibrated using the target image stabilization gain, and the image stabilization timing error is calibrated using the signal compensation phase difference, thereby improving the image stabilization effect of the camera module.

[0052] In some embodiments of this application, the camera module is connected to a waveform output device, which is used to transmit a first waveform signal and a second waveform signal to the camera module. The second waveform signal is a waveform signal of second jitter received by the analog lens assembly.

[0053] Before the control motor assembly performs optical image stabilization according to the target image stabilization gain when the camera module receives the first waveform signal, the method further includes: when the second waveform signal is transmitted to the camera module, acquiring a second drive signal corresponding to the second waveform signal, wherein the second drive signal is a signal in which the motor assembly drives the lens assembly to stabilize the second shake according to the initial image stabilization gain; updating the initial image stabilization gain according to the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target image stabilization gain.

[0054] In this embodiment of the application, before the control motor assembly performs optical image stabilization according to the target image stabilization gain, it is necessary to determine the target image stabilization gain, which is the gain obtained by iteratively updating the initial image stabilization gain.

[0055] In this embodiment, the camera module is connected to the output terminal of the waveform output device. The output terminal of the waveform output device transmits a second waveform signal to the camera module. The second waveform signal is an electrical signal input to the camera module. This second waveform signal is a preset second jitter signal, and its signal frequency is a fixed frequency. The second drive signal is a jitter signal generated by the movement of the lens assembly driven by the motor assembly in the camera module to stabilize the second jitter. This second drive signal is the jitter signal generated by the movement of the lens assembly driven by the motor assembly.

[0056] Figure 5 The following are waveform diagrams of the second drive signal provided in some embodiments of this application, such as... Figure 5As shown, when the camera module receives the second waveform signal, it controls the motor assembly to drive the lens assembly for optical image stabilization based on the initial image stabilization gain. During the process of the motor assembly driving the lens assembly based on the initial image stabilization gain, a corresponding second drive signal is acquired. Both the second waveform signal and the second drive signal are sinusoidal signals, and the first amplitude of the second waveform signal and the second amplitude of the second drive signal are determined. The first amplitude and the second amplitude are compared, and the initial image stabilization gain is adjusted according to the comparison result. After adjustment, the process returns to the step of transmitting the second waveform signal to the camera module, and the image stabilization gain is further updated and iterated based on the new second drive signal until the first amplitude and the second amplitude are equal. The image stabilization gain obtained at this point is then determined as the target image stabilization gain.

[0057] It should be noted that the first amplitude reflects the amount of displacement required by the lens assembly under the first waveform signal, and the second amplitude reflects the actual amount of displacement of the lens assembly under the drive of the motor assembly. When the amount of displacement required by the lens assembly is equal to the actual amount of displacement, the current image stabilization gain is determined to be accurate.

[0058] For example, the second waveform signal can be the same jitter signal as the first waveform signal, and the signal frequency of the second waveform signal is greater than 0Hz and less than 10Hz, specifically 4Hz.

[0059] For example, the initial stabilization gain can be 1.

[0060] In this embodiment, by connecting the camera module to a waveform output device, the waveform output device transmits a second waveform signal to the camera module and acquires a second drive signal generated by the motor assembly driving the lens assembly for optical image stabilization. By comparing the first amplitude of the second waveform signal with the second amplitude of the second drive signal, and then iteratively updating the initial image stabilization gain based on the comparison result, the target image stabilization gain is obtained. Compared with the prior art method of determining the image stabilization gain by applying vibration to the camera module and based on the blur amount of the image captured under vibration, this method has the advantage of higher accuracy. It further improves the effect of canceling the amplitude of shaking during the image stabilization process of the camera module, thereby improving the image stabilization effect of the camera.

[0061] In some embodiments of this application, before determining the first amplitude of the second waveform signal and the second amplitude of the second driving signal, the method includes: determining the first amplitude based on the amplitude angle of the second waveform signal and the effective focal length of the lens assembly; and determining the average amplitude of the second driving signal as the second amplitude.

[0062] In this embodiment, the first amplitude is the amplitude of the second waveform signal transmitted to the camera module, and the third amplitude can be determined according to the effective focal length and amplitude angle of the lens assembly. The effective focal length is a preset value of the camera module, and the amplitude angle is the amplitude angle of the second waveform signal, which is also a preset value.

[0063] It should be noted that the amplitude angle can be set according to actual needs. The amplitude angle ranges from 0 to 360°, and can be set to 1°.

[0064] Specifically, the expression for the second amplitude (3) is as follows:

[0065] Ampx = EFL ×tan(A / 180 × PI); (3)

[0066] Where Ampx is the second amplitude, EFL is the effective focal length, A is the amplitude angle, and PI is pi.

[0067] In this embodiment, the second amplitude is the average amplitude of the second driving signal generated when the motor assembly drives the lens assembly. Specifically, after acquiring the second driving signal, the maximum amplitude Ampmax and the minimum amplitude Ampmin in the second driving signal are extracted to calculate the average amplitude Ampavg, and the average amplitude is determined as the second amplitude.

[0068] In this embodiment of the application, during the process of updating the image stabilization gain, the first amplitude of the calculated second waveform signal is compared with the second amplitude of the second drive signal. When the first amplitude and the second amplitude are equal, it is determined that the image stabilization effect is better when optical image stabilization is performed according to the currently updated image stabilization gain, thereby accurately finding the target image stabilization gain.

[0069] In some embodiments of this application, the signal compensation phase difference includes a phase time difference; determining the signal compensation phase difference based on the first waveform signal and the first driving signal includes: performing sine wave modulation on the first waveform signal and the first driving signal respectively to obtain a first sine wave function and a second sine wave function, wherein the first sine wave function corresponds to the first waveform signal, the second sine wave function corresponds to the first driving signal, and the amplitudes of the first sine wave function and the second sine wave function are matched; determining the phase time difference based on the first sine wave function and the second sine wave function.

[0070] In this embodiment of the application, the signal compensation phase difference includes the phase time difference, the first waveform signal is the jitter signal transmitted by the signal transmission device to the camera module, and the first drive signal is the signal generated by the camera module in response to the first waveform signal to perform optical image stabilization.

[0071] Specifically, the camera module also includes a Hall sensor. The first driving signal is the jitter signal collected by the waveform transmission device through the Hall sensor. Therefore, the output time of the first waveform signal output by the waveform transmission device is comparable to the response of the Hall sensor.

[0072] In this embodiment of the application, a first sine wave function can be obtained by sinusoidal modulation of the first waveform signal. Specifically, the first waveform signal is integrated to obtain a sinusoidal signal whose angle changes with time, which is the first sine wave signal, where time t is x, the anti-shake angle is y, and the first sine wave function is obtained by fitting with the sin function.

[0073] The expression (4) for the first sine wave function is as follows:

[0074] input_λ = A × sin (w × t + b) + c; (4)

[0075] Wherein, input_λ is the anti-jitter angle in the first sine wave function, A is the amplitude, w is the angular velocity, c is the displacement in the amplitude direction, b is the phase, and t is the time of the first sine wave function.

[0076] The maximum amplitude of the Hall signal is calculated and normalized. Using time t as x and the Hall signal as y, the second sine wave function is obtained by fitting with the sin function.

[0077] The expression for the second sine wave function (5) is as follows:

[0078] output_hall = A1 × sin (w1 × t + b1) + c1; (5)

[0079] Where output_hall is the anti-shake angle in the second sine wave function, A1 is the amplitude, w1 is the angular velocity, c1 is the displacement in the amplitude direction, b1 is the phase, and t is the time of the first sine wave function.

[0080] It should be noted that the amplitude A in the first sine wave function and the amplitude A1 in the second sine wave function are made the same through normalization. For example, the amplitude A in the first sine wave function and the amplitude A1 in the second sine wave function are both set to 1.

[0081] For example, the phase time difference is PD_T, and PD_A is the phase difference angle calibration value, where PD_T = PD_A / 2N×PI, PI is pi, and N is the frequency of the input waveform, that is, the frequency of the first waveform signal, and the frequency unit is Hz.

[0082] In this embodiment of the application, during the process of determining the phase time difference based on the first sine wave function and the second sine wave function, the anti-shake angle in the first sine wave function is taken as the target value, the time difference corresponding to when the anti-shake angle in the second sine wave function reaches the target value is calculated, and the calculated time difference is used as the phase time difference.

[0083] In this embodiment of the application, the equations (6), (7), and (8) for calculating the phase time difference are as follows:

[0084] input_λ-output_hall = 0; (6)

[0085] A × sin (w ×t + b)+ c - A1 × sin (w1×t1 + b1)-c1 =0; (7)

[0086] PhaseDelta_Time= max( abs( t1 – t)); (8)

[0087] Where output_hall is the anti-jitter angle in the second sine wave function, A1 is the amplitude, w1 is the angular velocity, c1 is the displacement in the amplitude direction, b1 is the phase, t and t1 are the time of the first sine wave function, input_λ is the anti-jitter angle in the first sine wave function, A is the amplitude, w is the angular velocity, c is the displacement in the amplitude direction, b is the phase, t is the time of the first sine wave function, abs is the absolute value calculation, and PhaseDelta_Time is the phase time difference.

[0088] By solving t1 in the above equation (7), the maximum difference between t1 and t is taken as the phase time difference.

[0089] In this embodiment, the first waveform signal and the first driving signal are sinusoidally adjusted to obtain corresponding first and second sine wave functions. The stabilization angle in the first sine wave function is used as the target value. By solving the first and second sine wave functions, the time difference corresponding to when the stabilization angle in the second sine wave function reaches the target value can be obtained, thus obtaining the phase time difference. When the motor assembly is controlled to drive the lens assembly for optical image stabilization according to the phase time difference, the time delay error in the optical image stabilization process can be effectively eliminated, further improving the optical image stabilization effect.

[0090] In some embodiments of this application, the signal compensation phase difference includes a phase angle difference; determining the signal compensation phase difference based on the first waveform signal and the first driving signal includes: performing Fourier transform on the first waveform signal and the first driving signal respectively to obtain a first frequency and a second frequency, wherein the first frequency corresponds to the first waveform signal and the second frequency corresponds to the first driving signal; determining a first angle corresponding to the first frequency and a second angle corresponding to the second frequency; and determining the phase angle difference based on the first angle and the second angle.

[0091] In this embodiment, the signal compensation phase difference includes a phase frequency difference. The first waveform signal is a jitter signal transmitted from the signal transmission device to the camera module. The first drive signal is a signal generated by the camera module in response to the first waveform signal for optical image stabilization. By performing a Fourier transform on the first waveform signal and the first drive signal, the first frequency of the first waveform signal and the second frequency of the first drive signal can be calculated.

[0092] Specifically, the expressions for the first frequency (9) and the second frequency (10) are as follows:

[0093] Gyro_fft = fft(input_gyro); (9)

[0094] Hall_fft= fft(output_hall); (10)

[0095] Wherein, Gyro_fft is the first frequency, Hall_fft is the second frequency, input_gyro is the first waveform signal, output_hall is the first driving signal, and fft is the Fourier transform calculation formula.

[0096] In this embodiment of the application, after determining the first frequency and the second frequency, it is necessary to determine the main frequency in the first frequency and the main frequency in the second frequency. Then, by calculating the angle between the main frequency in the first frequency and the main frequency in the second frequency, the first angle corresponding to the first frequency and the second angle corresponding to the second frequency are obtained. Then, the difference between the first angle and the second angle is calculated to obtain the phase angle difference.

[0097] For example, the dominant frequency in the first frequency is the maximum value in the first frequency. The dominant frequency in the second frequency is the maximum value in the second frequency. The expressions for the dominant frequency in the first frequency (11) and the dominant frequency in the second frequency (12) are as follows:

[0098] idx1= max( abs( Gyro_fft )); (11)

[0099] idx2=max(abs(Hall_fft)); (12)

[0100] Wherein, idx1 is the primary frequency of the first frequency, idx2 is the primary frequency of the second frequency, Gyro_fft is the first frequency, Hall_fft is the second frequency, abs is for calculating the absolute value, and max is for calculating the maximum value.

[0101] The expressions for the first angle (13) and the second angle (14) are as follows:

[0102] ph1=angle(Gyro_fft(idx1)); (13)

[0103] ph2=angle(Hall_fft(idx2)); (14)

[0104] Where ph1 is the first angle, ph2 is the second angle, Gyro_fft is the first frequency, Hall_fft is the second frequency, idx1 is the main frequency of the first frequency, idx2 is the main frequency of the second frequency, and angle() is the angle calculation method.

[0105] The expression for the phase angle difference (15) is as follows:

[0106] PhaseDelta_Angle = abs(Ph2 – Ph1); (15)

[0107] Where PhaseDelta_Angle is the phase angle difference, abs is the absolute value calculation, ph1 is the first angle, and ph2 is the second angle.

[0108] In this embodiment, the first waveform signal and the first driving signal are subjected to Fourier transform to obtain the corresponding first frequency and second frequency. Then, based on the main frequency in the first frequency and the main frequency in the second frequency, the first angle corresponding to the first waveform signal and the angle corresponding to the first driving signal can be calculated. The difference between the first angle and the second angle is determined as the phase angle difference. When the motor assembly is controlled to drive the lens assembly for optical image stabilization according to the phase angle difference, the time delay error in the optical image stabilization process can be effectively eliminated, and the optical image stabilization effect is further improved.

[0109] It should be noted that the phase angle difference and phase time difference can be calculated simultaneously and burned into the control device of the camera module. When performing phase compensation for optical image stabilization, the phase angle difference or phase time difference can be selected to eliminate delay error according to actual needs.

[0110] Figure 6 The following are waveforms of the input jitter signal provided in some embodiments of this application. Figure 7 The following are schematic diagrams illustrating phase compensation of input jitter signals provided in some embodiments of this application, such as... Figure 6 and Figure 7 As shown, the input jitter signal can be compensated by the phase time difference or phase angle difference, so that the compensated waveform matches the waveform of the input jitter signal.

[0111] In some embodiments of this application, the camera module further includes a Hall sensor; when the camera module receives the first waveform signal, during the process of controlling the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain, the image stabilization method further includes: acquiring multiple Hall signals collected by the Hall sensor, and multiple acquisition times corresponding to the multiple Hall signals; and determining a first driving signal based on the multiple Hall signals and the multiple acquisition times.

[0112] In this embodiment, the camera module includes a Hall sensor. During the process of the motor assembly driving the lens assembly to move according to the target image stabilization gain, the Hall sensor continuously outputs Hall signals. Based on the acquisition time of each Hall signal, a corresponding first drive signal can be output, thereby improving the accuracy of the acquired first drive signal.

[0113] For example, in the process of fitting the first driving signal into a second sine wave signal, the fitting can be performed based on the Hall signal and the corresponding acquisition time.

[0114] In some embodiments of this application, when the camera module receives the first waveform signal, during the process of controlling the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain, the image stabilization method further includes: capturing multiple target images through the lens assembly, wherein each of the multiple target images includes a target object; and determining a first driving signal based on multiple shooting times corresponding to the multiple target images and the position information of the target object in the target images.

[0115] In this embodiment of the application, the same target object is captured by the camera module, so that each target image captured includes the target object. By analyzing the position information of the target object in each target image, the jitter trajectory of the lens assembly driven by the motor assembly can be determined. Based on the jitter trajectory, the first driving signal can be determined, thereby improving the accuracy of the obtained first driving signal.

[0116] For example, the location information of the target object can be the centroid coordinates of the target object in the target image.

[0117] Figure 8The diagram illustrates the lens assembly shake trajectory waveform provided in some embodiments of this application. Exemplarily, the target image is a dot plot card, which is positioned at a certain horizontal or vertical test distance from the camera module, for example, 50 cm. The camera module captures multiple target images at a high frame rate and records the capture time of each image. The frame rate is greater than 100 fps, and the number of target images ranges from 100 to 1000, specifically 500. The waveform is normalized by analyzing the displacement trajectory of the black dots in the multiple target images, i.e., calculating the centroid coordinates of the dots in each target image, with the capture time as the abscissa, to draw the dot trajectory diagram, which is the waveform of the first driving signal.

[0118] The image stabilization method provided in this application can be implemented by an image stabilization device. This application uses an image stabilization device to implement the image stabilization method as an example to illustrate the image stabilization method provided in this application.

[0119] In some embodiments of this application, an image stabilization device is provided, applied to a camera module, the camera module including a lens assembly and a motor assembly. Figure 9 Schematic block diagrams of image stabilization devices provided in some embodiments of this application are shown. For example... Figure 9 As shown, the image stabilization device 900 includes:

[0120] Control module 902 is used to control motor assembly to perform optical image stabilization on lens assembly according to target image stabilization gain when receiving first waveform signal, the first waveform signal being a waveform signal simulating the first shake experienced by lens assembly;

[0121] The determination module 904 is used to determine the signal compensation phase difference based on the first waveform signal and the first drive signal. The first drive signal is the signal that the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain.

[0122] The control module 902 is used to control the motor assembly to perform optical image stabilization on the lens assembly based on the target image stabilization gain and the signal compensation phase difference when the lens assembly is capturing an image.

[0123] In this embodiment, after determining the target image stabilization gain of the camera module, a first waveform signal is transmitted to the camera module, and a first drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained. Then, the signal compensation phase difference is determined by comparing the first waveform signal and the first drive signal. When the camera module captures an image, the amplitude of the shake is calibrated using the target image stabilization gain, and the image stabilization timing error is calibrated using the signal compensation phase difference, thereby improving the image stabilization effect of the camera module.

[0124] In some embodiments of this application, the camera module is connected to a waveform output device, which is used to transmit a first waveform signal and a second waveform signal to the camera module. The second waveform signal is a waveform signal simulating the second jitter experienced by the lens assembly.

[0125] The image stabilization device 900 also includes:

[0126] The acquisition module is used to acquire a second driving signal corresponding to the second waveform signal when the second waveform signal is transmitted to the camera module. The second driving signal is a signal that drives the lens assembly to stabilize the second shake according to the initial image stabilization gain of the motor assembly.

[0127] The update module is used to update the initial anti-shake gain based on the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target anti-shake gain.

[0128] In this embodiment, by connecting the camera module to a waveform output device, the waveform output device transmits a second waveform signal to the camera module and acquires a second drive signal generated by the motor assembly driving the lens assembly for optical image stabilization. By comparing the first amplitude of the second waveform signal with the second amplitude of the second drive signal, and then iteratively updating the initial image stabilization gain based on the comparison result, the target image stabilization gain is obtained. Compared with the prior art method of determining the image stabilization gain by applying vibration to the camera module and based on the blur amount of the image captured under vibration, this method has the advantage of higher accuracy. It further improves the effect of canceling the amplitude of shaking during the image stabilization process of the camera module, thereby improving the image stabilization effect of the camera.

[0129] In some embodiments of this application, the determining module 904 is used to determine the first amplitude based on the amplitude angle of the second waveform signal and the effective focal length of the lens assembly;

[0130] The determination module 904 is used to determine the average amplitude of the second driving signal as the second amplitude.

[0131] In this embodiment of the application, during the process of updating the image stabilization gain, the first amplitude of the calculated second waveform signal is compared with the second amplitude of the second drive signal. When the first amplitude and the second amplitude are equal, it is determined that the image stabilization effect is better when optical image stabilization is performed according to the currently updated image stabilization gain, thereby accurately finding the target image stabilization gain.

[0132] In some embodiments of this application, signal compensation phase difference includes phase time difference;

[0133] The image stabilization device 900 also includes:

[0134] The modulation module is used to perform sine wave modulation on the first waveform signal and the first driving signal respectively to obtain a first sine wave function and a second sine wave function, wherein the first sine wave function corresponds to the first waveform signal, the second sine wave function corresponds to the first driving signal, and the amplitudes of the first sine wave function and the second sine wave function are matched.

[0135] The determination module 904 is used to determine the phase time difference based on the first sine wave function and the second sine wave function.

[0136] In this embodiment, the first waveform signal and the first driving signal are sinusoidally adjusted to obtain corresponding first and second sine wave functions. The stabilization angle in the first sine wave function is used as the target value. By solving the first and second sine wave functions, the time difference corresponding to when the stabilization angle in the second sine wave function reaches the target value can be obtained, thus obtaining the phase time difference. When the motor assembly is controlled to drive the lens assembly for optical image stabilization according to the phase time difference, the time delay error in the optical image stabilization process can be effectively eliminated, further improving the optical image stabilization effect.

[0137] In some embodiments of this application, signal compensation phase difference includes phase angle difference;

[0138] The image stabilization device 900 also includes:

[0139] The processing module is used to perform Fourier transform on the first waveform signal and the first driving signal respectively to obtain a first frequency and a second frequency, wherein the first frequency corresponds to the first waveform signal and the second frequency corresponds to the first driving signal;

[0140] The determining module 904 is used to determine the first angle corresponding to the first frequency and the second angle corresponding to the second frequency;

[0141] The determination module 904 is used to determine the phase angle difference based on the first angle and the second angle.

[0142] In this embodiment, the first waveform signal and the first driving signal are subjected to Fourier transform to obtain the corresponding first frequency and second frequency. Then, based on the main frequency in the first frequency and the main frequency in the second frequency, the first angle corresponding to the first waveform signal and the angle corresponding to the first driving signal can be calculated. The difference between the first angle and the second angle is determined as the phase angle difference. When the motor assembly is controlled to drive the lens assembly for optical image stabilization according to the phase angle difference, the time delay error in the optical image stabilization process can be effectively eliminated, and the optical image stabilization effect is further improved.

[0143] In some embodiments of this application, the camera module further includes a Hall sensor;

[0144] The image stabilization device 900 also includes:

[0145] The acquisition module is used to acquire multiple Hall signals collected by the Hall sensor, as well as multiple acquisition times corresponding to the multiple Hall signals;

[0146] The determination module 904 is used to determine the first drive signal based on multiple Hall signals and multiple acquisition times.

[0147] In this embodiment, the camera module includes a Hall sensor. During the process of the motor assembly driving the lens assembly to move according to the target image stabilization gain, the Hall sensor continuously outputs Hall signals. Based on the acquisition time of each Hall signal, a corresponding first drive signal can be output, thereby improving the accuracy of the acquired first drive signal.

[0148] In some embodiments of this application, the image stabilization device 900 further includes:

[0149] The shooting module is used to capture multiple target images through the lens assembly, wherein each of the multiple target images includes the target object;

[0150] The determination module 904 is used to determine the first driving signal based on the multiple shooting times corresponding to multiple target images and the position information of the target object in the target images.

[0151] In this embodiment of the application, the same target object is captured by the camera module, so that each target image captured includes the target object. By analyzing the position information of the target object in each target image, the jitter trajectory of the lens assembly driven by the motor assembly can be determined. Based on the jitter trajectory, the first driving signal can be determined, thereby improving the accuracy of the obtained first driving signal.

[0152] The image stabilization 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.

[0153] The image stabilization device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0154] The image stabilization device provided in this application embodiment can realize all the processes implemented in the above method embodiments, and will not be described again here to avoid repetition.

[0155] Optionally, embodiments of this application also provide a camera module, such as... Figure 2 As shown, the camera module 200 further includes: a lens assembly 210; a motor assembly 220, the output of which is connected to the lens assembly 210; and a control assembly 230, connected to the lens assembly 210 and the motor assembly 220, for controlling the motor assembly 220 to perform optical image stabilization on the lens assembly 210 according to a target image stabilization gain when a first waveform signal is received, wherein the first waveform signal is a waveform signal simulating a first shake experienced by the lens assembly; determining a signal compensation phase difference based on the first waveform signal and a first drive signal, wherein the first drive signal is a signal in which the motor assembly 220 drives the lens assembly 210 to stabilize the first shake according to the target image stabilization gain; and controlling the motor assembly 220 to perform optical image stabilization on the lens assembly 210 when the lens assembly 210 is capturing an image, based on the target image stabilization gain and the signal compensation phase difference.

[0156] In this embodiment, the camera module 200 is a stabilized camera module 200. The camera module 200 includes a motor assembly 220, a lens assembly 210, and a control assembly 230. The control assembly 230 is used to control the motor assembly 220. When the lens assembly 210 is capturing an image, if the lens assembly 210 is detected to be shaking, the control assembly 230 controls the motor assembly 220 to move in the opposite direction to the shaking direction of the lens assembly 210, thereby counteracting the shaking.

[0157] In this embodiment, after the control component 230 obtains the signal compensation phase difference and the target image stabilization gain, when the lens component 210 captures an image, the target image stabilization gain controls the motor component 220 to compensate for the amplitude of the shaking signal generated when the lens component 210 shakes, and compensates for the delay generated during optical image stabilization by using the signal compensation phase difference, so that the camera module 200 has a high image stabilization effect.

[0158] Figure 10 The following are schematic diagrams illustrating the structure of the motor assembly 220 provided in some embodiments of this application, such as... Figure 10 As shown, in some embodiments of this application, the motor assembly 220 includes: a housing 221, in which a guide rail bracket 224 is disposed; a drive device 222, disposed on the guide rail bracket 224, the drive device 222 being connected to the lens assembly 210 and used to drive the lens assembly 210 to move; and an electric motor 223, disposed in the housing 221, the output end of the electric motor 223 being connected to the drive device 222 and used to drive the drive device 222 to move.

[0159] In this embodiment, the motor assembly 220 includes a housing 221, which includes an outer shell 2212 and a base 2214. A guide rail bracket 224 is provided on the base 2214. A drive device 222 is mounted on the guide rail bracket 224 and is located inside the housing 221. The drive device 222 is connected to the lens assembly 210. The output terminal of the motor 223 is connected to the drive device 222, and the motor 223 provides driving force to the drive device 222. When the lens assembly 210 requires optical image stabilization, the control assembly 230 controls the motor 223 to power on and run, driving the movement of the lens assembly 210 through the drive device 222, further improving the image stabilization effect of the camera module 200.

[0160] like Figure 10 As shown, Figure 10 Arrow A in the diagram indicates the first direction. Figure 10 Arrow B in the diagram indicates a second direction. In some embodiments of this application, the drive device 222 further includes:

[0161] The focusing mechanism 2221 is connected to the lens assembly 210 and is used to drive the lens assembly 210 to move along the first direction so as to drive the lens assembly 210 to focus.

[0162] The image stabilization mechanism 2222 is mounted on the guide rail bracket 224. The image stabilization mechanism 2222 is connected to the focusing mechanism 2221 and is used to drive the lens assembly 210 to move in the second direction so as to drive the lens assembly 210 to perform optical image stabilization.

[0163] In this embodiment, the driving device 222 includes a lens assembly 210 that is driven along the lens axis, i.e., driven to move in a first direction. When the control component 230 controls the lens assembly 210 to focus on the subject, it drives the focusing mechanism 2221 to move by controlling the motor 223. The driving device 222 also includes an image stabilization mechanism 2222 that moves along a plane parallel to the lens. When the control component 230 controls the lens assembly 210 to perform optical image stabilization, the control component 230 controls the motor 223 to drive the image stabilization mechanism 2222 to move in the opposite direction of the shaking direction, thereby counteracting the effect of shaking on the lens assembly 210 and further improving the shooting effect of the camera module 200.

[0164] Optionally, embodiments of this application also provide an electronic device. Figure 11 This illustration shows one of the structural schematic diagrams of the electronic device provided in some embodiments of this application. Figure 12 The second schematic diagram of the structure of the electronic device provided in some embodiments of this application is shown, such as... Figure 11 and Figure 12 As shown, the electronic device 300 includes: a camera output device 301; a camera module disposed on the camera output device 301; and a waveform output device 302 connected to the camera module for transmitting jitter signals to the camera module. The camera module is the camera module in any of the above embodiments, and therefore has all the beneficial effects of the camera module in any of the above embodiments, which will not be elaborated further here.

[0165] In this embodiment, the waveform output device 302 transmits a jitter signal to the camera module via the signal transmission line 303, specifically, for example, transmitting a first waveform signal or a second waveform signal. The camera module is installed on the camera output device. The camera module is a stabilized camera module, which can perform optical image stabilization in response to the jitter signal. The camera output device can output images captured by the camera module.

[0166] For example, the waveform output device can be a microcontroller or a sensor hub, and the waveform output device can modulate and output a sine wave signal of a fixed frequency.

[0167] For example, the signal transmission line 303 between the waveform output device 302 and the camera module can be transmitted in a manner including but not limited to SPI (SDH Physical Interface), IIC (Inter-Integrated Circuit, a serial, half-duplex bus protocol), RS232 (serial communication interface standard), etc.

[0168] For example, the electronic device 300 includes a circuit board 304, on which the camera output device 301 and the waveform output device 302 are both disposed. The circuit board 304 provides power to the waveform output device 302 and the camera output device 301, and is also capable of image transmission and calibration data.

[0169] For example, the camera module is connected to the camera output device 301 via a hinge 305. The hinge 305 can fix the camera module and electrically connect the camera module to the camera output device 301.

[0170] Optionally, embodiments of this application also provide an electronic device 300, which includes the image stabilization device as described in any of the above embodiments, and thus has all the beneficial effects of the image stabilization method in any of the embodiments, which will not be elaborated further here.

[0171] Optionally, embodiments of this application also provide an electronic device. Figure 13 A structural block diagram of an electronic device according to an embodiment of this application is shown, such as... Figure 13 As shown, the electronic device 1300 includes a processor 1302, a memory 1304, and a program or instructions stored in the memory 1304 and executable on the processor 1302. When the program or instructions are executed by the processor 1302, they implement the various processes of the above-described anti-shake method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0172] 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.

[0173] Figure 14 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0174] The electronic device 1400 includes, but is not limited to, components such as: radio frequency unit 1401, network module 1402, audio output unit 1403, input unit 1404, sensor 1405, display unit 1406, user input unit 1407, interface unit 1408, memory 1409, and processor 1410.

[0175] Those skilled in the art will understand that the electronic device 1400 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1410 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 14 The electronic device structure shown 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.

[0176] The processor 1410 is used to control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain when it receives the first waveform signal. The first waveform signal is a waveform signal that simulates the first shake experienced by the lens assembly.

[0177] The processor 1410 is used to determine the signal compensation phase difference based on the first waveform signal and the first drive signal, wherein the first drive signal is a signal in which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain;

[0178] The processor 1410 is used to control the motor assembly to perform optical image stabilization on the lens assembly based on the target image stabilization gain and the signal compensation phase difference when the lens assembly is capturing an image.

[0179] In this embodiment, after determining the target image stabilization gain of the camera module, a first waveform signal is transmitted to the camera module, and a first drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained. Then, the signal compensation phase difference is determined by comparing the first waveform signal and the first drive signal. When the camera module captures an image, the amplitude of the shake is calibrated using the target image stabilization gain, and the image stabilization timing error is calibrated using the signal compensation phase difference, thereby improving the image stabilization effect of the camera module.

[0180] Furthermore, the camera module is connected to a waveform output device, which is used to transmit a first waveform signal and a second waveform signal to the camera module. The second waveform signal is a waveform signal simulating the second shake experienced by the lens assembly.

[0181] The processor 1410 is configured to acquire a second drive signal corresponding to the second waveform signal when the second waveform signal is transmitted to the camera module. The second drive signal is a signal in which the motor assembly drives the lens assembly to stabilize the second shake according to the initial image stabilization gain.

[0182] The processor 1410 is used to update the initial stabilization gain based on the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target stabilization gain.

[0183] In this embodiment, by connecting the camera module to a waveform output device, the waveform output device transmits a second waveform signal to the camera module and acquires a second drive signal generated by the motor assembly driving the lens assembly for optical image stabilization. By comparing the first amplitude of the second waveform signal with the second amplitude of the second drive signal, and then iteratively updating the initial image stabilization gain based on the comparison result, the target image stabilization gain is obtained. Compared with the prior art method of determining the image stabilization gain by applying vibration to the camera module and based on the blur amount of the image captured under vibration, this method has the advantage of higher accuracy. It further improves the effect of canceling the amplitude of shaking during the image stabilization process of the camera module, thereby improving the image stabilization effect of the camera.

[0184] Furthermore, the processor 1410 is configured to determine the first amplitude based on the amplitude angle of the second waveform signal and the effective focal length of the lens assembly;

[0185] Processor 1410 is used to determine the average amplitude of the second drive signal as the second amplitude.

[0186] In this embodiment of the application, during the process of updating the image stabilization gain, the first amplitude of the calculated second waveform signal is compared with the second amplitude of the second drive signal. When the first amplitude and the second amplitude are equal, it is determined that the image stabilization effect is better when optical image stabilization is performed according to the currently updated image stabilization gain, thereby accurately finding the target image stabilization gain.

[0187] Furthermore, the signal compensation phase difference includes the phase time difference; the image stabilization device 900 also includes:

[0188] The processor 1410 is used to perform sine wave modulation on the first waveform signal and the first driving signal respectively to obtain a first sine wave function and a second sine wave function, wherein the first sine wave function corresponds to the first waveform signal, the second sine wave function corresponds to the first driving signal, and the amplitudes of the first sine wave function and the second sine wave function are matched.

[0189] Processor 1410 is used to determine the phase time difference based on a first sine wave function and a second sine wave function.

[0190] In this embodiment, the first waveform signal and the first driving signal are sinusoidally adjusted to obtain corresponding first and second sine wave functions. The stabilization angle in the first sine wave function is used as the target value. By solving the first and second sine wave functions, the time difference corresponding to when the stabilization angle in the second sine wave function reaches the target value can be obtained, thus obtaining the phase time difference. When the motor assembly is controlled to drive the lens assembly for optical image stabilization according to the phase time difference, the time delay error in the optical image stabilization process can be effectively eliminated, further improving the optical image stabilization effect.

[0191] Furthermore, signal compensation for phase difference includes phase angle difference;

[0192] The processor 1410 is used to perform Fourier transform on the first waveform signal and the first driving signal respectively to obtain a first frequency and a second frequency, wherein the first frequency corresponds to the first waveform signal and the second frequency corresponds to the first driving signal.

[0193] Processor 1410 is used to determine a first angle corresponding to a first frequency and a second angle corresponding to a second frequency;

[0194] Processor 1410 is used to determine the phase angle difference based on the first angle and the second angle.

[0195] In this embodiment, the first waveform signal and the first driving signal are subjected to Fourier transform to obtain the corresponding first frequency and second frequency. Then, based on the main frequency in the first frequency and the main frequency in the second frequency, the first angle corresponding to the first waveform signal and the angle corresponding to the first driving signal can be calculated. The difference between the first angle and the second angle is determined as the phase angle difference. When the motor assembly is controlled to drive the lens assembly for optical image stabilization according to the phase angle difference, the time delay error in the optical image stabilization process can be effectively eliminated, and the optical image stabilization effect is further improved.

[0196] Furthermore, the camera module also includes a Hall sensor; the image stabilization device 900 also includes:

[0197] The processor 1410 is used to acquire multiple Hall signals collected by the Hall sensor, as well as multiple acquisition times corresponding to the multiple Hall signals;

[0198] The processor 1410 is used to determine the first drive signal based on multiple Hall signals and multiple acquisition times.

[0199] In this embodiment, the camera module includes a Hall sensor. During the process of the motor assembly driving the lens assembly to move according to the target image stabilization gain, the Hall sensor continuously outputs Hall signals. Based on the acquisition time of each Hall signal, a corresponding first drive signal can be output, thereby improving the accuracy of the acquired first drive signal.

[0200] Furthermore, the processor 1410 is used to capture multiple target images through the lens assembly, wherein each of the multiple target images includes the target object;

[0201] The processor 1410 is used to determine the first driving signal based on multiple shooting times corresponding to multiple target images and the position information of the target object in the target images.

[0202] In this embodiment of the application, the same target object is captured by the camera module, so that each target image captured includes the target object. By analyzing the position information of the target object in each target image, the jitter trajectory of the lens assembly driven by the motor assembly can be determined. Based on the jitter trajectory, the first driving signal can be determined, thereby improving the accuracy of the obtained first driving signal.

[0203] It should be understood that, in this embodiment, the input unit 1404 may include a graphics processing unit (GPU) 14041 and a microphone 14042. The GPU 14041 processes image data of still images or motion files obtained by an image capture device (such as a camera) in motion file capture mode or image capture mode. The display unit 1406 may include a display panel 14061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1407 includes at least one of a touch panel 14071 and other input devices 14072. The touch panel 14071 is also called a touch screen. The touch panel 14071 may include a touch detection device and a touch controller. Other input devices 14072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0204] The memory 1409 can be used to store software programs and various data. The memory 1409 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 1409 may include volatile memory or non-volatile memory, or both. 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 1409 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0205] Processor 1410 may include one or more processing units; optionally, processor 1410 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 1410.

[0206] 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 method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0207] 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.

[0208] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described anti-shake method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0209] 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.

[0210] 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 method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0211] 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, apparatus, article, or device 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, apparatus, article, or device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or device that includes that element. Furthermore, it should be noted that the scope of the apparatus and devices 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 apparatus 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.

[0212] Through the above description of the embodiments, those skilled in the art can clearly understand that the apparatus of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform, and of course, it can also be implemented by hardware, but in many cases the former is a better implementation. 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 apparatus of the various embodiments of this application.

[0213] 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. A method for stabilizing image quality, characterized in that, Applied to a camera module, the camera module including a lens assembly and a motor assembly, the image stabilization method includes: Upon receiving a first waveform signal, the motor assembly is controlled to perform optical image stabilization on the lens assembly according to the target image stabilization gain. The first waveform signal is a waveform signal that simulates the first shake experienced by the lens assembly. Based on the first waveform signal and the first driving signal, the signal compensation phase difference is determined. The first driving signal is the signal in which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain. When the lens assembly captures an image, the motor assembly is controlled to perform optical image stabilization on the lens assembly based on the target image stabilization gain and the signal compensation phase difference; Specifically, the amplitude of the shaking signal generated when the lens assembly shakes is compensated by the target image stabilization gain, and the delay of the shaking signal is compensated by the signal compensation phase difference. The target image stabilization gain is a gain obtained by iteratively updating the initial image stabilization gain. The signal compensation phase difference includes the phase time difference; The step of determining the signal compensation phase difference based on the first waveform signal and the first driving signal includes: The first waveform signal and the first driving signal are respectively sinusoidally modulated to obtain a first sine wave function and a second sine wave function, wherein the first sine wave function corresponds to the first waveform signal, the second sine wave function corresponds to the first driving signal, and the amplitudes of the first sine wave function and the second sine wave function are matched. The phase time difference is determined based on the first sine wave function and the second sine wave function.

2. The image stabilization method according to claim 1, characterized in that, The camera module is connected to a waveform output device, which is used to transmit the first waveform signal and the second waveform signal to the camera module. The second waveform signal is a waveform signal that simulates the second shake experienced by the lens assembly. Before controlling the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain upon receiving the first waveform signal, the method further includes: When the second waveform signal is transmitted to the camera module, a second driving signal corresponding to the second waveform signal is obtained. The second driving signal is a signal in which the motor assembly drives the lens assembly to stabilize the second shake according to the initial image stabilization gain. The initial stabilization gain is updated based on the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target stabilization gain.

3. The image stabilization method according to claim 2, characterized in that, Before the first amplitude of the second waveform signal and the second amplitude of the second driving signal, the following are included: The first amplitude is determined based on the amplitude angle of the second waveform signal and the effective focal length of the lens assembly; And the average amplitude of the second driving signal is determined as the second amplitude.

4. The image stabilization method according to any one of claims 1 to 3, characterized in that, The signal compensation phase difference includes the phase angle difference; The step of determining the signal compensation phase difference based on the first waveform signal and the first driving signal includes: Perform Fourier transforms on the first waveform signal and the first driving signal respectively to obtain a first frequency and a second frequency, wherein the first frequency corresponds to the first waveform signal and the second frequency corresponds to the first driving signal; Determine the first angle corresponding to the first frequency and the second angle corresponding to the second frequency; The phase angle difference is determined based on the first angle and the second angle.

5. The image stabilization method according to any one of claims 1 to 3, characterized in that, The camera module also includes a Hall sensor; In the process of controlling the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain upon receiving the first waveform signal, the image stabilization method further includes: Acquire multiple Hall signals collected by the Hall sensor, and multiple acquisition times corresponding to the multiple Hall signals; The first drive signal is determined based on the plurality of Hall signals and the plurality of acquisition times.

6. The image stabilization method according to any one of claims 1 to 3, characterized in that, In the process of controlling the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain upon receiving the first waveform signal, the image stabilization method further includes: Multiple target images are captured by the lens assembly, wherein each of the multiple target images includes the target object; The first driving signal is determined based on multiple shooting times corresponding to multiple target images and the position information of the target object in the target images.

7. A shake-stabilizing device, characterized in that, Applied to a camera module, the camera module including a lens assembly and a motor assembly, the image stabilization device includes: The control module is used to control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain when a first waveform signal is received, wherein the first waveform signal is a waveform signal simulating the first shake experienced by the lens assembly; The determining module is used to determine the signal compensation phase difference based on the first waveform signal and the first driving signal, wherein the first driving signal is the signal in which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain; The control module is used to control the motor assembly to perform optical image stabilization on the lens assembly based on the target image stabilization gain and the signal compensation phase difference when the lens assembly is capturing an image. Specifically, the amplitude of the shaking signal generated when the lens assembly shakes is compensated by the target image stabilization gain, and the delay of the shaking signal is compensated by the signal compensation phase difference. The target image stabilization gain is a gain obtained by iteratively updating the initial image stabilization gain. The signal compensation phase difference includes the phase time difference; The step of determining the signal compensation phase difference based on the first waveform signal and the first driving signal includes: The first waveform signal and the first driving signal are respectively sinusoidally modulated to obtain a first sine wave function and a second sine wave function, wherein the first sine wave function corresponds to the first waveform signal, the second sine wave function corresponds to the first driving signal, and the amplitudes of the first sine wave function and the second sine wave function are matched; the phase time difference is determined based on the first sine wave function and the second sine wave function.

8. The image stabilization device according to claim 7, characterized in that, The camera module is connected to a waveform output device, which is used to transmit the first waveform signal and the second waveform signal to the camera module. The second waveform signal is a waveform signal that simulates the second shake experienced by the lens assembly. The anti-shake device also includes: The acquisition module is used to acquire a second driving signal corresponding to the second waveform signal when the second waveform signal is transmitted to the camera module. The second driving signal is a signal in which the motor assembly drives the lens assembly to stabilize the second shake according to the initial image stabilization gain. An update module is used to update the initial anti-shake gain based on the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target anti-shake gain.

9. A camera module, characterized in that, include: Lens assembly; A motor assembly, the output of which is connected to the lens assembly; A control component, connected to the lens assembly and the motor assembly, is configured to, upon receiving a first waveform signal, control the motor assembly to perform optical image stabilization on the lens assembly according to a target image stabilization gain, wherein the first waveform signal is a waveform signal simulating a first shake experienced by the lens assembly; determine a signal compensation phase difference based on the first waveform signal and a first drive signal, wherein the first drive signal is a signal in which the motor assembly drives the lens assembly to stabilize the first shake according to the target image stabilization gain; and, when the lens assembly is capturing an image, control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain and the signal compensation phase difference. Specifically, the amplitude of the shaking signal generated when the lens assembly shakes is compensated by the target image stabilization gain, and the delay of the shaking signal is compensated by the signal compensation phase difference. The target image stabilization gain is a gain obtained by iteratively updating the initial image stabilization gain. The signal compensation phase difference includes the phase time difference; The step of determining the signal compensation phase difference based on the first waveform signal and the first driving signal includes: The first waveform signal and the first driving signal are respectively sinusoidally modulated to obtain a first sine wave function and a second sine wave function, wherein the first sine wave function corresponds to the first waveform signal, the second sine wave function corresponds to the first driving signal, and the amplitudes of the first sine wave function and the second sine wave function are matched; the phase time difference is determined based on the first sine wave function and the second sine wave function.

10. An electronic device, characterized in that, include: Camera output device; The camera module as described in claim 9 is disposed in the camera output device; A waveform output device is connected to the camera module and is used to transmit jitter signals to the camera module.

11. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 6.