CN111246088A - Anti-shake method, electronic device, and computer-readable storage medium - Google Patents

Anti-shake method, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
CN111246088A
CN111246088A CN202010031665.4A CN202010031665A CN111246088A CN 111246088 A CN111246088 A CN 111246088A CN 202010031665 A CN202010031665 A CN 202010031665A CN 111246088 A CN111246088 A CN 111246088A
Authority
CN
China
Prior art keywords
processor
data
gyroscope
image
image frame
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.)
Pending
Application number
CN202010031665.4A
Other languages
Chinese (zh)
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 CN202010031665.4A priority Critical patent/CN111246088A/en
Publication of CN111246088A publication Critical patent/CN111246088A/en
Pending legal-status Critical Current

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/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
    • 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/682Vibration or motion blur correction
    • H04N23/683Vibration or motion blur correction performed by a processor, e.g. controlling the readout of an image memory

Abstract

Provided are an anti-shake method, an electronic device, and a computer-readable storage medium. The anti-shake method comprises the following steps: the method comprises the steps that a first processor receives gyroscope data transmitted by a gyroscope, wherein the gyroscope data are collected when the gyroscope receives a frame synchronization signal sent by an image sensor through a hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires first image frame data; the first processor receives second image frame data, wherein the second image frame data is first image frame data or image frame data obtained by processing the first image frame data; and the first processor performs anti-shake processing according to the gyroscope data and the second image frame data. By adopting the method, the accuracy of anti-shaking can be improved.

Description

Anti-shake method, electronic device, and computer-readable storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an anti-shake method, an electronic device, and a computer-readable storage medium.
Background
Conventional anti-shake methods include OIS (Optical Image Stabilization) and EIS (electrical Image Stabilization). Electronic anti-shake, among other things, needs to rely on synchronization of image frame information and gyroscope data. In the conventional anti-shake method, the synchronization between the image frame information and the gyroscope data is inaccurate, so that the anti-shake effect is poor.
Disclosure of Invention
The embodiment of the application provides an anti-shake method, an electronic device and a computer-readable storage medium, which can improve anti-shake accuracy.
An anti-shake method is applied to electronic equipment, wherein the electronic equipment comprises an image sensor, a gyroscope and a first processor, the image sensor is connected with the gyroscope through a hardware interrupt wire, the image sensor is connected with the first processor, and the gyroscope is connected with the first processor; the method comprises the following steps:
the first processor receives gyroscope data transmitted by the gyroscope, wherein the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by the image sensor through the hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires first image frame data;
the first processor receives second image frame data, wherein the second image frame data is the first image frame data or image frame data obtained after the first image frame data is processed;
and the first processor performs anti-shake processing according to the gyroscope data and the second image frame data.
An electronic device comprises an image sensor, a gyroscope and a first processor, wherein the image sensor is connected with the gyroscope through a hardware interrupt wire, the image sensor is connected with the first processor, and the gyroscope is connected with the first processor;
the image sensor is used for generating a frame synchronization signal when first image frame data is acquired, and sending the frame synchronization signal to the gyroscope through the hardware interrupt line;
the gyroscope is used for acquiring gyroscope data when the frame synchronization signal is received;
the first processor is configured to receive second image frame data, where the second image frame data is the first image frame data or image frame data obtained by processing the first image frame data;
and the first processor is used for performing electronic anti-shake according to the gyroscope data and the second image frame data.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
the first processor receives gyroscope data transmitted by the gyroscope, wherein the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by the image sensor through the hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires first image frame data;
the first processor receives second image frame data, wherein the second image frame data is the first image frame data or image frame data obtained after the first image frame data is processed;
and the first processor performs anti-shake processing according to the gyroscope data and the second image frame data.
According to the anti-shake method, the electronic device and the computer-readable storage medium, the first processor receives gyroscope data transmitted by the gyroscope, wherein the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by the image sensor through a hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires image frame data, namely when the image sensor acquires the image frame data, the frame synchronization signal is generated and sent to the gyroscope, so that the gyroscope acquires the gyroscope data, the time difference between the image frame data and the gyroscope data is small, and the synchronization of the image frame data and the gyroscope data can be ensured; the first processor receives the image frame data, and the first processor carries out anti-shake processing according to gyroscope data and the image frame data, so that the first processor can obtain the gyroscope data and the image frame data which are small in time difference and stable, the anti-shake accuracy is improved, and imaging is clearer.
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 anti-shaking method;
FIG. 2 is a flow chart of an anti-shaking method in one embodiment;
FIG. 3 is a diagram illustrating a mapping between image frame data and gyroscope data in one embodiment;
FIG. 4 is a flowchart illustrating an anti-shaking method according to another embodiment;
FIG. 5 is a diagram illustrating a method for synchronizing image frame data and gyroscope data according to one embodiment;
FIG. 6 is a diagram of an application environment of the anti-shake method in another embodiment;
fig. 7 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.
Fig. 1 is a schematic application environment diagram of the anti-shake method in one embodiment. The anti-shake method is applied to the electronic equipment. The electronic device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a Point of Sales (POS), a vehicle-mounted computer, a wearable device, and the like. As shown in fig. 1, the application environment includes an image sensor 110, a gyroscope 120, and a first processor 130. The gyroscope 120 may be included in an IMU (Inertial measurement unit). The first processor 130 may be a Central Processing Unit (CPU) or the like. The image sensor 110 is connected to the gyroscope 120 through a first hardware interrupt line. Specifically, the frame synchronization signal transmitted by the image sensor 110 is transmitted into a hardware interrupt port of the gyroscope through a first hardware interrupt line. The image sensor 110 may be connected to the first processor 130 through any line capable of transmitting a frame synchronization signal. For example, the image sensor 110 may be connected to the first processor 130 through a second hardware interrupt line. The gyroscope 120 may be connected to the first processor via a line capable of transmitting an electrical signal.
FIG. 2 is a flowchart of an anti-shaking method according to an embodiment. The anti-shake method in the present embodiment is described by taking the first processor 130 in fig. 1 as an example. As shown in fig. 2, the anti-shake method includes steps 202 to 206.
In step 202, the first processor receives gyroscope data transmitted by a gyroscope, wherein the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by an image sensor through a hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires first image frame data.
Wherein the gyroscope is used for angular motion detection. The gyroscope data may be angular velocity data, angular acceleration data, or the like. A hardware interrupt line refers to a wire that can implement a hardware interrupt. A hardware interrupt refers to an interrupt caused by an interrupt request signal of a certain hardware. The Frame synchronization signal may refer to a Vertical synchronization pulse signal (Vsync), a Frame synchronization pulse signal (Fsync), or the like. The vertical synchronization pulse signal may be used to indicate the end of previous image frame data and the start of new image frame data. That is, the image sensor generates a frame synchronization signal every time it acquires image frame data. The first image frame data refers to image frame data directly acquired by the image sensor.
Specifically, when the image sensor acquires image frame data, one frame synchronization signal is generated. The image sensor sends the frame synchronization signal to the gyroscope through a hardware interrupt line. And acquiring gyroscope data when the gyroscope receives a frame synchronization signal sent by the image sensor through a hardware interrupt wire.
In step 204, the first processor receives second image frame data, where the second image frame data is the first image frame data or the image frame data after the first image frame data is processed.
The second image frame data refers to image frame data processed by the image signal processor according to the first image frame data.
Specifically, the first processor receives second image frame data from the image sensor, wherein the second image frame data is the first image frame data. Or the first processor receives second image frame data from the image signal processor, wherein the second image frame data is obtained after the image signal processor processes the first image frame data.
And step 206, the first processor performs anti-shake processing according to the gyroscope data and the second image frame data.
The anti-shake process may specifically be an electronic anti-shake process. The electronic anti-shake processing is anti-shake processing for performing compensation using an edge image.
Specifically, the EIS (electronic Image Stabilization) needs to rely on time synchronization between the posture information of the mobile phone camera and the Image frame information, and needs to correspond to the posture of the mobile phone camera when the camera is shot corresponding to each frame of Image picture. The attitude of the mobile phone camera can be obtained through gyroscope data generated by a gyroscope. Therefore, the first processor performs electronic anti-shake processing based on the gyro data and the image frame data.
In this embodiment, the first processor may perform image anti-shake processing or video anti-shake processing according to the second image frame data of the gyroscope data.
In the anti-shake method in this embodiment, a first processor receives gyroscope data transmitted by a gyroscope, where the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by an image sensor through a hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires image frame data, that is, when the image sensor acquires the image frame data, a frame synchronization signal is generated and sent to the gyroscope, and then, compared to a mode in which timestamps are marked for the image frame data and the gyroscope data through software, a time difference between the image frame data and the gyroscope data in this embodiment is a time difference of the frame synchronization signal in a hardware interrupt line transmission process, and a time difference is small when the image frame data and the gyroscope data are transmitted through the hardware interrupt line, and is stable, so that synchronization of the image frame information and the gyroscope data can be ensured; the first processor receives the image frame data, and the first processor carries out anti-shake processing according to gyroscope data and the image frame data, so that the first processor can obtain the gyroscope data and the image frame data which are small in time difference and stable, the anti-shake accuracy is improved, and imaging is clearer.
In one embodiment, as shown in fig. 3, a diagram of a mapping relationship between image frame data and gyroscope data in one embodiment is shown. Ft, Gt represent the t-th frame image and the corresponding gyroscope data, Lm +1. Since a CMOS (Complementary Metal-Oxide-Semiconductor) sensor is photosensitive-imaged by lines, the imaging time is different for each line of the same frame image. The imaging time of one frame of image is about several to several tens of milliseconds, which corresponds to much gyro data because the sampling rate of gyro data is typically several hundred hertz. And then, the image sensor is connected with the gyroscope through a hardware interrupt wire, so that only one piece of gyroscope data can be determined, and electronic anti-shaking is carried out according to the image frame data and the corresponding gyroscope data.
In one embodiment, as shown in fig. 4, a schematic flow chart of an anti-shake method in another embodiment includes:
step 402, when the first processor receives a frame synchronization signal, the frame synchronization signal is sent to the gyroscope and the first processor by the image sensor, respectively, and then generates a data identifier.
The data identifier may be used to identify a mapping relationship between the gyroscope data and the first image frame data, and may also be used to identify a generation time of the gyroscope data and the first image frame data. The data identifier may be composed of at least one of a number, a letter, a symbol, and a word. For example, the data identifier may be a time stamp, and specifically, the time stamp when the frame synchronization signal is received by the first processor is not limited thereto.
In particular, the image sensor may be connected to the first processor through a second hardware interrupt line. The transmission rate of the frame synchronization signal can be increased by interrupting the line through the second hardware. When the image sensor acquires first image frame data, the image sensor simultaneously sends frame synchronization signals to the gyroscope and the first processor respectively. When the first processor receives the frame synchronization signal through the second hardware interrupt line, the data identification is generated. Then, the data identification and the gyroscope data, the first image frame data, may be considered to be simultaneously generated data.
In this embodiment, after the first processor receives the frame synchronization signal, before the image processor acquires image frame data of a next frame, the first processor generates a data identifier. That is, one frame of image frame data corresponds to only one data identifier.
At step 404, the first processor associates the second image frame data with the data identifier and associates the gyroscope data with the data identifier.
In particular, the first processor may establish a mapping relationship between the data identification and the second image frame data and the gyroscope data. The first processor corresponds the second image frame data to the data identifier and corresponds the gyroscope data to the data identifier.
In this embodiment, since the second image frame data is the first image frame data or the image frame data after processing the first image frame data, the first processor may also correspond the first image frame data to the data identifier.
In this embodiment, the first processor corresponds the second image frame data to the data identifier, and corresponds the gyroscope data to the data identifier, including: the data identification comprises a target timestamp; the first processor acquires a first time stamp corresponding to the first image frame and a second time stamp corresponding to the gyroscope data; when the difference value between the first time stamp and the target time stamp is within a preset time difference value range, corresponding the second image frame data to the target time stamp; and when the difference value between the second time stamp and the target time stamp is within a preset time difference value range, corresponding the gyroscope data to the target time stamp. The preset time range may be a duration of data transmission through the hardware interrupt line. For example, a second is required for interrupt line transmission through hardware, and the preset time range may be 0 to a seconds, etc., but is not limited thereto.
And 406, the first processor performs anti-shake processing according to the gyroscope data corresponding to the data identifier and the second image frame data.
Specifically, the gyroscope data and the second image frame data corresponding to the same data identifier may be regarded as the gyroscope data and the second image frame data generated at the same time. And the first processor performs electronic anti-shake processing according to the gyroscope data corresponding to the data identifier and the second image frame data.
In the anti-shake method in this embodiment, when the first processor receives a frame synchronization signal, a data identifier is generated, where the frame synchronization signal is sent to the gyroscope and the first processor by the image sensor, the second image frame data corresponds to the data identifier, the gyroscope data corresponds to the data identifier, the first processor performs anti-shake processing according to the gyroscope data corresponding to the data identifier and the second image frame data, and then the gyroscope data and the second image frame data corresponding to the same data identifier are regarded as data generated at the same time, so that the first processor can obtain the gyroscope data and the image frame data with small time difference and stability, thereby improving an anti-shake effect and making imaging more clear.
In one embodiment, generating the data identification when the first processor receives the frame synchronization signal includes: updating the value of the counter when the first processor receives the frame synchronization signal; the first processor identifies the value of the counter as data.
Wherein, the Counter (Counter) may refer to an interrupt handling software. Counter software may be used to capture interrupt signals, count, record timestamps, and the like. The counter may also be a piece of hardware that updates the value of the counter when the frame synchronization signal is received. The value of the counter may be a time stamp, a pulse number, or a meaningless value, and is not limited to 1, 2, 3 …, for example.
Specifically, when the first processor receives the frame synchronization signal, the value of the counter is updated. For example, if the original counter has a value of 1, the frame synchronization signal is incremented by 1 each time, the counter has a value of 2, and the value of each counter may correspond to a time stamp. The first processor identifies the value of the counter as data.
In the anti-shake method in this embodiment, when the first processor receives the frame synchronization signal, the value of the counter is updated, and the first processor uses the value of the counter as the data identifier, so that the gyroscope data and the first image frame data can be made to correspond to each other and used for anti-shake processing.
In one embodiment, the first electronic device further comprises an image signal processor, the image signal processor being connected to the image sensor and the first processor, respectively.
The first processor receives second image frame data, wherein the second image frame data is image frame data obtained by processing the first image frame data, and the second processor comprises:
the first processor receives second image frame data transmitted by the image signal processor, and the second image frame data is obtained by processing the first image frame data by the image signal processor.
Specifically, the image signal processor receives first image frame data from the image sensor. The image signal processor may perform at least one of filtering, auto exposure, auto white balance, auto focus, flicker detection, black level compensation, and lens shading correction on the first image frame data to obtain second image frame data. The image signal processor transmits the second image frame data to the first processor.
In this embodiment, since the image sensor generates the frame synchronization signal once every time the image sensor acquires image frame data, the first processor does not generate other data identifiers after the current image frame data is acquired and before the next frame of first image frame data is acquired. The first image frame data has been recorded with a data identification by a frame synchronization signal before entering the first processor. Then, the time when the image signal processor finishes processing the first image frame signal may be before the time when the next frame of the first image frame data is acquired, and the first processor may implement the one-to-one correspondence between the data identifier and the gyroscope data and the second image frame data. Similarly, the time when the first processor acquires the gyroscope data may be before the time when the first image frame data of the next frame is acquired.
In the anti-shake method in this embodiment, the first processor receives second image frame data transmitted by the image signal processor, the second image frame data is obtained by processing the first image frame data by the image signal processor, and an image effect after the processing by the image signal processor is better, so that an anti-shake effect is improved, and imaging is clearer and more personalized.
In one embodiment, the electronic device further comprises a second processor, the second processor being connected to the gyroscope and the first processor, respectively. The first processor receives gyroscope data, comprising: the first processor receives the gyroscope data from the second processor, and the second processor is used for driving the gyroscope to acquire the gyroscope data.
Specifically, the second processor is connected with the gyroscope, and the second processor is connected with the first processor. The driver of the gyroscope may be installed in the second processor. The second processor may be considered as a carrier of the gyroscope, responsible for the driving and processing strongly related to the hardware. For example, the second processor may be used to drive a gyroscope to acquire data, filter data, and the like, without limitation. The second processor may communicate with the first processor to transmit the gyroscope data. The driving of the image sensor may be installed in the first processor. The first processor includes a shared memory. The first processor and the second processor can read data from the shared memory. The gyroscope data received by the first processor from the second processor may be stored in a shared memory.
In the anti-shake method in this embodiment, the first processor receives the gyroscope data from the second processor, the second processor is configured to drive the gyroscope to obtain the gyroscope data, the gyroscope data can be quickly obtained from the gyroscope by using the second processor, and resource occupation of the first processor is reduced.
In one embodiment, as shown in fig. 5, a schematic diagram of a synchronization method of image frame data and gyroscope data in one embodiment is shown. There are timestamps of the same source clock in the image frames and in the gyroscope data. Each frame of image is time stamped while the camera is in operation, thus generating a series of time stamps t1, t 2. Meanwhile, in each clock cycle of the gyroscope, gyroscope data is generated and is stamped, and a series of gyroscope data t1, t2,. t.tN is generated during the period of shooting the video. Since the time stamp function is implemented by software, this synchronization manner is also software synchronization in nature. There may be a time interval between the image frame time and the gyroscope data time. And the time intervals are not necessarily the same. The time interval between the first frame image and the gyro data 1 as in fig. 5 is Δ t 1; the time interval between the second frame image and the gyroscope 2 is Δ t2, and the like. The video anti-shake algorithm is synchronized and calibrated again when using the image frame time and the gyroscope data time, for example, by calibration and the like. However, since the timestamp synchronization method is essentially a software synchronization, there is a time interval between the image frame time and the corresponding gyroscope data time, and the time interval may cause the anti-shake effect of the video to be reduced. One remedy is to fit the best interval parameters by calibration, but this approach still does not eliminate the impact of hardware-specific variability, and the calibration algorithm also causes performance degradation. Therefore, the anti-shake method in the embodiment of the present application is proposed.
Fig. 6 is a diagram of an application environment of the anti-shake method in another embodiment. The application environment includes an image sensor 110, a gyroscope 120, a first processor 130, an image signal processor 140, and a second processor 150. Wherein the image signal processor 140 is respectively connected to the image sensor 110 and the first processor 130. It is sufficient that the image signal processor 140 and the image sensor 110 and the first processor 130 can transmit electrical signals. The second processor 150 is not the same processor as the first processor 130. The second processor 150 may be a single chip or a CPU. The second processor 150 is connected to the gyroscope 120. The second processor 150 is connected to the first processor 130. The connection lines in fig. 6 may all be hardware interrupt lines. When the image sensor 110 receives the first image frame data, a frame synchronization signal is generated. The image sensor 110 transmits the frame synchronization signal to the gyroscope through the first hardware interrupt line, and transmits the frame synchronization signal to the first processor 130 through the second hardware interrupt line. The first processor 130 updates the value of the counter when receiving the frame synchronization signal. The image sensor 110 transmits the first image frame data to the image signal processor 140. The image signal processor 140 performs image processing on the first image frame data to obtain second image frame data. The image signal processor 140 transmits the second image frame data to the first processor 130. When receiving the frame synchronization signal, the second processor 150 drives the gyroscope 120 to acquire gyroscope data, and transmits the gyroscope data to the first processor 130. The first processor 130 corresponds the second image frame data, and the gyro data to the value of the counter. The first processor 130 performs an electronic anti-shake process according to the gyro data corresponding to the value of the counter and the second image frame data.
In one embodiment, the anti-shake method is applied to an electronic device, the electronic device comprises an image sensor, a gyroscope and a first processor, the image sensor is connected with the gyroscope through a hardware interrupt wire, the image sensor is connected with the first processor, the gyroscope is connected with the first processor, and the first electronic device further comprises an image signal processor. The image signal processor is respectively connected with the image sensor and the first processor, and comprises:
and a1, the first processor receives gyroscope data from the second processor, and the second processor is used for driving the gyroscope to acquire the gyroscope data, wherein the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by the image sensor through a hardware interrupt wire, and the frame synchronization signal is generated when the image sensor acquires first image frame data and is respectively sent to the gyroscope and the first processor by the image sensor.
Step a2, when the first processor receives the frame synchronization signal, the value of the counter is updated.
In step a3, the first processor identifies the value of the counter as data.
In step a4, the first processor receives second image frame data, where the second image frame data is the first image frame data or image frame data obtained by processing the first image frame data by the image signal processor.
In step a5, the first processor associates the second image frame data with the data identifier and associates the gyroscope data with the data identifier.
And a6, the first processor performs anti-shake processing according to the gyroscope data corresponding to the data identifier and the second image frame data.
In the anti-shake method in this embodiment, a first processor receives gyroscope data transmitted by a gyroscope, where the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by an image sensor through a hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires image frame data, that is, when the image sensor acquires the image frame data, a frame synchronization signal is generated and sent to the gyroscope, and then, compared to a mode in which timestamps are marked for the image frame data and the gyroscope data through software, a time difference between the image frame data and the gyroscope data in this embodiment is a time difference of the frame synchronization signal in a hardware interrupt line transmission process, and a time difference is small when the image frame data and the gyroscope data are transmitted through the hardware interrupt line, and is stable, so that synchronization of the image frame information and the gyroscope data can be ensured; the first processor receives the image frame data, and the first processor carries out anti-shake processing according to gyroscope data and the image frame data, so that the first processor can obtain the gyroscope data and the image frame data which are small in time difference and stable, the anti-shake accuracy is improved, and imaging is clearer.
It should be understood that although the various steps in the flowcharts of fig. 2 and 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order 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 and 4 may include multiple sub-steps or multiple stages that 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 in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 1, an electronic device includes an image sensor 110, a gyroscope 120, and a first processor 130, the image sensor 110 is connected to the gyroscope 120 through a hardware interrupt line, the image sensor 110 is connected to the first processor 130, and the gyroscope 120 is connected to the first processor 130;
the image sensor 110 is configured to generate a frame synchronization signal when acquiring first image frame data, and send the frame synchronization signal to the gyroscope 120 through a hardware interrupt line;
the gyroscope 120 is configured to collect gyroscope data when receiving the frame synchronization signal;
the first processor 130 is configured to receive second image frame data, where the second image frame data is the first image frame data or image frame data obtained by processing the first image frame data;
the first processor 130 is configured to perform electronic anti-shake based on the gyroscope data and the second image frame data.
In the electronic device in this embodiment, the first processor receives gyroscope data transmitted by a gyroscope, where the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by an image sensor through a hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires image frame data, that is, when the image sensor acquires the image frame data, a frame synchronization signal is generated and sent to the gyroscope, and then, compared to a mode in which timestamps are marked for the image frame data and the gyroscope data through software, a time difference between the image frame data and the gyroscope data in this embodiment is a time difference of the frame synchronization signal in a hardware interrupt line transmission process, and a time difference is small when the frame synchronization signal is transmitted through the hardware interrupt line, and the time difference is stable, so that synchronization between the image frame information and the gyroscope data can be ensured; the first processor receives the image frame data, and the first processor carries out anti-shake processing according to gyroscope data and the image frame data, so that the first processor can obtain the gyroscope data and the image frame data which are small in time difference and stable, the anti-shake accuracy is improved, and imaging is clearer.
In one embodiment, the image sensor 110 is configured to send frame synchronization signals to the gyroscope 120 and the first processor 130, respectively. The first processor 130 is configured to generate a data identifier when receiving the frame synchronization signal; the first processor 130 is configured to correspond the second image frame data to the data identifier, and to correspond the gyroscope data to the data identifier; the first processor 130 is configured to perform anti-shake according to the gyroscope data and the second image frame data corresponding to the data identifier.
In the electronic device in this embodiment, when the first processor receives a frame synchronization signal, a data identifier is generated, where the frame synchronization signal is sent to the gyroscope and the first processor by the image sensor, the second image frame data corresponds to the data identifier, the gyroscope data corresponds to the data identifier, the first processor performs anti-shake processing according to the gyroscope data corresponding to the data identifier and the second image frame data, and then treats the gyroscope data corresponding to the same data identifier and the second image frame data as data generated at the same time, so that the first processor can obtain the gyroscope data and the image frame data with small time difference and stability, thereby improving anti-shake effect and making imaging clearer.
In one embodiment, the first processor 130 is configured to update the value of the counter when receiving the frame synchronization signal; the first processor 130 is configured to identify the value of the counter as data.
In the electronic device in this embodiment, when the first processor receives the frame synchronization signal, the value of the counter is updated, and the first processor uses the value of the counter as a data identifier, so that the gyroscope data and the first image frame data can be corresponded and used for anti-shake processing.
In one embodiment, the electronic device further comprises an image signal processor 140, the image signal processor 140 being connected to the image sensor 110 and the first processor 130, respectively; the image signal processor 140 is configured to receive first image frame data; the image signal processor 140 is configured to perform image processing on the first image frame data to obtain second image frame data.
In the electronic device in this embodiment, the first processor receives second image frame data transmitted by the image signal processor, the second image frame data is obtained by processing the first image frame data by the image signal processor, and an image effect after the processing by the image signal processor is better, so that an anti-shake effect is improved, and imaging is clearer and more personalized.
In one embodiment, the electronic device further comprises a second processor 150, the second processor 150 being connected to the gyroscope 120 and the first processor 130, respectively. The first processor 130 is configured to receive the gyroscope data from the second processor 150, and the second processor 150 is configured to drive the gyroscope 120 to obtain the gyroscope data.
In the electronic device in this embodiment, the first processor receives the gyroscope data from the second processor, the second processor is configured to drive the gyroscope to obtain the gyroscope data, the gyroscope data can be quickly obtained from the gyroscope by using the second processor, and resource occupation of the first processor is reduced.
Fig. 7 is a schematic diagram of an internal structure of an electronic device in one embodiment. As shown in fig. 7, 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 for implementing an anti-shake 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 device in the electronic apparatus provided in the embodiments 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 anti-shake method.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform an anti-shake method.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. 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 (10)

1. An anti-shake method is characterized in that the anti-shake method is applied to electronic equipment, the electronic equipment comprises an image sensor, a gyroscope and a first processor, the image sensor is connected with the gyroscope through a hardware interrupt wire, the image sensor is connected with the first processor, and the gyroscope is connected with the first processor; the method comprises the following steps:
the first processor receives gyroscope data transmitted by the gyroscope, wherein the gyroscope data is acquired when the gyroscope receives a frame synchronization signal sent by the image sensor through the hardware interrupt line, and the frame synchronization signal is generated when the image sensor acquires first image frame data;
the first processor receives second image frame data, wherein the second image frame data is the first image frame data or image frame data obtained after the first image frame data is processed;
and the first processor performs anti-shake processing according to the gyroscope data and the second image frame data.
2. The method of claim 1, further comprising:
when the first processor receives the frame synchronization signal, generating a data identifier, wherein the frame synchronization signal is sent to the gyroscope and the first processor by the image sensor respectively;
the first processor corresponds the second image frame data to the data identifier and corresponds the gyroscope data to the data identifier;
the first processor performs anti-shake processing according to the gyroscope data and the second image frame data, and includes:
and the first processor performs anti-shake processing according to the gyroscope data corresponding to the data identifier and the second image frame data.
3. The method of claim 2, wherein generating a data identification when the frame synchronization signal is received by the first processor comprises:
updating a value of a counter when the first processor receives the frame synchronization signal;
the first processor identifies a value of the counter as the data.
4. The method of any of claims 1-3, wherein the first electronic device further comprises an image signal processor; the image signal processor is respectively connected with the image sensor and the first processor;
the first processor receives second image frame data, wherein the second image frame data is image frame data obtained by processing the first image frame data, and the second image frame data comprises:
and the first processor receives second image frame data transmitted by the image signal processor, wherein the second image frame data is obtained by processing the first image frame data by the image signal processor.
5. The method of any one of claims 1 to 3, wherein the electronic device further comprises a second processor, the second processor being connected to the gyroscope and the first processor, respectively;
the first processor receives gyroscope data, comprising:
the first processor receives gyroscope data from the second processor, and the second processor is used for driving the gyroscope to acquire the gyroscope data.
6. An electronic device is characterized in that the electronic device comprises an image sensor, a gyroscope and a first processor, wherein the image sensor is connected with the gyroscope through a hardware interrupt wire, the image sensor is connected with the first processor, and the gyroscope is connected with the first processor;
the image sensor is used for generating a frame synchronization signal when first image frame data is acquired, and sending the frame synchronization signal to the gyroscope through the hardware interrupt line;
the gyroscope is used for acquiring gyroscope data when the frame synchronization signal is received;
the first processor is configured to receive second image frame data, where the second image frame data is the first image frame data or image frame data obtained by processing the first image frame data;
and the first processor is used for performing electronic anti-shake according to the gyroscope data and the second image frame data.
7. The electronic device of claim 6, wherein the image sensor is configured to send the frame synchronization signals to the gyroscope and the first processor, respectively;
the first processor is used for generating a data identifier when receiving the frame synchronization signal;
the first processor is used for corresponding the second image frame data with the data identification and corresponding the gyroscope data with the data identification;
and the first processor is used for carrying out anti-shake according to the gyroscope data and the second image frame data corresponding to the data identification.
8. The electronic device of claim 7, wherein the first processor is configured to update a value of a counter when the frame synchronization signal is received;
the first processor is configured to identify a value of the counter as the data.
9. The electronic device of claim 6, further comprising an image signal processor, the image signal processor being connected to the image sensor and the first processor, respectively;
the image signal processor is used for receiving the first image frame data;
the image signal processor is used for carrying out image processing on the first image frame data to obtain second image frame data.
10. 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 5.
CN202010031665.4A 2020-01-13 2020-01-13 Anti-shake method, electronic device, and computer-readable storage medium Pending CN111246088A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010031665.4A CN111246088A (en) 2020-01-13 2020-01-13 Anti-shake method, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010031665.4A CN111246088A (en) 2020-01-13 2020-01-13 Anti-shake method, electronic device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN111246088A true CN111246088A (en) 2020-06-05

Family

ID=70868741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010031665.4A Pending CN111246088A (en) 2020-01-13 2020-01-13 Anti-shake method, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN111246088A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489878A (en) * 2021-07-29 2021-10-08 Oppo广东移动通信有限公司 Electronic device, information synchronization method, and computer-readable storage medium
CN113489880A (en) * 2021-07-29 2021-10-08 Oppo广东移动通信有限公司 Electronic device, information synchronization method, and computer-readable storage medium
CN115134525A (en) * 2022-06-27 2022-09-30 维沃移动通信有限公司 Data transmission method, inertia measurement unit and optical anti-shake unit
CN115499575A (en) * 2021-06-18 2022-12-20 哲库科技(上海)有限公司 Image data processing method, multimedia processing chip and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106027909A (en) * 2016-07-05 2016-10-12 大连海事大学 System and method for synchronously collecting shipboard videos based on MEMS inertial sensor and camera
CN107172320A (en) * 2017-06-21 2017-09-15 成都理想境界科技有限公司 Method of data synchronization and picture pick-up device
CN109951639A (en) * 2019-03-26 2019-06-28 Oppo广东移动通信有限公司 Camera stabilization system, method, electronic equipment and computer readable storage medium
CN109983758A (en) * 2016-12-02 2019-07-05 索尼半导体解决方案公司 Image-forming component, imaging method and electronic equipment
US20190364186A1 (en) * 2016-12-23 2019-11-28 Samsung Electronics Co., Ltd. Image processing method and electronic device supporting same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106027909A (en) * 2016-07-05 2016-10-12 大连海事大学 System and method for synchronously collecting shipboard videos based on MEMS inertial sensor and camera
CN109983758A (en) * 2016-12-02 2019-07-05 索尼半导体解决方案公司 Image-forming component, imaging method and electronic equipment
US20190364186A1 (en) * 2016-12-23 2019-11-28 Samsung Electronics Co., Ltd. Image processing method and electronic device supporting same
CN107172320A (en) * 2017-06-21 2017-09-15 成都理想境界科技有限公司 Method of data synchronization and picture pick-up device
CN109951639A (en) * 2019-03-26 2019-06-28 Oppo广东移动通信有限公司 Camera stabilization system, method, electronic equipment and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499575A (en) * 2021-06-18 2022-12-20 哲库科技(上海)有限公司 Image data processing method, multimedia processing chip and electronic equipment
CN113489878A (en) * 2021-07-29 2021-10-08 Oppo广东移动通信有限公司 Electronic device, information synchronization method, and computer-readable storage medium
CN113489880A (en) * 2021-07-29 2021-10-08 Oppo广东移动通信有限公司 Electronic device, information synchronization method, and computer-readable storage medium
WO2023005424A1 (en) * 2021-07-29 2023-02-02 Oppo广东移动通信有限公司 Electronic device, information synchronization method, and computer readable storage medium
CN115134525A (en) * 2022-06-27 2022-09-30 维沃移动通信有限公司 Data transmission method, inertia measurement unit and optical anti-shake unit

Similar Documents

Publication Publication Date Title
CN111246088A (en) Anti-shake method, electronic device, 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
US9654672B1 (en) Synchronized capture of image and non-image sensor data
US8159541B2 (en) Image stabilization method and apparatus
CN109600548B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110300263B (en) Gyroscope processing method and device, electronic equipment and computer readable storage medium
CN110035228B (en) Camera anti-shake system, camera anti-shake method, electronic device, and computer-readable storage medium
CN109951638B (en) Camera anti-shake system, camera anti-shake method, electronic device, and computer-readable storage medium
CN111432118B (en) Image anti-shake processing method and device, electronic equipment and storage medium
US11032477B2 (en) Motion stabilized image sensor, camera module and apparatus comprising same
KR101642569B1 (en) Digital photographing System and Controlling method thereof
CN108924426B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107124542B (en) Image anti-shake processing method and device
CN109598764A (en) Camera calibration method and device, electronic equipment, computer readable storage medium
CN110177213B (en) Gyroscope parameter adjusting method and device, terminal and computer readable storage medium
US20200112681A1 (en) Image stabilizing apparatus, image processing apparatus, and detection method
KR20160098853A (en) Method for stabilizing image and electronic device thereof
CN112414400A (en) Information processing method and device, electronic equipment and storage medium
CN110113542B (en) Anti-shake method and apparatus, electronic device, computer-readable storage medium
CN110519513B (en) Anti-shake method and apparatus, electronic device, computer-readable storage medium
CN108603752B (en) Deflection angle detection method and device and jitter compensation method and device for camera module of terminal
CN110266950B (en) Gyroscope processing method and device, electronic equipment and computer readable storage medium
CN110233969B (en) Image processing method and device, electronic equipment and computer readable storage medium
US20230049796A1 (en) Information processing apparatus, information processing method, and program

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200605