Anti-shake method and related device

By using two anti-shake modules in the electronic device camera, the low-frequency large amplitude and high-frequency small amplitude jitter are compensated, which solves the jitter problem during shooting of electronic devices and improves the shooting quality.

CN120455844APending Publication Date: 2025-08-08HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410177164.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-08
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The cameras of existing electronic devices are prone to shake during shooting, resulting in a decrease in shooting quality, and the current anti-shake effect is limited.

Method used

Two anti-shake modules are adopted. The first anti-shake module is used to compensate for large jitter at low frequency, and the second anti-shake module is used to compensate for small jitter at high frequency. By obtaining the attitude signal of the electronic device and decomposing it into signals of different frequencies and amplitudes, the two anti-shake modules are controlled to compensate for jitter.

Benefits of technology

The anti-shake effect is improved, and the shooting quality can be improved in a variety of jitter scenes, especially in scenarios where low-frequency large amplitude and high-frequency small amplitude jitters are present at the same time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455844A_ABST
    Figure CN120455844A_ABST
Patent Text Reader

Abstract

The invention provides an anti-shake method and related device.The method is applied to electronic equipment comprising a camera, the camera comprises a first anti-shake module and a second anti-shake module, the load of the first anti-shake module is larger than that of the second anti-shake module, and the method comprises the steps that a first posture signal of the electronic equipment is obtained, obtaining a first anti-shake signal and a second anti-shake signal according to the first attitude signal, then obtaining first compensation information according to the first anti-shake signal, and controlling a first anti-shake module to carry out shake compensation according to the first compensation information; second compensation information is obtained according to the second anti-shake signal, the second anti-shake module is controlled to conduct shake compensation according to the second compensation information, the frequency of the first anti-shake signal is smaller than or equal to the first frequency threshold value, and the maximum amplitude is larger than the first amplitude threshold value; the frequency of the second anti-shake signal is greater than the first frequency threshold and the maximum amplitude is smaller than the first amplitude threshold. The anti-shake effect can be improved, so that the shooting quality of the electronic equipment is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an anti-shake method and related devices. Background Art

[0002] With the popularity and development of electronic devices such as smartphones and tablets, users often use these devices to take photos, and their requirements for photo quality are becoming increasingly higher. When users use electronic devices to take photos, the devices are prone to shaking, which seriously affects the photo quality. Therefore, the cameras in electronic devices are usually equipped with anti-shake mechanisms. However, the current anti-shake effect is limited, resulting in an ineffective improvement in the photo quality of electronic devices. Summary of the Invention

[0003] The present application discloses an anti-shake method and related devices, which can improve the anti-shake effect, thereby effectively improving the shooting quality of electronic equipment.

[0004] In the first aspect, the present application provides an anti-shake method, which is applied to an electronic device including a camera, wherein the camera includes a first anti-shake module and a second anti-shake module (the anti-shake module is, for example, an anti-shake motor), the load capacity of the first anti-shake module is greater than the load capacity of the second anti-shake module, and the anti-shake characteristics include, for example, the anti-shake frequency of the first anti-shake module is less than the anti-shake frequency of the second anti-shake module, and the anti-shake amplitude of the first anti-shake module is greater than the anti-shake amplitude of the second anti-shake module. The method includes: an electronic device acquiring a first posture signal (e.g., an angular velocity signal) of the electronic device, and acquiring a first anti-shake signal and a second anti-shake signal based on the first posture signal, wherein the frequency of the first anti-shake signal is less than or equal to a first frequency threshold, and the maximum amplitude of the first anti-shake signal is greater than the first amplitude threshold, the frequency of the second anti-shake signal is greater than the first frequency threshold, and the maximum amplitude of the second anti-shake signal is less than or equal to the first amplitude threshold, and the first anti-shake signal can be understood as a low-frequency, large-amplitude signal, and the second anti-shake signal can be understood as a high-frequency, small-amplitude signal; the electronic device acquiring first compensation information based on the first anti-shake signal, and acquiring second compensation information based on the second anti-shake signal; then, controlling the first anti-shake module to perform jitter compensation based on the first compensation information, and controlling the second anti-shake module to perform jitter compensation based on the second compensation information.

[0005] In the above method, the electronic device comprehensively uses two anti-shake modules with different anti-shake characteristics, and extracts anti-shake signals of different frequencies and amplitudes from the posture signal based on the different anti-shake characteristics, so that the two anti-shake modules perform shake compensation based on the anti-shake signals corresponding to the anti-shake characteristics. Therefore, it can compensate for both low-frequency and large-amplitude shakes and high-frequency and small-amplitude shakes at the same time, instead of only compensating for one type of shake like an ordinary anti-shake module. The proportion of anti-shake scenes that can be covered is increased, the anti-shake effect is effectively improved, and thus the shooting quality of the electronic device is effectively improved.

[0006] In one possible implementation, the first posture signal is a first angular velocity signal of the electronic device in a first time period. The electronic device can integrate the first angular velocity signal and obtain a first amplitude signal in the first time period. Then, based on a first frequency threshold and a first amplitude threshold, the first amplitude signal can be decomposed into: a first anti-shake signal in a second time period and a second anti-shake signal in a third time period, wherein the first time period includes the second time period and the third time period.

[0007] In the above method, the first amplitude signal can reflect the amplitude and frequency (frequency corresponds to period) of the electronic device jitter during the first time period. Therefore, the first anti-shake signal and the second anti-shake signal obtained by decomposing the first amplitude signal can better reflect different characteristics (frequency and amplitude), thereby making analysis and application based on such anti-shake signals more intuitive and convenient.

[0008] In one possible implementation, a signal obtained by Fourier transforming the first angular velocity signal is a first frequency spectrum signal. The first frequency spectrum signal includes a second frequency spectrum signal having a frequency less than or equal to a first frequency threshold and an amplitude greater than the first amplitude threshold, and a third frequency spectrum signal having a frequency greater than the first frequency threshold and an amplitude less than or equal to the first amplitude threshold. The second frequency spectrum signal is the frequency spectrum signal of the first anti-shake signal, and the third frequency spectrum signal is the frequency spectrum signal of the second anti-shake signal. The maximum amplitude of the first frequency signal in the first anti-shake signal is the amplitude of the first frequency signal in the second frequency spectrum signal, and the maximum amplitude of the second frequency signal in the second anti-shake signal is the amplitude of the second frequency signal in the third frequency spectrum signal. In one possible implementation, the first posture signal is a first angular velocity signal of the electronic device in a first time period. The electronic device can perform a Fourier transform on the first angular velocity signal to obtain the first frequency spectrum signal. The first frequency spectrum signal can then be decomposed into a second frequency spectrum signal and a third frequency spectrum signal from the first frequency spectrum signal based on the first frequency threshold and the first amplitude threshold. The first anti-shake signal and the second anti-shake signal can be obtained based on the second frequency spectrum signal and the third frequency spectrum signal, respectively.

[0009] In the above method, the electronic device can decompose the first amplitude signal of the first posture signal to obtain the first anti-shake signal and the second anti-shake signal, or decompose the first frequency spectrum signal of the first posture signal to obtain the first anti-shake signal and the second anti-shake signal. The acquisition methods are diverse and the application scenarios are more extensive.

[0010] In one possible implementation, the signal obtained by Fourier transforming the first angular velocity signal is a first frequency spectrum signal, the signal obtained by integrating the first angular velocity signal is a first amplitude signal, and the first frequency threshold and the first amplitude threshold are determined based on the first frequency spectrum signal and / or the first amplitude signal.

[0011] In the above method, the currently used first frequency threshold and first amplitude threshold can be determined by analyzing the current first frequency spectrum signal and / or the first amplitude signal. This can be understood as real-time analysis of the frequency and amplitude and other characteristics of the signal, and dynamic determination of the first frequency threshold and the first amplitude threshold. The anti-shake signal determined based on this is also more in line with the current scenario, thereby further improving the anti-shake effect.

[0012] In one possible implementation, the camera includes a first optical element (such as a lens) and an image sensor arranged from the object side to the image side. The shake compensation method of the first anti-shake module and the second anti-shake module can be: the first anti-shake module drives the first optical element to deflect or translate, and the second anti-shake module drives the image sensor to deflect or translate; or, the first anti-shake module drives the camera to deflect or translate, and the second anti-shake module drives the image sensor to deflect and translate; or, the first anti-shake module drives the camera to deflect or translate, and the second anti-shake module is used to drive the first optical element to deflect or translate.

[0013] In the above method, the first anti-shake module and the second anti-shake module have various shake compensation modes, the applicable hardware architecture of the anti-shake module is also relatively wide, and the usability of the anti-shake function is higher.

[0014] In one possible implementation, the first compensation information includes a first position or a first motion mode, and the first anti-shake module is used to drive the corresponding element to reach the first position, or the first anti-shake module is used to drive the corresponding element to move in the first motion mode; the second compensation information includes a second position or a second motion mode, and the second anti-shake module is used to drive the corresponding element to reach the second position, or the second anti-shake module is used to drive the corresponding element to move in the second motion mode.

[0015] In the above method, the compensation information can be the target position to be reached or the movement mode to be performed. There are many different compensation methods and the application scenarios are more extensive.

[0016] In one possible implementation, when the electronic device is in a still shooting state or a moving shooting state, if the electronic device detects a second anti-shake signal, for example, if it detects that the ratio of the second anti-shake signal to the first amplitude signal is greater than or equal to a first preset ratio, the electronic device controls the first anti-shake module to perform shake compensation based on the first compensation information, and controls the second anti-shake module to perform shake compensation based on the second compensation information. In some examples, if the electronic device does not detect the second anti-shake signal (i.e., the first amplitude signal is the first anti-shake signal), or if the electronic device detects that the ratio of the second anti-shake signal to the first amplitude signal is less than the first preset ratio, the electronic device can directly obtain compensation information based on the first amplitude signal, and control the first anti-shake module to perform shake compensation based on the compensation information.

[0017] In one possible implementation, when the electronic device is in motion capture mode, if the electronic device detects a first anti-shake signal, for example, if the electronic device detects that the ratio of the first anti-shake signal to the first amplitude signal is greater than or equal to a second preset ratio, the electronic device controls the first anti-shake module to perform shake compensation based on the first compensation information, and controls the second anti-shake module to perform shake compensation based on the second compensation information. In some examples, if the electronic device does not detect the first anti-shake signal (i.e., the first amplitude signal is the second anti-shake signal), or if the electronic device detects that the ratio of the first anti-shake signal to the first amplitude signal is less than the second preset ratio, the electronic device can directly obtain compensation information based on the first amplitude signal and control the second anti-shake module to perform shake compensation based on the compensation information.

[0018] In the above method, the electronic device can use the first anti-shake signal and the second anti-shake signal to control the first anti-shake module and the second anti-shake signal to perform jitter compensation in a scenario where both the first anti-shake signal and the second anti-shake signal exist, that is, in a scenario where jitter of two characteristics exists at the same time. In a scenario where only jitter of one characteristic exists, only one anti-shake module can be used to perform jitter compensation. It can be understood that two levels of anti-shake are performed when necessary, thereby reducing unnecessary power consumption while ensuring the anti-shake effect.

[0019] In one possible implementation, the electronic device further includes a gyroscope sensor, a first driver chip, and a second driver chip. The gyroscope sensor is connected to the first driver chip and the second driver chip, respectively. The first driver chip is connected to the first anti-shake module, and the second driver chip is connected to the second anti-shake module. After the gyroscope sensor collects the first posture signal, it can send the first posture signal to the first driver chip and the second driver chip. Then, the first driver chip can obtain a first anti-shake signal based on the first posture signal and obtain first compensation information based on the first anti-shake signal. The second driver chip can obtain a second anti-shake signal based on the first posture signal and obtain second compensation information based on the second anti-shake signal. Next, the first driver chip sends the first compensation information to the first anti-shake module so that the first anti-shake module performs jitter compensation based on the first compensation information. The second driver chip sends the second compensation information to the second anti-shake module so that the second anti-shake module performs jitter compensation based on the second compensation information.

[0020] In one possible implementation, the electronic device further includes a gyroscope sensor, a first driver chip, and a second driver chip. The gyroscope sensor is connected to the first driver chip, the first driver chip is connected to the second driver chip, the first driver chip is connected to the first anti-shake module, and the second driver chip is connected to the second anti-shake module. After the gyroscope sensor collects a first posture signal, it can send the first posture signal to the first driver chip. The first driver chip can obtain a first anti-shake signal and a second anti-shake signal based on the first posture signal, and obtain first compensation information based on the first anti-shake signal and second compensation information based on the second anti-shake signal. Then, the first driver chip can send the first compensation information to the first anti-shake module, so that the first anti-shake module performs jitter compensation based on the first compensation information. The first driver chip can also send the second compensation information to the second driver chip, so that the second driver chip sends the second compensation information to the second anti-shake module. The second compensation information is used by the second anti-shake module to perform jitter compensation.

[0021] In the above method, the structures of the gyroscope sensor, the first driver chip, and the second driver chip in the electronic device can be various. Different data transmission paths can be used under different structures to control the first anti-shake module and the second anti-shake module to perform shake compensation. The structures of the applicable electronic devices are relatively wide, and the availability of the anti-shake function is higher.

[0022] In a second aspect, the present application provides an electronic device including a camera, a processor and a memory, the camera including a first anti-shake module and a second anti-shake module, the load capacity of the first anti-shake module is greater than the load capacity of the second anti-shake module, the above-mentioned memory is used to store a computer program, and the above-mentioned processor calls the above-mentioned computer program to execute the anti-shake method provided in the first aspect and any one of the embodiments of the first aspect.

[0023] In a third aspect, the present application provides a computer storage medium storing a computer program. When the computer program is executed by a processor, it is used to execute the anti-shake method provided in the first aspect and any one of the embodiments of the first aspect.

[0024] In a fourth aspect, the present application provides a computer program product, which, when running on a device, is used to execute the anti-shake method provided in the first aspect and any one of the implementations of the first aspect.

[0025] In a fifth aspect, the present application provides an electronic device, the electronic device including a method or apparatus for executing any aspect or embodiment of the present application. The electronic device is, for example, a chip.

[0026] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single implementation. On the contrary, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution or beneficial effect is included in at least one implementation. Therefore, the description of a technical feature, technical solution or beneficial effect in this application does not necessarily refer to the same implementation. Furthermore, the technical features, technical solutions and beneficial effects described in this application can also be combined in any appropriate manner. Those skilled in the art will understand that this application can be implemented without one or more specific technical features, technical solutions or beneficial effects of a specific implementation. In other implementations, additional technical features and beneficial effects can also be identified in specific implementations that do not embody all implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The following is an introduction to the drawings used in this application.

[0028] Figure 1 This is a schematic diagram of the hardware structure of an electronic device provided by this application;

[0029] Figure 2 This is a schematic diagram of the hardware structure of another electronic device provided by this application;

[0030] Figure 3 This is a schematic diagram of the hardware structure of another electronic device provided by this application;

[0031] Figure 4 is a schematic diagram of a camera provided by this application;

[0032] Figure 5 is a schematic diagram of another camera provided by this application;

[0033] Figure 6 is a schematic diagram of another camera provided by this application;

[0034] Figure 7 This is a schematic diagram of the software architecture of an electronic device provided by this application;

[0035] Figure 8 This is a flowchart of an anti-shake method provided by this application;

[0036] Figure 9 is a schematic diagram of an original angular velocity signal provided by this application;

[0037] Figure 10 and Figure 11 is a schematic diagram of a frequency spectrum signal provided by this application;

[0038] Figure 12is a schematic diagram of a signal with amplitude distribution provided by the present application;

[0039] Figure 13 This is a flowchart of another anti-shake method provided by this application. DETAILED DESCRIPTION

[0040] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings. The terms used in the implementation methods of the embodiments of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.

[0041] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0042] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0043] The present invention provides an anti-shake method and related apparatus. The anti-shake method can be applied to an electronic device including a camera. The camera of the electronic device can include a first anti-shake module and a second anti-shake module. The first anti-shake module and the second anti-shake module can implement optical image stabilization (OIS) of the camera. The load capacity of the first anti-shake module is greater than that of the second anti-shake module. The anti-shake characteristics of the first anti-shake module are better for anti-shake effect against low-frequency, large-amplitude vibrations, thereby implementing low-frequency, large-amplitude anti-shake. The anti-shake characteristics of the second anti-shake module are better for anti-shake effect against high-frequency, small-amplitude vibrations, thereby implementing high-frequency, small-amplitude anti-shake. The anti-shake method can include: after the electronic device activates the camera, it can obtain a posture signal (e.g., an angular velocity signal) of the electronic device and split the posture signal into a low-frequency, large-amplitude posture signal (which can be simply referred to as a low-frequency, large-amplitude signal) and a high-frequency, small-amplitude posture signal (which can be simply referred to as a high-frequency, small-amplitude signal). Then, the electronic device can control the first anti-shake module to perform shake compensation based on the low-frequency, large-amplitude signal, and control the second anti-shake module to perform shake compensation based on the high-frequency, small-amplitude signal. This can be understood as combining two anti-shake modules with different anti-shake characteristics, extracting gesture signals of different frequencies and amplitudes from the gesture signal based on the different anti-shake characteristics, and allowing the two anti-shake modules to perform jitter compensation based on the gesture signals corresponding to the anti-shake characteristics. Therefore, the embodiment of the present application can simultaneously compensate for both low-frequency, large-amplitude jitter and high-frequency, small-amplitude jitter, rather than just compensating for one type of jitter like a conventional anti-shake module, effectively improving the anti-shake effect. In particular, it can greatly improve the anti-shake effect in scenarios where the proportions of the two types of jitter are similar, thereby effectively improving the shooting quality of the electronic device.

[0044] The frequency of the attitude signal can represent the frequency of the jitter, that is, the speed of the jitter, and the amplitude of the attitude signal can represent the amplitude of the jitter, that is, the displacement of the jitter. The jitter displacement can be an angular displacement (that is, an angle).

[0045] It can be understood that in most scenarios, when the shooting state of the electronic device 100 is relatively stable, such as in still shooting, walking shooting, etc., the posture signal of the electronic device 100 contains more low-frequency and large-amplitude signals. When the shooting state of the electronic device 100 is motion shooting, such as in running shooting, cycling shooting, shooting during extreme sports, shooting while riding in a vehicle (such as a car, train, high-speed rail, etc.), shooting while riding in an airplane, etc., the posture signal of the electronic device 100 contains more high-frequency and small-angle signals.

[0046] Next, the electronic device 100 provided in an embodiment of the present application is introduced.

[0047] In the embodiments of the present application, the electronic device including a camera can be a mobile phone, a tablet computer, a handheld computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), as well as wearable devices such as smart bracelets, smart watches, and smart glasses, and extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR). The embodiments of the present application do not impose any special restrictions on the specific type of electronic device.

[0048] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or combine or separate certain components, or have different component arrangements, different component shapes, different component sizes, or different component structures. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0049] Figure 1 Schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application.

[0050] like Figure 1 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0051] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0052] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0053] Processor 110 may also include a memory for storing instructions and data. In one embodiment, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0054] In one embodiment, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0055] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging implementations, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging implementations, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141.

[0056] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In another embodiment, the power management module 141 can also be set in the processor 110. In another embodiment, the power management module 141 and the charging management module 140 can also be set in the same device.

[0057] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0058] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In another embodiment, the antenna can be used in conjunction with a tuning switch.

[0059] The mobile communication module 150 can provide wireless communication solutions for the electronic device 100, including second generation (2G), third generation (3G), fourth generation (4G), fifth generation (5G), and sixth generation (6G). The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1. In one embodiment, at least some of the functional modules of the mobile communication module 150 can be located in the processor 110. In another embodiment, at least some of the functional modules of the mobile communication module 150 and at least some of the modules of the processor 110 can be located in the same device.

[0060] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In one embodiment, the modem processor may be an independent device. In another embodiment, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0061] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0062] In one embodiment, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0063] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0064] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In one embodiment, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0065] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0066] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and other factors. It can also optimize parameters such as exposure and color temperature of the captured scene. In one embodiment, the ISP can be located within camera 193.

[0067] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element (also known as an image sensor). The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In one embodiment, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0068] The camera 193 may be, but is not limited to, a vertical camera or a periscope camera. The camera 193 may be, but is not limited to, a fixed-focus camera or a zoom camera. The camera 193 may be, but is not limited to, a wide-angle camera, a telephoto camera, or a standard camera.

[0069] The camera 193 can be set on the back of the electronic device 100 (for example, the plane where the back panel is located), that is, the camera 193 can be a rear camera. Not limited to this, the camera 193 can also be set on the front (for example, the plane where the display screen is located), that is, the camera 193 can be a front camera.

[0070] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0071] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0072] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0073] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0074] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0075] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0076] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In one embodiment, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0077] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0078] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0079] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In another embodiment, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In another embodiment, the electronic device 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and can also identify the source of sound, realize directional recording function, etc.

[0080] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0081] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In one embodiment, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In one embodiment, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0082] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In one embodiment, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the camera 193 needs to compensate based on the angle, and allows the camera 193 to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0083] The air pressure sensor 180C is used to measure air pressure.

[0084] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.

[0085] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0086] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In one embodiment, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0087] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.

[0088] The ambient light sensor 180L is used to sense the brightness of the ambient light.

[0089] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0090] The temperature sensor 180J is used to detect temperature.

[0091] The touch sensor 180K is also called a "touch-sensitive device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In another embodiment, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0092] The bone conduction sensor 180M can acquire vibration signals.

[0093] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0094] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Motor 191 can also be an anti-shake motor in camera 193, and camera 193 may include one or more anti-shake motors. The anti-shake motor can be used to drive the camera 193 or the module in the camera 193 to perform movements such as translation or deflection to offset the shaking generated during shooting, thereby achieving anti-shake shooting. The load capacity (that is, the weight of the actuator that can be driven) of anti-shake motors with different hardware architectures is different, and accordingly, the anti-shake characteristics (such as anti-shake frequency, anti-shake amplitude) are also different. For example, the anti-shake frequency of an anti-shake motor with a larger load is smaller and the anti-shake amplitude is larger, and the anti-shake frequency of an anti-shake motor with a smaller load is larger and the anti-shake amplitude is smaller.

[0095] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0096] The SIM card interface 195 is used to connect a SIM card.

[0097] In the embodiment of the present application, the electronic device 100 can obtain the posture signal of the electronic device 100 through the gyroscope sensor 180B. However, the present invention is not limited thereto and can also obtain the posture signal through other sensors in the sensor module 180, such as the acceleration sensor 180E. For ease of description, the following embodiment uses the example of obtaining the posture signal of the electronic device 100 through the gyroscope sensor 180B as an example.

[0098] Next, the structure of the camera 193 in the electronic device 100 is exemplarily introduced. For the convenience of explanation, the following figure only shows the camera 193 and related modules in the electronic device 100. The description of other modules can be found in Figure 1 .

[0099] Figure 2 This is a schematic diagram of the hardware structure of another electronic device 100 provided in an embodiment of the present application.

[0100] like Figure 2 As shown, the camera 193 in the electronic device 100 may include a first driver chip 193A, a second driver chip 193B, a first anti-shake module 193C, a second anti-shake module 193D, and an image sensor 193E. The first driver chip 193A may be electrically connected (e.g., via an inter-integrated circuit (I2C) interface) to the first anti-shake module 193C and control the first anti-shake module 193C. The second driver chip 193B may be electrically connected (e.g., via an I2C interface) to the second anti-shake module 193D and control the second anti-shake module 193D. The gyroscope sensor 180B in the electronic device 100 may be electrically connected (e.g., via a serial peripheral interface (SPI)) to both the first driver chip 193A and the second driver chip 193B in the camera 193. The processor 110 in the electronic device 100 may be electrically connected (e.g., via a mobile industry processor interface (MIPI)) to the image sensor 193E in the camera 193.

[0101] For example, Figure 2As shown, when the electronic device 100 captures an image via the camera 193, the image sensor 193E can send the captured image to the processor 110 for processing. During this process, if the electronic device 100 shakes, the gyroscope sensor 180B can obtain the posture signal of the electronic device 100 and send the obtained posture signal to the first driver chip 193A and the second driver chip 193B. The first driver chip 193A can use a filtering algorithm to decompose the received posture signal and obtain the low-frequency, large-amplitude signal therein. Then, the first driver chip 193A can obtain first compensation information based on the low-frequency, large-amplitude signal and send the first compensation information to the first anti-shake module 193C. The second driver chip 193B can use a filtering algorithm to decompose the received posture signal and obtain the high-frequency, small-amplitude signal therein. Then, the second driver chip 193B can obtain second compensation information based on the high-frequency, small-amplitude signal and send the second compensation information to the second anti-shake module 193D. For example, the first driver chip 193A and the second driver chip 193B are configured with orthogonal filters, and the posture information can be decomposed using the orthogonal filters. Among them, the first compensation information and the second compensation information can be the target positions or target motion modes of the first anti-shake module 193C and the second anti-shake module 193D, respectively. The first driving chip 193A and the second driving chip 193B can respectively run the closed-loop control algorithm and respectively drive the first anti-shake module 193C and the second anti-shake module 193D to reach the corresponding target positions, that is, respectively drive the first anti-shake module 193C and the second anti-shake module 193D to move according to the corresponding target motion mode.

[0102] Figure 3 This is a schematic diagram of the hardware structure of another electronic device 100 provided in an embodiment of the present application.

[0103] Figure 3 The electronic device 100 and Figure 2 The electronic device 100 shown is similar except that Figure 3 In the electronic device 100 shown, the gyro sensor 180B is electrically connected to the first driver chip 193A and not to the second driver chip 193B. However, the first driver chip 193A and the second driver chip 193B are electrically connected (eg, via an I2C interface).

[0104] For example, Figure 3As shown, when the electronic device 100 captures an image through the camera 193, the image sensor 193E can send the captured image to the processor 110 for processing. During this process, if the electronic device 100 shakes, the gyroscope sensor 180B can obtain the posture signal of the electronic device 100 and send the obtained posture signal to the first driver chip 193A. The first driver chip 193A can split the received posture signal through a filtering algorithm and obtain the low-frequency large-amplitude signal and the high-frequency small-amplitude signal therein. For example, the first driver chip 193A is configured with an orthogonal filter, and the posture information can be split through the orthogonal filter. The first driver chip 193A can obtain the first compensation information based on the low-frequency large-amplitude signal, and obtain the second compensation information based on the high-frequency small-amplitude signal. The first driver chip 193A can send the first compensation information to the first anti-shake module 193C. The first driver chip 193A can send the second compensation information to the second driver chip 193B, and the second driver chip 193B can send the received second compensation information to the second anti-shake module 193D. For an explanation of the first compensation information and the second compensation information, please refer to Figure 2 The description is omitted here.

[0105] Figure 4 This is a schematic diagram of the hardware structure of another electronic device 100 provided in an embodiment of the present application.

[0106] Figure 4 The electronic device 100 and Figure 2 The electronic device 100 shown is similar except that Figure 4 In the electronic device 100 shown, the gyroscope sensor 180B may also be electrically connected only to the processor 110 (for example, via an SPI connection), and will not be electrically connected to the first driver chip 193A and the second driver chip 193B. In addition, the processor 110 may be electrically connected to the first driver chip 193A and the second driver chip 193B (for example, via an I2C interface).

[0107] For example, Figure 4As shown, when the electronic device 100 captures an image through the camera 193, the image sensor 193E can send the captured image to the processor 110 for processing. During this process, if the electronic device 100 shakes, the gyroscope sensor 180B can obtain the posture signal of the electronic device 100 and send the obtained posture signal to the processor 110. The processor 110 can split the received posture signal through a filtering algorithm and obtain the low-frequency large-amplitude signal and the high-frequency small-amplitude signal therein. The processor 110 can obtain the first compensation information based on the low-frequency large-amplitude signal, and obtain the second compensation information based on the high-frequency small-amplitude signal. The processor 110 can send the first compensation information and the second compensation information to the first driver chip 193A and the second driver chip 193B respectively. The first driver chip 193A can send the received first compensation information to the first anti-shake module 193C, and the second driver chip 193B can send the received second compensation information to the second anti-shake module 193D. For an explanation of the first compensation information and the second compensation information, please refer to Figure 2 The description is omitted here.

[0108] Not limited to Figure 4 In another embodiment, the processor 110 may be electrically connected to the first driver chip 193A and not electrically connected to the second driver chip 193B. However, the first driver chip 193A and the second driver chip 193B are electrically connected. Figure 3 In the structure shown, in this case, the processor 110 can send both the acquired first compensation information and the second compensation information to the first driver chip 193A, and the first driver chip 193A sends the second compensation information to the second driver chip 193B.

[0109] Not limited to Figure 4 As shown in the description, in other examples, the first driver chip 193A and / or the second driver chip 193B may also split the posture signal and obtain the compensation information, which is not limited in the embodiments of the present application.

[0110] Figure 5 This is a schematic diagram of a camera provided by this application. Figure 5 (A) and Figure 5 (B) is a schematic diagram of a camera 193 on an electronic device 100 provided in an embodiment of the present application. Figure 5 (C) is a structural diagram of a camera 193 provided in an embodiment of the present application.

[0111] like Figure 5 (A) and Figure 5 As shown in (B), the electronic device 100 may include a back panel, a display screen 194 and a camera 193. Figure 5(A) and Figure 5 (B) is illustrated by taking the camera 193 being set on the back panel as an example.

[0112] For the convenience of explanation, the width direction of the electronic device 100 is defined as the X axis, which can be the first direction X, the length direction of the electronic device 100 is defined as the Y axis, which can be the second direction Y, and the thickness direction of the electronic device 100 is defined as the Z axis, which can be the third direction Z. The coordinate system can be seen in FIG. Figure 5 .

[0113] like Figure 5 As shown in (C), the camera 193 may include a first optical element, a focusing module, a second optical element (which may be fixed) and an image sensor arranged from the object side to the image side, and the direction from the object side to the image side can also be understood as the direction of light. Among them, the first optical element, the focusing module and the second optical element / image sensor can be arranged in sequence in the first direction X, and the image sensor and the second optical element can be arranged in sequence in the third direction Z. In some examples, the first optical element may be a reflecting prism or a reflecting plane mirror, and the first optical element may be used to reflect the light entering the interior of the electronic device 100 to the focusing module. In some examples, the focusing module may include at least one lens. In some examples, the second optical element may be a reflecting prism or a reflecting plane mirror, and the second optical element may be used to reflect the light emitted by the focusing module to the image sensor to achieve imaging of the camera 193.

[0114] Figure 6 This is a structural diagram of another camera 193 provided in an embodiment of the present application.

[0115] like Figure 6 As shown, the camera 193 may include a first optical element and an image sensor arranged from the object side to the image side. The direction from the object side to the image side can also be understood as the direction of light. The image sensor and the first optical element may be arranged in sequence in a third direction Z. In some examples, the first optical element may be a prism, which may be used to direct light entering the electronic device 100 into the image sensor to achieve imaging by the camera 193.

[0116] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. For example, the software system with a layered architecture can be an Android system, a Harmony operating system (OS), or other software systems. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.

[0117] Figure 7Schematic diagram of the software architecture of an electronic device 100 provided in an embodiment of the present application.

[0118] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In one embodiment, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0119] The application layer can include a series of application packages.

[0120] like Figure 7 As shown, the application package may include applications such as camera, video, music, gallery, short message, call, navigation, Bluetooth, browser, etc. The application in the embodiment of the present application may also be replaced by other software such as mini-programs and atomic services. The camera in the embodiment of the present application may be a standalone application or integrated into other applications, such as a browser, instant messaging, etc.

[0121] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0122] like Figure 7 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, an anti-shake system, and the like.

[0123] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0124] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0125] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0126] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0127] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0128] The notification manager enables applications to display notification information in the status bar. This can be used to convey notification-type messages and can disappear automatically after a short period of time without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be used to display notifications in the form of icons or scrolling text in the top status bar of the system, such as notifications from applications running in the background, or notifications that appear on the screen in the form of dialog windows. For example, a text message can be displayed in the status bar, a notification sound can be emitted, the electronic device 100 can vibrate, an indicator light can flash, etc.

[0129] The anti-shake system can be used to process the attitude signal of the electronic device 100 reported by the gyroscope sensor and extract a low-frequency, large-amplitude signal and a high-frequency, small-amplitude signal. The anti-shake system can obtain first compensation information for the first anti-shake module in the camera 193 based on the low-frequency, large-amplitude signal, and obtain second compensation information for the second anti-shake module in the camera 193 based on the high-frequency, small-amplitude signal.

[0130] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0131] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0132] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0133] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0134] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0135] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0136] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0137] A 2D graphics engine is a drawing engine for 2D drawings.

[0138] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0139] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with a shooting scenario.

[0140] When the touch sensor receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a single-touch operation and the control corresponding to the single-touch operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer, and captures a still image or video through the camera 193.

[0141] When camera 193 captures a still image or video, the anti-shake system of the application framework layer can receive the attitude signal reported by the gyroscope sensor, and obtain the first compensation information and the second compensation information based on the attitude signal. The first compensation information and the second compensation information can be sent to the first anti-shake module and the second anti-shake module in the camera 193 for shake compensation, thereby improving the shooting quality of camera 193.

[0142] Based on the above embodiments, the anti-shake method provided by the embodiments of the present application is introduced. The method can be applied to the electronic device 100 described in the above embodiments.

[0143] Figure 8 This is a flowchart of an anti-shake method provided in an embodiment of the present application.

[0144] like Figure 8 As shown, the gyro sensor 180B in the electronic device 100 can detect and obtain an angular velocity signal (which may be referred to as an original angular velocity signal) in the first period. An example of the original angular velocity signal can be found in Figure 9 . Figure 9 Take the first period of 10 milliseconds (ms) as an example for illustration. Figure 9 The horizontal axis is time, in ms. Figure 9 The vertical axis is angular velocity, with the unit being radians per second (which may be abbreviated as degrees per second). The positive or negative value of the angular velocity shown on the vertical axis can represent different shaking directions. Figure 9 In the signal waveform shown, any peak / trough can represent a jitter (also called vibration). The time between any peak and the adjacent trough / peak is the jitter frequency, and the integral of the signal waveform is the jitter amplitude. Therefore, the larger the absolute value of the angular velocity corresponding to any peak / trough, the greater the amplitude of the jitter. Figure 9 As shown, from approximately 0 to 6ms, the angular velocity fluctuates between -400 degrees per second and 400 degrees per second, and the range of angular velocity fluctuation is small, which can be understood as a small amplitude of jitter. From approximately 6ms to 10ms, the angular velocity fluctuates between -800 degrees per second and 800 degrees per second, and the range of angular velocity fluctuation is large, which can be understood as a large amplitude of jitter. For example, when the shooting state of the electronic device 100 is still shooting or walking shooting, the user's hand shakes slightly from approximately 0 to 6ms, and the user's hand shakes significantly due to external factors (such as being bumped by others) from approximately 6ms to 10ms.

[0145] like Figure 8 As shown, the electronic device 100 can perform Fourier transform on the original angular velocity signal and obtain a corresponding frequency spectrum signal. An example of the frequency spectrum signal can be found in Figure 10 and Figure 11 . Figure 10 and Figure 11 The horizontal axis is the frequency (which can represent the frequency of jitter), and the unit is Hertz (Hz). Figure 10 and Figure 11 The vertical axis is amplitude (which can represent the amplitude of jitter), and the unit is radians (which can be simply referred to as degrees). Figure 10 The signal waveform shown includes signals of multiple frequencies within 0 to 2.5 Hz. For example, the amplitude of the signal with a frequency greater than 0 and less than 1 Hz is approximately 0.5 degrees, the amplitude of the signal with a frequency of 1 Hz is 0.8 degrees, the amplitude of the signal with a frequency greater than 1 Hz and less than 2 Hz is less than 0.4 degrees, the amplitude of the signal with a frequency of 2 Hz is 0.4 degrees, and the amplitude of the signal with a frequency greater than 2 Hz is less than 0.4 degrees. Figure 11 The signal waveforms shown include a signal with a frequency of 1 Hz (amplitude of 0.8 degrees) and a signal with a frequency of 2 Hz (amplitude of 0.4 degrees). It can be seen that the amplitude of low-frequency signals (e.g., frequencies less than or equal to 1 Hz) is larger, and the amplitude of high-frequency signals (e.g., frequencies greater than 1 Hz) is smaller.

[0146] like Figure 8 As shown, the electronic device 100 can also integrate the original angular velocity signal (cumulative integration) and obtain a signal with a corresponding amplitude distribution (which can be referred to as an amplitude signal). For an example of the amplitude signal, see Figure 12 . Figure 12The horizontal axis is time, in ms. Figure 12 The vertical axis is the amplitude (which can represent the amplitude of the jitter), and the unit is degree. The positive and negative amplitudes shown on the vertical axis can represent different jitter directions. Figure 12 The signal waveform shown includes two periodic signals: a signal with a period of 0.5ms and a signal with a period of 1ms. Figure 12 As shown, approximately from 0 to 6ms, the period of the signal is 0.5ms, and the amplitude fluctuates between -0.4 degrees and 0.4 degrees, that is, the absolute value of the maximum amplitude is 0.4 degrees. Approximately from 6ms to 10ms, the period of the signal is 1ms, and the amplitude fluctuates between -0.8 degrees and 0.8 degrees, that is, the absolute value of the maximum amplitude is 0.8 degrees.

[0147] It can be understood that there is a corresponding relationship between the frequency spectrum signal and the amplitude signal. Specifically, the signal of the first frequency f1 in the frequency spectrum signal corresponds to the signal of the first period T1 in the amplitude signal. The relationship between the first frequency f1 and the first period T1 is f1=1 / T1. The frequency spectrum signal of the first frequency f1 and the amplitude signal of the first period T1 can be understood as the frequency domain signal and time domain signal of the same signal. The amplitude of the frequency spectrum signal of the first frequency f1 is the maximum amplitude (absolute value) of the amplitude signal of the first period T1. Figure 11 The frequency spectrum signal and Figure 12 The amplitude signal shown is used as an example to illustrate. Figure 11 The frequency spectrum signal shown includes signal 1 with a frequency of 1 Hz (amplitude of 0.8 degrees) and signal 2 with a frequency of 2 Hz (amplitude of 0.4 degrees). Figure 12 The amplitude signal shown includes signal 3 with a period of 1ms (time within 6ms to 10ms) and signal 4 with a period of 0.5ms (time within 0 to 6ms). Based on the relationship between frequency and period, it can be obtained that signal 1 in the frequency spectrum signal corresponds to signal 3 in the amplitude signal, the frequency of signal 3 is the frequency of signal 1 1Hz, and the absolute value of the maximum amplitude of signal 3 is 0.4 of the amplitude of signal 1. Signal 2 in the frequency spectrum signal corresponds to signal 4 in the amplitude signal, the frequency of signal 4 is the frequency of signal 2 2Hz, and the absolute value of the maximum amplitude of signal 4 is 0.8 of the amplitude of signal 1. Figure 10 The amplitude signal and the frequency spectrum signal corresponding to the Figure 12 The amplitude signals shown are similar, except that Figure 10 The frequency spectrum signal shown includes signals of more frequencies, so the corresponding amplitude signal also includes waveforms of more periods, for example, Figure 10 The frequency spectrum signal shown also includes a signal with a frequency of 0.5 Hz (amplitude of 0.6), and the corresponding amplitude signal also includes a signal with a period of 2 ms (amplitude fluctuates between -0.6 degrees and 0.6 degrees).

[0148] like Figure 8 As shown, the electronic device 100 can analyze the frequency spectrum signal and / or the amplitude signal and obtain a first frequency threshold and a first amplitude threshold. Figure 10 The frequency spectrum signal shown is analyzed and found to have a maximum amplitude of 0.8 corresponding to a frequency of 1Hz. The amplitude of the signal with a frequency less than 1Hz is about 0.5 degrees, and the amplitude of the signal with a frequency greater than 1Hz is less than or equal to 0.4 degrees. That is, the amplitude of the signal with a frequency less than 1Hz is greater than the amplitude of the signal with a frequency greater than 1Hz. Therefore, the signal less than or equal to 1Hz can be considered as a low-frequency large-amplitude signal, and the signal greater than 1Hz can be considered as a high-frequency small-amplitude signal. Accordingly, the first frequency threshold can be determined as the maximum frequency of the low-frequency large-amplitude signal of 1Hz, and the first amplitude threshold can be determined as the maximum amplitude of the high-frequency small-amplitude signal of 0.4 degrees. For example, Figure 11 The frequency spectrum signal and Figure 12 An analysis of the amplitude signal shown shows that the amplitude of the 1 Hz frequency spectrum signal, 0.8, is greater than the amplitude of the 2 Hz frequency spectrum signal, 0.4. Therefore, the 1 Hz signal can be considered as a low-frequency, large-amplitude signal, and the 2 Hz signal can be considered as a high-frequency, small-amplitude signal. Accordingly, the first frequency threshold can be determined as the frequency of the low-frequency, large-amplitude signal, 1 Hz, and the first amplitude threshold can be determined as the amplitude of the high-frequency, small-amplitude signal, 0.4 degrees.

[0149] In the above example, the electronic device 100 obtains the first frequency threshold and the first amplitude threshold based on the frequency spectrum signal and the amplitude signal of the currently acquired angular velocity signal. This can be understood as real-time analysis of the signal's characteristics, such as frequency and amplitude, and dynamic determination of the first frequency threshold and the first amplitude threshold. Therefore, when processing angular velocity signals from different time periods, the first frequency threshold and the first amplitude threshold used can be different. Without limitation, in another embodiment, the electronic device 100 may also analyze the frequency spectrum signal and the amplitude signal of the previously acquired angular velocity signal. In another embodiment, the first frequency threshold and the first amplitude threshold may be preset. In some examples, the electronic device 100 may determine the first frequency threshold and the first amplitude threshold based on the frequency spectrum signals and / or amplitude signals of a large number of users. For example, the electronic device 100 may obtain the primary jitter amplitude (i.e., the maximum amplitude of the amplitude range of 99% of the signals in the amplitude signal) and the primary jitter frequency (i.e., the frequency of the peak in the frequency spectrum signal) of a large number of users during actual filming. The first frequency threshold is determined based on the primary jitter frequency of the majority of users, and the first amplitude threshold is determined based on the primary jitter amplitude of the majority of users.

[0150] like Figure 8As shown, the electronic device 100 can filter and decompose the amplitude signal according to the first frequency threshold and the first amplitude threshold, and decompose the low-frequency large-amplitude signal and the high-frequency small-amplitude signal from the amplitude signal, wherein the frequency of the low-frequency large-amplitude signal is less than or equal to the first frequency threshold, and the maximum amplitude (absolute value) is greater than the first amplitude threshold, and the frequency of the high-frequency small-amplitude signal is greater than the first frequency threshold, and the maximum amplitude (absolute value) is less than or equal to the first amplitude threshold. For example, assuming that the first frequency threshold is 1 Hz and the first amplitude threshold is 0.4 degrees, it can be obtained from Figure 12 The 10ms amplitude signal shown is decomposed into a high-frequency small-amplitude signal from 0 to 6ms (frequency is 2Hz, the absolute value of the maximum amplitude is 0.4 degrees), and a low-frequency large-amplitude signal from 6ms to 10ms (frequency is 1Hz, the absolute value of the maximum amplitude is 0.8 degrees). It can be understood that the amplitude signal corresponds to the frequency spectrum signal. Therefore, the electronic device 100 can also decompose the frequency spectrum signal according to the first frequency threshold and the first amplitude threshold. For example, assuming that the first frequency threshold is 1Hz and the first amplitude threshold is 0.4 degrees, it can be obtained from Figure 10 The frequency spectrum signal shown can be decomposed into low-frequency and large-amplitude signals with frequencies less than or equal to 1 Hz, and high-frequency and small-amplitude signals with frequencies greater than 1 Hz. Alternatively, Figure 11 The frequency spectrum signal shown is decomposed into low-frequency and large-amplitude signals with a frequency less than or equal to 1 Hz (i.e., signals with a frequency of 1 Hz, corresponding to Figure 12 The low-frequency, large-amplitude signal of 6ms to 10ms shown in the figure) and the high-frequency, small-amplitude signal with a frequency greater than 1Hz (i.e., the signal with a frequency of 2Hz, corresponding to Figure 12 (high frequency, small amplitude signal from 0 to 6 ms as shown).

[0151] like Figure 8 As shown, the electronic device 100 can obtain first compensation information (used to compensate the first anti-shake module 193C) based on the low-frequency, large-amplitude signal, and obtain second compensation information (used to compensate the second anti-shake module 193D) based on the high-frequency, small-amplitude signal. The first compensation information and the second compensation information can be the target position or target motion mode.

[0152] Table 1 below exemplifies signal-related information for some common shooting states (such as still shooting, walking shooting, jogging shooting, and cycling shooting).

[0153] Table 1

[0154]

[0155]

[0156] Among them, frequency spectrum decomposition refers to decomposing a signal of a specific frequency from a frequency spectrum signal. The amplitude range of most signals (for example, 99% of the signals) in the signal (time domain signal) is the corresponding amplitude range in Table 1. For example, Figure 10 or Figure 11 The frequency spectrum signal is a static shooting state. From the frequency spectrum signal, a 1 Hz signal (amplitude 0.8 degrees) and a 2 Hz signal (amplitude 0.4 degrees) can be decomposed. The time domain signal waveform of the 1 Hz signal can be seen in Figure 12 The signal waveform within 6ms to 10ms (the amplitude fluctuates within -0.8 degrees to 0.8 degrees) and the time domain signal waveform of the signal with a frequency of 2Hz can be seen in Figure 12 The signal waveform within 0 to 6ms (the amplitude fluctuates within -0.4 degrees to 0.4 degrees).

[0157] Among them, the main frequency of the amplitude change can be the maximum frequency of the frequency range in which the amplitude changes greatly. For example, in the frequency spectrum signal in the static shooting state, the amplitude of the signal with a frequency less than or equal to 4 Hz generally fluctuates greatly, and the amplitude of the signal with a frequency greater than 4 Hz is close to 0 (which can be understood as the waveform tends to be a straight line).

[0158] Among them, the main range of amplitude change can be the amplitude range of most signals (such as 99% of the signals) in the time domain signal. For example, in the amplitude signal in a static shooting state, the amplitude of 99% of the signals fluctuates within -1.2 degrees to 1.2 degrees.

[0159] Figure 13 This is a flow chart of another anti-shake method provided in an embodiment of the present application.

[0160] Figure 13 The method shown can be applied to an electronic device including a camera. The camera of the electronic device may include a first anti-shake module and a second anti-shake module. The load of the first anti-shake module is greater than that of the second anti-shake module. Therefore, the anti-shake characteristics of the first anti-shake module are better for anti-shake effects against low-frequency and large-amplitude jitters, while the anti-shake characteristics of the second anti-shake module are better for anti-shake effects against high-frequency and small-amplitude jitters. The electronic device may be the electronic device 100 described in the above embodiment. For specific structure / architecture examples, please refer to the above. Figure 1-Figure 7 .

[0161] Figure 13 The method shown may include, but is not limited to, the following steps:

[0162] S101: The electronic device obtains a first posture signal of the electronic device.

[0163] In one embodiment, after starting the camera, the electronic device may obtain a posture signal of the electronic device in real time for performing optical image stabilization of the camera.

[0164] In one embodiment, the electronic device can collect the first posture signal of the electronic device through the gyroscope sensor. The first posture signal can be the angular velocity signal of the electronic device in the first period. The collected angular velocity signal includes, for example, the electronic device 100 around Figure 5 The angular velocity of the three axes (x-axis, y-axis and z-axis) shown. The frequency of the first posture signal can represent the frequency of the electronic device shaking in the first time period, and the amplitude of the first posture signal can represent the displacement of the electronic device shaking in the first time period. An example of the first posture signal can be seen in Figure 9 .

[0165] S102: The electronic device obtains a first anti-shake signal and a second anti-shake signal according to the first posture signal.

[0166] In one embodiment, the first posture signal is the angular velocity signal of the electronic device in the first time period. The electronic device can integrate the first angular velocity signal and obtain the first amplitude signal of the first time period. Then, according to the first frequency threshold and the first amplitude threshold, the first anti-shake signal of the second time period and the first anti-shake signal of the third time period can be decomposed from the first amplitude signal. Among them, the first time period includes the second time period and the third time period, the first amplitude signal includes the first anti-shake signal and the second anti-shake signal, the frequency of the first anti-shake signal is less than or equal to the first frequency threshold and the maximum amplitude of the first anti-shake signal is greater than the first amplitude threshold, the frequency of the second anti-shake signal is greater than the first frequency threshold and the maximum amplitude of the second anti-shake signal is less than or equal to the first amplitude threshold, the first anti-shake signal can be understood as a low-frequency large-amplitude signal, and the second anti-shake signal can be understood as a high-frequency small-amplitude signal. For example, Figure 12 The signal shown is the first amplitude signal (the first time period is 0 to 10ms). Assuming that the first frequency threshold is 1Hz and the first amplitude threshold is 0.4 degrees, the first anti-shake signal is a low-frequency, large-amplitude signal from 6ms to 10ms (i.e., the second time period), and the second anti-shake signal is a high-frequency, small-amplitude signal from 0 to 6ms (i.e., the third time period).

[0167] In one embodiment, the first posture signal is an angular velocity signal of the electronic device in a first time period. The electronic device can perform a Fourier transform on the first angular velocity signal and obtain a first frequency spectrum signal. Then, based on the first frequency threshold and the first amplitude threshold, the first frequency spectrum signal can be decomposed into: a second frequency spectrum signal having a frequency less than or equal to the first frequency threshold and an amplitude greater than the first amplitude threshold, and a third frequency spectrum signal having a frequency greater than the first frequency threshold and an amplitude less than or equal to the first amplitude threshold. It can be understood that the first amplitude signal is a time domain signal of the first posture signal, the first frequency spectrum signal is a frequency domain signal of the first posture signal, the first amplitude signal corresponds to the first frequency spectrum signal, the maximum amplitude of the frequency 1 signal in the first amplitude signal (which can be understood as a waveform) is the amplitude of the frequency 1 signal in the first frequency spectrum signal (which can be understood as a point). Correspondingly, the second frequency spectrum signal is the frequency spectrum signal of the first anti-shake signal, the third frequency spectrum signal is the frequency spectrum signal of the second anti-shake signal, the maximum amplitude of the first frequency signal in the first anti-shake signal is the amplitude of the first frequency signal in the second frequency spectrum signal, and the maximum amplitude of the second frequency signal in the second anti-shake signal is the amplitude of the second frequency signal in the third frequency spectrum signal. For example, Figure 10 The signal shown is the first frequency spectrum signal, Figure 12 The signal shown is part of the first amplitude signal. Assuming the first frequency threshold is 1 Hz and the first amplitude threshold is 0.4 degrees, the second frequency spectrum signal is Figure 10 The frequency in the low-frequency and large-amplitude signal is greater than 0 and less than or equal to 1 Hz, and the third frequency spectrum signal is Figure 10 The frequency is greater than 1Hz, the high-frequency small-amplitude signal, the first anti-shake signal includes Figure 12 The low-frequency and large-amplitude signal (frequency is 1 Hz) of 6 ms to 10 ms in the second anti-shake signal includes Figure 12 The high-frequency small-amplitude signal (frequency is 2 Hz) from 0 to 6 ms is Figure 12 The 1 Hz signal (period is 6 ms to 10 ms) (maximum amplitude is 0.8) in the first anti-shake signal shown corresponds to Figure 10 The 1 Hz signal (amplitude is 0.8) in the second frequency spectrum signal shown, Figure 12 The 2 Hz signal (period 0 to 6 ms) (maximum amplitude 0.4) in the second anti-shake signal shown corresponds to Figure 10 The third frequency spectrum signal shown is a 2 Hz signal (with an amplitude of 0.4).

[0168] In one embodiment, the first frequency threshold and the first amplitude threshold are determined according to the first frequency spectrum signal and / or the first amplitude signal. For specific examples, see Figure 8 Description of the first frequency threshold and the first amplitude threshold.

[0169] For an example of S102, see Figures 8-12 Description.

[0170] S103: The electronic device obtains first compensation information according to the first anti-shake signal, and obtains second compensation information according to the second anti-shake signal.

[0171] S104: The electronic device controls the first anti-shake module to perform shake compensation according to the first compensation information, and controls the second anti-shake module to perform shake compensation according to the second compensation information.

[0172] In one embodiment, a first anti-shake module corresponds to a first element, and a second anti-shake module corresponds to a second element. First compensation information includes a first position or a first motion mode. When the first anti-shake module performs shake compensation, it can drive the corresponding first element to the first position or to move the corresponding first element in the first motion mode. Second compensation information includes a second position or a second motion mode. When the second anti-shake module performs shake compensation, it can drive the corresponding second element to the second position or to move the corresponding second element in the second motion mode.

[0173] In one embodiment, the camera of the electronic device includes a first optical element and an image sensor arranged from the object side to the image side. For specific examples, see Figure 5 and Figure 6The camera 193 shown. In one embodiment, the first anti-shake module and the second anti-shake module may be anti-shake motors. The hardware architecture of the anti-shake motor may include, but is not limited to: lens tilt, lens shift, sensor tilt, sensor shift, module tilt, module shift. The anti-shake characteristics (such as anti-shake frequency, anti-shake angle) of anti-shake motors with different hardware architectures are different. The characteristics of lens tilt and lens shift are similar and can be characterized as lens shift / lens shift for subsequent explanation. Similarly, sensor tilt and sensor shift can also be characterized as sensor tilt / sensor shift, and module tilt and module shift can also be characterized as module tilt / module shift. Among them, the relationship of the load of the anti-shake motors in the above examples is: sensor tilt / sensor shift < lens shift / lens shift < module tilt / module shift. Therefore, in order of decreasing anti-shake frequency, they are: sensor tilt / sensor shift, lens shift / lens shift, module tilt / module shift. In the anti-shake motors in the above examples, the anti-shake angle of module tilt / module shift is the largest, and the anti-shake angles of lens shift / lens shift and sensor tilt / sensor shift are similar. For example, lens shift / lens shift is greater than sensor tilt / sensor shift.

[0174] The following combines Figure 5 and Figure 6 exemplarily illustrates three cases of the first anti-shake module and the second anti-shake module and the corresponding jitter compensation methods:

[0175] Case 1: The first anti-shake module is used to drive the first optical element to deflect or translate, and the second anti-shake module is used to drive the image sensor to deflect or translate. Exemplarily, the first anti-shake module is lens shift / lens shift, and the second anti-shake module is sensor tilt / sensor shift. For example Figure 5 and Figure 6As shown, when the first anti-shake module drives the first optical element to deflect, it can drive the first optical element to deflect around the X-axis or the Y-axis. When the first anti-shake module drives the first optical element to translate, it can drive the first optical element to move in the plane formed by the X-axis and the Y-axis. When the second anti-shake module drives the image sensor to deflect, it can drive the image sensor to deflect around the X-axis or the Y-axis. When the second anti-shake module drives the image sensor to translate, it can drive the image sensor to move in the plane formed by the X-axis and the Y-axis.

[0176] In case 2, the first anti-shake module is used to drive the camera 193 to deflect or translate, and the second anti-shake module is used to drive the image sensor to deflect or translate. For example, the first anti-shake module is module tilt / module shift, and the second anti-shake module is sensor tilt / sensor shift. Figure 5 and Figure 6 As shown, when the first anti-shake module drives the camera 193 to deflect, it can drive the camera 193 to deflect around the X-axis or Y-axis. When the first anti-shake module drives the camera 193 to translate, it can drive the camera 193 to move in the plane formed by the X-axis and the Y-axis. When the second anti-shake module drives the image sensor to deflect, it can drive the image sensor to deflect around the X-axis or Y-axis. When the second anti-shake module drives the image sensor to translate, it can drive the image sensor to move in the plane formed by the X-axis and the Y-axis.

[0177] Case 3: The first anti-shake module is used to drive the camera 193 to deflect or translate, and the second anti-shake module is used to drive the first optical element to deflect or translate. For example, the first anti-shake module is module tilt / module shift, and the second anti-shake module is lens shift / lens shift. Figure 5 and Figure 6 As shown, when the first anti-shake module drives the camera 193 to deflect, it can drive the camera 193 to deflect around the X-axis or the Y-axis. When the first anti-shake module drives the camera 193 to translate, it can drive the camera 193 to move in the plane formed by the X-axis and the Y-axis. When the second anti-shake module drives the first optical element to deflect, it can drive the first optical element to deflect around the X-axis or the Y-axis. When the second anti-shake module drives the first optical element to translate, it can drive the first optical element to move in the plane formed by the X-axis and the Y-axis.

[0178] The above examples are described using deflection around the X-axis or Y-axis as an example. In a specific implementation, deflection around the Z-axis or R-axis is also possible, and this embodiment of the present application does not limit this.

[0179] In one embodiment, when the shooting state of the electronic device is a relatively stable shooting state such as still shooting or moving shooting, the posture signal of the electronic device is generally mostly or entirely a low-frequency, large-amplitude signal (i.e., the first anti-shake signal). In this shooting state, if the electronic device detects the second anti-shake signal (i.e., the high-frequency, small-amplitude signal), S104 (optionally also including S103) can be executed. In some examples, if the electronic device detects that the ratio of the second anti-shake signal to the first posture signal / first amplitude signal / first frequency spectrum signal is greater than or equal to the first ratio, S104 can be executed. For example, the ratio range of the first anti-shake signal to the first posture signal in most still shooting and / or moving shooting states can be counted (assuming it is greater than or equal to 0 and less than or equal to the second ratio), and the first ratio can be determined based on the second ratio, and the first ratio can be set to a value greater than or equal to the second ratio. For example, when the second ratio is 0.1, the first ratio is set to 0.2. Not limited to the above examples, in other examples, when the shooting state of the electronic device is a relatively stable shooting state such as still shooting or walking shooting, the electronic device may also execute S104 when it detects that the ratio of the first anti-shake signal to the second anti-shake signal is less than or equal to a certain ratio.

[0180] In another embodiment, when the shooting state of the electronic device is sports shooting, such as shooting while running, cycling, shooting during extreme sports, shooting while riding in a vehicle (such as a car, train, high-speed train, etc.), shooting while riding in an airplane, etc., the posture signal of the electronic device is generally mostly or entirely a high-frequency small-amplitude signal (i.e., a second anti-shake signal). In this shooting state, if the electronic device detects the first anti-shake signal (i.e., a low-frequency large-amplitude signal), it can execute S104 (optionally also including S103). In some examples, if the electronic device detects that the ratio of the first anti-shake signal to the first posture signal / first amplitude signal / first frequency spectrum signal is greater than or equal to the third ratio, it can execute S104. For example, the ratio range of the second anti-shake signal to the first posture signal in most sports shooting states can be counted (assuming it is greater than or equal to 0 and less than or equal to the fourth ratio), the third ratio can be determined based on the fourth ratio, and the third ratio can be set to a value greater than or equal to the fourth ratio. Not limited to the above examples, in other examples, when the shooting state of the electronic device is motion shooting, the electronic device may also execute S104 when it detects that the ratio of the first anti-shake signal to the second anti-shake signal is greater than or equal to a certain ratio.

[0181] In one embodiment, the electronic device further includes a gyroscope sensor, a first driver chip, and a second driver chip. The gyroscope sensor is connected to the first driver chip and the second driver chip respectively. The first driver chip is connected to the first anti-shake module, and the second driver chip is connected to the second anti-shake module. For a specific structural example of the electronic device, see Figure 2After the gyroscope sensor collects the first posture signal, it can send the first posture signal to the first driver chip and the second driver chip. Then, the first driver chip can obtain a first anti-shake signal based on the first posture signal and can obtain first compensation information based on the first anti-shake signal. The second driver chip can obtain a second anti-shake signal based on the first posture signal and can obtain second compensation information based on the second anti-shake signal. Next, the first driver chip can send the first compensation information to the first anti-shake module so that the first anti-shake module can perform jitter compensation based on the first compensation information. The second driver chip can send the second compensation information to the second anti-shake module so that the second anti-shake module can perform jitter compensation based on the second compensation information.

[0182] In another embodiment, the electronic device further includes a gyroscope sensor, a first driver chip and a second driver chip, the gyroscope sensor is connected to the first driver chip, the first driver chip is connected to the second driver chip, the first driver chip is connected to the first anti-shake module, and the second driver chip is connected to the second anti-shake module. For a specific structural example of the electronic device, see Figure 3 After the gyroscope sensor collects the first attitude signal, it can send the first attitude signal to the first driver chip. The first driver chip can obtain a first anti-shake signal and a second anti-shake signal based on the first attitude signal, and obtain first compensation information based on the first anti-shake signal and obtain second compensation information based on the second anti-shake signal. Then, the first driver chip can send the first compensation information to the first anti-shake module so that the first anti-shake module performs jitter compensation based on the first compensation information. In addition, the first driver chip can send the second compensation information to the second driver chip so that the second driver chip sends the second compensation information to the second anti-shake module. The second compensation information is used by the second anti-shake module to perform jitter compensation.

[0183] In the above method, the electronic device combines a first anti-shake module with a better anti-shake effect for low-frequency and large-amplitude jitters, and a second anti-shake module with a better anti-shake effect for high-frequency and small-amplitude signal jitters to achieve optical image stabilization. Therefore, a larger anti-shake angle and anti-shake frequency can be achieved, and the proportion of anti-shake scenes that can be covered is increased. Moreover, one anti-shake module (such as sensor tilt / sensor shift) can be used to suppress the image rotation problem of another anti-shake module (such as lensshift / lens shift) due to the optical image stabilization principle, thereby further improving the imaging quality and enhancing the user experience.

[0184] The methods provided in the various embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, they may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital video disc (DWD), or a semiconductor medium (e.g., a solid state drive (SSD)). As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments may be modified, or some of the technical features thereof may be replaced by equivalents. However, such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for anti-shake, characterized in that: Applied to an electronic device, the electronic device includes a camera, the camera includes a first anti-shake module and a second anti-shake module, the load capacity of the first anti-shake module is greater than the load capacity of the second anti-shake module, the method includes: Acquiring a first posture signal of the electronic device; obtaining a first anti-shake signal and a second anti-shake signal according to the first posture signal, wherein a frequency of the first anti-shake signal is less than or equal to a first frequency threshold, and a maximum amplitude of the first anti-shake signal is greater than a first amplitude threshold, and a frequency of the second anti-shake signal is greater than the first frequency threshold, and a maximum amplitude of the second anti-shake signal is less than or equal to the first amplitude threshold; acquiring first compensation information according to the first anti-shake signal, and acquiring second compensation information according to the second anti-shake signal; The first anti-shake module is controlled to perform shake compensation according to the first compensation information, and the second anti-shake module is controlled to perform shake compensation according to the second compensation information.

2. The method according to claim 1, wherein The first posture signal is a first angular velocity signal of the electronic device in the first time period; The acquiring of a first anti-shake signal and a second anti-shake signal according to the first posture signal includes: Integrating the first angular velocity signal to obtain the first amplitude signal of the first time period; The first anti-shake signal of a second time period and the second anti-shake signal of a third time period are decomposed from the first amplitude signal according to the first frequency threshold and the first amplitude threshold, where the first time period includes the second time period and the third time period.

3. The method according to claim 2, wherein The signal obtained by Fourier transforming the first angular velocity signal is a first frequency spectrum signal, which includes a second frequency spectrum signal having a frequency less than or equal to the first frequency threshold and an amplitude greater than the first amplitude threshold, and a third frequency spectrum signal having a frequency greater than the first frequency threshold and an amplitude less than or equal to the first amplitude threshold. The second frequency spectrum signal is the frequency spectrum signal of the first anti-shake signal, and the third frequency spectrum signal is the frequency spectrum signal of the second anti-shake signal. The maximum amplitude of the first frequency signal in the first anti-shake signal is the amplitude of the first frequency signal in the second frequency spectrum signal, and the maximum amplitude of the second frequency signal in the second anti-shake signal is the amplitude of the second frequency signal in the third frequency spectrum signal.

4. The method according to claim 2 or 3, wherein: The signal obtained by Fourier transforming the first angular velocity signal is a first frequency spectrum signal, the signal obtained by integrating the first angular velocity signal is a first amplitude signal, and the first frequency threshold and the first amplitude threshold are determined based on the first frequency spectrum signal and / or the first amplitude signal.

5. The method according to any one of claims 1 to 4, characterized in that The camera includes a first optical element and an image sensor arranged from an object side to an image side, and controlling the first anti-shake module to perform shake compensation according to the first compensation information and controlling the second anti-shake module to perform shake compensation according to the second compensation information include: The first anti-shake module drives the first optical element to deflect or translate, and the second anti-shake module drives the image sensor to deflect or translate; or The first anti-shake module drives the camera to deflect or translate, and the second anti-shake module drives the image sensor to deflect and translate; or The first anti-shake module drives the camera to deflect or translate, and the second anti-shake module is used to drive the first optical element to deflect or translate.

6. The method according to any one of claims 1 to 5, characterized in that The first compensation information includes a first position or a first motion mode, and the first anti-shake module is used to drive the corresponding element to reach the first position, or the first anti-shake module is used to drive the corresponding element to move according to the first motion mode; The second compensation information includes a second position or a second motion mode, and the second anti-shake module is used to drive the corresponding element to reach the second position, or the second anti-shake module is used to drive the corresponding element to move according to the second motion mode.

7. The method according to any one of claims 1 to 6, wherein: The controlling the first anti-shake module to perform jitter compensation according to the first compensation information, and controlling the second anti-shake module to perform jitter compensation according to the second compensation information, includes: When the shooting state of the electronic device is still shooting or moving shooting, if the second anti-shake signal is detected, the first anti-shake module is controlled to perform shake compensation according to the first compensation information, and the second anti-shake module is controlled to perform shake compensation according to the second compensation information; When the shooting state of the electronic device is motion shooting, if the first anti-shake signal is detected, the first anti-shake module is controlled to perform shake compensation according to the first compensation information, and the second anti-shake module is controlled to perform shake compensation according to the second compensation information.

8. The method according to any one of claims 1 to 7, wherein: The electronic device further includes a gyroscope sensor, a first driver chip, and a second driver chip, the gyroscope sensor being connected to the first driver chip and the second driver chip respectively, the first driver chip being connected to the first anti-shake module, and the second driver chip being connected to the second anti-shake module, and the first posture signal being collected by the gyroscope sensor; The obtaining of the first posture signal of the electronic device includes: The first driving chip receives the first attitude signal sent by the gyroscope sensor, and the second driving chip receives the first attitude signal sent by the gyroscope sensor; The acquiring of a first anti-shake signal and a second anti-shake signal according to the first posture signal includes: The first driver chip obtains the first anti-shake signal according to the first posture signal, and the second driver chip obtains the second anti-shake signal according to the first posture signal; The acquiring first compensation information according to the first anti-shake signal and acquiring second compensation information according to the second anti-shake signal includes: The first driver chip obtains the first compensation information according to the first anti-shake signal, and the second driver chip obtains the second compensation information according to the second anti-shake signal; The controlling the first anti-shake module to perform jitter compensation according to the first compensation information, and controlling the second anti-shake module to perform jitter compensation according to the second compensation information, includes: The first driver chip sends the first compensation information to the first anti-shake module, and the second driver chip sends the second compensation information to the second anti-shake module. The first compensation information is used by the first anti-shake module to perform jitter compensation, and the second compensation information is used by the second anti-shake module to perform jitter compensation.

9. The method according to any one of claims 1 to 7, wherein: The electronic device further includes a gyroscope sensor, a first driver chip, and a second driver chip, wherein the gyroscope sensor is connected to the first driver chip, the first driver chip is connected to the second driver chip, the first driver chip is connected to the first anti-shake module, and the second driver chip is connected to the second anti-shake module, and the first posture signal is collected by the gyroscope sensor; The obtaining of the first posture signal of the electronic device includes: The first driver chip receives the first attitude signal sent by the gyroscope sensor; The acquiring of a first anti-shake signal and a second anti-shake signal according to the first posture signal includes: The first driver chip obtains the first anti-shake signal and the second anti-shake signal according to the first posture signal; The acquiring first compensation information according to the first anti-shake signal and acquiring second compensation information according to the second anti-shake signal includes: The first driver chip obtains the first compensation information according to the first anti-shake signal, and obtains the second compensation information according to the second anti-shake signal; The controlling the first anti-shake module to perform jitter compensation according to the first compensation information, and controlling the second anti-shake module to perform jitter compensation according to the second compensation information, includes: The first driver chip sends the second compensation information to the second driver chip; The first driver chip sends the first compensation information to the first anti-shake module, and the second driver chip sends the second compensation information to the second anti-shake module. The first compensation information is used by the first anti-shake module to perform jitter compensation, and the second compensation information is used by the second anti-shake module to perform jitter compensation.

10. An electronic device, characterized in that: The device comprises a camera, a processor and a memory, wherein the camera comprises a first anti-shake module and a second anti-shake module, the load capacity of the first anti-shake module is greater than the load capacity of the second anti-shake module, the memory is used to store a computer program, and the processor calls the computer program to execute the method described in any one of claims 1 to 9.

11. A computer storage medium, characterized in that The computer storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 9.

12. A computer program product, characterized in that When the computer program product is run on an electronic device, it is used to execute the method according to any one of claims 1 to 9.