CN110300263B - Gyroscope processing method and device, electronic equipment and computer readable storage medium - Google Patents

Gyroscope processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN110300263B
CN110300263B CN201910577788.5A CN201910577788A CN110300263B CN 110300263 B CN110300263 B CN 110300263B CN 201910577788 A CN201910577788 A CN 201910577788A CN 110300263 B CN110300263 B CN 110300263B
Authority
CN
China
Prior art keywords
gyroscope
angular velocity
velocity data
vibration frequency
shake
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910577788.5A
Other languages
Chinese (zh)
Other versions
CN110300263A (en
Inventor
陈嘉伟
张海裕
韦怡
徐锐
周彦汝
杨鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910577788.5A priority Critical patent/CN110300263B/en
Publication of CN110300263A publication Critical patent/CN110300263A/en
Application granted granted Critical
Publication of CN110300263B publication Critical patent/CN110300263B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/65Control of camera operation in relation to power supply
    • H04N23/651Control of camera operation in relation to power supply for reducing power consumption by affecting camera operations, e.g. sleep mode, hibernation mode or power off of selective parts of the camera
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/681Motion detection
    • H04N23/6812Motion detection based on additional sensors, e.g. acceleration sensors

Abstract

The application relates to a gyroscope processing method, a gyroscope processing device, an electronic device and a computer readable storage medium. The method comprises the following steps: acquiring a shooting anti-shake instruction; starting the gyroscope according to the shooting anti-shake instruction; collecting first angular velocity data of the gyroscope in the shooting process of the camera; adjusting the vibration frequency of the gyroscope according to the first angular velocity data, wherein the magnitude of the vibration frequency is in negative correlation with the magnitude of the shake of the electronic device detected by the gyroscope, and the first angular velocity data is used for representing the magnitude of the shake of the electronic device detected by the gyroscope. The gyroscope processing method, the gyroscope processing device, the electronic equipment and the computer readable storage medium can reduce the power consumption of the gyroscope.

Description

Gyroscope processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a gyroscope processing method, an apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of computer technology, OIS (Optical image stabilization) technology has emerged. At present, the camera mainly realizes anti-shake through a lens module when shooting, and the anti-shake and anti-shake depend on magnetic force to wrap a suspension lens, so that image blurring caused by camera shake is effectively overcome. Usually, a gyroscope in the lens detects a tiny movement, transmits a shaking signal to the OIS controller for calculation to obtain a compensated displacement, and then adjusts the position and angle of the lens module through a motor to make an image look stable, thereby effectively overcoming image blur caused by shaking of the camera.
However, the gyroscope processing method in the traditional camera shooting process has the problem of high power consumption.
Disclosure of Invention
Embodiments of the present application provide a gyroscope processing method and apparatus, an electronic device, and a computer-readable storage medium, which can reduce power consumption of a gyroscope.
A gyroscope processing method is applied to an electronic device comprising a camera and a gyroscope, and comprises the following steps:
acquiring a shooting anti-shake instruction;
starting the gyroscope according to the shooting anti-shake instruction;
collecting first angular velocity data of the gyroscope in the shooting process of the camera;
adjusting the vibration frequency of the gyroscope according to the first angular velocity data, wherein the magnitude of the vibration frequency is in negative correlation with the magnitude of the shake of the electronic device detected by the gyroscope, and the first angular velocity data is used for representing the magnitude of the shake of the electronic device detected by the gyroscope.
A gyroscope processing device applied to an electronic device comprising a camera and a gyroscope comprises:
the anti-shake instruction acquisition module is used for acquiring a shooting anti-shake instruction;
the gyroscope starting module is used for starting the gyroscope according to the shooting anti-shake instruction;
the data acquisition module is used for acquiring first angular velocity data of the gyroscope in the shooting process of the camera;
and the vibration frequency adjusting module is used for adjusting the vibration frequency of the gyroscope according to the first angular velocity data, wherein the magnitude of the vibration frequency is in negative correlation with the magnitude of the shake of the electronic equipment which can be detected by the gyroscope, and the first angular velocity data is used for indicating the magnitude of the shake of the electronic equipment which is detected by the gyroscope.
An electronic device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the gyroscope processing method.
A computer-readable storage medium, on which a computer program is stored, which computer program is executed by a processor for performing the steps of the above-mentioned gyroscope processing method.
According to the gyroscope processing method and device, the electronic equipment and the computer readable storage medium, the gyroscope is started according to the obtained shooting anti-shake instruction, the first angular velocity data of the gyroscope is collected in the shooting process of the camera, and the vibration frequency of the gyroscope is adjusted according to the first angular velocity data. The size of the vibration frequency of the gyroscope is in negative correlation with the size of the shake of the electronic equipment which can be detected by the gyroscope, namely, when the shake of the electronic equipment is large, the gyroscope can detect the shake only by a small vibration frequency, and therefore first angular velocity data is obtained. Therefore, the vibration frequency of the gyroscope is adjusted according to the shake of the electronic equipment, namely the first angular velocity data, so that the power consumption of the gyroscope can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an exemplary environment in which a gyroscope processing method may be implemented;
FIG. 2 is a schematic diagram of an image processing circuit in one embodiment;
FIG. 3 is a flow diagram of a method of gyroscope processing in one embodiment;
FIG. 4 is a block diagram of a MEMS gyroscope in one embodiment;
FIG. 5 is a schematic diagram of a gyroscope to detect jitter in one implementation;
FIG. 6 is a flow chart of the step of adjusting the vibration frequency in one embodiment;
FIG. 7 is a flow diagram of the target gyroscope determination step in one embodiment;
FIG. 8 is a schematic diagram of the optical anti-shake operation in one embodiment;
FIG. 9 is a block diagram of a gyroscope processing apparatus in one embodiment;
FIG. 10 is a block diagram showing the structure of a gyro processing device in another embodiment;
fig. 11 is a schematic diagram of an internal structure of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, the first angular velocity data may be referred to as second angular velocity data, and similarly, the second angular velocity data may be referred to as first angular velocity data, without departing from the scope of the present application. Both the first angular velocity data and the second angular velocity data are angular velocity data, but they are not the same angular velocity data.
FIG. 1 is a diagram illustrating an exemplary environment in which a gyroscope may be implemented. As shown in fig. 1, the application environment includes an electronic device 10, and a camera 102 and a gyroscope 104 are included in the electronic device 10. The electronic device 10 acquires a shooting anti-shake instruction; starting a gyroscope according to the shooting anti-shake instruction; acquiring first angular velocity data of a gyroscope in the shooting process of a camera; and adjusting the vibration frequency of the gyroscope according to first angular velocity data, wherein the magnitude of the vibration frequency is in negative correlation with the magnitude of the shake of the electronic equipment which can be detected by the gyroscope, and the first angular velocity data is used for indicating the magnitude of the shake of the electronic equipment which is detected by the gyroscope. The electronic device 10 may be a mobile phone, a computer, a wearable device, a personal digital assistant, and the like, which is not limited herein.
The embodiment of the application provides electronic equipment. The electronic device includes therein an Image Processing circuit, which may be implemented using hardware and/or software components, and may include various Processing units defining an ISP (Image Signal Processing) pipeline. FIG. 2 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 2, for convenience of explanation, only aspects of the image processing technology related to the embodiments of the present application are shown.
As shown in fig. 2, the image processing circuit includes an ISP processor 240 and control logic 250. The image data captured by the imaging device 210 is first processed by the ISP processor 240, and the ISP processor 240 analyzes the image data to capture image statistics that may be used to determine and/or control one or more parameters of the imaging device 210. The imaging device 210 may include a camera having one or more lenses 212 and an image sensor 214. The image sensor 214 may include an array of color filters (e.g., Bayer filters), and the image sensor 214 may acquire light intensity and wavelength information captured with each imaging pixel of the image sensor 214 and provide a set of raw image data that may be processed by the ISP processor 240. The sensor 220 (e.g., gyroscope) may provide parameters of the acquired image processing (e.g., anti-shake parameters) to the ISP processor 240 based on the type of interface of the sensor 220. The sensor 220 interface may utilize an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above.
In addition, the image sensor 214 may also send raw image data to the sensor 220, the sensor 220 may provide the raw image data to the ISP processor 240 based on the sensor 220 interface type, or the sensor 220 may store the raw image data in the image memory 230.
The ISP processor 240 processes the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the ISP processor 240 may perform one or more image processing operations on the raw image data, gathering statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
The ISP processor 240 may also receive image data from the image memory 230. For example, the sensor 220 interface sends raw image data to the image memory 230, and the raw image data in the image memory 230 is then provided to the ISP processor 240 for processing. The image Memory 230 may be a portion of a Memory device, a storage device, or a separate dedicated Memory within an electronic device, and may include a DMA (Direct Memory Access) feature.
Upon receiving raw image data from image sensor 214 interface or from sensor 220 interface or from image memory 230, ISP processor 240 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 230 for additional processing before being displayed. ISP processor 240 receives processed data from image memory 230 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The image data processed by ISP processor 240 may be output to display 260 for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). Further, the output of the ISP processor 240 may also be sent to the image memory 230, and the display 260 may read image data from the image memory 230. In one embodiment, image memory 230 may be configured to implement one or more frame buffers.
The statistics determined by ISP processor 240 may be sent to control logic 250 unit. For example, the statistical data may include image sensor 214 statistics such as gyroscope vibration frequency, auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 212 shading correction, and the like. Control logic 250 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of imaging device 210 and ISP processor 240 based on the received statistical data. For example, the control parameters of the imaging device 210 may include sensor 220 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, camera anti-shake displacement parameters, lens 212 control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), as well as lens 212 shading correction parameters.
In one embodiment, when the electronic device acquires a shooting anti-shake instruction, the sensor (gyroscope) 220 is turned on, and first angular velocity data of the sensor (gyroscope) 220 is acquired during shooting by the imaging device (camera) 210. The sensor (gyroscope) 220 may transmit the acquired first angular velocity data to the ISP processor 240, or may transmit the first angular velocity data to the image memory 230 for storage. After the ISP processor 240 acquires the first angular velocity data, the acquired image may be processed according to the first angular velocity data, for example, the image may be subjected to shake compensation according to the first angular velocity data, and the first angular velocity data may also be sent to the control logic 250.
The control logic 250 determines the first angular velocity data and adjusts the vibration frequency of the gyroscope according to the determination result. Decreasing the vibration frequency of the sensor (gyroscope) 220 when the first angular velocity data is greater than or equal to the first angular velocity threshold; the vibration frequency of the sensor (gyroscope) 220 is increased when the first angular velocity data is less than a second angular velocity threshold, wherein the first angular velocity threshold is greater than or equal to the second angular velocity threshold.
When the electronic device includes at least two sensors (gyroscopes) 220, the ISP processor 240 may process the angular velocity data of the at least two sensors (gyroscopes) 220 and send the processed data to the control logic 250. Control logic 250 determines a target sensor (gyroscope) from the at least two sensors (gyroscopes) 220 based on the processed data.
The image stored in the image memory 230 and the image processed by the ISP processor may be transmitted to the display 260, and the image is displayed on the display interface of the electronic device.
In one embodiment, control logic 250 may adjust the sampling frequency of sensor (gyroscope) 220 based on the first angular velocity data of sensor (gyroscope) 220.
FIG. 3 is a flow diagram of a method for gyroscope processing in one embodiment. The gyroscope processing method in this embodiment is described by taking the example of the gyroscope processing method running on the electronic device in fig. 1. As shown in fig. 3, the gyro processing method includes steps 302 to 308.
Step 302, a shooting anti-shake command is obtained.
In the process of image shooting, when a user clicks a shutter to shoot, the exposure of an image is often finished in a moment. In the process of image exposure, the captured image is often blurred due to large or small shake, thereby causing inconvenience to the user. Therefore, anti-shake is performed in the shooting process, and a clearer image can be acquired.
In one embodiment, a photographing anti-shake mode may be set in the application program, and when the user selects the photographing anti-shake mode, the electronic device obtains a photographing anti-shake instruction. In another embodiment, information such as a gesture and a biometric feature (a fingerprint and a portrait) of the user may also be matched with preset information such as a preset gesture and a preset biometric feature (a preset fingerprint and a preset portrait), and when the matching is successful, the electronic device acquires the shooting anti-shake instruction. In another embodiment, the photographing anti-shake instruction may also be acquired by recognizing a voice, a selected instruction, or the like. The specific acquisition of the photographing anti-shake instruction is not limited thereto.
And step 304, starting the gyroscope according to the shooting anti-shake instruction.
The gyroscope is also called as an angular velocity sensor and can measure the rotation angular velocity of the electronic equipment during deflection and inclination. The gyroscopes include a fiber optic gyroscope, a laser gyroscope, a MEMS (Micro Electro Mechanical systems) gyroscope, and the like. The gyroscope in the above-described gyroscope processing method may be an optical fiber gyroscope, a laser gyroscope, a MEMS gyroscope, or the like, but is not limited thereto. The following is exemplified with respect to a MEMS gyroscope.
Fig. 4 is a schematic structural diagram of the MEMS gyroscope. The MEMS gyroscope consists of two masses 402 and 404 that constantly vibrate and constantly move in opposite directions. When a jitter is detected, i.e. an angular velocity Ω is applied, the coriolis effect F on each mass generates a force in the opposite direction, causing a change in capacitance. The capacitance difference is in direct proportion to the angular velocity, so that the angular velocity at the moment can be known by measuring the change of the capacitance value, and the first angular velocity data can be acquired.
And step 306, acquiring first angular speed data of the gyroscope in the shooting process of the camera.
Angular velocity refers to a vector that describes in physics the angle an object turns through per unit time as well as the direction of the turn. The first angular speed data refers to the angle of rotation and the direction of rotation of the electronic equipment in unit time during shooting of the camera. The larger the first angular velocity data is, the larger the angle indicating that the electronic apparatus is rotated is, and the larger the direction of the rotation is, the larger the shake of the electronic apparatus is.
In the shooting process of the camera, the preview process before shooting the image may be performed, or in the process of shooting the video, the camera acquires a plurality of consecutive frames of images, and may generate one first angular velocity data for each frame of image, or generate a plurality of first angular velocity data for one frame of image, or generate one first angular velocity data for a plurality of frames of images, which is not limited to this.
It can be understood that the real-time performance of processing each frame of image can be ensured by generating first angular velocity data for each frame of image, collecting the first angular velocity data generated by the gyroscope, and processing the corresponding image according to each first angular velocity data. And a plurality of first angular velocity data are generated for one frame of image, the first angular velocity data generated by the gyroscope are collected, and the corresponding frame of image is processed according to the plurality of first angular velocity data, so that the accuracy of image processing can be improved. And a first angular velocity data is generated for the multi-frame image, for example, when the electronic device shakes within a certain range, a first angular velocity data can be generated for the multi-frame image, the first angular velocity data generated by the gyroscope is collected, the multi-frame image is respectively processed according to the collected first angular velocity data, and the power consumption of the gyroscope can be reduced.
And 308, adjusting the vibration frequency of the gyroscope according to first angular velocity data, wherein the vibration frequency is in negative correlation with the shake of the electronic equipment which can be detected by the gyroscope, and the first angular velocity data is used for indicating the shake of the electronic equipment which is detected by the gyroscope.
The vibration frequency refers to the number of vibrations per second. Taking the MEMS gyroscope as an example, the vibration frequency is the number of times each second each mass in the MEMS gyroscope vibrates. The vibration frequency of each block is the same.
When the vibration frequency of the gyroscope is larger, the smaller the jitter can be detected by the gyroscope. When the vibration frequency of the gyroscope is smaller, the gyroscope can detect a large shake. That is, the vibration frequency is inversely related to the magnitude of the shake of the electronic apparatus that can be detected by the gyroscope. Therefore, when the shake of the electronic equipment is large, the gyroscope can obtain the shake of the detected electronic equipment only by a small vibration frequency, and correct first angular velocity data can be acquired. The first angular velocity data is used to indicate a magnitude of a shake of the electronic device detected by the gyroscope.
In the conventional gyro processing method, the vibration frequency of the gyro is generally set large to detect a small shake of the electronic device. However, this gyro processing method has a problem of high power consumption.
Gather the first angular velocity data of gyroscope in camera shooting process, can adjust the vibration frequency of gyroscope according to first angular velocity data. Specifically, when the acquired first angular velocity data is large, the vibration frequency of the gyroscope may be reduced; when the acquired first angular velocity data is small, the vibration frequency of the gyroscope may be increased.
The vibration frequency of the gyroscope is adjusted according to the first angular velocity data, and the range of the gyroscope for measuring jitter can be further improved. For example, when the vibration frequency of the gyroscope is 100Hz, the measurable range of jitter is 2 degrees or more, and when the vibration frequency of the gyroscope is adjusted to 150Hz based on the first angular velocity data, and the measurable range of jitter is 1 degree or more, the adjusted gyroscope can measure more minute jitter, increasing the range of jitter measurement of the gyroscope.
According to the gyroscope processing method, the gyroscope is started according to the obtained shooting anti-shake instruction, first angular velocity data of the gyroscope is collected in the shooting process of the camera, and the vibration frequency of the gyroscope is adjusted according to the first angular velocity data. The size of the vibration frequency of the gyroscope is in negative correlation with the size of the shake of the electronic equipment which can be detected by the gyroscope, namely, when the shake of the electronic equipment is large, the gyroscope can detect the shake only by a small vibration frequency, and therefore first angular velocity data is obtained. Therefore, the vibration frequency of the gyroscope is adjusted according to the shake of the electronic equipment, namely the first angular velocity data, so that the power consumption of the gyroscope can be reduced.
In one embodiment, adjusting the vibration frequency of the gyroscope based on the first angular velocity data comprises: when the first angular velocity data is greater than or equal to a first angular velocity threshold, reducing the vibration frequency of the gyroscope; and when the first angular velocity data is smaller than a second angular velocity threshold value, increasing the vibration frequency of the gyroscope, wherein the first angular velocity threshold value is larger than or equal to the second angular velocity threshold value.
As shown in fig. 5, when the gyroscope detects the electronic device shaking, the coriolis force of the gyroscope is as follows:
Figure BDA0002112503270000101
Figure BDA0002112503270000102
Figure BDA0002112503270000103
Figure BDA0002112503270000104
Figure BDA0002112503270000105
wherein the content of the first and second substances,
Figure BDA0002112503270000111
is the base vector of three axes of a spatial rotating coordinate system. r denotes the radius of motion, ω is the angular velocity, vrIs the radial movement speed, arIs the radial acceleration, aCoriolisIs the coriolis force acceleration.
From the above formula, when the Coriolis force a is appliedCoriolisFor small jitter, i.e. small angular velocities, a large radial movement velocity v is required when not changingrCan achieve the precision of the gyroscope, and the radial motion velocity vrIs in direct proportion to the vibration frequency. That is, the gyroscope requires a higher vibration frequency to detect a smaller jitter. When the vibration frequency of the gyroscope is high, large power consumption is also generated.
It is understood that when the first angular velocity data is greater than or equal to the first angular velocity threshold, a large jitter of the electronic device is indicated. And the magnitude of the vibration frequency of the gyroscope is inversely related to the magnitude of the shake of the electronic device that can be detected by the gyroscope. Therefore, when the shake of the electronic device is large, the gyroscope can detect the shake of the electronic device even with a small vibration frequency, so that correct first angular velocity data can be acquired. When the vibration frequency of the gyroscope is reduced, the power consumption of the gyroscope can be reduced, and therefore resources of electronic equipment are saved.
When the first angular velocity data is smaller than the second angular velocity threshold, it indicates that the shake of the electronic device is small. Therefore, it is necessary to increase the vibration frequency of the electronic device, so that the gyroscope can detect more minute jitter of the electronic device, and the range of measuring jitter by the gyroscope is increased.
In one embodiment, the correspondence relationship of the first angular velocity data and the vibration frequency may be set in advance; and when the first angular velocity data is greater than or equal to the first angular velocity threshold, determining a target vibration frequency of the gyroscope from the corresponding relation between the first angular velocity data and the vibration frequency according to the first angular velocity data, wherein the target vibration frequency is less than or equal to the vibration frequency.
It is understood that, in the correspondence relationship of the first angular velocity data and the vibration frequency, the larger the first angular velocity data is, the smaller the vibration frequency is. The corresponding relationship between the first angular velocity data and the vibration frequency may be set in the form of a table, or may be set in a functional relationship, such as an inverse function, but is not limited thereto.
For example, the corresponding relationship between the first angular velocity data and the vibration frequency is preset in the electronic device as follows: y is 1/(0.01 × x), where x is a value of the first angular velocity data and y is a value of the vibration frequency. And when the first angular speed data is 2 degrees, the vibration frequency is 100Hz, and the first angular speed threshold is 1 degree, and the first angular speed data is greater than or equal to the first angular speed threshold, determining that the target vibration frequency of the gyroscope is 50Hz from the corresponding relation between the first angular speed data and the vibration frequency.
In another embodiment, when the first angular velocity data is greater than or equal to the first angular velocity threshold, a difference between the first angular velocity data and the first angular velocity threshold is obtained, the difference is substituted into a direct proportional function of the difference and the reduction value to obtain a reduction value of the vibration frequency, and the reduction value is subtracted from the value of the vibration frequency of the gyroscope to obtain the target vibration frequency.
For example, the value of the first angular velocity data is 3 degrees, the vibration frequency of the gyroscope is 50Hz, the first angular velocity threshold value is 1 degree, and the direct proportional function of the difference value to the reduction value is y ═ 10x, where y is the reduction value and x is the difference value. The difference between the first angular velocity data and the first angular velocity threshold is 2 degrees, the difference 2 degrees is substituted into a direct proportional function y of the difference and the reduction value of 10x 220, and the reduction value 20 is subtracted from the value 50 of the vibration frequency of the gyroscope to obtain 30, that is, the target vibration frequency is 30 Hz.
Correspondingly, when the first angular velocity data is smaller than the second angular velocity threshold, the target vibration frequency of the gyroscope can be determined from the preset corresponding relation between the first angular velocity data and the vibration frequency according to the first angular velocity data; or obtaining a difference value between the first angular velocity data and the first angular velocity threshold value, substituting the difference value into a direct proportional function of the difference value and the increase value to obtain an increase value of the vibration frequency, and adding the increase value to the value of the vibration frequency of the gyroscope to obtain the target vibration frequency.
In the correspondence relationship between the first angular velocity data and the vibration frequency, the smaller the first angular velocity data is, the larger the vibration frequency is. The corresponding relationship between the first angular velocity data and the vibration frequency may be set in the form of a table, or may be set in a functional relationship, such as an inverse function, but is not limited thereto.
It should be noted that, when the first angular velocity data is greater than or equal to the first angular velocity threshold, or when the first angular velocity data is less than the second angular velocity threshold, the vibration frequency of the gyroscope is adjusted, that is, the vibration frequency of the gyroscope is reduced or increased, and the method of adjustment is not limited to the above implementation, and the specific implementation may be set according to the user requirement, but is not limited to this.
As shown in fig. 6, in one embodiment, collecting first angular velocity data of a gyroscope during camera shooting includes:
step 602, collecting first angular velocity data of a preset number of gyroscopes in the shooting process of the camera.
In the shooting process of the camera, the first angular velocity data of the preset number of gyroscopes can be collected. It is understood that the larger the preset number, i.e., the larger the number of the collected first angular velocity data, the more accurately the vibration frequency of the gyroscope can be adjusted. On the other hand, the larger the preset number is, the more the first angular velocity acquired by the gyroscope is, and the higher the power consumption of the gyroscope is. The preset number may be set or modified according to the user requirement, and is not limited herein.
In one embodiment, collecting first angular velocity data of a preset number of gyroscopes in a camera shooting process includes: in the shooting process of the camera, detecting the shake of the electronic equipment through a gyroscope to generate at least one piece of first angular velocity data; generating a data sequence from the at least one first angular velocity data; a preset amount of first angular velocity data is collected from the data sequence.
The data sequence refers to a sequence of at least one first angular velocity data. A preset number of first angular velocity data are collected from the data sequence, and the first angular velocity data may be collected from the latest moment in time sequence until the number of collected first angular velocity data reaches the preset number. The first angular velocity data of the preset number can also be acquired at intervals of a preset number, such as 1 interval of the first angular velocity data. The manner of collecting the preset number of first angular velocity data may be set according to the user requirement, and is not limited thereto.
It can be understood that the closer the time corresponding to the acquired first angular velocity data is, the more accurately the vibration frequency of the gyroscope can be adjusted.
When the first angular velocity data is greater than the first angular velocity threshold, reducing a vibration frequency of the gyroscope, including:
and step 604, when the preset number of first angular velocity data are all larger than the first angular velocity threshold, reducing the vibration frequency of the gyroscope.
It can be understood that, when the collected preset number of first angular velocity data are all greater than the first angular velocity threshold, it can be considered that the jitters of the electronic device within the time length corresponding to the collected first angular velocity data are all large, and then the vibration frequency of the gyroscope can be reduced, and the power consumption of the gyroscope is reduced.
When the first angular velocity data is less than the second angular velocity threshold, increasing the vibration frequency of the gyroscope, including:
and 606, when the preset number of first angular velocity data are all smaller than the second angular velocity threshold, increasing the vibration frequency of the gyroscope.
It can be understood that, when the collected preset number of first angular velocity data are all smaller than the second angular velocity threshold, it can be considered that the jitters of the electronic device within the time length corresponding to the collected first angular velocity data are all smaller, so that the vibration frequency of the gyroscope can be increased, and the range of the gyroscope for detecting the vibration can be increased.
In one embodiment, when the preset number of first angular velocities includes both the first angular velocity greater than the first angular velocity threshold and the first angular velocity less than the second angular velocity threshold, it indicates that the shake of the electronic device within the time duration corresponding to the collected first angular velocity data is unstable, sometimes the shake is large, and sometimes the shake is small, and the vibration frequency of the gyroscope may be kept unchanged.
According to the gyroscope processing method, the first angular velocity data of the gyroscopes in preset number are collected in the shooting process of the camera, and when the first angular velocity data in preset number are all larger than the first angular velocity threshold value, the vibration frequency of the gyroscopes is reduced, so that the power consumption of the gyroscopes can be reduced; when the preset number of first angular velocity data are all smaller than the second angular velocity threshold, the vibration frequency of the gyroscope is improved, and the range of the gyroscope for detecting vibration can be improved.
In one embodiment, the gyroscope processing method further includes: when the electronic equipment comprises at least two gyroscopes, and the vibration frequencies of the at least two gyroscopes are lower than a preset frequency threshold, determining a target gyroscope from the at least two gyroscopes according to first angular speed data of each gyroscope; adjusting a vibration frequency of the gyroscope according to the first angular velocity data, comprising: and adjusting the vibration frequency of the target gyroscope according to the first angular velocity data of the target gyroscope.
In the electronic device, at least two gyroscopes may be included, and the vibration frequencies of the at least two gyroscopes are both lower than the preset frequency threshold, that is, the power consumption of the at least two gyroscopes is lower. The target gyroscope may be determined from the at least two gyroscopes based on the first angular velocity data for the respective gyroscope. And adjusting the vibration frequency of the target gyroscope according to the first angular velocity data of the target gyroscope.
It is to be understood that the at least two gyroscopes of the electronic device may be different types of gyroscopes, such as fiber optic gyroscopes, laser gyroscopes, MEMS gyroscopes, etc., or may be the same type of gyroscope. The at least two gyroscopes in the electronic device may be gyroscopes with different property parameters, such as different vibration frequencies, different sampling frequencies, different sensitivity to jitter, etc., without being limited thereto.
According to the gyroscope processing method, when the electronic equipment comprises at least two gyroscopes, and the vibration frequencies of the at least two gyroscopes are lower than the preset frequency threshold, the target gyroscope is determined from the at least two gyroscopes according to the first angular velocity data of each gyroscope, the vibration frequency of the target gyroscope is adjusted according to the first angular velocity of the target gyroscope, and power consumption of the gyroscopes can be reduced.
In one embodiment, an electronic device includes at least one first gyroscope to detect capacitance values below a first capacitance threshold and at least one second gyroscope to detect capacitance values above a second capacitance threshold, the first capacitance threshold being less than or equal to the second capacitance threshold;
determining a target gyroscope from the at least two gyroscopes based on the first angular rate data, comprising:
and step 702, when the first angular velocity data is larger than the third angular velocity threshold, taking the second gyroscope as a target gyroscope.
Capacitance refers to a physical quantity that represents the capacity of a capacitor to hold a charge. The capacitance value refers to the amount of charge that the capacitor holds. The first gyroscope refers to a gyroscope for detecting capacitance values below a first capacitance threshold value and the second gyroscope refers to a gyroscope for detecting capacitance values above a second capacitance threshold value. In the gyroscope, when the capacitance value is larger, the gyroscope is sensitive to larger jitter, and the larger jitter can be quickly detected. When the capacitance value is small, the gyroscope is sensitive to small jitter, and the small jitter can be detected quickly.
Taking a MEMS gyroscope as an example, as shown in fig. 4, two masses 402 and 404 are the two poles of a plate capacitor. The sensitivity of the gyroscope to capacitance can be varied by varying the facing area between the two masses, and by adding different dielectrics between the two masses. When the gyroscope is sensitive to the small capacitance of the plate capacitor, the gyroscope may detect a smaller capacitance value, and then the gyroscope may act as the first gyroscope. When the gyroscope is sensitive to the large capacitance of the plate capacitor, the gyroscope can detect a large capacitance value, and then the gyroscope can be used as a second gyroscope.
In another embodiment, the plate capacitor may output a voltage signal, and when the voltage detection device in the gyroscope detects a smaller voltage, which indicates that the gyroscope is sensitive to a small capacitance, and detects a smaller capacitance value, the gyroscope may be the first gyroscope. When a larger voltage is detected during voltage detection in the gyroscope, indicating that the gyroscope is sensitive to a large capacitance, and the larger voltage can be detected, the gyroscope can be a second gyroscope.
And when the first angular velocity data is larger than the third angular velocity threshold, the first angular velocity data is larger, the shake of the electronic equipment is larger, and the second gyroscope is used as a target gyroscope.
And step 704, when the first angular velocity data is less than or equal to a fourth angular velocity threshold, taking the first gyroscope as a target gyroscope, wherein the third angular velocity threshold is greater than or equal to the fourth angular velocity threshold.
And when the first angular velocity data is smaller than or equal to the fourth angular velocity threshold, the first angular velocity data is smaller, the shake of the electronic equipment is smaller, and the first gyroscope is taken as a target gyroscope.
According to the gyroscope processing method, when the first angular velocity data is larger than the third angular velocity threshold value, the second gyroscope is used as the target gyroscope; when the first angular velocity data is less than or equal to the fourth angular velocity threshold, the first gyroscope is used as a target gyroscope, the target gyroscope is determined from the plurality of gyroscopes according to the size of the first angular velocity data, and a more accurate gyroscope can be determined to adjust a more accurate vibration frequency.
In one embodiment, the gyroscope processing method further includes: and adjusting the sampling frequency of the gyroscope according to the first angular velocity data.
The sampling frequency refers to the number of times per second the gyroscope acquires the first angular velocity data.
It can be understood that the larger the sampling frequency is, the more the first angular velocity data is acquired by the gyroscope, the higher the power consumption of the gyroscope is, and the higher the accuracy of processing the gyroscope according to the first angular velocity data is.
According to the gyroscope processing method, the sampling frequency of the gyroscope is adjusted according to the first angular velocity data, and the relation between the power consumption of the gyroscope and the accuracy of gyroscope processing can be balanced.
In one embodiment, adjusting the sampling frequency of the gyroscope based on the first angular velocity data comprises: when the first angular velocity data is larger than or equal to the fifth angular velocity threshold, increasing the sampling frequency of the gyroscope; and when the first angular velocity data is smaller than a sixth angular velocity threshold, reducing the sampling frequency of the gyroscope, wherein the fifth angular velocity threshold is larger than or equal to the sixth angular velocity threshold.
It is understood that when the first angular velocity data is greater than or equal to the fifth angular velocity threshold, it indicates that the first angular velocity data is larger and the jitter of the electronic device is larger. In order to ensure the stability and accuracy of images in the shooting process of the camera, the camera needs to be subjected to larger shake compensation. Therefore, the sampling frequency of the gyroscope needs to be increased, more first angular velocity data can be acquired by a larger sampling frequency, and the camera can be more accurately subjected to jitter compensation according to the acquired first angular velocity data.
When the first angular velocity data is smaller than the sixth angular velocity threshold, the first angular velocity data is smaller, the shake of the electronic device is smaller, and the acquired image in the shooting process of the camera is clearer. Therefore, only minor shake compensation needs to be performed on the camera. When the first angular velocity data is smaller than the sixth angular velocity threshold, the sampling frequency of the gyroscope is reduced, and the power consumption of the gyroscope can be reduced.
According to the processing method of the gyroscope, when the first angular velocity data is larger than or equal to the fifth angular velocity threshold, the sampling frequency of the gyroscope is increased, more first angular velocity data can be obtained, and therefore the camera can be subjected to shake compensation more accurately; when the first angular velocity data is smaller than the sixth angular velocity threshold, the sampling frequency of the gyroscope is reduced, and the power consumption of the gyroscope can be reduced.
In one embodiment, the correspondence relationship of the first angular velocity data to the sampling frequency may be set in advance; and when the first angular velocity data is greater than or equal to the fifth angular velocity threshold, determining a target sampling frequency of the gyroscope from the corresponding relation between the first angular velocity data and the sampling frequency according to the first angular velocity data, wherein the target sampling frequency is greater than or equal to the sampling frequency.
It is understood that, in the correspondence relationship of the first angular velocity data to the sampling frequency, the larger the first angular velocity data, the larger the sampling frequency. The corresponding relationship between the first angular velocity data and the sampling frequency may be set in a table form, or may be set in a functional relationship, such as a proportional function, but is not limited thereto.
For example, the corresponding relationship between the first angular velocity data and the sampling frequency is preset in the electronic device as follows: y is 50x, where x is the value of the first angular velocity data and y is the value of the sampling frequency. And when the first angular speed data is 2 degrees, the sampling frequency is 50Hz, and the first angular speed threshold is 1 degree, and the first angular speed data is greater than or equal to the first angular speed threshold, determining the target sampling frequency of the gyroscope to be 100Hz from the corresponding relation between the first angular speed data and the sampling frequency.
In another embodiment, when the first angular velocity data is greater than or equal to the fifth angular velocity threshold, a difference between the first angular velocity data and the fifth angular velocity threshold is obtained, the difference is substituted into a direct proportional function of the difference and the increase to obtain an increase of the sampling frequency, and the increase is added to the value of the sampling frequency of the gyroscope to obtain the target sampling frequency.
For example, the first angular velocity data has a value of 2 degrees, the sampling frequency of the gyroscope is 50Hz, the first angular velocity threshold is 1 degree, and the direct proportional function of the difference value to the boost value is y-20 x, where y is the boost value and x is the difference value. The difference between the first angular velocity data and the first angular velocity threshold is 1 degree, the difference 1 degree is substituted into a direct proportional function y of the difference and the increase value, i.e., 20x 20 1 20, and the increase value 20 is added to the value 50 of the sampling frequency of the gyroscope to obtain 70, i.e., the target sampling frequency is 70 Hz.
Correspondingly, when the first angular velocity data is smaller than the sixth angular velocity threshold, the target sampling frequency of the gyroscope can be determined from the preset corresponding relation between the first angular velocity data and the sampling frequency according to the first angular velocity data; the difference between the first angular velocity data and the sixth angular velocity threshold value can also be obtained, the difference is substituted into a direct proportional function of the difference and the reduction value to obtain a reduction value of the sampling frequency, and the reduction value is subtracted from the value of the sampling frequency of the gyroscope to obtain the target sampling frequency.
It should be noted that, when the first angular velocity data is greater than or equal to the fifth angular velocity threshold, or when the first angular velocity data is less than the sixth angular velocity threshold, the sampling frequency of the gyroscope is adjusted, that is, the sampling frequency of the gyroscope is increased or decreased, and the method of adjustment is not limited to the foregoing implementation manner, and the specific implementation manner may be set according to a user requirement, and is not limited to this.
In one embodiment, the method further comprises: acquiring second angular velocity data of the adjusted gyroscope; and carrying out shake compensation on the camera according to the second angular velocity data.
The shake compensation refers to a process of compensating shake in the shooting process of the camera, and the image definition in the shooting process of the camera can be improved.
Specifically, when the vibration frequency of the gyroscope is adjusted, the second angular velocity data of the gyroscope with the adjusted vibration frequency is acquired. And when the sampling frequency of the gyroscope is adjusted, acquiring second angular velocity data of the gyroscope with the adjusted sampling frequency. And when the vibration frequency and the sampling frequency of the gyroscope are adjusted, acquiring second angular velocity data of the gyroscope after the vibration frequency and the sampling frequency are adjusted.
The camera may be shake-compensated based on the second angular velocity data, and shake compensation may be performed by an OIS (Optical image stabilization).
As shown in fig. 8, during shooting by the camera 802, a gyroscope (Gyro Sensor)804 detects a shake of the electronic device to generate first angular velocity data, an OIS Controller (OIS Controller)806 determines a compensation amount of the camera 802 by calculating the first angular velocity data, moves the camera 802 according to a compensation amount control Motor (Motor)808, and detects a moving distance of the camera 802 using a Hall Sensor (Hall Sensor)810 and provides the detected moving distance to the OIS Controller 806.
According to the gyroscope processing method, the adjusted second angular velocity data of the gyroscope is collected, the camera is subjected to shake compensation according to the second angular velocity data, and a more accurate and clearer image can be obtained.
It should be understood that, although the steps in the flowcharts of fig. 2, 6 to 7 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 6-7 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
Fig. 9 is a block diagram of a gyroscope processing apparatus according to an embodiment. As shown in fig. 9, there is provided a gyroscope processing apparatus 900 applied to an electronic device including a camera and a gyroscope, including: anti-shake instruction acquisition module 902, gyroscope turn-on module 904, data acquisition module 906 and vibration frequency adjustment module 908, wherein:
an anti-shake command obtaining module 902, configured to obtain a shooting anti-shake command.
And a gyroscope starting module 904, configured to start the gyroscope according to the shooting anti-shake instruction.
And the data acquisition module 906 is used for acquiring first angular velocity data of the gyroscope in the shooting process of the camera.
The vibration frequency adjusting module 908 is configured to adjust a vibration frequency of the gyroscope according to first angular velocity data, where a magnitude of the vibration frequency is inversely related to a magnitude of a shake of the electronic device that can be detected by the gyroscope, and the first angular velocity data is used to indicate the magnitude of the shake of the electronic device that is detected by the gyroscope.
According to the gyroscope processing device, the gyroscope is started according to the obtained shooting anti-shake instruction, first angular velocity data of the gyroscope are collected in the shooting process of the camera, and the vibration frequency of the gyroscope is adjusted according to the first angular velocity data. The size of the vibration frequency of the gyroscope is in negative correlation with the size of the shake of the electronic equipment which can be detected by the gyroscope, namely, when the shake of the electronic equipment is large, the gyroscope can detect the shake only by a small vibration frequency, and therefore first angular velocity data is obtained. Therefore, the vibration frequency of the gyroscope is adjusted according to the shake of the electronic equipment, namely the first angular velocity data, so that the power consumption of the gyroscope can be reduced.
Fig. 10 is a block diagram of a gyroscope processing apparatus according to an embodiment. As shown in fig. 10, there is provided a gyroscope processing apparatus 1000 applied to an electronic device including a camera and a gyroscope, including: an anti-shake command acquisition module 1002, a gyroscope start module 1004, a data acquisition module 1006, a target gyroscope determination module 1008, a vibration frequency adjustment module 1010, a sampling frequency adjustment module 1012, and a shake compensation module 1014, wherein:
an anti-shake command obtaining module 1002, configured to obtain a shooting anti-shake command.
And the gyroscope starting module 1004 is used for starting the gyroscope according to the shooting anti-shake instruction.
And the data acquisition module 1006 is used for acquiring first angular velocity data of the gyroscope in the shooting process of the camera.
And a target gyroscope determining module 1008, configured to determine a target gyroscope from the at least two gyroscopes according to the first angular velocity data of each gyroscope, when the electronic device includes the at least two gyroscopes and the vibration frequencies of the at least two gyroscopes are lower than a preset frequency threshold.
The vibration frequency adjusting module 1010 is configured to adjust a vibration frequency of the gyroscope according to first angular velocity data, where a magnitude of the vibration frequency is in a negative correlation with a magnitude of a shake of the electronic device that can be detected by the gyroscope, and the first angular velocity data is used to indicate the magnitude of the shake of the electronic device that is detected by the gyroscope.
And a sampling frequency adjusting module 1012 for adjusting the sampling frequency of the gyroscope according to the first angular velocity data.
The shake compensation module 1014 is used for acquiring second angular velocity data of the adjusted gyroscope; and carrying out shake compensation on the camera according to the second angular velocity data.
According to the gyroscope processing device, the gyroscope is started according to the obtained shooting anti-shake instruction, first angular velocity data of the gyroscope are collected in the shooting process of the camera, and the vibration frequency of the gyroscope is adjusted according to the first angular velocity data. The size of the vibration frequency of the gyroscope is in negative correlation with the size of the shake of the electronic equipment which can be detected by the gyroscope, namely, when the shake of the electronic equipment is large, the gyroscope can detect the shake only by a small vibration frequency, and therefore first angular velocity data is obtained. Therefore, the vibration frequency of the gyroscope is adjusted according to the shake of the electronic equipment, namely the first angular velocity data, so that the power consumption of the gyroscope can be reduced. When the electronic device includes at least two gyroscopes, a target gyroscope may be determined from the at least two gyroscopes to adjust a more accurate vibration frequency. The sampling frequency of the gyroscope can be adjusted according to the first angular velocity, and the power consumption of the gyroscope can be reduced when the sampling frequency of the gyroscope is reduced; when the sampling frequency of the gyroscope is improved, more angular velocity data can be obtained, so that the camera can be subjected to shake compensation more accurately, and the definition of the obtained image is improved.
In one embodiment, the vibration frequency adjustment module 1010 is further configured to decrease the vibration frequency of the gyroscope when the first angular velocity data is greater than or equal to the first angular velocity threshold; and when the first angular velocity data is smaller than a second angular velocity threshold value, increasing the vibration frequency of the gyroscope, wherein the first angular velocity threshold value is larger than or equal to the second angular velocity threshold value.
In one embodiment, the vibration frequency adjustment module 1010 is further configured to collect first angular velocity data of a preset number of gyroscopes during a camera shooting process. When the first angular velocity data is greater than the first angular velocity threshold, reducing a vibration frequency of the gyroscope, including: and when the preset number of first angular speed data are all larger than the first angular speed threshold value, reducing the vibration frequency of the gyroscope. When the first angular velocity data is less than the second angular velocity threshold, increasing the vibration frequency of the gyroscope, including: and when the preset number of first angular velocity data are all smaller than the second angular velocity threshold value, improving the vibration frequency of the gyroscope.
In one embodiment, the vibration frequency adjustment module 1010 is further configured to adjust the vibration frequency of the target gyroscope according to the first angular velocity data of the target gyroscope.
In one embodiment, the target gyroscope determination module 1008 is further configured to determine the second gyroscope as the target gyroscope when the first angular velocity data is greater than the third angular velocity threshold; and when the first angular velocity data is less than or equal to a fourth angular velocity threshold, taking the first gyroscope as a target gyroscope, wherein the third angular velocity threshold is greater than or equal to the fourth angular velocity threshold.
In one embodiment, the sampling frequency adjustment module 1012 is further configured to increase the sampling frequency of the gyroscope when the first angular velocity data is greater than or equal to the fifth angular velocity threshold; and when the first angular velocity data is smaller than a sixth angular velocity threshold, reducing the sampling frequency of the gyroscope, wherein the fifth angular velocity threshold is larger than or equal to the sixth angular velocity threshold.
The division of the modules in the gyroscope processing apparatus is merely for illustration, and in other embodiments, the gyroscope processing apparatus may be divided into different modules as needed to complete all or part of the functions of the gyroscope processing apparatus.
Fig. 11 is a schematic diagram of an internal structure of an electronic device in one embodiment. As shown in fig. 11, the electronic device includes a processor and a memory connected by a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by a processor to implement a gyroscope processing method provided in the following embodiments. The internal memory provides a cached execution environment for the operating system computer programs in the non-volatile storage medium. The electronic device may be a mobile phone, a tablet computer, or a personal digital assistant or a wearable device, etc.
The implementation of each module in the gyroscope processing apparatus provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program modules constituted by the computer program may be stored on the memory of the terminal or the server. Which when executed by a processor, performs the steps of the method described in the embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the gyroscope processing method.
A computer program product containing instructions which, when run on a computer, cause the computer to perform a gyroscope processing method.
Any reference to memory, storage, database, or other medium used by embodiments of the present application may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A gyroscope processing method is applied to an electronic device comprising a camera and a gyroscope, and is characterized by comprising the following steps:
acquiring a shooting anti-shake instruction;
starting the gyroscope according to the shooting anti-shake instruction;
collecting first angular velocity data of the gyroscope in the shooting process of the camera;
adjusting the vibration frequency of the gyroscope according to the first angular velocity data, wherein the vibration frequency refers to the number of times of vibration of the gyroscope per second, the magnitude of the vibration frequency is in negative correlation with the magnitude of the shake of the electronic device which can be detected by the gyroscope, and the first angular velocity data is used for representing the magnitude of the shake of the electronic device which is detected by the gyroscope.
2. The method of claim 1, wherein said adjusting a vibration frequency of said gyroscope according to said first angular velocity data comprises:
when the first angular velocity data is greater than or equal to a first angular velocity threshold, reducing a vibration frequency of the gyroscope;
and when the first angular velocity data is smaller than a second angular velocity threshold value, increasing the vibration frequency of the gyroscope, wherein the first angular velocity threshold value is larger than or equal to the second angular velocity threshold value.
3. The method of claim 2, wherein collecting the first angular velocity data of the gyroscope during the camera shot comprises:
collecting a preset number of first angular velocity data of the gyroscopes in the shooting process of the cameras;
when the first angular velocity data is greater than a first angular velocity threshold, decreasing the vibration frequency of the gyroscope includes:
when the preset number of the first angular velocity data are all larger than a first angular velocity threshold value, reducing the vibration frequency of the gyroscope;
when the first angular velocity data is smaller than a second angular velocity threshold, increasing the vibration frequency of the gyroscope includes:
and when the preset number of the first angular velocity data is smaller than a second angular velocity threshold value, improving the vibration frequency of the gyroscope.
4. The method of claim 1, further comprising:
when the electronic equipment comprises at least two gyroscopes, and the vibration frequencies of the at least two gyroscopes are lower than a preset frequency threshold, determining a target gyroscope from the at least two gyroscopes according to first angular speed data of each gyroscope;
the adjusting the vibration frequency of the gyroscope according to the first angular velocity data includes:
and adjusting the vibration frequency of the target gyroscope according to the first angular speed data of the target gyroscope.
5. The method of claim 4, wherein the electronic device comprises at least one first gyroscope and at least one second gyroscope, wherein the first gyroscope is configured to detect capacitance values below a first capacitance threshold, wherein the second gyroscope is configured to detect capacitance values above a second capacitance threshold, and wherein the first capacitance threshold is less than or equal to the second capacitance threshold;
the determining a target gyroscope from at least two gyroscopes based on the first angular velocity data includes:
when the first angular velocity data is larger than a third angular velocity threshold value, taking the second gyroscope as a target gyroscope;
and when the first angular velocity data is smaller than or equal to a fourth angular velocity threshold, taking the first gyroscope as a target gyroscope, wherein the third angular velocity threshold is larger than or equal to the fourth angular velocity threshold.
6. The method of claim 1, further comprising:
and adjusting the sampling frequency of the gyroscope according to the first angular velocity data.
7. The method of claim 6, wherein said adjusting a sampling frequency of said gyroscope according to said first angular velocity data comprises:
when the first angular velocity data is greater than or equal to a fifth angular velocity threshold, increasing the sampling frequency of the gyroscope;
and when the first angular velocity data is smaller than a sixth angular velocity threshold, reducing the sampling frequency of the gyroscope, wherein the fifth angular velocity threshold is larger than or equal to the sixth angular velocity threshold.
8. The method according to any one of claims 1 to 7, further comprising:
acquiring second angular velocity data of the adjusted gyroscope;
and carrying out shake compensation on the camera according to the second angular velocity data.
9. A gyroscope processing apparatus applied to an electronic device including a camera and a gyroscope, the gyroscope processing apparatus comprising:
the anti-shake instruction acquisition module is used for acquiring a shooting anti-shake instruction;
the gyroscope starting module is used for starting the gyroscope according to the shooting anti-shake instruction;
the data acquisition module is used for acquiring first angular velocity data of the gyroscope in the shooting process of the camera;
the vibration frequency adjusting module is used for adjusting the vibration frequency of the gyroscope according to the first angular velocity data, wherein the vibration frequency refers to the number of times of vibration of the gyroscope per second, the magnitude of the vibration frequency is in negative correlation with the magnitude of the shake of the electronic equipment which can be detected by the gyroscope, and the first angular velocity data is used for representing the magnitude of the shake of the electronic equipment which is detected by the gyroscope.
10. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the gyroscope processing method of any of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
CN201910577788.5A 2019-06-28 2019-06-28 Gyroscope processing method and device, electronic equipment and computer readable storage medium Active CN110300263B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910577788.5A CN110300263B (en) 2019-06-28 2019-06-28 Gyroscope processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910577788.5A CN110300263B (en) 2019-06-28 2019-06-28 Gyroscope processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110300263A CN110300263A (en) 2019-10-01
CN110300263B true CN110300263B (en) 2021-06-08

Family

ID=68029311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910577788.5A Active CN110300263B (en) 2019-06-28 2019-06-28 Gyroscope processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110300263B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111432118B (en) * 2020-03-26 2021-08-17 Oppo广东移动通信有限公司 Image anti-shake processing method and device, electronic equipment and storage medium
CN112135051A (en) * 2020-09-24 2020-12-25 维沃移动通信有限公司 Anti-shake control method and device
CN112822399B (en) * 2021-01-06 2022-10-04 维沃移动通信有限公司 Optical anti-shake method, electronic device, and readable storage medium
CN113218419B (en) * 2021-04-25 2024-04-12 维沃移动通信(深圳)有限公司 Method and device for detecting abnormality of gyroscope, electronic equipment and storage medium
CN114125266B (en) * 2021-10-20 2024-04-09 武汉旷视金智科技有限公司 Rotation detection method, rotation detection device, rotation detection apparatus, rotation detection device, rotation detection medium, and rotation detection program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1210255A (en) * 1997-09-04 1999-03-10 株式会社村田制作所 Vibrating gyroscope and adjusting method therefor
KR101004120B1 (en) * 2009-11-13 2010-12-27 주식회사 뉴티씨 (Newtc) Electronic device with power saving mode
CN103869928A (en) * 2012-10-22 2014-06-18 马克西姆综合产品公司 System for reducing power consumption in multisensor environment, and method
CN106681476A (en) * 2016-12-19 2017-05-17 浙江大学 Low-power-consumption gesture interaction system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1210255A (en) * 1997-09-04 1999-03-10 株式会社村田制作所 Vibrating gyroscope and adjusting method therefor
KR101004120B1 (en) * 2009-11-13 2010-12-27 주식회사 뉴티씨 (Newtc) Electronic device with power saving mode
CN103869928A (en) * 2012-10-22 2014-06-18 马克西姆综合产品公司 System for reducing power consumption in multisensor environment, and method
CN106681476A (en) * 2016-12-19 2017-05-17 浙江大学 Low-power-consumption gesture interaction system

Also Published As

Publication number Publication date
CN110300263A (en) 2019-10-01

Similar Documents

Publication Publication Date Title
CN110300263B (en) Gyroscope processing method and device, electronic equipment and computer readable storage medium
CN109842753B (en) Camera anti-shake system, camera anti-shake method, electronic device and storage medium
CN110012224B (en) Camera anti-shake system, camera anti-shake method, electronic device, and computer-readable storage medium
CN108737734B (en) Image compensation method and apparatus, computer-readable storage medium, and electronic device
CN110035228B (en) Camera anti-shake system, camera anti-shake method, electronic device, and computer-readable storage medium
CN108769528B (en) Image compensation method and apparatus, computer-readable storage medium, and electronic device
CN109194876B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110536057B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109951638B (en) Camera anti-shake system, camera anti-shake method, electronic device, and computer-readable storage medium
CN110636223B (en) Anti-shake processing method and apparatus, electronic device, and computer-readable storage medium
CN111432118B (en) Image anti-shake processing method and device, electronic equipment and storage medium
WO2020192479A1 (en) Camera stabilization system and method, and electronic device
CN109922264B (en) Camera anti-shake system and method, electronic device, and computer-readable storage medium
CN110049237B (en) Camera anti-shake method and device, electronic equipment and computer storage medium
US20220180484A1 (en) Image processing method, electronic device, and computer-readable storage medium
CN110177213B (en) Gyroscope parameter adjusting method and device, terminal and computer readable storage medium
CN112087580A (en) Image acquisition method and device, electronic equipment and computer readable storage medium
CN111246100B (en) Anti-shake parameter calibration method and device and electronic equipment
CN109963080B (en) Image acquisition method and device, electronic equipment and computer storage medium
CN107615744A (en) A kind of image taking determination method for parameter and camera device
CN107465880B (en) Focusing method, device, terminal and computer readable storage medium
CN110266950B (en) Gyroscope processing method and device, electronic equipment and computer readable storage medium
EP3267675B1 (en) Terminal device and photographing method
CN110519513B (en) Anti-shake method and apparatus, electronic device, computer-readable storage medium
CN110233969B (en) Image processing method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant