CN115103108A - Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium - Google Patents

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

Info

Publication number
CN115103108A
CN115103108A CN202210627303.0A CN202210627303A CN115103108A CN 115103108 A CN115103108 A CN 115103108A CN 202210627303 A CN202210627303 A CN 202210627303A CN 115103108 A CN115103108 A CN 115103108A
Authority
CN
China
Prior art keywords
shake
information
compensation
motion
translation
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
CN202210627303.0A
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 CN202210627303.0A priority Critical patent/CN115103108A/en
Publication of CN115103108A publication Critical patent/CN115103108A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to an anti-shake processing method, an anti-shake processing apparatus, a computer device, a storage medium, and a computer program product. The method comprises the following steps: determining the current motion information of the camera at the current moment; acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information; determining translation compensation information and rotation compensation information based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment; and driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information. By adopting the method, different jitter scenes can be accurately subjected to jitter compensation.

Description

Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium
Technical Field
The present application relates to the field of image technologies, and in particular, to an anti-shake processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of imaging technology, people often shoot images or videos through image acquisition equipment such as a camera on electronic equipment and record various information. In the process of shooting, the shaking of a shot picture can be brought by the shaking of the outside, so that the motion blur of the image is caused. In order to ensure the quality of shooting, the shooting process needs to be anti-shake.
However, the conventional anti-shake scheme usually processes a single motion blur and cannot adapt to different scenes.
Disclosure of Invention
The embodiment of the application provides an anti-shake processing method and device, electronic equipment, a computer readable storage medium and a computer program product, which can adapt to different shake scenes.
An anti-shake processing method comprising:
determining the current motion information of the camera at the current moment;
acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
determining translation compensation information and rotation compensation information based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment;
and driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
An anti-shake processing apparatus comprising:
the first determining module is used for determining the current motion information of the camera at the current moment;
the acquisition module is used for acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
a second determining module, configured to determine translational compensation information and rotational compensation information based on the translational anti-shake intensity information and the rotational anti-shake intensity information, and the current motion information and the filtered motion information corresponding to the preorder time of the current time;
and the compensation module is used for driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
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:
determining the current motion information of the camera at the current moment;
acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
determining translation compensation information and rotation compensation information based on the translation anti-shake intensity information and the rotation anti-shake intensity information, and the current motion information and filtering motion information corresponding to a preamble time of the current time;
and driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
determining the current motion information of the camera at the current moment;
acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
determining translation compensation information and rotation compensation information based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment;
and driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
A computer program product comprising a computer program which when executed by a processor performs the steps of:
determining current motion information of the camera at the current moment;
acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
determining translation compensation information and rotation compensation information based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment;
and driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
According to the anti-shake processing method, the anti-shake processing device, the electronic equipment, the computer readable storage medium and the computer program product, the translation anti-shake intensity information and the rotation anti-shake intensity information corresponding to the current motion information are acquired by determining the current motion information of the camera at the current moment, so that the translation anti-shake intensity information and the rotation anti-shake intensity information which are suitable for the current motion state of the camera can be adapted based on the current motion state. The translation compensation information and the rotation compensation information can be accurately determined based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment, so that the camera is driven to perform translation anti-shake compensation and rotation anti-shake compensation, and shake compensation generated by motion is more accurate. Moreover, the appropriate translational anti-shake intensity and the appropriate rotational anti-shake intensity are adapted based on the current motion information, and the anti-shake compensation processing with different intensities can be performed in a targeted manner aiming at various scenes such as motion blur generated by movement and motion blur generated by rotation, so that different shake scenes can be effectively adapted.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be 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 an image processing circuit of an electronic device in one embodiment;
FIG. 2 is a flow diagram of an anti-shake processing method according to an embodiment;
fig. 3 is a flowchart of driving the camera to perform anti-shake compensation according to the translational compensation information and the rotational compensation information in one embodiment;
FIG. 4 is a schematic illustration of a rotation compensation operation performed by the sensor in one embodiment;
FIG. 5 is a schematic diagram of the translation compensation operation and the rotation compensation operation of the sensor in another embodiment;
FIG. 6A is a flowchart illustrating an anti-shaking processing method according to an embodiment;
FIG. 6B is a flowchart illustrating an anti-shake processing method according to another embodiment;
FIG. 7 is a block diagram of an anti-shake processing apparatus according to an embodiment;
FIG. 8 is a diagram illustrating the internal architecture of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in 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.
The anti-shake processing method in the embodiment of the application can be applied to electronic equipment. The electronic device may be a computer device with at least one camera, a personal digital assistant, a tablet computer, a smartphone, a wearable device, or the like.
In one embodiment, the electronic device may include an Image Processing circuit, which may be implemented using hardware and/or software components, and may include various Processing units that define an ISP (Image Signal Processing) pipeline. FIG. 1 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 1, 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. 1, an image processing circuit of an electronic device with two cameras is provided. The image processing circuit includes a first ISP processor 130, a second ISP processor 140 and control logic 150. The first camera 110 includes one or more first lenses 112 and a first image sensor 114. The first image sensor 114 may include a color filter array (e.g., a Bayer filter), and the first image sensor 114 may acquire light intensity and wavelength information captured with each imaging pixel of the first image sensor 114 and provide a set of image data that may be processed by the first ISP processor 130. The second camera 120 includes one or more second lenses 122 and a second image sensor 124. The second image sensor 124 may include a color filter array (e.g., a Bayer filter), and the second image sensor 124 may acquire light intensity and wavelength information captured with each imaging pixel of the second image sensor 124 and provide a set of image data that may be processed by the second ISP processor 140.
The first image acquired by the first camera 110 is transmitted to the first ISP processor 130 for processing, after the first ISP processor 130 processes the first image, the statistical data (such as brightness of the image, contrast value of the image, color of the image, etc.) of the first image may be sent to the control logic 150, and the control logic 150 may determine the control parameter of the first camera 110 according to the statistical data, so that the first camera 110 may perform operations such as auto focus and auto exposure according to the control parameter. The first image may be stored in the image memory 160 after being processed by the first ISP processor 130, and the first ISP processor 130 may also read the image stored in the image memory 160 for processing. In addition, the first image may be directly transmitted to the display 170 for display after being processed by the ISP processor 130, or the display 170 may read and display the image in the image memory 160.
Wherein the first ISP processor 130 processes the image data pixel by pixel in a plurality of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the first ISP processor 130 may perform one or more image processing operations on the image data, collecting statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
The image Memory 160 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.
When receiving image data from the first image sensor 114 interface, the first ISP processor 130 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 160 for additional processing before being displayed. The first ISP processor 130 receives the processed data from the image memory 160 and performs image data processing in RGB and YCbCr color spaces on the processed data. The image data processed by the first ISP processor 130 may be output to a display 170 for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). Further, the output of the first ISP processor 130 may also be sent to the image memory 160, and the display 170 may read image data from the image memory 160. In one embodiment, image memory 160 may be configured to implement one or more frame buffers.
The statistics determined by the first ISP processor 130 may be sent to the control logic 150. For example, the statistical data may include first image sensor 114 statistics such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, first lens 112 shading correction, and the like. The control logic 150 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of the first camera 110 and control parameters of the first ISP processor 130 based on the received statistical data. For example, the control parameters of the first camera 110 may include gain, integration time of exposure control, anti-shake parameters, flash control parameters, first lens 112 control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters, and the like. 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 first lens 112 shading correction parameters.
Similarly, the second image collected by the second camera 120 is transmitted to the second ISP processor 140 for processing, after the second ISP processor 140 processes the first image, the statistical data of the second image (such as the brightness of the image, the contrast value of the image, the color of the image, etc.) may be sent to the control logic 150, and the control logic 150 may determine the control parameter of the second camera 120 according to the statistical data, so that the second camera 120 may perform operations such as auto-focus and auto-exposure according to the control parameter. The second image may be stored in the image memory 160 after being processed by the second ISP processor 140, and the second ISP processor 140 may also read the image stored in the image memory 160 for processing. In addition, the second image may be directly transmitted to the display 170 for displaying after being processed by the ISP processor 140, or the display 170 may read the image in the image memory 160 for displaying. The second camera 120 and the second ISP processor 140 may also implement the processes described for the first camera 110 and the first ISP processor 130.
In one embodiment, the first camera 110 may be a color camera and the second camera 120 may be a TOF (Time Of Flight) camera or a structured light camera. The TOF camera can acquire a TOF depth map, and the structured light camera can acquire a structured light depth map. The first camera 110 and the second camera 120 may both be color cameras. And acquiring a binocular depth map through the two color cameras. The first ISP processor 130 and the second ISP processor 140 may be the same ISP processor.
When the first camera 110 performs a photographing, the first ISP processor 130 may determine current motion information of the first camera 110 at the current time. The ISP processor may acquire anti-shake intensity information corresponding to the current motion information, the anti-shake intensity information including translational anti-shake intensity information and rotational anti-shake intensity information. The ISP processor may determine the translational compensation information and the rotational compensation information based on the translational anti-shake intensity information and the rotational anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the preceding time of the current time. The ISP processor drives the first camera 110 to perform anti-shake compensation according to the translational compensation information and the rotational compensation information.
In one embodiment, the anti-shake processing is Optical Image Stabilization (OIS anti-shake). The optical anti-shake is that when a gyroscope in a lens detects tiny movement in the shooting process, a signal is transmitted to a microprocessor to immediately calculate the displacement required to be compensated, and then compensation is performed according to the shake direction and the displacement of the lens through a compensation lens group, so that the problem of image blur caused by the shake of a camera can be effectively solved, and different shake scenes can be adapted.
Fig. 2 is a flowchart of an anti-shake processing method according to an embodiment. The anti-shake processing method in this embodiment is described by taking the electronic device in fig. 1 as an example. As shown in fig. 2, the anti-shake processing method includes:
and step S202, determining the current motion information of the camera at the current moment.
The current motion information refers to relevant information representing a motion state of the camera at the current moment, and the current motion information may include a motion speed. The motion speed refers to a speed generated by a motion state of the camera at the current time, and may include at least one of an angular speed and an acceleration. The angular velocity may be converted into a rotation matrix of the camera in a world coordinate system. Thus, the rotation matrix may be used to characterize the current motion information of the camera. The movement speed includes at least one of a translational movement speed and a rotational movement speed. The translational motion speed refers to the speed of the camera moving at the current moment, and the rotational motion speed refers to the speed of the camera rotating at the current moment.
Specifically, an ISP processor or a central processing unit of the electronic device may detect a movement speed of the camera at the current time, and use the movement speed as the current movement information. Further, at least one of the angular velocity and the acceleration of the camera at the current time can be detected, and the at least one of the angular velocity and the acceleration at the current time is used as the movement velocity at the current time. Angular velocity can be detected by a Gyro (Gyro) sensor, and acceleration can be detected by an acceleration (Acc) sensor. The gyroscope sensor is a simple and easy-to-use control system based on free space movement and gesture positioning, and the acceleration sensor is a sensor capable of measuring acceleration.
In one embodiment, the ISP processor or central processor of the electronic device may determine the movement speed at the current time by the acceleration of the camera at the current time.
In one embodiment, the ISP processor or the central processing unit of the electronic device may detect the angular velocity of the camera through the gyroscope sensor to obtain the angular velocity of the camera at the current time, and use the current angular velocity information as the motion velocity of the camera. Further, an ISP processor or a central processing unit of the electronic device may obtain a triaxial angular velocity of the camera at the current time through the gyroscope sensor, and use the triaxial angular velocity at the current time as a motion velocity of the camera at the current time. Alternatively, the three-axis angular velocity is subjected to correction and integration processing in a time domain, and the three-axis angular velocity is output.
Or, the ISP processor or the central processing unit of the electronic device may detect the acceleration of the camera through the acceleration sensor to obtain the acceleration of the camera at the current moment, and use the acceleration at the current moment as the motion speed of the camera at the current moment.
Step S204, acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information includes translational anti-shake intensity information and rotational anti-shake intensity information.
Specifically, translation anti-shake intensity information and rotation anti-shake intensity information corresponding to different motion information are configured in the electronic device in advance, and the motion information and the translation anti-shake intensity information are in a positive correlation relationship, and the motion information and the rotation anti-shake intensity information are in a positive correlation relationship. For example, the motion information is represented by a specific numerical value, and when the anti-shake intensity information is represented by an anti-shake intensity value, the larger the numerical value representing the motion information is, the larger the corresponding translational anti-shake intensity value is, the larger the numerical value representing the motion information is, and the larger the corresponding rotational anti-shake intensity value is; the smaller the numerical value of the representation motion information is, the smaller the corresponding translation anti-shake intensity value is, and the smaller the numerical value of the representation motion information is, the smaller the corresponding rotation anti-shake intensity value is.
The ISP processor or the central processor of the electronic device may obtain the translational anti-shake intensity information and the rotational anti-shake intensity information corresponding to the current motion information according to the current motion information of the camera at the current time.
Step S206, based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preamble time of the current time, determining translation compensation information and rotation compensation information.
The preamble time refers to a time before the current time, and may be a time before the current time, a plurality of times before the current time, for example, two times before, three times before, and the like, but is not limited thereto. The translational compensation information is information for compensating for a displacement amount of the camera due to the shake, and the rotational compensation information is information for compensating for a rotational amount of the camera due to the shake. The filtered motion information is information obtained by filtering the motion information, and may be specifically information obtained by low-pass filtering the motion information.
Specifically, an ISP processor or a central processing unit of the electronic device may obtain the filtering motion information corresponding to the preamble time of the current time, and determine the translation compensation information according to the translation anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the preamble time. And determining rotation compensation information according to the filtering motion information corresponding to the current motion information and the preorder time based on the rotation anti-shake intensity information.
For example, the translational compensation information is determined according to the translational anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the previous time before the current time. And determining rotation compensation information according to the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the previous moment of the current moment.
Further, an ISP processor or a central processing unit of the electronic device may obtain motion information corresponding to the preamble time of the current time, and perform filtering processing on the motion information of the preamble time to obtain filtered motion information corresponding to the preamble time.
And step S208, driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
Specifically, the ISP processor or the central processor of the electronic device may drive the camera to perform the translational anti-shake compensation based on the translational compensation information, and drive the camera to perform the rotational anti-shake compensation based on the rotational compensation information.
In this embodiment, the current motion information of the camera at the current moment is determined to obtain the translational anti-shake intensity information and the rotational anti-shake intensity information corresponding to the current motion information, so that the translational anti-shake intensity information and the rotational anti-shake intensity information suitable for the current motion state of the camera can be adapted based on the current motion state. Based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment, the translation compensation information and the rotation compensation information can be accurately determined, so that the camera is driven to perform translation anti-shake compensation and rotation anti-shake compensation, and shake compensation generated by motion is more accurate. Moreover, the appropriate translational anti-shake intensity and the appropriate rotational anti-shake intensity are adapted based on the current motion information, and the anti-shake compensation processing with different intensities can be performed in a targeted manner aiming at various scenes such as motion blur generated by movement and motion blur generated by rotation, so that different shake scenes can be effectively adapted.
In one embodiment, the current motion information includes a translational motion speed and a rotational motion speed, the translational anti-shake intensity information includes a translational anti-shake intensity value, and the rotational anti-shake intensity information includes a rotational anti-shake intensity value; acquiring anti-shake intensity information corresponding to current motion information, including:
according to the translational movement speed of the camera in the translational direction, obtaining a translational anti-shake intensity value associated with the translational movement speed, wherein the translational movement speed is positively correlated with the translational anti-shake intensity value; and according to the rotating motion speed of the camera in the rotating direction, obtaining a rotating anti-shake intensity value associated with the rotating motion speed, wherein the rotating motion speed is positively associated with the rotating anti-shake intensity value, and the translation direction is vertical to the rotating direction.
Specifically, the mapping relationship between the translational movement speed and the translational anti-shake intensity value, and the mapping relationship between the rotational movement speed and the rotational anti-shake intensity value may be configured in advance in the electronic device. The translational motion speed is positively correlated with the translational anti-shake intensity value, and the rotational motion speed is positively correlated with the rotational anti-shake intensity value.
The translation direction refers to a direction in which the camera is displaced due to shaking, and the rotation direction refers to a direction in which the camera rotates due to shaking. The translation direction is perpendicular to the rotation direction.
The ISP processor or the central processing unit of the electronic equipment can detect the translational motion speed of the camera in the translational direction at the current moment and can obtain the corresponding translational anti-shake intensity value according to the translational motion speed.
The ISP processor or the central processing unit of the electronic equipment can detect the rotating movement speed of the camera in the rotating direction at the current moment and can obtain the corresponding rotating anti-shake intensity value according to the translating movement speed.
In one embodiment, the electronic device is pre-configured with translational anti-shake intensity values corresponding to different translational movement speeds. The ISP processor or the central processor of the electronic equipment can detect the translational motion speed of the camera at the current moment, and obtains the translational anti-shake intensity value corresponding to the translational motion speed based on the mapping relation between the translational motion speed and the translational anti-shake intensity value.
In one embodiment, the electronic device is pre-configured with rotation anti-shake intensity values corresponding to different rotation speeds. The ISP processor or the central processing unit of the electronic equipment can detect the rotational movement speed of the camera at the current moment, and the rotational anti-shake intensity value corresponding to the rotational movement speed is obtained based on the mapping relation between the rotational movement speed and the rotational anti-shake intensity value.
In one embodiment, the translation direction comprises a first movement direction and a second movement direction, the rotation direction comprises a third movement direction, and the first movement direction, the second movement direction and the third movement direction are perpendicular to each other; acquiring anti-shake intensity information corresponding to current motion information, including:
according to the translational movement speeds of the camera in the first movement direction and the second movement direction respectively, acquiring a translational anti-shake intensity value associated with the translational movement speed in the first movement direction and acquiring a translational anti-shake intensity value associated with the translational movement speed in the second movement direction, wherein the translational movement speed is positively correlated with the translational anti-shake intensity value; and obtaining a rotation anti-shake intensity value associated with the rotation movement speed according to the rotation movement speed of the camera in the third movement direction, wherein the rotation movement speed is positively associated with the rotation anti-shake intensity value, and the translation direction is vertical to the rotation direction.
It will be understood that the speeds of movement occurring in the first and second directions of movement are referred to as translational speeds of movement and the speeds of movement occurring in the third direction of movement are referred to as rotational speeds of movement.
In one embodiment, the first moving direction, the second moving direction and the third moving direction are respectively an X-axis direction, a Y-axis direction and a Z-axis direction, the moving speed generated by moving around the X-axis and the Y-axis is called a translational moving speed, and the moving speed generated by moving around the Z-axis is called a rotational moving speed.
In this embodiment, when the motion speed is small, motion blur is not easily generated, and jitter generated at this time is small. When the moving speed is large, motion blur is easily generated, that is, the generated jitter is large. Also, the degree of shake generated in the translational direction and the degree of shake generated in the rotational direction are different. In this embodiment, the mapping relationship between the translational motion speed and the rotational anti-shake intensity value is preconfigured, and the mapping relationship between the rotational motion speed and the rotational anti-shake intensity value is preconfigured, so that the translational motion speed and the rotational anti-shake intensity value are positively correlated, and the rotational motion speed and the rotational anti-shake intensity value are positively correlated, so that when the translational motion speed is small, a small translational anti-shake intensity value is adapted, a small translational anti-shake compensation amount can be calculated, and when the translational motion speed is large, a large translational anti-shake intensity value is adapted, a large translational anti-shake compensation amount can be calculated, and the translational shake compensation can be accurately performed on the generated translational shake, so that the lens is maintained in the optimal compensation state. Meanwhile, when the rotational motion speed is low, a small rotational anti-shake intensity value is matched, small rotational anti-shake compensation quantity can be calculated, when the rotational motion speed is high, a large rotational anti-shake intensity value is matched, large rotational anti-shake compensation quantity can be calculated, and targeted rotational anti-shake compensation can be accurately performed on generated rotational shake, so that the lens is kept in the best compensation state. And the shake generated by the lens is divided into shake in the translation direction and shake in the rotation direction, so that the translation compensation and the rotation compensation can be dynamically fused according to the real-time motion state, and the accuracy of anti-shake compensation is improved.
In one embodiment, the method further comprises:
respectively collecting sample videos obtained by the movement of a camera in the translation direction and the rotation direction at different movement speeds; determining a translation anti-shake intensity value corresponding to each movement speed according to the ambiguity of the sample video corresponding to the translation direction and each movement speed when the sample video is collected; and determining the rotation anti-shake intensity value corresponding to each movement speed according to the ambiguity of the sample video corresponding to the rotation direction and each movement speed when the sample video is collected.
The blurriness of the sample video refers to the blurriness of the sample video.
Specifically, the camera moves at different movement speeds in the translation direction and performs video acquisition to obtain a sample video corresponding to the translation direction. An ISP processor or central processor of the electronic device may detect ambiguities of the sample video and determine respective corresponding ambiguities of different motion speeds in the sample video. The ISP processor or the central processing unit of the electronic equipment can obtain the candidate translation anti-shake intensity values, and the sample video is adjusted through the candidate translation anti-shake intensity values, so that the ambiguity of the sample video is reduced, and the sample video becomes clear.
The ISP processor or the central processor of the electronic device may select the translation anti-shake intensity value corresponding to each motion speed from the translation anti-shake intensity values of the candidates based on the adjustment of the sample video by the translation anti-shake intensity value of each candidate. Further, determining the ambiguity of the sample video corresponding to each motion speed, and adjusting the ambiguity to a candidate translation anti-shake intensity value when the ambiguity meets a definition condition, wherein the candidate translation anti-shake intensity value is used as the translation anti-shake intensity value corresponding to the corresponding motion speed.
Similarly, the camera moves at different movement speeds in the rotation direction and performs video acquisition to obtain a sample video corresponding to the rotation direction. An ISP processor or central processor of the electronic device may detect ambiguities of the sample video and determine respective corresponding ambiguities of different motion speeds in the sample video. The ISP processor or the central processing unit of the electronic equipment can obtain the candidate rotation anti-shake intensity values, and the sample video is adjusted through the candidate rotation anti-shake intensity values, so that the ambiguity of the sample video is reduced, and the sample video is clear.
The ISP processor or the central processor of the electronic device may adjust the sample video based on the rotation anti-shake intensity values of the respective candidates, and screen out a rotation anti-shake intensity value corresponding to each motion speed from the rotation anti-shake intensity values of the respective candidates. Further, determining the ambiguity of the sample video corresponding to each motion speed, and adjusting the ambiguity to a candidate rotation anti-shake intensity value when the ambiguity meets a definition condition, wherein the candidate rotation anti-shake intensity value is used as the rotation anti-shake intensity value corresponding to the corresponding motion speed.
In one embodiment, one motion speed in the panning direction may be captured to obtain one sample video, such that different motion speeds in the panning direction correspond to respective sample videos. One sample video can be acquired at one movement speed in the rotating direction, so that different movement speeds in the rotating direction correspond to respective sample videos. And adjusting the sample video corresponding to the single movement speed in the translation direction through the candidate translation anti-shake intensity values until the ambiguity of the sample video meets the definition condition, and taking the candidate translation anti-shake intensity value meeting the definition condition as the translation anti-shake intensity value corresponding to the movement speed. And establishing a mapping relation between the movement speed and the corresponding translation anti-shake intensity value. Similarly, each movement speed in the translation direction and each movement speed in the rotation direction are processed according to the above, so that a translation anti-shake intensity value corresponding to each movement speed in the translation direction and a rotation anti-shake intensity value corresponding to each movement speed in the rotation direction can be obtained.
In this embodiment, the translation direction includes a first movement direction and a second movement direction, the rotation direction includes a third movement direction, and the first movement direction, the second movement direction, and the third movement direction are perpendicular to each other; gather the camera respectively and carry out the sample video that obtains with different movement speed in translation direction and direction of rotation, include: respectively collecting sample videos generated by the movement of a camera in a first movement direction, a second movement direction and a third movement direction at different movement speeds;
according to the ambiguity of the sample video corresponding to the translation direction and each movement speed when the sample video is collected, determining the translation anti-shake intensity value corresponding to each movement speed respectively, comprising: determining a translation anti-shake intensity value corresponding to each motion speed in the first motion direction according to the ambiguity of the sample video corresponding to the first motion direction and each motion speed; determining a translation anti-shake intensity value corresponding to each motion speed in the second motion direction according to the ambiguity of the sample video corresponding to the second motion direction and each motion speed;
determining a rotation anti-shake intensity value corresponding to each movement speed according to the ambiguity of the sample video corresponding to the rotation direction and each movement speed when the sample video is collected, and the method comprises the following steps: and determining a rotation anti-shake intensity value corresponding to each movement speed in the third movement direction based on the ambiguity of the sample video corresponding to the third movement direction and each movement speed.
In this embodiment, sample videos obtained by moving the camera at different movement speeds in the translation direction and the rotation direction are respectively collected, so that the videos are respectively collected under the conditions of generating translation jitter and rotation jitter, and the degree of blur of the video shot under the conditions of generating translation jitter and the degree of blur of the video shot under the conditions of generating rotation jitter can be determined. And respectively adapting respective translation anti-shake intensity values for each motion speed according to the corresponding relation between the ambiguity of the sample video corresponding to the translation direction and each motion speed when the sample video is collected so as to reduce the video ambiguity caused by translation shake. And respectively adapting respective rotation anti-shake intensity values for each motion speed according to the ambiguity of the sample video corresponding to the rotation direction and each motion speed when the sample video is collected so as to reduce the ambiguity of the video caused by rotation shake. The mapping relation between different movement speeds in the translation direction and different translation anti-shake intensity values and the mapping relation between different movement speeds in the rotation direction and different rotation anti-shake intensity values are predetermined, and the efficiency of subsequent anti-shake processing is improved. And respective anti-shake intensity is set aiming at the translation direction and the rotation direction, so that shake compensation of shake adaptation different intensities caused aiming at different directions can be realized, the integration of shake compensation in two aspects is realized, and the accuracy of shake compensation is improved.
In one embodiment, determining the translational anti-shake intensity value corresponding to each motion speed according to the ambiguity of the sample video corresponding to the translational direction and each motion speed when the sample video is acquired comprises
Dividing each movement speed when the sample video is collected according to the ambiguity of the sample video corresponding to the translation direction to obtain the movement speed at each level; determining the ambiguity of the sample video corresponding to the movement speeds of different levels, adjusting the ambiguity to a translation anti-shake intensity value when a definition condition is met, and constructing a mapping relation between the movement speeds of different levels and each translation anti-shake intensity value;
according to the ambiguity of the sample video corresponding to the rotation direction and each movement speed when the sample video is collected, the rotation anti-shake intensity value corresponding to each movement speed is determined, which comprises the following steps:
dividing each movement speed when the sample video is collected according to the ambiguity of the sample video corresponding to the rotation direction to obtain the movement speed at each level; determining the ambiguity of the sample video corresponding to the movement speeds of different levels, adjusting the ambiguity to the rotation anti-shake intensity value when the ambiguity meets the definition condition, and constructing a mapping relation between the movement speeds of different levels and each rotation anti-shake intensity value.
Specifically, an ISP processor or a central processing unit of the electronic device may detect respective corresponding ambiguities of different motion speeds in the sample video, and perform division processing on the motion speeds when the sample video is acquired, so as to obtain the motion speeds at the respective levels. And determining the ambiguity corresponding to the motion speed at one level by an ISP (internet service provider) processor or a central processing unit of the electronic equipment, adjusting the sample video by the translation anti-shake intensity value of each candidate until the ambiguity corresponding to the motion speed at one level meets a definition condition, and taking the candidate translation anti-shake intensity value meeting the definition condition as the translation anti-shake intensity value corresponding to the motion speed at the level. And constructing a mapping relation between the movement speed at the level and the corresponding translation anti-shake intensity value.
According to the same processing, for the translation direction, the mapping relation between the motion speed of different levels and each translation anti-shake intensity value can be obtained. Similarly, for the rotation direction, the mapping relationship between the movement speeds of different levels and the anti-shake intensity values of each rotation can also be obtained.
In this embodiment, each moving speed when the sample video is acquired is divided according to the ambiguity of the sample video corresponding to the translation direction to obtain a moving speed at each level, so as to divide the moving speeds at multiple levels in the translation direction. Determining the ambiguity of the sample video corresponding to the motion speeds of different levels, adjusting the sample video to the translation anti-shake intensity value when the ambiguity meets the definition condition, and constructing the mapping relation between the motion speeds of different levels and the translation anti-shake intensity values, thereby accurately determining the translation anti-shake intensity value when the video ambiguity caused by different translation shakes can be adjusted to the definition. Dividing and processing each motion speed when the sample video is collected according to the ambiguity of the sample video corresponding to the rotation direction to obtain the motion speed under each level, determining the ambiguity of the sample video corresponding to the motion speeds of different levels, adjusting the sample video to the rotation anti-shake intensity value when the definition condition is met, and establishing the mapping relation between the motion speeds of different levels and each rotation anti-shake intensity value, thereby accurately determining the rotation anti-shake intensity value when the video blur caused by different rotation shakes is adjusted to be clear.
In one embodiment, determining the translational compensation information and the rotational compensation information based on the translational anti-shake strength information and the rotational anti-shake strength information, the current motion information, and the filtered motion information corresponding to the preamble time of the current time includes:
determining filtering motion information at the current moment based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information and filtering motion information corresponding to a preorder moment of the current moment; and determining translation compensation information and rotation compensation information based on the current motion information and the filtering motion information at the current moment.
Specifically, the ISP processor or the central processing unit of the electronic device may perform motion gesture fusion processing on the current motion information and the filtered motion information at the previous time based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information, and the filtered motion information corresponding to the previous time at the current time, so as to obtain the filtered motion information at the current time. An ISP processor or central processor of the electronic device may determine a difference between the current motion information and the filtered motion information at the current time, and determine translation compensation information and rotation compensation information based on the difference. The translational shake prevention compensation information is information for compensating translational shake generated by the camera. The rotational anti-shake compensation information is information for compensating for rotational shake generated by the camera.
In one embodiment, the translational anti-shake intensity information and the rotational anti-shake intensity information may be used as weight information of the current motion information, and the weight information corresponding to the filtered motion information at the preamble time may be determined based on the translational anti-shake intensity information and the rotational anti-shake intensity information. The weight information of the current motion information can represent the weight occupied by the current motion information in the motion fusion process, and the weight information corresponding to the filtering motion information at the preamble time can represent the weight occupied by the filtering motion information at the preamble time in the motion fusion process. The ISP processor or the central processing unit of the electronic device may perform motion attitude fusion processing on the current motion information and the filtered motion information at the preamble time based on the current motion information and the corresponding weight information, and the filtered motion information at the preamble time and the corresponding weight information, to obtain the filtered motion information at the current time.
In one embodiment, the motion attitude fusion process may be a kalman filter process, which may be implemented by a kalman filter. Kalman filtering (Kalman filtering) is an algorithm that uses a linear system state equation to optimally estimate the system state by inputting and outputting observation data through the system. The optimal estimate can also be viewed as a filtering process, since the observed data includes the effects of noise and interference in the system. The Kalman filter is a recursive filter proposed by Kalman (Kalman) for time-varying linear systems. The system can be described by a differential equation model containing orthogonal state variables, and the filter is used for estimating future errors by combining the past measurement estimation errors into new measurement errors.
In this embodiment, based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the preamble time of the current time, the filtering motion information of the current time can be accurately determined, so that the anti-shake compensation information can be accurately determined according to the difference between the current motion information and the filtering motion information of the current time, and shake compensation can be implemented.
In one embodiment, as shown in fig. 3, the translational compensation information includes a translational compensation amount and a translational compensation stroke, and the rotational compensation information includes a rotational compensation amount and a rotational compensation stroke; determining translational compensation information and rotational compensation information based on the current motion information and the filtered motion information at the current time, including steps S302-S304:
step S302 determines a translational compensation amount and a rotational compensation amount based on the current motion information and the filter motion information at the current time.
Specifically, the translational compensation information includes a translational compensation amount and a translational compensation stroke, and the rotational compensation information includes a rotational compensation amount and a rotational compensation stroke. The translation compensation quantity represents a numerical value for performing translation compensation on the moving shake generated by the camera, and the rotation compensation quantity represents a numerical value for performing rotation compensation on the rotation shake generated by the camera.
The electronic equipment realizes optical anti-shake by pushing the lens, and the lens can be pushed in a first movement direction, a second movement direction and a third movement direction which are mutually perpendicular. For example, the lens may be pushed in the X direction, the Y direction, and the Z direction, and the unit of the pushed stroke is code. The translation compensation stroke refers to a stroke pushed in the X direction or the Y direction when the camera generates translation shaking, and the stroke is used for compensating the translation shaking generated by the camera. The X direction is perpendicular to the Y direction. The rotation compensation stroke is a stroke pushed in the Z direction when the camera generates rotational shake, and the stroke is used for compensating the rotational shake generated by the camera. The X, Y and Z directions are perpendicular to each other.
The ISP processor or central processor of the electronic device may determine the amount of translational compensation and the amount of rotational compensation based on the current motion information and the filtered motion information at the current time. Further, the ISP processor or the central processor of the electronic device may calculate the amount of translational compensation in the X direction, the amount of translational compensation in the Y direction, and the amount of rotational compensation in the Z direction, respectively, based on the current motion information and the filtered motion information at the current time.
Step S304, acquiring a preset calibration value, and determining the translational compensation stroke of the camera based on the translational compensation amount and the preset calibration value; and determining the rotation compensation stroke of the camera based on the rotation compensation amount and a preset calibration value.
Specifically, the electronic device is preset with an association relationship among the translational compensation amount, the preset calibration value and the stroke center position, so as to obtain an association relationship among the rotational compensation amount, the preset calibration value and the stroke center position. The preset calibration value is a preset empirical value capable of representing the relationship between the translational compensation amount, the rotational compensation amount, and the stroke center position. The stroke center position refers to a center position of the camera in the whole stroke that can be pushed. It can be understood that the preset calibration values corresponding to the translational compensation amount and the rotational compensation amount may be the same or different, for example, based on the translational compensation amount and the first preset calibration value, the translational compensation stroke of the camera is determined; and determining the rotation compensation stroke of the camera based on the rotation compensation amount and the second preset calibration value.
The ISP processor or the central processing unit of the electronic equipment can determine the stroke center position of the current stroke of the camera, acquire the preset calibration value and calculate the corresponding translation compensation stroke according to the translation compensation amount, the preset calibration value and the stroke center position. And calculating the corresponding rotation compensation stroke according to the rotation compensation amount and a preset calibration value.
In one embodiment, the sum of the product of the translational compensation amount and the preset calibration value and the stroke center position is taken as the corresponding translational compensation stroke. And taking the sum of the product of the rotation compensation amount and the preset calibration value and the stroke center position as the corresponding rotation compensation stroke.
In one embodiment, a first correlation among the translational compensation amount in the X direction, the preset calibration value, and the stroke center position, a second correlation among the translational compensation amount in the Y direction, the preset calibration value, and the stroke center position, and a third correlation among the rotational compensation amount in the Z direction, the preset calibration value, and the stroke center position are preset in the electronic apparatus. An ISP processor or central processor of the electronic device may determine the travel center position of the camera in the X direction, the Y direction, and the Z direction. And calculating the translation compensation stroke in the X direction according to the translation compensation amount in the X direction, the preset calibration value in the X direction and the stroke center position in the X direction. And calculating the translation compensation stroke in the Y direction according to the translation compensation amount in the Y direction, the preset calibration value in the Y direction and the stroke center position in the Y direction. And calculating the rotation compensation stroke in the Z direction according to the rotation compensation amount in the Z direction, the preset calibration value in the Z direction and the stroke center position in the Z direction.
Further, the ISP processor or the central processor of the electronic device may use the sum of the product of the translational compensation amount in the X direction and the preset calibration value in the X direction and the stroke center position in the X direction as the translational compensation stroke corresponding to the X direction. And taking the sum of the product of the translational compensation amount in the Y direction and the preset calibration value in the Y direction and the stroke center position in the Y direction as the corresponding translational compensation stroke in the Y direction. And taking the sum of the product of the translational compensation amount in the Z direction and the preset calibration value in the Z direction and the stroke center position in the Z direction as the corresponding translational compensation stroke in the Z direction.
According to the translational compensation information and the rotational compensation information, the camera is driven to perform anti-shake compensation, and the method comprises the following steps of S306:
and S306, driving the camera to perform translational anti-shake compensation and rotational anti-shake compensation according to the current stroke position, the translational compensation stroke and the rotational compensation stroke of the camera.
The current travel position refers to the actual position of the camera in the current travel.
Specifically, the ISP processor or the central processing unit of the electronic device may push the camera from the current stroke position to the translational compensation stroke in the translational direction according to the current stroke position of the camera, so as to implement the translational anti-shake compensation, and push the rotational compensation stroke in the rotational direction, so as to implement the rotational anti-shake compensation.
In this embodiment, based on the current motion information and the filtering motion information at the current time, the translational compensation amount and the rotational compensation amount required for overcoming the current shake can be accurately calculated. The method comprises the steps of obtaining a preset calibration value, accurately calculating a translation compensation stroke required for overcoming shaking based on the translation compensation amount, the preset calibration value and the stroke center position of the stroke where the camera is located at present, and accurately calculating a rotation compensation stroke required for overcoming shaking based on the rotation compensation amount, the preset calibration value and the stroke center position of the stroke where the camera is located at present, so that the camera can be driven to accurately perform anti-shaking compensation.
In one embodiment, driving the camera to perform anti-shake compensation according to the translational compensation information and the rotational compensation information includes:
determining a target travel position of the camera according to the current travel position, the translation compensation information and the rotation compensation information of the camera; and driving the camera to move to a target stroke position.
Specifically, an ISP processor or a central processing unit of the electronic device calculates a target stroke position of the camera according to a current stroke position of the camera, the translation compensation information, and the rotation compensation information. The target stroke position refers to a position where the camera performs anti-shake compensation, that is, a position where the camera eliminates shake generated by the camera. An ISP processor or a central processing unit of the electronic equipment drives the camera to move from the current travel position to the target travel position so as to eliminate the shake generated by the camera.
In one embodiment, an ISP processor or central processor of the electronic device calculates a target travel position of the camera in the X direction based on a current travel position of the camera in the X direction and a translation compensation amount in the X direction. And calculating the target travel position of the camera in the Y direction according to the current travel position of the camera in the Y direction and the translation compensation amount in the Y direction. And calculating the target travel position of the camera in the Z direction according to the current travel position of the camera in the Z direction and the rotation compensation amount in the Z direction. The camera is driven so that the camera moves to a target stroke position in the X direction, a target stroke position in the Y direction, and a target stroke position in the Z direction.
In one embodiment, after an ISP processor or a central processing unit of the electronic device calculates a target stroke position of the camera in the X, Y, Z direction, the target stroke position in the X, Y, Z direction is sent to the driving circuit, so that each motor corresponding to the X, Y, Z direction pushes the lens of the camera to the target stroke position in the X, Y, Z direction, so as to complete the anti-shake compensation.
In this embodiment, according to the current stroke position, the translational compensation information, and the rotational compensation information of the camera, which position the camera should be located to overcome the current shake, that is, the target stroke position, is calculated, so that the camera can be driven to move to the target stroke position, the compensation processing on the current shake is realized, and the lens of the camera can be kept in the optimal compensation state in both the translational and the rotational directions.
In one embodiment, determining the target travel position of the camera according to the current travel position of the camera, the translation compensation information and the rotation compensation information comprises:
and fusing the current stroke position, the translation compensation information and the rotation compensation information of the camera to obtain the target stroke position of the camera.
Specifically, an ISP processor or a central processing unit of the electronic device may determine a current stroke position of the camera, perform fusion processing on the current stroke position of the camera, the translation compensation information, and the rotation compensation information, and obtain a target stroke position of the camera through the fusion processing.
In one embodiment, the fusion processing may be kalman filtering processing, and an ISP processor or a central processing unit of the electronic device may perform kalman filtering processing on the current stroke position, the translational compensation information, and the rotational compensation information of the camera to obtain a target stroke position of the camera. Further, the current travel position, the translation compensation information and the rotation compensation information can be input into a Kalman filter, and the target travel position of the camera is output through the Kalman filter.
In this embodiment, the current stroke position of the camera, the translational compensation information, and the rotational compensation information are fused, so that which position the camera is located at can be accurately calculated to effectively overcome translational shake and rotational shake.
In one embodiment, before determining the translational compensation information and the rotational compensation information based on the translational anti-shake strength information and the rotational anti-shake strength information, the current motion information, and the filtered motion information corresponding to the preamble time of the current time, the method further includes:
and acquiring the motion information corresponding to the preorder moment of the current moment, and performing low-pass filtering processing on the motion information corresponding to the preorder moment to obtain filtered motion information corresponding to the preorder moment.
Low-pass filtering (Low-pass filter) is a filtering method, in which the Low-frequency signal can normally pass through the Low-pass filter, and the high-frequency signal exceeding a predetermined threshold is blocked and attenuated. But the magnitude of the blocking and attenuation will vary depending on the frequency and the purpose of the filtering. The low-pass filtering is also called high-cut filter or top-cut filter.
Specifically, an ISP processor or a central processing unit of the electronic device may determine a preamble time of a current time and obtain filtering motion information corresponding to the preamble time. And an ISP processor or a central processing unit of the electronic equipment performs low-pass filtering processing on the motion information at the preorder moment to obtain filtering motion information corresponding to the preorder moment.
In one embodiment, the low pass filtering process may be performed by a low pass filter. The ISP processor or the central processing unit of the electronic equipment inputs the motion information of the preorder moment into the low-pass filter to obtain the filtering motion information output by the low-pass filter. The low pass filter may be a butterworth filter or a chebyshev filter.
In this embodiment, the motion information corresponding to the preamble time of the current time is obtained, and the low-pass filtering processing is performed on the motion information corresponding to the preamble time, so that the smooth denoising processing can be performed on the motion information at the preamble time, short-term fluctuation is effectively eliminated, and the smooth filtered motion information corresponding to the preamble time is obtained.
The conventional anti-shake processing is difficult to realize that an XY axis and a Z axis simultaneously perform rotation compensation through a lens, and the problem of coupling of simultaneous compensation of three axes mainly exists. In a limited moving range, after the translation compensation operation of the XY axis is performed, the angular range of the rotation compensation operation left for the sensor is reduced, so that the rotation compensation is difficult to reach the target stroke position of rolling _ z.
The coupling problem is caused by the hardware condition of the device, as shown in fig. 4, a range that the sensor and the sensor can rotate and translate is provided, when the sensor does not perform translation compensation operation, rotation compensation operation is performed, and edge collision does not occur after the sensor rotates by the angle theta. As shown in fig. 5, when the sensor performs the rotation compensation operation after the translation compensation operation, and rotates by the same angle θ, one of the sensors hits the edge, and at this time, if the issued compensation amount rolling _ z is greater than θ, the sensor can only actually rotate to the θ position. This coupling problem can cause unsmooth video frames and can also cause undesirable motion blur resistance.
Fig. 6A is a schematic flow chart illustrating an anti-shake processing method according to an embodiment.
Motion data of the gyro sensor gyro, i.e., current motion information, is received, and a current motion state is analyzed based on the motion data, and it is determined whether the resulting motion blur is caused by rotation about the X, Y axis or rotation about the Z axis.
If the motion blur is mainly caused by rotation around axis X, Y, the anti-shake compensation is mainly performed by sensor translation. Namely, filtering the motion data of the gyroscope in the X, Y axis by using a larger anti-shake intensity value, and filtering the motion data of the gyroscope in the Z axis by using a smaller anti-shake intensity value; sensor shift, also known as sensor displacement.
If motion blur is mainly caused by rotation around the Z-axis, anti-shake compensation is mainly performed by sensor rotation. Namely, filtering the motion data of the gyroscope in the Z axis by using a larger anti-shake intensity value, and filtering the motion data of the gyroscope in the X, Y axis by using a smaller anti-shake intensity value; the sensor rotation is the sensor rolling.
All the steps are real-time calculation processing and are dynamic fusion processes.
The anti-shake intensity value corresponding to the motion data of the gyroscope on the X, Y, Z axis is a preset empirical value, and can be obtained by the following processing:
(1) the method comprises the steps of respectively acquiring data of a gyroscope rotating around an X axis, data of a gyroscope rotating around a Y axis and data of a gyroscope rotating around a Z axis under a line, wherein the rotating speed around the axis is rich and diverse enough and includes the minimum speed of the maximum speed which can be reached by a user as much as possible, and the data content specifically includes gyroscope motion data and videos corresponding to the gyroscope data. Namely, the gyroscope rotates around the X axis at different rotating speeds, and video acquisition is carried out to obtain videos corresponding to the different rotating speeds on the X axis. In the same way, videos corresponding to different rotation speeds on the Y axis and the Z axis can be obtained. The rotation speed is a movement speed, and specifically may be an angular speed. Rotation about the X, Y axis is translation on the X, Y axis, and rotation compensation on the X, Y axis is translation compensation on the XY axis.
(2) For each video corresponding to different rotation speeds of the X axis, each rotation speed of the X axis of the gyroscope is divided into five levels according to the blurring degree of the video, for example, one level indicates that the rotation speed is slow, the obtained video is not blurred basically, and five levels indicate that the rotation speed is large, and the image quality of the obtained video is blurred. I.e. the higher the rating the higher the rotation speed, the more blurred the video.
(3) And for the rotating speed and the video corresponding to each grade, adjusting the video fuzziness through each candidate anti-shake intensity value to change the video from fuzziness to clearness, and determining an anti-shake intensity value used when the video is changed to clearness, so as to construct a mapping relation among the rotating speed, the video fuzziness and the anti-shake intensity values of different grades. According to the same processing mode, the mapping relations among the rotating speed, the video fuzziness and the anti-shake intensity values of different levels corresponding to the X axis, the Y axis and the Z axis can be respectively obtained. The mapping relationship may be represented by a mapping table.
After the mapping relationship corresponding to each axis is obtained, the mapping relationship may be stored in the electronic device in advance. When the electronic device moves, the current movement speeds of the gyroscope on the X axis, the Y axis and the Z axis are obtained, and the anti-shake intensity values corresponding to the current movement speeds of the gyroscope on the X axis, the Y axis and the Z axis are obtained based on the mapping relationship, for example, if the X axis is five stages, and if the Y axis and the Z axis are one stage, the anti-shake intensity value corresponding to the movement speed of the X axis is larger, and the anti-shake intensity value corresponding to the movement speed of the Y axis and the Z axis is smaller. The anti-shake intensity value is also called anti-shake filtering intensity value.
And filtering X, Y, Z three axes based on each anti-shake intensity value, and calculating a stroke value code corresponding to each axis and actually issued, wherein the stroke value code comprises shift _ x, shift _ y and rolling _ z. Wherein shift _ x and shift _ y correspond to sensor shift motors, and rolling _ z corresponds to sensor rolling motors.
Fig. 6B is a schematic flow chart of an anti-shake processing method according to an embodiment. And calculating the real-time motion of a target object through data detected by at least one of the Gyro sensor Gyro and the acceleration sensor Acc, wherein the target object refers to a camera, a lens of the camera or a gyroscope. The real-time position values of the current moment of the lens of the camera in the direction X, Y, Z, namely the current travel position Hall _ X in the X direction and the current travel position Hall _ Y in the Y direction, and the current travel position Hall _ Z in the Z direction are determined, and the target travel position target Hall is calculated by three values. The specific treatment process is as follows:
and calculating current motion information of the target object at the current moment based on the detected values of at least one of the Gyro sensor and the Acc sensor, namely real-time motion Qi, Qi is a vector and represents the motion in the direction of the X, Y, Z axis. And acquiring a corresponding anti-shake intensity value alpha according to the current real-time motion Qi.
According to the anti-shake intensity value alpha, based on the real-time motion Qi and the filtering motion Qfilter at the previous moment i-1 Calculating the filtering motion Qfilter at the current moment, wherein the formula is as follows:
Qfilter=f(Qi,alpha)
qfilter is Qi and Qfilter i-1 The result of the motion fusion is carried out, wherein alpha determines the real-time motion Qi and the filtering motion Qfilter at the previous moment in the fusion process i-1 The respective weights.
Calculating the anti-shake compensation quantity delta Q through the real-time motion Qi and the filtering motion Qfilter at the current moment:
△Q=Qi-Qfilter
the anti-shake compensation quantity Δ Q is a vector, and may be a fusion of a translational compensation quantity and a rotational compensation quantity.
The anti-shake compensation amount Δ Q includes compensation amounts (Δ x, Δ y, Δ z) on XYZ axes; Δ x, Δ y represent translational compensation amounts in the XY axis, and Δ Z represents rotational compensation amounts in the Z axis, respectively.
Acquiring preset calibration values (gain _ x, gain _ y and gain _ z), and calculating the target Hall:
△code_x=(△x*gain_x)+center_code_x;
△code_y=(△y*gain_y)+center_code_y;
△code_z=(△z*gain_z)+center_code_z;
target_Hall_x=f(△code_x,Hall_x);
target_Hall_y=f(△code_y,Hall_y);
target_Hall_z=f(△code_z,Hall_z);
wherein, (center _ code _ x, center _ code _ y, center _ code _ z) is the middle position of the full stroke of the lens, f is the fusion of the current stroke values Hall _ x, Hall _ y, Hall _ z of the current lens and the calculated compensation stroke values delta code _ x, delta code _ y, delta code _ z, and the fusion mode can be Kalman filtering or other fusion algorithms.
And issuing target _ Hall to a driving circuit driver IC, and enabling a motor VCM to push the lens to target stroke positions of target _ Hall _ x, target _ Hall _ y and target _ Hall _ z so as to complete the anti-shake compensation.
The anti-shake processing flow can be realized by repeating the operations so as to overcome the shake generated by the lens of the camera.
In this embodiment, it can be determined whether the motion blur caused by the current motion is mainly caused by the shake of the XY axis or the shake of the Z axis according to the motion speed on the XYZ axis. The motion speed on the XY axis is high, the motion speed on the Z axis is low, the motion speed mainly caused by the shaking of the XY axis is shown, a large translation anti-shaking strength value is adapted to the motion speed on the XY axis, a small rotation anti-shaking strength value is adapted to the motion speed on the Z axis, the anti-shaking strength value is enabled to be more adapted to the current motion state, a large translation compensation quantity is obtained on the X, Y axis, a small rotation compensation quantity is obtained on the Z axis, and therefore the current shaking can be accurately compensated. The motion speed on the XY axis is small, the motion speed on the Z axis is large, the motion speed is mainly caused by the shake of the Z axis, a larger translation anti-shake intensity value is adapted to the motion speed on the Z axis, a smaller rotation anti-shake intensity value is adapted to the motion speed on the X, Y axis, so that a larger rotation compensation amount is obtained on the Z axis, and a smaller translation compensation amount is obtained on the X, Y axis, and the current shake can be accurately compensated. Through the different anti-shake intensity values of shake adaptation for different reasons cause, can effectively let the motion blur restrain and reach the expectant effect, the limit problem of hitting that sensor motion compensation and sensor rotation compensation coupling brought has been alleviated to a great extent.
In one embodiment, an anti-shake processing method is provided, which is applied to an electronic device and includes:
the method comprises the steps that an ISP processor or a central processing unit of the electronic equipment determines the translational motion speed of a camera in a first motion direction and a second motion direction at the current moment, and the rotational motion speed of the camera in a third motion direction; the first, second and third directions of movement are perpendicular to each other. And taking the translational motion speed and the rotational motion speed as current motion information.
Then, an ISP processor or a central processing unit of the electronic device obtains a translation anti-shake intensity value associated with a translation movement speed in a first movement direction and a translation anti-shake intensity value associated with a translation movement speed in a second movement direction, wherein the translation movement speed is positively correlated to the translation anti-shake intensity value; and obtaining a rotation anti-shake intensity value associated with the rotation movement speed, wherein the rotation movement speed is positively correlated with the rotation anti-shake intensity value.
Further, the ISP processor or the central processing unit of the electronic device determines the filtering motion information of the current time based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the preamble time of the current time.
Then, an ISP processor or a central processing unit of the electronic equipment determines a translation compensation amount and a rotation compensation amount based on the current motion information and the filtering motion information at the current moment; acquiring a preset calibration value, and determining the translation compensation stroke of the camera based on the translation compensation amount and the preset calibration value; and determining the rotation compensation stroke of the camera based on the rotation compensation amount and a preset calibration value.
Further, an ISP processor or a central processing unit of the electronic device drives the camera to perform translational anti-shake compensation and rotational anti-shake compensation according to the current stroke position, the translational compensation stroke and the rotational compensation stroke of the camera.
When the moving speed is small, motion blur is not easily generated, and the generated shake is small. When the moving speed is large, motion blur is easily generated, that is, the generated jitter is large. Also, the degree of shake generated in the translational direction and the degree of shake generated in the rotational direction are different.
In this embodiment, the mapping relationship between the translational motion speed and the rotational anti-shake intensity value is preconfigured, and the mapping relationship between the rotational motion speed and the rotational anti-shake intensity value is preconfigured, so that the translational motion speed and the rotational anti-shake intensity value are positively correlated, and the rotational motion speed and the rotational anti-shake intensity value are positively correlated, so that when the translational motion speed is small, a small translational anti-shake intensity value is adapted, a small translational anti-shake compensation amount can be calculated, and when the translational motion speed is large, a large translational anti-shake intensity value is adapted, a large translational anti-shake compensation amount can be calculated, and the translational shake compensation can be accurately performed on the generated translational shake, so that the lens is maintained in the optimal compensation state. Meanwhile, when the rotational motion speed is low, a small rotational anti-shake intensity value is matched, small rotational anti-shake compensation quantity can be calculated, when the rotational motion speed is high, a large rotational anti-shake intensity value is matched, large rotational anti-shake compensation quantity can be calculated, targeted rotational anti-shake compensation can be accurately carried out on generated rotational shake, and the lens is kept in the optimal compensation state. And the shake generated by the lens is divided into shake in the translation direction and shake in the rotation direction, so that the translation compensation and the rotation compensation can be dynamically fused according to the real-time motion state, and the accuracy of anti-shake compensation is improved.
Based on the translation anti-shake intensity value, the rotation anti-shake intensity value, the current motion information and the filtering motion information corresponding to the preamble time, the filtering motion information of the current time can be accurately determined. Based on the current motion information and the filtering motion information at the current moment, the translation compensation amount and the rotation compensation amount required for overcoming the current jitter can be accurately calculated. The method comprises the steps of obtaining a preset calibration value, and accurately calculating the position where the camera needs to be located, namely the target stroke position, based on the translation compensation amount, the rotation compensation amount, the preset calibration value and the stroke center position of the current stroke of the camera, so that the camera can be driven to move to the target stroke position to realize compensation processing of the current shake, and the lens of the camera is kept in the optimal compensation state. Moreover, the appropriate translational anti-shake intensity and the appropriate rotational anti-shake intensity are adapted based on the current motion information, and the anti-shake compensation processing with different intensities can be performed in a targeted manner aiming at various scenes such as motion blur generated by movement and motion blur generated by rotation, so that different shake scenes can be effectively adapted.
It should be understood that although the steps in the flowcharts of fig. 2-3, 6 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 a strict order unless explicitly stated herein, and may be performed in other orders. Moreover, at least some of the steps in fig. 2-3, 6 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. 7 is a block diagram of an anti-shake processing apparatus according to an embodiment. As shown in fig. 7, the anti-shake processing apparatus 700 includes: a first determination module 702, an acquisition module 704, a second determination module 706, and a compensation module 708, wherein:
a first determining module 702, configured to determine current motion information of the camera at a current time.
An obtaining module 704, configured to obtain anti-shake intensity information corresponding to current motion information; the anti-shake intensity information includes translational anti-shake intensity information and rotational anti-shake intensity information.
A second determining module 706, configured to determine translational compensation information and rotational compensation information based on the translational anti-shake intensity information and the rotational anti-shake intensity information, and the current motion information and the filter motion information corresponding to the preamble time of the current time.
And the compensation module 708 is configured to drive the camera to perform anti-shake compensation according to the translational compensation information and the rotational compensation information.
In this embodiment, the current motion information of the camera at the current moment is determined to obtain the translational anti-shake intensity information and the rotational anti-shake intensity information corresponding to the current motion information, so that the translational anti-shake intensity information and the rotational anti-shake intensity information suitable for the current motion state of the camera can be adapted based on the current motion state. The translation compensation information and the rotation compensation information can be accurately determined based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment, so that the camera is driven to perform translation anti-shake compensation and rotation anti-shake compensation, and shake compensation generated by motion is more accurate. Moreover, the appropriate translational anti-shake intensity and the appropriate rotational anti-shake intensity are adapted based on the current motion information, and the anti-shake compensation processing with different intensities can be performed in a targeted manner aiming at various scenes such as motion blur generated by movement and motion blur generated by rotation, so that different shake scenes can be effectively adapted.
In one embodiment, the current motion information includes a translational motion speed and a rotational motion speed, the translational anti-shake intensity information includes a translational anti-shake intensity value, and the rotational anti-shake intensity information includes a rotational anti-shake intensity value; the obtaining module 704 is further configured to obtain, according to a translational movement speed of the camera in the translational direction, a translational anti-shake intensity value associated with the translational movement speed, where the translational movement speed is positively correlated with the translational anti-shake intensity value; and according to the rotating motion speed of the camera in the rotating direction, obtaining a rotating anti-shake intensity value associated with the rotating motion speed, wherein the rotating motion speed is positively associated with the rotating anti-shake intensity value, and the translation direction is vertical to the rotating direction.
In this embodiment, when the motion speed is small, motion blur is not easily generated, and jitter generated at this time is small. When the moving speed is large, motion blur is easily generated, that is, the generated jitter is large. Also, the degree of shake generated in the translational direction and the degree of shake generated in the rotational direction are different. In this embodiment, the mapping relationship between the translational motion speed and the rotational anti-shake intensity value is preconfigured, and the mapping relationship between the rotational motion speed and the rotational anti-shake intensity value is preconfigured, so that the translational motion speed and the rotational anti-shake intensity value are positively correlated, and the rotational motion speed and the rotational anti-shake intensity value are positively correlated, so that when the translational motion speed is small, a small translational anti-shake intensity value is adapted, a small translational anti-shake compensation amount can be calculated, and when the translational motion speed is large, a large translational anti-shake intensity value is adapted, a large translational anti-shake compensation amount can be calculated, and the translational shake compensation can be accurately performed on the generated translational shake, so that the lens is maintained in the optimal compensation state. Meanwhile, when the rotational motion speed is low, a small rotational anti-shake intensity value is matched, small rotational anti-shake compensation quantity can be calculated, when the rotational motion speed is high, a large rotational anti-shake intensity value is matched, large rotational anti-shake compensation quantity can be calculated, targeted rotational anti-shake compensation can be accurately carried out on generated rotational shake, and the lens is kept in the optimal compensation state. And the shake generated by the lens is divided into shake in the translation direction and shake in the rotation direction, so that the translation compensation and the rotation compensation can be dynamically fused according to the real-time motion state, and the accuracy of anti-shake compensation is improved.
In one embodiment, the apparatus further comprises a pre-processing module; the preprocessing module is used for respectively acquiring sample videos obtained by the movement of the camera in the translation direction and the rotation direction at different movement speeds; determining a translation anti-shake intensity value corresponding to each movement speed according to the ambiguity of the sample video corresponding to the translation direction and each movement speed when the sample video is collected; and determining the rotation anti-shake intensity value corresponding to each movement speed according to the ambiguity of the sample video corresponding to the rotation direction and each movement speed when the sample video is collected.
In this embodiment, sample videos obtained by moving the camera at different movement speeds in the translation direction and the rotation direction are respectively collected, so that the videos are respectively collected under the conditions of generating translation jitter and rotation jitter, and the degree of blur of the video shot under the conditions of generating translation jitter and the degree of blur of the video shot under the conditions of generating rotation jitter can be determined. And respectively adapting respective translation anti-shake intensity values for each motion speed according to the corresponding relation between the ambiguity of the sample video corresponding to the translation direction and each motion speed when the sample video is collected so as to reduce the video ambiguity caused by translation shake. And respectively adapting respective rotation anti-shake intensity values for each motion speed according to the ambiguity of the sample video corresponding to the rotation direction and each motion speed when the sample video is collected so as to reduce the ambiguity of the video caused by rotation shake. The mapping relation between different movement speeds in the translation direction and different translation anti-shake intensity values and the mapping relation between different movement speeds in the rotation direction and different rotation anti-shake intensity values are predetermined, and the efficiency of subsequent anti-shake processing is improved. And respective anti-shake intensity is set for translation direction and rotation direction, so that shake compensation of shake adaptation different intensities caused by different directions can be realized, the integration of shake compensation in two aspects is realized, and the accuracy of shake compensation is improved.
In one embodiment, the preprocessing module is further configured to divide each motion speed when the sample video is acquired according to the ambiguity of the sample video corresponding to the translation direction to obtain the motion speed at each level; determining the ambiguity of the sample video corresponding to the movement speeds of different levels, adjusting the ambiguity to a translation anti-shake intensity value when a definition condition is met, and constructing a mapping relation between the movement speeds of different levels and each translation anti-shake intensity value; dividing each movement speed when the sample video is collected according to the ambiguity of the sample video corresponding to the rotation direction to obtain the movement speed at each level; determining the ambiguity of the sample video corresponding to the motion speeds of different levels, adjusting the ambiguity to a rotation anti-shake intensity value when the ambiguity meets a definition condition, and constructing a mapping relation between the motion speeds of different levels and each rotation anti-shake intensity value.
In this embodiment, each motion speed when the sample video is acquired is divided according to the ambiguity of the sample video corresponding to the translation direction, so as to obtain a motion speed at each level, and divide the motion speeds at multiple levels in the translation direction. Determining the ambiguity of the sample video corresponding to the motion speeds of different levels, adjusting the sample video to the translation anti-shake intensity value when the ambiguity meets the definition condition, and constructing the mapping relation between the motion speeds of different levels and the translation anti-shake intensity values, thereby accurately determining the translation anti-shake intensity value when the video ambiguity caused by different translation shakes can be adjusted to the definition. According to the ambiguity of the sample video corresponding to the rotation direction, dividing and processing each movement speed when the sample video is collected to obtain the movement speed under each level, determining the ambiguity of the sample video corresponding to the movement speeds of different levels, adjusting the sample video to the rotation anti-shake intensity value when the definition condition is met, and establishing the mapping relation between the movement speeds of different levels and each rotation anti-shake intensity value, thereby accurately determining the rotation anti-shake intensity value when the video blur caused by different rotation shakes is adjusted to be clear.
In an embodiment, the second determining module 706 is further configured to determine the filtering motion information at the current time based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the preamble time of the current time; and determining translation compensation information and rotation compensation information based on the current motion information and the filtering motion information at the current moment.
In this embodiment, based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information, and the filtering motion information corresponding to the preamble time of the current time, the filtering motion information of the current time can be accurately determined, so that the anti-shake compensation information can be accurately determined according to the difference between the current motion information and the filtering motion information of the current time, and shake compensation can be realized.
In one embodiment, the second determining module 706 is further configured to determine a translational compensation amount and a rotational compensation amount based on the current motion information and the filtered motion information at the current time; acquiring a preset calibration value, and determining the translation compensation stroke of the camera based on the translation compensation amount and the preset calibration value; determining a rotation compensation stroke of the camera based on the rotation compensation amount and a preset calibration value;
the compensation module 708 is further configured to drive the camera to perform translational anti-shake compensation and rotational anti-shake compensation according to the current stroke position, the translational compensation stroke, and the rotational compensation stroke of the camera.
In this embodiment, based on the current motion information and the filtering motion information at the current time, the translational compensation amount and the rotational compensation amount required for overcoming the current shake can be accurately calculated. The method comprises the steps of obtaining a preset calibration value, accurately calculating a translation compensation stroke required for overcoming shaking based on the translation compensation amount, the preset calibration value and the stroke center position of the stroke where the camera is located at present, and accurately calculating a rotation compensation stroke required for overcoming shaking based on the rotation compensation amount, the preset calibration value and the stroke center position of the stroke where the camera is located at present, so that the camera can be driven to accurately perform anti-shaking compensation.
In one embodiment, the compensation module 708 is further configured to determine a target travel position of the camera according to the current travel position of the camera, the translational compensation information, and the rotational compensation information; and driving the camera to move to a target stroke position.
In this embodiment, according to the current stroke position, the translational compensation information, and the rotational compensation information of the camera, which position the camera should be located in to overcome the current shake, that is, the target stroke position is calculated, so that the camera can be driven to move to the target stroke position, the compensation processing on the current shake is realized, and the lens of the camera can be kept in the optimal compensation state in both the translational and rotational directions.
In an embodiment, the compensation module 708 is further configured to perform fusion processing on the current stroke position of the camera, the translational compensation information, and the rotational compensation information to obtain a target stroke position of the camera.
In this embodiment, the current stroke position of the camera, the translational compensation information, and the rotational compensation information are fused, so that which position the camera is located at can be accurately calculated to effectively overcome translational shake and rotational shake.
In an embodiment, the second determining module 706 is further configured to obtain motion information corresponding to a preamble time of the current time, and perform low-pass filtering processing on the motion information corresponding to the preamble time to obtain filtered motion information corresponding to the preamble time.
In this embodiment, the motion information corresponding to the preamble time of the current time is obtained, and the low-pass filtering processing is performed on the motion information corresponding to the preamble time, so that the smooth denoising processing can be performed on the motion information at the preamble time, short-term fluctuation is effectively eliminated, and the smooth filtered motion information corresponding to the preamble time is obtained.
The division of each module in the anti-shake processing apparatus is only for illustration, and in other embodiments, the anti-shake processing apparatus may be divided into different modules as needed to complete all or part of the functions of the anti-shake processing apparatus.
Fig. 8 is a schematic diagram of an internal structure of an electronic device in one embodiment. As shown in fig. 8, 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 an anti-shake 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 anti-shake 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 anti-shake processing method.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the anti-shake processing method.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data that are authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the relevant data need to comply with relevant laws and regulations and standards in relevant countries and regions.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive random access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is 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 application should be subject to the appended claims.

Claims (10)

1. An anti-shake processing method, comprising:
determining current motion information of the camera at the current moment;
acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
determining translation compensation information and rotation compensation information based on the translation anti-shake intensity information and the rotation anti-shake intensity information, the current motion information and the filtering motion information corresponding to the preorder moment of the current moment;
and driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
2. The method according to claim 1, wherein the current motion information comprises translational motion speed and rotational motion speed, the translational anti-shake intensity information comprises translational anti-shake intensity values, and the rotational anti-shake intensity information comprises rotational anti-shake intensity values; the obtaining of the anti-shake intensity information corresponding to the current motion information includes:
according to the translational movement speed of the camera in the translational direction, obtaining a translational anti-shake intensity value associated with the translational movement speed, wherein the translational movement speed is positively correlated with the translational anti-shake intensity value;
according to the rotating motion speed of the camera in the rotating direction, a rotating anti-shake intensity value associated with the rotating motion speed is obtained, the rotating motion speed is positively correlated with the rotating anti-shake intensity value, and the translation direction is perpendicular to the rotating direction.
3. The method of claim 1, further comprising:
respectively collecting sample videos obtained by the camera moving in the translation direction and the rotation direction at different movement speeds;
determining a translation anti-shake intensity value corresponding to each motion speed according to the ambiguity of the sample video corresponding to the translation direction and each motion speed when the sample video is collected;
and determining a rotation anti-shake intensity value corresponding to each motion speed according to the ambiguity of the sample video corresponding to the rotation direction and each motion speed when the sample video is collected.
4. The method according to claim 3, wherein determining the translational anti-shake intensity value corresponding to each of the motion speeds according to the ambiguity of the sample video corresponding to the translational direction and each of the motion speeds when the sample video is collected comprises
Dividing each movement speed when the sample video is collected according to the ambiguity of the sample video corresponding to the translation direction to obtain the movement speed at each level;
determining the ambiguity of the sample video corresponding to the movement speeds of different levels, adjusting the ambiguity to a translation anti-shake intensity value when a definition condition is met, and constructing a mapping relation between the movement speeds of different levels and each translation anti-shake intensity value;
determining a rotation anti-shake intensity value corresponding to each motion speed according to the ambiguity of the sample video corresponding to the rotation direction and each motion speed when the sample video is collected, comprising:
dividing each movement speed when the sample video is collected according to the ambiguity of the sample video corresponding to the rotation direction to obtain the movement speed at each level;
determining the ambiguity of the sample video corresponding to the motion speeds of different levels, adjusting the ambiguity to a rotation anti-shake intensity value when the ambiguity meets a definition condition, and constructing a mapping relation between the motion speeds of different levels and each rotation anti-shake intensity value.
5. The method according to claim 1, wherein the determining translational compensation information and rotational compensation information based on the translational anti-shake strength information and the rotational anti-shake strength information, the current motion information, and the filtered motion information corresponding to the preceding time of the current time comprises:
determining filtering motion information of the current moment based on the translation anti-shake intensity information, the rotation anti-shake intensity information, the current motion information and filtering motion information corresponding to a preorder moment of the current moment;
and determining translation compensation information and rotation compensation information based on the current motion information and the filtering motion information of the current moment.
6. The method of claim 5, wherein the translational compensation information includes a translational compensation amount and a translational compensation stroke, and the rotational compensation information includes a rotational compensation amount and a rotational compensation stroke; the determining translational compensation information and rotational compensation information based on the current motion information and the filtered motion information at the current time comprises:
determining a translational compensation amount and a rotational compensation amount based on the current motion information and the filtering motion information of the current moment;
acquiring a preset calibration value, and determining the translation compensation stroke of the camera based on the translation compensation amount and the preset calibration value;
determining a rotation compensation stroke of the camera based on the rotation compensation amount and the preset calibration value;
the driving the camera to perform anti-shake compensation according to the translational compensation information and the rotational compensation information includes:
and driving the camera to perform translation anti-shake compensation and rotation anti-shake compensation according to the current stroke position of the camera, the translation compensation stroke and the rotation compensation stroke.
7. An anti-shake processing apparatus, comprising:
the first determining module is used for determining the current motion information of the camera at the current moment;
the acquisition module is used for acquiring anti-shake intensity information corresponding to the current motion information; the anti-shake intensity information comprises translation anti-shake intensity information and rotation anti-shake intensity information;
a second determining module, configured to determine translational compensation information and rotational compensation information based on the translational anti-shake intensity information and the rotational anti-shake intensity information, and the current motion information and the filtered motion information corresponding to the preorder time of the current time;
and the compensation module is used for driving the camera to perform anti-shake compensation according to the translation compensation information and the rotation compensation information.
8. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the steps of the method according to any of claims 1 to 6.
9. 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 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202210627303.0A 2022-06-06 2022-06-06 Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium Pending CN115103108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210627303.0A CN115103108A (en) 2022-06-06 2022-06-06 Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210627303.0A CN115103108A (en) 2022-06-06 2022-06-06 Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN115103108A true CN115103108A (en) 2022-09-23

Family

ID=83288461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210627303.0A Pending CN115103108A (en) 2022-06-06 2022-06-06 Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN115103108A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200404178A1 (en) * 2018-03-23 2020-12-24 Huawei Technologies Co., Ltd. Video image anti-shake method and terminal
CN113542612A (en) * 2021-09-17 2021-10-22 深圳思谋信息科技有限公司 Lens anti-shake method and device, computer equipment and storage medium
CN114338994A (en) * 2021-12-30 2022-04-12 Oppo广东移动通信有限公司 Optical anti-shake method, optical anti-shake apparatus, electronic device, and computer-readable storage medium
CN114449173A (en) * 2022-02-25 2022-05-06 Oppo广东移动通信有限公司 Optical anti-shake control method, device, storage medium and electronic equipment
CN114531546A (en) * 2022-02-23 2022-05-24 Oppo广东移动通信有限公司 Lens adjusting method and device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200404178A1 (en) * 2018-03-23 2020-12-24 Huawei Technologies Co., Ltd. Video image anti-shake method and terminal
CN113542612A (en) * 2021-09-17 2021-10-22 深圳思谋信息科技有限公司 Lens anti-shake method and device, computer equipment and storage medium
CN114338994A (en) * 2021-12-30 2022-04-12 Oppo广东移动通信有限公司 Optical anti-shake method, optical anti-shake apparatus, electronic device, and computer-readable storage medium
CN114531546A (en) * 2022-02-23 2022-05-24 Oppo广东移动通信有限公司 Lens adjusting method and device, storage medium and electronic equipment
CN114449173A (en) * 2022-02-25 2022-05-06 Oppo广东移动通信有限公司 Optical anti-shake control method, device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109194876B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111147741B (en) Focusing processing-based anti-shake method and device, electronic equipment and storage medium
CN111246089B (en) Jitter compensation method and apparatus, electronic device, computer-readable storage medium
CN110536057B (en) Image processing method and device, electronic equipment and computer readable storage medium
US8229172B2 (en) Algorithms for estimating precise and relative object distances in a scene
WO2020259474A1 (en) Focus tracking method and apparatus, terminal device, and computer-readable storage medium
JP2020528700A (en) Methods and mobile terminals for image processing using dual cameras
JP2019510234A (en) Depth information acquisition method and apparatus, and image acquisition device
CN107615744B (en) Image shooting parameter determining method and camera device
CN113875219B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109598764B (en) Camera calibration method and device, electronic equipment and computer-readable storage medium
CN109660718B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109963080B (en) Image acquisition method and device, electronic equipment and computer storage medium
CN114586337A (en) Video anti-shake optimization processing method and device and electronic equipment
CN111432118A (en) Image anti-shake processing method and device, electronic equipment and storage medium
CN114338994A (en) Optical anti-shake method, optical anti-shake apparatus, electronic device, and computer-readable storage medium
CN110351508B (en) Anti-shake processing method and device based on video recording mode and electronic equipment
CN109671028B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110930440B (en) Image alignment method, device, storage medium and electronic equipment
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
US20220174217A1 (en) Image processing method and device, electronic device, and computer-readable storage medium
CN109685854A (en) Camera calibration method and device, electronic equipment, computer readable storage medium
CN115103108A (en) Anti-shake processing method, anti-shake processing device, electronic equipment and computer-readable storage medium
CN116437207A (en) Optical anti-shake method and apparatus, electronic device, 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