Anti-shake method and device, camera module, electronic equipment and readable storage medium
By receiving the jitter signal in the camera module and calibrating according to the signal compensation phase difference, the problem of deterioration of anti-shake effect caused by the delay of the anti-shake algorithm is solved, and a more efficient optical anti-shake effect is achieved.
Patent Information
- Application Number
- CN202411717006.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Due to the anti-shake algorithm, there is a problem that the anti-shake effect of the camera module is deteriorated due to delay.
By receiving the first waveform signal in the camera module, the control motor assembly optically prevents the lens assembly from the target anti-shake gain, and determines the signal compensation phase difference based on the first waveform signal and the first driving signal to calibrate the amplitude of the jitter and the anti-shake aging error.
The anti-shake effect of the camera module is improved, and the clarity of the captured images is significantly improved by accurately calibrating the amplitude of the jitter and eliminating the anti-shake aging error.
Smart Images

Figure CN119603557A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to an anti-shake method, device, camera module, electronic equipment and readable storage medium. Background Art
[0002] As people's demand for taking photos with electronic devices such as mobile phones increases, cameras with anti-shake performance are becoming more and more popular.
[0003] In the related art, in the actual anti-shake system of the camera module, at time t0, the jitter signal is input to the camera, and the anti-shake algorithm is processed to calculate the target value of compensation. After a period of time t1, the target value instruction is sent to the anti-shake motor to move to the specified position. After another period of time t2, this means that the compensation displacement to which the anti-shake motor moves is a compensation for the jitter signal at time t0, and the signal at this time has changed. Due to the delay in the anti-shake algorithm, the anti-shake effect of the camera module is poor. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide an anti-shake method, device, camera module, electronic device and readable storage medium, which solve the problem of poor anti-shake effect caused by the delay of the anti-shake algorithm.
[0005] In a first aspect, an embodiment of the present application provides an anti-shake method, which is applied to a camera module, wherein the camera module includes a lens assembly and a motor assembly, and the anti-shake method includes: when a first waveform signal is received, controlling the motor assembly to perform optical anti-shake on the lens assembly according to a target anti-shake gain, the first waveform signal being a waveform signal that simulates 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 that the motor assembly drives the lens assembly to perform anti-shake on the first shake according to the target anti-shake gain; when the lens assembly shoots an image, controlling the motor assembly to perform optical anti-shake on the lens assembly based on the target anti-shake gain and the signal compensation phase difference.
[0006] In a second aspect, an embodiment of the present application provides an anti-shake device, which is applied to a camera module, wherein the camera module includes a lens assembly and a motor assembly, and the anti-shake device includes: a control module, which is used to control the motor assembly to perform optical anti-shake on the lens assembly according to a target anti-shake gain when a first waveform signal is received, wherein the first waveform signal is a waveform signal that simulates a first shake experienced by the lens assembly; a determination module, which is used to determine a signal compensation phase difference according to the first waveform signal and a first drive signal, wherein the first drive signal is a signal that the motor assembly drives the lens assembly to perform anti-shake on the first shake according to the target anti-shake gain; and a control module, which is used to control the motor assembly to perform optical anti-shake on the lens assembly according to the target anti-shake gain and the signal compensation phase difference when the lens assembly captures an image.
[0007] In the third aspect, an embodiment of the present application provides a camera module, including: a lens assembly; a motor assembly, an output end of the motor assembly is connected to the lens assembly; a control assembly, connected to the lens assembly and the motor assembly, and used to control the motor assembly to perform optical image stabilization on the lens assembly according to a target image stabilization gain when a first waveform signal is received, the first waveform signal being a waveform signal that simulates 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 that the motor assembly drives the lens assembly to perform image stabilization on the first shake according to the target image stabilization gain; when the lens assembly shoots an image, controlling 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.
[0008] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a camera image output device; a camera module in any of the above embodiments, arranged in the camera image output device; a waveform output device, connected to the camera module, for transmitting a jitter signal to the camera module.
[0009] In a fifth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.
[0010] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the method of the first aspect.
[0011] In a seventh aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.
[0012] In the embodiment of the present application, after determining the target anti-shake 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 anti-shake is obtained, and then the signal compensation phase difference is determined by comparing the first waveform signal with the first drive signal. When the camera module shoots an image, the amplitude of the jitter is calibrated by the target anti-shake gain, and the anti-shake time error is calibrated by the signal compensation phase difference, thereby improving the anti-shake effect of the camera module. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A schematic diagram showing a flow chart of an anti-shake method provided in some embodiments of the present application;
[0014] Figure 2One of the structural schematic diagrams of the camera module provided in some embodiments of the present application is shown;
[0015] Figure 3 shows a waveform diagram of a first waveform signal provided in some embodiments of the present application;
[0016] Figure 4 shows a waveform diagram of a first driving signal provided in some embodiments of the present application;
[0017] Figure 5 shows a waveform diagram of a second driving signal provided in some embodiments of the present application;
[0018] Figure 6 shows a waveform diagram of an input jitter signal provided in some embodiments of the present application;
[0019] Figure 7 A schematic diagram of phase compensation of an input jitter signal provided in some embodiments of the present application is shown;
[0020] Figure 8 A waveform diagram of the lens assembly shaking trajectory provided in some embodiments of the present application is shown;
[0021] Fig. 9 A schematic block diagram of an anti-shake device provided in some embodiments of the present application is shown;
[0022] Fig.10 A schematic diagram of the structure of a motor assembly provided in some embodiments of the present application is shown;
[0023] Fig.11 One of the structural schematic diagrams of an electronic device provided in some embodiments of the present application is shown;
[0024] Fig.12 A second structural schematic diagram of an electronic device provided in some embodiments of the present application is shown;
[0025] Fig.13 A structural block diagram of an electronic device according to an embodiment of the present application is shown;
[0026] Fig.14 A schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present application is shown.
[0027] The reference numerals are as follows:
[0028] 200 camera module, 210 lens assembly, 220 motor assembly, 221 shell, 2212 housing, 2214 base, 222 driving device, 2221 focusing mechanism, 2222 anti-shake mechanism, 223 motor, 224 guide rail bracket, 230 control component, 240 Hall sensor, 300 electronic device, 301 camera image output device, 302 waveform output device, 303 signal transmission line, 304 circuit board, 305 hinge. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0031] The following is combined with Figures 1 to 14 , the anti-shake method, device, camera module, electronic device and readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0032] In some embodiments of the present application, an anti-shake method is provided, which is applied to a camera module, wherein the camera module includes a lens assembly and a motor assembly. Figure 1 FIG. 2 is a flow chart showing an anti-shake method provided in some embodiments of the present application. Figure 1 As shown, the anti-shake method includes:
[0033] Step 102, when receiving a first waveform signal, controlling 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;
[0034] Figure 2 One of the structural schematic diagrams of the camera module provided in some embodiments of the present application is shown, such as Figure 2As shown, in the embodiment of the present application, the anti-shake method is applied to the camera module 200, which includes a lens assembly 210 and a Hall sensor 240, and a motor assembly 220 for driving the movement of the lens assembly 210. Specifically, when the camera module 200 generates shaking when shooting an image, the motor assembly 220 can drive the lens assembly 210 in the opposite direction of the shaking direction, thereby offsetting the shaking of the lens assembly 210 and improving the image effect of the image shot by the camera module 200.
[0035] In the embodiment of the present application, the first waveform signal is an electrical signal input to the camera module, the first waveform signal is a preset first jittering jittering signal, and the signal frequency of the first waveform signal is a fixed frequency. Specifically, the camera module is connected to the waveform output device through a signal transmission line, and the waveform output device can transmit the first waveform signal to the camera module through the signal transmission line.
[0036] Exemplarily, the first waveform signal may be a standard sine wave signal, and the signal frequency of the first waveform signal has a value range of greater than 0 Hz and less than 10 Hz, and may be specifically selected to be 4 Hz.
[0037] In an embodiment of the present application, the camera module also includes a control device, which, when receiving the first waveform signal, can control the motor assembly to drive the lens assembly to move according to the target anti-shake gain to perform optical image stabilization on the lens assembly.
[0038] Specifically, when the motor assembly does not drive the lens assembly to perform optical image stabilization, the image displacement expression (1) collected by the lens assembly is as follows:
[0039] Dt = A × sin(w × t); (1)
[0040] Wherein, Dt is the displacement waveform of the camera without anti-shake, A is the amplitude of the shake, t is the 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] Among them, Dt'_n is the displacement waveform of the camera during anti-shake, and Ggain_n is the target anti-shake gain.
[0044] Step 104, determining a signal compensation phase difference according to the first waveform signal and the first driving signal, wherein the first driving signal is a signal for the motor assembly to drive the lens assembly to stabilize the first vibration according to the target stabilization gain;
[0045] Figure 3 shows a waveform diagram of a first waveform signal provided in some embodiments of the present application, Figure 4 2 shows a waveform diagram of a first driving signal provided in some embodiments of the present application, such as Figure 3 and Figure 4 As shown, the first driving signal is a jitter 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 signals obtained are all jitter signals generated by the motor assembly driving the lens assembly to move. It can be understood that the jitter generated by the lens assembly driven by the motor assembly can offset the first jitter, which is used to prevent the lens assembly from shaking.
[0046] Exemplarily, a Hall signal when the lens assembly moves is collected by a Hall sensor, and a corresponding first drive signal is obtained by fitting the Hall signal, so that both the first waveform signal and the first drive signal are sinusoidal signals.
[0047] Exemplarily, the lens assembly captures an image when driven by the motor assembly, and a corresponding first drive signal can be fitted according to position information of a target object in the captured image, so that both the first waveform signal and the first drive signal are sinusoidal signals.
[0048] In an embodiment of the present 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 taken by the control device to calculate the target value of compensation and the time taken by the motor assembly to respond to the instruction. The phase difference can reflect the delay when the camera module performs optical image stabilization based on the target image stabilization gain, and therefore the phase difference is used as the signal compensation phase difference.
[0049] Step 106 , when the lens assembly is shooting an image, the motor assembly is controlled to perform optical image stabilization on the lens assembly according to the target image stabilization gain and the signal compensation phase difference.
[0050] In an embodiment of the present application, after the signal compensation phase difference and the target anti-shake gain are obtained, when the lens assembly shoots an image, the amplitude of the jitter signal generated when the lens assembly shakes is compensated by the target anti-shake gain, and the delay generated when optical image stabilization is performed is compensated by the signal compensation phase difference.
[0051] In the embodiment of the present application, after determining the target anti-shake 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 anti-shake is obtained, and then the signal compensation phase difference is determined by comparing the first waveform signal with the first drive signal. When the camera module shoots an image, the amplitude of the jitter is calibrated by the target anti-shake gain, and the anti-shake time error is calibrated by the signal compensation phase difference, thereby improving the anti-shake effect of the camera module.
[0052] In some embodiments of the present application, the camera module is connected to a waveform output device, and the waveform output device is used to transmit a first waveform signal and a second waveform signal to the camera module, and the second waveform signal is a waveform signal simulating a second shake received by the lens assembly;
[0053] When the camera module receives the first waveform signal, before controlling the motor assembly to perform optical image stabilization according to the target anti-shake gain, the method further includes: when the second waveform signal is transmitted to the camera module, obtaining a second drive signal corresponding to the second waveform signal, the second drive signal being a signal for the motor assembly to drive the lens assembly to perform optical image stabilization for a second shake according to the initial anti-shake gain; and updating the initial anti-shake gain according to the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target anti-shake gain.
[0054] In the embodiment of the present application, before controlling the motor assembly to perform optical image stabilization according to the target image stabilization gain, it is necessary to determine the target image stabilization gain, which is a gain obtained by iteratively updating the initial image stabilization gain.
[0055] In the embodiment of the present application, the camera module is connected to the output end of the waveform output device, and the output end 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. The second waveform signal is a jitter signal of a preset second jitter, and the signal frequency of the second waveform signal is a fixed frequency. The second drive signal is a jitter signal generated by the motor assembly in the camera module driving the lens assembly to prevent the second jitter and driving the movement of the lens assembly. The second drive signal is a jitter signal generated by the motor assembly driving the movement of the lens assembly.
[0056] Figure 5 2 shows a waveform diagram of a second driving signal provided in some embodiments of the present 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 to perform optical image stabilization based on the initial anti-shake gain. In the process of the motor assembly driving the lens assembly based on the initial anti-shake gain, a corresponding second drive signal is obtained. Among them, the second waveform signal and the second drive signal are both 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 anti-shake gain is adjusted according to the comparison result. After the adjustment, the step of transmitting the second waveform signal to the camera module is returned, and the anti-shake gain is further updated and iterated based on the new second drive signal until the first amplitude and the second amplitude are equal, then it is determined that the anti-shake gain adjusted at this time is the target anti-shake gain.
[0057] It should be noted that the first amplitude can reflect the displacement required by the lens assembly under the first waveform signal, and the second amplitude can reflect the actual displacement of the lens assembly under the drive of the motor assembly. When the displacement required by the lens assembly is equal to the actual displacement, it is determined that the current anti-shake gain is accurate.
[0058] Exemplarily, the second waveform signal may be the same jitter signal as the first waveform signal, and the signal frequency of the second waveform signal may range from greater than 0 Hz to less than 10 Hz, and may be specifically selected as 4 Hz.
[0059] Exemplarily, the initial anti-shake gain may be 1.
[0060] In an embodiment of the present application, a camera module is connected to a waveform output device so that the waveform output device transmits a second waveform signal to the camera module, and a second drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained, and a first amplitude of the second waveform signal is compared with a second amplitude of the second drive signal, and then an initial image stabilization gain is iteratively updated based on the comparison result, thereby obtaining a target image stabilization gain. Compared with the prior art method of applying vibration to the camera module and determining the image stabilization gain based on the blur amount of the image captured under vibration, this method has the advantage of higher accuracy, further improving the effect of offsetting the amplitude of the vibration generated during the image stabilization process of the camera module, thereby improving the image stabilization effect of the camera.
[0061] In some embodiments of the present application, before determining the first amplitude of the second waveform signal and the second amplitude of the second drive 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 drive signal as the second amplitude.
[0062] In an embodiment of the present application, the first amplitude is the amplitude of the second waveform signal transmitted to the camera module, and the third amplitude can be determined based on 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, and the value range of the amplitude angle is 0 to 360°, and specifically 1° can be selected.
[0064] Specifically, the expression (3) of the second amplitude is as follows:
[0065] Ampx = EFL ×tan(A / 180 × PI); (3)
[0066] Among them, Ampx is the second amplitude, EFL is the effective focal length, A is the amplitude angle, and PI is pi.
[0067] In the embodiment of the present application, the second amplitude is the average amplitude of the second drive signal generated when the motor assembly drives the lens assembly. Specifically, after the second drive signal is acquired, the maximum amplitude Ampmax and the minimum amplitude Ampmin in the second drive signal are extracted to calculate the average amplitude Ampavg, and the average amplitude is determined as the second amplitude.
[0068] In an embodiment of the present application, in the process of updating the anti-shake gain, by comparing the first amplitude of the calculated second waveform signal with the second amplitude of the second drive signal, when the first amplitude and the second amplitude are equal, it is determined that the anti-shake effect when performing optical anti-shake according to the currently updated anti-shake gain is better, thereby accurately finding the target anti-shake gain.
[0069] In some embodiments of the present application, the signal compensation phase difference includes a phase time difference; the signal compensation phase difference is determined according to the first waveform signal and the first drive signal, including: performing sinusoidal wave modulation on the first waveform signal and the first drive signal respectively to obtain a first sinusoidal wave function and a second sinusoidal wave function, wherein the first sinusoidal wave function corresponds to the first waveform signal, the second sinusoidal wave function corresponds to the first drive signal, and the amplitudes of the first sinusoidal wave function and the second sinusoidal wave function match; the phase time difference is determined according to the first sinusoidal wave function and the second sinusoidal wave function.
[0070] In an embodiment of the present application, the signal compensation phase difference includes a phase time difference, the first waveform signal is a jitter signal transmitted by the signal transmission device to the camera module, and the first drive signal is a signal generated by the camera module in response to the first waveform signal for optical image stabilization.
[0071] Specifically, the camera module also includes a Hall sensor, and the first driving signal is a 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 the embodiment of the present application, the first waveform signal is subjected to sinusoidal modulation to obtain a first sinusoidal wave function. Specifically, the first waveform signal is subjected to integration processing to obtain a sinusoidal wave signal whose angle varies with time, that is, the first sinusoidal wave signal, where time t is x, the anti-shake angle is y, and the first sinusoidal wave function is obtained by fitting with a sin function.
[0073] The expression (4) of the first sine wave function is as follows:
[0074] input_λ = A × sin (w × t + b) + c; (4)
[0075] Among them, input_λ is the anti-shake 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. The time t is taken as x and the Hall signal is taken as y. The sin function is used for fitting to obtain the second sinusoidal wave function.
[0077] The expression (5) of the second sine wave function is as follows:
[0078] output_hall = A1 × sin (w1 × t + b1) + c1; (5)
[0079] Among them, 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 processing. Exemplarily, 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] Exemplarily, the phase time difference is PD_T, PD_A is the phase difference angle calibration value, wherein PD_T=PD_A / 2N×PI, PI is pi, 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 an embodiment of the present application, in 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 used 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 the embodiment of the present application, the calculation equations (6), (7) and (8) of 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] Among them, 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, t and t1 are the time of the first sine wave function, input_λ is the anti-shake 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 the embodiment of the present application, the first waveform signal and the first drive signal are sinusoidally adjusted to obtain corresponding first sine wave functions and second sine wave functions, and the anti-shake angle in the first sine wave function is used as the target value. By solving and calculating the first sine wave function and the second sine wave function, the time difference corresponding to when the anti-shake angle in the second sine wave function reaches the target value can be obtained, thereby obtaining the phase time difference. When the motor assembly is controlled according to the phase time difference to drive the lens assembly for optical anti-shake, the delay error in the optical anti-shake process can be effectively eliminated, thereby further improving the optical anti-shake effect.
[0090] In some embodiments of the present application, the signal compensation phase difference includes a phase angle difference; the signal compensation phase difference is determined according to the first waveform signal and the first drive signal, including: performing Fourier transform on the first waveform signal and the first drive signal respectively to obtain a first frequency and a second frequency, the first frequency corresponding to the first waveform signal, and the second frequency corresponding to the first drive signal; determining a first angle corresponding to the first frequency, and a second angle corresponding to the second frequency; determining the phase angle difference according to the first angle and the second angle.
[0091] In the embodiment of the present application, the signal compensation phase difference includes a phase frequency difference, the first waveform signal is a jitter signal transmitted by the signal transmission device to the camera module, and 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 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 expression (9) of the first frequency and the expression (10) of the second frequency are as follows:
[0093] Gyro_fft = fft(input_gyro); (9)
[0094] Hall_fft= fft(output_hall); (10)
[0095] Among them, 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 an embodiment of the present 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, and then calculate the angles of the main frequency in the first frequency and the main frequency in the second frequency to obtain the first angle corresponding to the first frequency and the second angle corresponding to the second frequency, and then calculate the difference between the first angle and the second angle to obtain the phase angle difference.
[0097] Exemplarily, the main frequency in the first frequency is the maximum value in the first frequency. The main frequency in the second frequency is the maximum value in the second frequency. The expression (11) of the main frequency in the first frequency and the expression (12) of the main frequency in the second frequency are as follows:
[0098] idx1= max( abs( Gyro_fft )); (11)
[0099] idx2=max(abs(Hall_fft)); (12)
[0100] Among them, idx1 is the main frequency of the first frequency, idx2 is the main frequency of the second frequency, Gyro_fft is the first frequency, Hall_fft is the second frequency, abs is for absolute value calculation, and max is for maximum value calculation.
[0101] The expression (13) of the first angle and the expression (14) of the second angle are as follows:
[0102] ph1=angle(Gyro_fft(idx1)); (13)
[0103] ph2=angle(Hall_fft(idx2)); (14)
[0104] Among them, 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 (15) of the phase angle difference is as follows:
[0106] PhaseDelta_Angle = abs(Ph2 – Ph1); (15)
[0107] Among them, 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 the embodiment of the present application, the first waveform signal and the first drive signal are Fourier transformed to obtain the corresponding first frequency and second frequency, and then calculation is performed based on the main frequency in the first frequency and the main frequency in the second frequency to obtain the first angle corresponding to the first waveform signal and the angle corresponding to the first drive signal. The difference between the first angle and the second angle is determined as the phase angle difference. When the motor assembly is controlled according to the phase angle difference to drive the lens assembly for optical image stabilization, the time delay error in the optical image stabilization process can be effectively eliminated, thereby further improving the optical image stabilization effect.
[0109] It should be noted that the phase angle difference and phase time difference can be calculated synchronously and both the phase angle difference and the phase time difference can be 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 used to eliminate the delay error according to actual needs.
[0110] Figure 6 shows a waveform diagram of an input jitter signal provided in some embodiments of the present application, Figure 7 FIG. 4 shows a schematic diagram of phase compensation of an input jitter signal provided in some embodiments of the present application, such as Figure 6 and Figure 7 As shown, the input jitter signal can be compensated by the phase time difference or the phase angle difference, so that the compensated waveform matches the waveform of the input jitter signal.
[0111] In some embodiments of the present application, the camera module also includes a Hall sensor; when the camera module receives the first waveform signal, the motor assembly is controlled to perform optical image stabilization on the lens assembly according to the target image stabilization gain, and the anti-shake method also includes: acquiring multiple Hall signals collected by the Hall sensor, and multiple collection times corresponding to the multiple Hall signals; determining the first drive signal based on the multiple Hall signals and the multiple collection times.
[0112] In an embodiment of the present application, the camera module includes a Hall sensor. When the motor assembly drives the lens assembly to move according to the target anti-shake gain, the Hall sensor continuously outputs a Hall signal. According to 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] Exemplarily, in the process of fitting the first driving signal to the second sinusoidal wave signal, the fitting may be performed according to the Hall signal and the corresponding acquisition time.
[0114] In some embodiments of the present application, when the camera module receives the first waveform signal, the anti-shake method further includes: capturing a plurality of target images through the lens assembly, wherein the plurality of target images each include a target object; and determining a first drive signal based on a plurality of shooting moments corresponding to the plurality of target images and position information of the target object in the target images.
[0115] In an embodiment of the present application, the same subject is photographed by a camera module so that each target image obtained includes the target object. The shaking trajectory of the lens assembly driven by the motor assembly can be determined through the position information of the target object in each target image, and the first drive signal can be determined based on the shaking trajectory, thereby improving the accuracy of the acquired first drive signal.
[0116] Exemplarily, the position information of the target object may be the centroid coordinates of the target object in the target image.
[0117] Figure 8The lens assembly jitter trajectory waveform diagram provided in some embodiments of the present application is shown. For example, the shooting object is a dot chart card, and the dot chart card is at a certain test distance horizontally or vertically from the camera module, for example: 50 cm. The camera module is used to shoot multiple target images at a high frame rate, and the shooting time of each target image is recorded. The shooting frame rate range is greater than 100fps, and the number of target images ranges from 100 to 1000, specifically 500. The displacement trajectory of the black dots in the multiple target images is parsed, that is, the centroid coordinates of the dots in each target image are calculated, and the waveform is normalized with the shooting time as the horizontal coordinate, so that a dot trajectory diagram can be drawn, that is, a waveform diagram of the first drive signal.
[0118] The anti-shake method provided in the embodiment of the present application can be executed by an anti-shake device. In the embodiment of the present application, the anti-shake method is executed by an anti-shake device as an example to illustrate the anti-shake method provided in the embodiment of the present application.
[0119] In some embodiments of the present application, an anti-shake device is provided, which is applied to a camera module, wherein the camera module includes a lens assembly and a motor assembly. Fig. 9 FIG. 2 shows a schematic block diagram of an anti-shake device provided in some embodiments of the present application. Fig. 9 As shown, the anti-shake device 900 includes:
[0120] The control module 902 is used to control the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain when receiving the first waveform signal, wherein the first waveform signal is a waveform signal simulating a first shake experienced by the lens assembly;
[0121] A determination module 904 is used to determine a signal compensation phase difference according to the first waveform signal and the first driving signal, wherein the first driving signal is a signal that the motor assembly drives the lens assembly to perform anti-shake on the first shake according to the target anti-shake gain;
[0122] The control module 902 is used 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 shooting an image.
[0123] In the embodiment of the present application, after determining the target anti-shake 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 anti-shake is obtained, and then the signal compensation phase difference is determined by comparing the first waveform signal with the first drive signal. When the camera module shoots an image, the amplitude of the jitter is calibrated by the target anti-shake gain, and the anti-shake time error is calibrated by the signal compensation phase difference, thereby improving the anti-shake effect of the camera module.
[0124] In some embodiments of the present application, the camera module is connected to a waveform output device, and the waveform output device is used to transmit a first waveform signal and a second waveform signal to the camera module, and the second waveform signal is a waveform signal simulating a second shake of the lens assembly;
[0125] The anti-shake device 900 further includes:
[0126] An acquisition module, configured to acquire a second drive signal corresponding to the second waveform signal when the second waveform signal is transmitted to the camera module, wherein the second drive signal is a signal for the motor assembly to drive the lens assembly to perform anti-shake on the second shake according to the initial anti-shake gain;
[0127] The updating module is used to update the initial anti-shake gain according to the first amplitude of the second waveform signal and the second amplitude of the second driving signal to obtain a target anti-shake gain.
[0128] In an embodiment of the present application, a camera module is connected to a waveform output device so that the waveform output device transmits a second waveform signal to the camera module, and a second drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained, and a first amplitude of the second waveform signal is compared with a second amplitude of the second drive signal, and then an initial image stabilization gain is iteratively updated based on the comparison result, thereby obtaining a target image stabilization gain. Compared with the prior art method of applying vibration to the camera module and determining the image stabilization gain based on the blur amount of the image captured under vibration, this method has the advantage of higher accuracy, further improving the effect of offsetting the amplitude of the vibration generated during the image stabilization process of the camera module, thereby improving the image stabilization effect of the camera.
[0129] In some embodiments of the present application, the determination module 904 is used to determine the first amplitude according to the amplitude angle of the second waveform signal and the effective focal length of the lens assembly;
[0130] The determination module 904 is configured to determine the average amplitude of the second driving signal as the second amplitude.
[0131] In an embodiment of the present application, in the process of updating the anti-shake gain, by comparing the first amplitude of the calculated second waveform signal with the second amplitude of the second drive signal, when the first amplitude and the second amplitude are equal, it is determined that the anti-shake effect when performing optical anti-shake according to the currently updated anti-shake gain is better, thereby accurately finding the target anti-shake gain.
[0132] In some embodiments of the present application, the signal compensation phase difference includes a phase time difference;
[0133] The anti-shake device 900 further includes:
[0134] A modulation module, used to perform sinusoidal wave modulation on the first waveform signal and the first drive signal respectively to obtain a first sinusoidal wave function and a second sinusoidal wave function, wherein the first sinusoidal wave function corresponds to the first waveform signal, the second sinusoidal wave function corresponds to the first drive signal, and the amplitudes of the first sinusoidal wave function and the second sinusoidal wave function match;
[0135] The determination module 904 is configured to determine a phase time difference according to the first sinusoidal wave function and the second sinusoidal wave function.
[0136] In the embodiment of the present application, the first waveform signal and the first drive signal are sinusoidally adjusted to obtain corresponding first sine wave functions and second sine wave functions, and the anti-shake angle in the first sine wave function is used as the target value. By solving and calculating the first sine wave function and the second sine wave function, the time difference corresponding to when the anti-shake angle in the second sine wave function reaches the target value can be obtained, thereby obtaining the phase time difference. When the motor assembly is controlled according to the phase time difference to drive the lens assembly for optical anti-shake, the delay error in the optical anti-shake process can be effectively eliminated, thereby further improving the optical anti-shake effect.
[0137] In some embodiments of the present application, the signal compensation phase difference includes a phase angle difference;
[0138] The anti-shake device 900 further includes:
[0139] A processing module, used for performing Fourier transform on the first waveform signal and the first drive 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 drive signal;
[0140] A determination module 904, configured to determine a first angle corresponding to the first frequency and a second angle corresponding to the second frequency;
[0141] The determination module 904 is used to determine a phase angle difference according to the first angle and the second angle.
[0142] In the embodiment of the present application, the first waveform signal and the first drive signal are Fourier transformed to obtain the corresponding first frequency and second frequency, and then calculation is performed based on the main frequency in the first frequency and the main frequency in the second frequency to obtain the first angle corresponding to the first waveform signal and the angle corresponding to the first drive signal. The difference between the first angle and the second angle is determined as the phase angle difference. When the motor assembly is controlled according to the phase angle difference to drive the lens assembly for optical image stabilization, the time delay error in the optical image stabilization process can be effectively eliminated, thereby further improving the optical image stabilization effect.
[0143] In some embodiments of the present application, the camera module further includes a Hall sensor;
[0144] The anti-shake device 900 further includes:
[0145] An acquisition module, used to acquire multiple Hall signals collected by the Hall sensor and multiple acquisition moments corresponding to the multiple Hall signals;
[0146] The determination module 904 is used to determine the first driving signal according to the multiple Hall signals and the multiple acquisition moments.
[0147] In an embodiment of the present application, the camera module includes a Hall sensor. When the motor assembly drives the lens assembly to move according to the target anti-shake gain, the Hall sensor continuously outputs a Hall signal. According to 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 the present application, the anti-shake device 900 further includes:
[0149] A shooting module, used for shooting a plurality of target images through a lens assembly, wherein the plurality of target images all include a target object;
[0150] The determination module 904 is used to determine the first driving signal according to the multiple shooting moments corresponding to the multiple target images and the position information of the target object in the target image.
[0151] In an embodiment of the present application, the same subject is photographed by a camera module so that each target image obtained includes the target object. The shaking trajectory of the lens assembly driven by the motor assembly can be determined through the position information of the target object in each target image, and the first drive signal can be determined based on the shaking trajectory, thereby improving the accuracy of the acquired first drive signal.
[0152] The anti-shake device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.
[0153] The anti-shake device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0154] The anti-shake device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.
[0155] Optionally, the embodiment of the present application further provides a camera module, such as Figure 2 As shown, the camera module 200 also includes: a lens assembly 210; a motor assembly 220, wherein the output end of the motor assembly 220 is connected to the lens assembly 210; a control assembly 230, which is connected to the lens assembly 210 and the motor assembly 220, and is used to control 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; a signal compensation phase difference is determined according to the first waveform signal and a first drive signal, wherein the first drive signal is a signal for the motor assembly 220 to drive the lens assembly 210 to perform image stabilization on the first shake according to the target image stabilization gain; when the lens assembly 210 captures an image, the motor assembly 220 is controlled to perform optical image stabilization on the lens assembly 210 according to the target image stabilization gain and the signal compensation phase difference.
[0156] In the embodiment of the present application, the camera module 200 is an anti-shake camera module 200, and 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 shooting an image, if it is detected that the lens assembly 210 is shaking, the control assembly 230 controls the motor assembly 220 to move, and drives the lens assembly 210 to move in the opposite direction of the shaking direction of the lens assembly 210, thereby offsetting the shaking.
[0157] In the embodiment of the present application, after the control component 230 obtains the signal compensation phase difference and the target anti-shake gain, when the lens component 210 shoots an image, the motor component 220 is controlled by the target anti-shake gain to compensate for the amplitude of the shake signal generated when the lens component 210 shakes, and the delay generated during optical anti-shake is compensated by the signal compensation phase difference, so that the camera module 200 has a higher anti-shake effect.
[0158] Fig.10 Schematic diagram of the structure of the motor assembly 220 provided in some embodiments of the present application is shown, such as Fig.10 As shown, in some embodiments of the present application, the motor assembly 220 includes: a shell 221, in which a guide rail bracket 224 is disposed; a driving device 222, which is disposed on the guide rail bracket 224, and the driving device 222 is connected to the lens assembly 210, and is used to drive the lens assembly 210 to move; a motor 223, which is disposed in the shell 221, and the output end of the motor 223 is connected to the driving device 222, and is used to drive the driving device 222 to move.
[0159] In the embodiment of the present application, the motor assembly 220 includes a housing 221, the housing 221 includes a shell 2212 and a base 2214, a guide rail bracket 224 is provided on the base 2214, a driving device 222 is mounted on the guide rail bracket 224, the driving device 222 is located in the housing 221, and the driving device 222 is connected to the lens assembly 210, the output end of the motor 223 is connected to the driving device 222, and the motor 223 provides driving force for the driving device 222. When the lens assembly 210 requires optical image stabilization, the control assembly 230 controls the motor 223 to power on and run, and drives the movement of the lens assembly 210 through the driving device 222, thereby further improving the image stabilization effect of the camera module 200.
[0160] like Fig.10 As shown, Fig.10 The arrow A in FIG. 1 shows a first direction, Fig.10 The arrow B in FIG. 2 shows the second direction. In some embodiments of the present application, the driving device 222 further includes:
[0161] A focusing mechanism 2221, which is connected to the lens assembly 210 and is used to drive the lens assembly 210 to move along a first direction to drive the lens assembly 210 to focus;
[0162] The anti-shake mechanism 2222 is disposed on the guide rail bracket 224 . The anti-shake mechanism 2222 is connected to the focus mechanism 2221 and is used to drive the lens assembly 210 to move along the second direction, so as to drive the lens assembly 210 to perform optical image stabilization.
[0163] In the embodiment of the present application, the driving device 222 includes driving along the axial direction of the lens, that is, driving the lens assembly 210 to move along the first direction. When the control component 230 controls the lens assembly 210 to focus on the photographed object, the focus mechanism 2221 is driven to move by controlling the motor 223. The driving device 222 also includes an anti-shake mechanism 2222 that moves along a plane parallel to the lens. When the control component 230 controls the lens assembly 210 to perform optical anti-shake, the control component 230 controls the motor 223 to drive the anti-shake mechanism 2222 to move in the opposite direction of the shaking direction, thereby offsetting the influence of the shaking on the lens assembly 210, and further improving the shooting effect of the camera module 200.
[0164] Optionally, an embodiment of the present application further provides an electronic device, Fig.11 One of the structural schematic diagrams of the electronic device provided in some embodiments of the present application is shown, Fig.12 FIG. 2 shows a second structural diagram of an electronic device provided in some embodiments of the present application, such as Fig.11 and Fig.12 As shown, the electronic device 300 includes: a camera image output device 301; a camera module, which is arranged on the camera image output device 301; a waveform output device 302, which is connected to the camera module and is used to transmit a jitter signal to the camera module, wherein the camera module is the camera module in any of the above-mentioned embodiments, and thus has all the beneficial effects of the camera module in any of the above-mentioned embodiments, which will not be elaborated herein.
[0165] In the embodiment of the present application, the waveform output device 302 transmits a jitter signal to the camera module through the signal transmission line 303, specifically, for example, transmitting a first waveform signal or a second waveform signal. The camera module is installed on a camera image output device, and the camera module is an anti-shake camera module. The anti-shake camera module can perform optical image stabilization in response to the jitter signal, and the camera image output device can output the image captured by the camera module.
[0166] Exemplarily, the waveform output device may be a single chip microcomputer or a sensor hub, and the waveform output device may be capable of modulating and outputting a sine wave signal with a fixed frequency.
[0167] Exemplarily, the transmission mode of the signal transmission line 303 between the waveform output device 302 and the camera module includes but is not limited to SPI (SDH Physical Interface) transmission, IIC (Inter-Integrated Circuit, a serial, dual-duplex bus protocol) transmission, RS232 (serial communication interface standard) transmission, etc.
[0168] Exemplarily, the electronic device 300 includes a circuit board 304, on which the camera image output device 301 and the waveform output device 302 are both arranged. The circuit board 304 supplies power to the waveform output device 302 and the camera image output device 301, and can also perform image transmission and calibration data.
[0169] Exemplarily, the camera module is connected to the camera image output device 301 via a hinge 305 , and the hinge 305 can fix the camera module and electrically connect the camera module to the camera image output device 301 .
[0170] Optionally, the embodiment of the present application further provides an electronic device 300, which includes an anti-shake device as in any of the above embodiments, and thus has all the beneficial effects of the anti-shake method in any of the embodiments, which will not be elaborated herein.
[0171] Optionally, an embodiment of the present application further provides an electronic device, Fig.13 A structural block diagram of an electronic device according to an embodiment of the present application is shown. Fig.13 As shown, the electronic device 1300 includes a processor 1302, a memory 1304, and a program or instruction stored in the memory 1304 and executable on the processor 1302. When the program or instruction is executed by the processor 1302, each process of the above-mentioned anti-shake method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0172] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0173] Fig.14 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0174] The electronic device 1400 includes but is not limited to: a radio frequency unit 1401, a network module 1402, an audio output unit 1403, an input unit 1404, a sensor 1405, a display unit 1406, a user input unit 1407, an interface unit 1408, a memory 1409 and a processor 1410 and other components.
[0175] Those skilled in the art will appreciate that the electronic device 1400 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1410 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.14 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0176] The processor 1410 is configured to control the motor assembly to perform optical image stabilization on the lens assembly according to a target image stabilization gain when receiving a first waveform signal, wherein the first waveform signal is a waveform signal simulating a first shake experienced by the lens assembly;
[0177] The processor 1410 is used to determine a signal compensation phase difference according to a first waveform signal and a first driving signal, wherein the first driving signal is a signal that a motor assembly drives a lens assembly to perform anti-shake on a first shake according to a target anti-shake gain;
[0178] 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 and the signal compensation phase difference when the lens assembly is shooting an image.
[0179] In the embodiment of the present application, after determining the target anti-shake 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 anti-shake is obtained, and then the signal compensation phase difference is determined by comparing the first waveform signal with the first drive signal. When the camera module shoots an image, the amplitude of the jitter is calibrated by the target anti-shake gain, and the anti-shake time error is calibrated by the signal compensation phase difference, thereby improving the anti-shake effect of the camera module.
[0180] Furthermore, the camera module is connected to a waveform output device, and the waveform output device is used to transmit a first waveform signal and a second waveform signal to the camera module, wherein the second waveform signal is a waveform signal simulating a second shake of the lens assembly;
[0181] The processor 1410 is configured to obtain a second driving signal corresponding to the second waveform signal when the second waveform signal is transmitted to the camera module, where the second driving signal is a signal for the motor assembly to drive the lens assembly to stabilize the second shake according to the initial anti-shake gain;
[0182] The processor 1410 is configured to update the initial anti-shake gain according to the first amplitude of the second waveform signal and the second amplitude of the second driving signal to obtain a target anti-shake gain.
[0183] In an embodiment of the present application, a camera module is connected to a waveform output device so that the waveform output device transmits a second waveform signal to the camera module, and a second drive signal generated by the motor assembly driving the lens assembly for optical image stabilization is obtained, and a first amplitude of the second waveform signal is compared with a second amplitude of the second drive signal, and then an initial image stabilization gain is iteratively updated based on the comparison result, thereby obtaining a target image stabilization gain. Compared with the prior art method of applying vibration to the camera module and determining the image stabilization gain based on the blur amount of the image captured under vibration, this method has the advantage of higher accuracy, further improving the effect of offsetting the amplitude of the vibration generated during the image stabilization process of the camera module, thereby improving the image stabilization effect of the camera.
[0184] Further, the processor 1410 is used to determine the first amplitude according to the amplitude angle of the second waveform signal and the effective focal length of the lens assembly;
[0185] The processor 1410 is configured to determine the average amplitude of the second driving signal as the second amplitude.
[0186] In an embodiment of the present application, in the process of updating the anti-shake gain, by comparing the first amplitude of the calculated second waveform signal with the second amplitude of the second drive signal, when the first amplitude and the second amplitude are equal, it is determined that the anti-shake effect when performing optical anti-shake according to the currently updated anti-shake gain is better, thereby accurately finding the target anti-shake gain.
[0187] Further, the signal compensation phase difference includes a phase time difference; the anti-shake device 900 also includes:
[0188] Processor 1410, configured to perform sinusoidal wave modulation on the first waveform signal and the first drive signal respectively to obtain a first sinusoidal wave function and a second sinusoidal wave function, wherein the first sinusoidal wave function corresponds to the first waveform signal, the second sinusoidal wave function corresponds to the first drive signal, and the amplitudes of the first sinusoidal wave function and the second sinusoidal wave function match;
[0189] The processor 1410 is configured to determine a phase time difference according to the first sinusoidal wave function and the second sinusoidal wave function.
[0190] In the embodiment of the present application, the first waveform signal and the first drive signal are sinusoidally adjusted to obtain corresponding first sine wave functions and second sine wave functions, and the anti-shake angle in the first sine wave function is used as the target value. By solving and calculating the first sine wave function and the second sine wave function, the time difference corresponding to when the anti-shake angle in the second sine wave function reaches the target value can be obtained, thereby obtaining the phase time difference. When the motor assembly is controlled according to the phase time difference to drive the lens assembly for optical anti-shake, the delay error in the optical anti-shake process can be effectively eliminated, thereby further improving the optical anti-shake effect.
[0191] Further, the signal compensation phase difference includes a 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, where the first frequency corresponds to the first waveform signal and the second frequency corresponds to the first driving signal;
[0193] Processor 1410, configured 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 a phase angle difference according to the first angle and the second angle.
[0195] In the embodiment of the present application, the first waveform signal and the first drive signal are Fourier transformed to obtain the corresponding first frequency and second frequency, and then calculation is performed based on the main frequency in the first frequency and the main frequency in the second frequency to obtain the first angle corresponding to the first waveform signal and the angle corresponding to the first drive signal. The difference between the first angle and the second angle is determined as the phase angle difference. When the motor assembly is controlled according to the phase angle difference to drive the lens assembly for optical image stabilization, the time delay error in the optical image stabilization process can be effectively eliminated, thereby further improving the optical image stabilization effect.
[0196] Furthermore, the camera module further includes a Hall sensor; the anti-shake device 900 further includes:
[0197] The processor 1410 is used to obtain multiple Hall signals collected by the Hall sensor and multiple collection moments corresponding to the multiple Hall signals;
[0198] The processor 1410 is used to determine a first driving signal according to a plurality of Hall signals and a plurality of acquisition moments.
[0199] In an embodiment of the present application, the camera module includes a Hall sensor. When the motor assembly drives the lens assembly to move according to the target anti-shake gain, the Hall sensor continuously outputs a Hall signal. According to 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] Further, the processor 1410 is used to capture a plurality of target images through the lens assembly, wherein the plurality of target images all include the target object;
[0201] The processor 1410 is used to determine a first driving signal according to a plurality of shooting moments corresponding to a plurality of target images and position information of the target object in the target images.
[0202] In an embodiment of the present application, the same subject is photographed by a camera module so that each target image obtained includes the target object. The shaking trajectory of the lens assembly driven by the motor assembly can be determined through the position information of the target object in each target image, and the first drive signal can be determined based on the shaking trajectory, thereby improving the accuracy of the acquired first drive signal.
[0203] It should be understood that in the embodiment of the present application, the input unit 1404 may include a graphics processor (Graphics Processing Unit, GPU) 14041 and a microphone 14042, and the graphics processor 14041 processes the image data of the static picture or action file obtained by the image capture device (such as a camera) in the action file capture mode or the image capture mode. The display unit 1406 may include a display panel 14061, and the display panel 14061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1407 includes a touch panel 14071 and at least one of other input devices 14072. The touch panel 14071 is also called a touch screen. The touch panel 14071 may include two parts: 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 keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0204] The memory 1409 can be used to store software programs and various data. The memory 1409 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1409 may include a volatile memory or a non-volatile memory, or the memory 1409 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1409 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0205] The processor 1410 may include one or more processing units; optionally, the processor 1410 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1410.
[0206] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0207] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0208] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned anti-shake method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0209] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0210] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the anti-shake method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0211] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, device, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or device. In the absence of further restrictions, an element defined by the statement "includes one..." does not exclude the presence of other identical elements in the process, device, article or device including the element. In addition, it should be noted that the scope of the devices and apparatuses in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described device may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0212] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment device can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions for a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) to execute the device of each embodiment of the present application.
[0213] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An anti-shake method, characterized in that: Applied to a camera module, the camera module includes a lens assembly and a motor assembly, and the anti-shake method includes: When receiving a first waveform signal, controlling 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 to which the lens assembly is subjected; determining a signal compensation phase difference according to the first waveform signal and a first driving signal, wherein the first driving signal is a signal for the motor assembly to drive the lens assembly to stabilize the first shake according to the target anti-shake gain; When the lens assembly captures an image, the motor assembly is controlled to perform optical image stabilization on the lens assembly according to the target image stabilization gain and the signal compensation phase difference.
2. The anti-shake method according to claim 1, characterized in that: The camera module is connected to a waveform output device, and the waveform output device is used to transmit the first waveform signal and the second waveform signal to the camera module, wherein the second waveform signal is a waveform signal simulating a second shake of the lens assembly; Before controlling the motor assembly to perform optical image stabilization on the lens assembly according to the target image stabilization gain when the first waveform signal is received, 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, where the second driving signal is a signal for the motor assembly to drive the lens assembly to stabilize the second shake according to an initial anti-shake gain; The initial anti-shake gain is updated according to the first amplitude of the second waveform signal and the second amplitude of the second drive signal to obtain the target anti-shake gain.
3. The anti-shake method according to claim 2, characterized in that: Before the first amplitude of the second waveform signal and the second amplitude of the second drive signal, the method comprises: determining the first amplitude according to the amplitude angle of the second waveform signal and the effective focal length of the lens assembly; And determining an average amplitude of the second driving signal as the second amplitude.
4. The anti-shake method according to any one of claims 1 to 3, characterized in that: The signal compensation phase difference includes a phase time difference; The step of determining the signal compensation phase difference according to the first waveform signal and the first driving signal comprises: Performing sinusoidal wave modulation on the first waveform signal and the first drive signal respectively to obtain a first sinusoidal wave function and a second sinusoidal wave function, wherein the first sinusoidal wave function corresponds to the first waveform signal, the second sinusoidal wave function corresponds to the first drive signal, and the amplitudes of the first sinusoidal wave function and the second sinusoidal wave function match; The phase time difference is determined based on the first sine wave function and the second sine wave function.
5. The anti-shake method according to any one of claims 1 to 3, characterized in that: The signal compensation phase difference includes a phase angle difference; The step of determining the signal compensation phase difference according to the first waveform signal and the first driving signal comprises: Performing Fourier transform on the first waveform signal and the first drive 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 drive signal; Determine a first angle corresponding to the first frequency and a second angle corresponding to the second frequency; The phase angle difference is determined based on the first angle and the second angle.
6. The anti-shake 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 when the first waveform signal is received, the image stabilization method further includes: Acquire multiple Hall signals collected by the Hall sensor and multiple collection moments corresponding to the multiple Hall signals; The first driving signal is determined according to the plurality of Hall signals and the plurality of acquisition moments.
7. The anti-shake 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 when the first waveform signal is received, the image stabilization method further includes: Taking a plurality of target images through the lens assembly, wherein the plurality of target images all include a target object; The first driving signal is determined according to a plurality of shooting moments corresponding to a plurality of the target images and position information of the target object in the target images.
8. An anti-shake device, characterized in that: Applied to a camera module, the camera module includes a lens assembly and a motor assembly, and the anti-shake 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 when 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 according to the first waveform signal and a first driving signal, wherein the first driving signal is a signal for the motor assembly to drive the lens assembly to perform anti-shake on the first shake according to the target anti-shake gain; 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 and the signal compensation phase difference when the lens assembly is shooting an image.
9. The anti-shake device according to claim 8, characterized in that: The camera module is connected to a waveform output device, and the waveform output device is used to transmit the first waveform signal and the second waveform signal to the camera module, wherein the second waveform signal is a waveform signal simulating a second shake of the lens assembly; The anti-shake device also includes: an acquisition module, configured to acquire a second drive signal corresponding to the second waveform signal when the second waveform signal is transmitted to the camera module, wherein the second drive signal is a signal for the motor assembly to drive the lens assembly to stabilize the second shake according to an initial anti-shake gain; An updating module is used to update the initial anti-shake gain according to the first amplitude of the second waveform signal and the second amplitude of the second driving signal to obtain the target anti-shake gain.
10. A camera module, characterized in that: include: Lens assembly; A motor assembly, wherein an output end of the motor assembly is connected to the lens assembly; A control component is connected to the lens component and the motor component, and is used to control the motor component to perform optical image stabilization on the lens component according to a target image stabilization gain when a first waveform signal is received, wherein the first waveform signal is a waveform signal that simulates a first shake to which the lens component is subjected; a signal compensation phase difference is determined according to the first waveform signal and a first drive signal, wherein the first drive signal is a signal for the motor component to drive the lens component to perform image stabilization on the first shake according to the target image stabilization gain; and when the lens component is shooting an image, the motor component is controlled to perform optical image stabilization on the lens component according to the target image stabilization gain and the signal compensation phase difference.
11. An electronic device, characterized in that: include: Camera image output device; The camera module of claim 10 is arranged in the camera image output device; A waveform output device is connected to the camera module and is used to transmit a jitter signal to the camera module.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Video anti-shake method and device, electronic equipment, computer equipment and storage medium
CN111225155A
Camera with vibration isolating function
JP1994194713A
Camera
WO2023001036A1
Anti-shake method and apparatus, electronic device, and computer readable storage medium
WO2023124610A1
Cited By
Phase correction method and device, optical anti-vibration system, electronic equipment and medium
CN120499513A