CN111372000B - Video anti-shake method and apparatus, electronic device, and computer-readable storage medium - Google Patents

Video anti-shake method and apparatus, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
CN111372000B
CN111372000B CN202010186990.8A CN202010186990A CN111372000B CN 111372000 B CN111372000 B CN 111372000B CN 202010186990 A CN202010186990 A CN 202010186990A CN 111372000 B CN111372000 B CN 111372000B
Authority
CN
China
Prior art keywords
information
shake
video
processed
fuzzy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010186990.8A
Other languages
Chinese (zh)
Other versions
CN111372000A (en
Inventor
戴朋飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010186990.8A priority Critical patent/CN111372000B/en
Publication of CN111372000A publication Critical patent/CN111372000A/en
Application granted granted Critical
Publication of CN111372000B publication Critical patent/CN111372000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/681Motion detection
    • H04N23/6811Motion detection based on the image signal

Abstract

The application relates to a video anti-shake method, which comprises the following steps: acquiring first fuzzy information of an image frame of a video to be processed, wherein the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed; determining anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed; determining anti-shake parameters of the video to be processed according to the anti-shake information; and carrying out anti-shake processing on the video to be processed according to the anti-shake parameters. The application also discloses a video anti-shake device, an electronic device and a computer readable storage medium. The method and the device reduce the influence of motion blur on the video and improve the shooting quality of the video.

Description

Video anti-shake method and apparatus, electronic device, and computer-readable storage medium
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a video anti-shake method and apparatus, an electronic device, and a computer-readable storage medium.
Background
In recent years, with the rapid development of electronic device technologies, many electronic devices support video shooting, and the shooting quality of videos becomes one of important indexes for evaluating the electronic devices. There are many factors that affect the shooting quality of video, such as resolution, saturation, sharpness, and the like, where image sharpness is an important factor.
When a photographic subject moves or the electronic device shakes during the exposure time of the electronic device, motion blur in the video may be caused. Motion blur is a common phenomenon generated when an electronic device is used for shooting, and is specifically represented as blur, diffusion or smear when a shooting object is imaged. The reasons for the formation of motion blur are: due to the movement of the shooting object or the shake of the electronic equipment, the imaging position of the shooting object on the sensor changes, and a fuzzy effect is formed. Motion blur affects the sharpness of the video and thus the quality of the video shot.
Disclosure of Invention
The embodiment of the application provides a video anti-shake method, a video anti-shake device, an electronic device and a computer-readable storage medium, which can reduce the influence of motion blur on a video and improve the shooting quality of the video.
A video anti-shake method comprising:
acquiring first fuzzy information of an image frame of a video to be processed, wherein the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed;
determining anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed;
determining anti-shake parameters of the video to be processed according to the anti-shake information;
and carrying out anti-shake processing on the video to be processed according to the anti-shake parameters.
A video anti-shake apparatus comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring first fuzzy information of an image frame of a video to be processed, and the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed;
the determining module is used for determining anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed;
the determining module is further configured to determine anti-shake parameters of the video to be processed according to the anti-shake information;
and the processing module is used for carrying out anti-shake processing on the video to be processed according to the anti-shake parameters.
An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to perform any of the steps of the video anti-shake method.
A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of any of the video anti-shake methods.
According to the video anti-shake method, the video anti-shake device, the electronic equipment and the computer readable storage medium, the first fuzzy information of the image frame of the video to be processed is obtained and used for representing the fuzzy degree of the image frame of the video to be processed, the anti-shake information is determined according to the first fuzzy information of the image frame of the video to be processed and used for representing the anti-shake degree of the video to be processed, the anti-shake parameter of the video to be processed is determined according to the anti-shake information, and the anti-shake processing is carried out on the video to be processed according to the anti-shake parameter.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow diagram of a video anti-shake method in one embodiment;
FIG. 2 is a flow diagram illustrating a refinement of obtaining first fuzzy information in one embodiment;
FIG. 3 is a flowchart illustrating a refinement of the determination of anti-shaking information in one embodiment;
FIG. 4 is a flowchart of a video anti-shake method in another embodiment;
FIG. 5 is a flow chart illustrating a detailed process of obtaining jitter information according to an embodiment;
FIG. 6 is a flowchart illustrating a refinement of determining anti-shaking information in another embodiment;
FIG. 7 is a flowchart illustrating a video anti-shake method according to another embodiment;
FIG. 8 is a block diagram of an embodiment of a video anti-shake apparatus;
fig. 9 is a block diagram showing an internal configuration of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The electronic device in the embodiment of the present application may be a mobile terminal, such as a mobile phone, a camera, a video camera, a tablet computer, a notebook computer, a wearable device, and the like. The electronic device is provided with a camera for taking videos, photographs and the like. Specifically, the electronic device obtains first blurring information of an image frame of a video to be processed, wherein the first blurring information is used for representing a blurring degree of the image frame of the video to be processed. Then, the electronic equipment determines anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed. And then, the electronic equipment determines the anti-shake parameters of the video to be processed according to the anti-shake information. And then, the electronic equipment performs anti-shake processing on the video to be processed according to the anti-shake parameters.
Fig. 1 is a flowchart of a video anti-shake method according to an embodiment. The video anti-shake method shown in fig. 1 can be applied to the electronic device, and includes:
step 102, acquiring first fuzzy information of an image frame of a video to be processed, wherein the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed.
The video to be processed refers to a video to be subjected to anti-shake processing, and optionally, the video to be processed may be a video currently being shot by the electronic device. The image frame is the minimum unit of the composed video, and the image frame of the to-be-processed video is used for representing each frame image of the to-be-processed video.
The first blurring information is used for representing the blurring degree of the image frame of the video to be processed. The blurring degree of the image frame refers to a degree of reverse deviation of the sharpness of the image frame from a preset sharpness. The definition refers to the definition of each detail shadow and its boundary in the image frame. The method comprises the steps of taking a preset definition as a standard definition, judging that an image frame is clear when the definition of the image frame is higher than or equal to the preset definition, and judging that the image frame is fuzzy when the definition of the image frame is lower than the preset definition.
In one embodiment, the first obfuscation may be sharpness. In another embodiment, the first blur information may be a blur level, e.g., the blur level is higher and higher as the sharpness of the image frame is lower and lower.
In one embodiment, the sharpness of any one of the image frames of the video to be processed may be obtained, and the first blur information may be determined according to the sharpness of the any one frame. In another embodiment, the sharpness of any several frames in the image frames of the video to be processed may be obtained, and the first blur information may be determined according to an average value of the sharpness of the any several frames. The arbitrary frames can be any frames in the image frames of the video to be processed within the preset time period.
In one embodiment, the first blur information of the image frame of the video to be processed may be acquired by an image sharpness detection method. The image definition detection method can be as follows: brenner gradient function, Laplacian gradient function, variance function, energy gradient function, etc. The Brenner gradient function determines the sharpness of an image frame by computing the square of the difference between the gray levels of two adjacent pixels. And calculating the convolution of the Laplacian operator at each pixel point by the Laplacian gradient function, and accumulating pixel by pixel to determine the definition of the image frame. The variance function determines the definition of the image frame through the average gray value of all the pixel points. The energy gradient function determines the definition of the image frame through the gray value of each pixel point.
And 104, determining anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed.
The anti-shake information is used for representing the anti-shake degree of the video to be processed. Alternatively, the anti-shake information may be an anti-shake level, such as anti-shake level one, anti-shake level two, anti-shake level three, and the like. The relation between anti-shake grade and the anti-shake degree can set up according to practical application, for example, anti-shake grade is higher, and the anti-shake degree is higher, or the anti-shake grade is higher, and the anti-shake degree is lower etc.
In particular, when a user watches a video, the user's perception of the blur of the video is related to the jitter of the video. For example, in a jittered video, the user often does not easily perceive the blurred representation of the video, while in a stable video, the blurred representation of the video is easily perceived by the user. Further, the user's perception of the blurred representation of the video is different at different degrees of judder. Therefore, the degree of the video jitter is adjusted according to the degree of the video blur, and the video blur expression can be suppressed at the user perception layer.
In one embodiment, the first blur information is inversely proportional to the anti-shake information. Namely, the higher the blurring degree of the image frame of the video to be processed is, the lower the anti-shake degree of the video to be processed is.
In one embodiment, before determining the anti-shake information according to the first blur information of the image frame of the video to be processed, the method further comprises: detecting whether first fuzzy information of an image frame of a video to be processed meets an adjusting condition, and when the first fuzzy information of the image frame of the video to be processed meets the adjusting condition, executing a step of determining anti-shake information according to the first fuzzy information of the image frame of the video to be processed. The adjusting condition is used for detecting whether the definition of the image frame of the video to be processed is lower than the preset definition or not, when the definition of the image frame of the video to be processed is lower than the preset definition, the first fuzzy information of the image frame of the video to be processed is judged to meet the adjusting condition, and anti-shake information is determined according to the first fuzzy information of the image frame of the video to be processed; when the definition of the image frame of the video to be processed is higher than or equal to the predetermined definition, the anti-shake processing of the video to be processed may not be affected by the first blur information. The predetermined resolution may be set according to practical applications, and may be lower than the predetermined resolution.
And 106, determining the anti-shake parameters of the video to be processed according to the anti-shake information.
The anti-shake parameters are used for anti-shake processing of the video to be processed. The anti-shake parameter may be any parameter applied in the process of performing anti-shake processing on the video to be processed.
In one embodiment, a mapping relationship between the anti-shake information and the anti-shake parameters may be preset, and the anti-shake parameters may be determined according to the anti-shake information and the mapping relationship. It can be understood that the mapping relationship between the anti-shake information and the anti-shake parameters is obtained through a large number of experiments, and the mapping relationship can enable the blurring performance of the image frames of the video to be within a reasonable range.
And 108, performing anti-shake processing on the video to be processed according to the anti-shake parameters.
In one embodiment, the anti-shake process may be an EIS (electrical Image stabilization) electronic anti-shake process, an OIS (optical Image stabilization) optical anti-shake process, or a combination of an EIS electronic anti-shake process and an OIS optical anti-shake process. The EIS electronic anti-shake is to use the shake degree of the shooting terminal to dynamically adjust the sensitivity, shutter or software to perform blur correction. The OIS optical anti-shake is to avoid or reduce the shake phenomenon of the shooting terminal occurring in the process of capturing an optical signal through the arrangement of optical components, such as a lens, in the shooting terminal.
Specifically, the basic principle of the anti-shake process is to transform each frame image from an imaging plane projection corresponding to the actual camera pose to an imaging plane projection corresponding to the corresponding virtual smooth camera pose. The camera attitude refers to the camera attitude, and the camera attitude change can be obtained through data generated by the gyroscope. The camera pose change in a period of time can form a camera pose path, if the video is a stable video, the actual camera pose path of the video presents a smooth curve, and if the video is a jittering video, the actual camera pose path of the video presents a jittering curve. And smoothing the actual camera attitude path of the jittered video to obtain a virtual smooth camera attitude path, namely completing the anti-shake processing.
In the video anti-shake method in this embodiment, first blur information of an image frame of a video to be processed is obtained, the first blur information is used to represent a blur degree of the image frame of the video to be processed, anti-shake information is determined according to the first blur information of the image frame of the video to be processed, the anti-shake information is used to represent an anti-shake degree of the video to be processed, an anti-shake parameter of the video to be processed is determined according to the anti-shake information, and the video to be processed is subjected to anti-shake processing according to the anti-shake parameter, so that an influence of motion blur on the video is reduced, the video shooting quality is improved, the shake degree of the video is adjusted according to the blur degree of the video, and the video stability is achieved on a user perception level.
In one embodiment, as shown in fig. 2, the acquiring first blur information of image frames of the video to be processed includes:
step 202, acquiring second fuzzy information and third fuzzy information of an image frame of the video to be processed, wherein the second fuzzy information is fuzzy information generated by the motion of a shooting object, and the third fuzzy information is fuzzy information generated by the motion of a shooting terminal.
Wherein the second blur information is blur information generated by a motion of a photographic subject, the photographic subject refers to a subject to be photographed, and the motion of the photographic subject refers to a state that the subject to be photographed is not in a still state during photographing. The third fuzzy information is fuzzy information generated by the motion of the shooting terminal, the shooting terminal can be an electronic device for shooting, and the motion of the shooting terminal means that the electronic device for shooting is not in a static state during shooting.
In one embodiment, the second blur information and the third blur information may be sharpness. In another embodiment, the second blur information and the third blur information may be blur levels, for example, the blur levels may be higher as the sharpness of the image frame is lower.
In one embodiment, the manner of acquiring the second blur information and the third blur information of the image frames of the video to be processed may be: and respectively acquiring the second fuzzy information and the third fuzzy information according to the characteristic information of the second fuzzy information and the characteristic information of the third fuzzy information. The characteristic information of the second fuzzy information refers to that the shooting object moves, but the background where the shooting object is located is in a static state; the feature information of the third blur information means that both the photographic subject and the background where the photographic subject is located are in a moving state.
Step 204, determining the first fuzzy information according to the second fuzzy information and the third fuzzy information.
In one embodiment, the first obfuscation may include a second obfuscation and a third obfuscation.
In one embodiment, a mapping relationship between the second fuzzy information, the third fuzzy information and the anti-shake information may be preset, and the anti-shake information may be determined according to the second fuzzy information, the third fuzzy information and the mapping relationship.
In the video anti-shake method in this embodiment, second blur information and third blur information of an image frame of a video to be processed are obtained, the second blur information is blur information generated by motion of a shooting object, the third blur information is blur information generated by motion of a shooting terminal, and the first blur information is determined according to the second blur information and the third blur information, so that the first blur information is refined into the second blur information and the third blur information, and the anti-shake information is determined more accurately.
In one embodiment, as shown in fig. 3, the determining anti-shake information according to first blur information of image frames of the video to be processed includes:
step 302, obtaining a first mapping relation between the first fuzzy information and the anti-shake information, which are stored in advance.
The first mapping relation is used for representing the mapping relation between the first fuzzy information and the anti-shake information.
Step 304, determining the anti-shake information according to the first fuzzy information and the first mapping relation.
Specifically, a mapping relation between the first fuzzy information and the anti-shake information is preset, and the anti-shake information is determined according to the first fuzzy information and the mapping relation. It can be understood that the mapping relationship between the first fuzzy information and the anti-shake information is obtained through a large number of experiments. Specifically, the first blur information may be a sharpness (the higher the sharpness is, the lower the blur degree is), or the first blur information may be a blur level (a relationship between the blur level and the blur degree may be set according to an actual application, such as the higher the blur level is, the higher the blur degree is); the anti-shake information may be an anti-shake level (a relationship between the anti-shake level and the anti-shake degree may be set according to actual applications, for example, the higher the anti-shake level is, the higher the anti-shake degree is). The mapping relationship between the first fuzzy information and the anti-shake information may be a mapping relationship between definition and anti-shake level, or a mapping relationship between fuzzy level and anti-shake level. And the mapping relation between the first fuzzy information and the anti-shake information is used for representing the relation between the fuzzy degree and the anti-shake degree. In one embodiment, the first blur information is inversely proportional to the anti-shake information, i.e., the higher the blur degree of the image frames of the video to be processed, the lower the anti-shake degree of the video to be processed. In the video anti-shake method in this embodiment, a first mapping relationship between pre-stored first blur information and anti-shake information is obtained, the anti-shake information is determined according to the first blur information and the first mapping relationship, and the shake degree of the video is adjusted according to the blur degree of the video, so that the blur performance of the video is suppressed on a user perception layer.
In one embodiment, before determining the anti-shake information according to the first blur information of the image frame of the video to be processed, the method further comprises: and acquiring jitter information of the image frame of the video to be processed, wherein the jitter information is used for representing the jitter degree of the video to be processed.
The jitter information is used for representing the jitter degree of the video to be processed. The degree of shake of the video to be processed refers to the degree of deviation of the shake state of the video to be processed from the still state.
In one embodiment, the jitter information may be a jitter level, for example, a jitter level that increases as the jitter state of the video becomes more severe.
In one embodiment, the jitter information of the video to be processed within a predetermined time may be obtained. The predetermined time may be set according to practical applications, such as a unit time.
In one embodiment, determining anti-shake information from first blur information of image frames of a video to be processed includes: and determining anti-shake information according to the first fuzzy information and the shake information. Specifically, the first blur information and the shake information may reflect blur expression visually perceived by a user, and more accurate determination of the anti-shake information may be achieved according to the first blur information and the shake information. That is, the blur representation visually perceived by the user may be a function constructed by the first blur information and the shaking information, assuming that the blur representation visually perceived by the user is B1The first fuzzy information is B2The jitter information is Y, then B1=f1(B2,Y)。
In the video anti-shake method in this embodiment, shake information of an image frame of a video to be processed is obtained, the shake information is used to represent a shake degree of the video to be processed, and the anti-shake information is determined according to the first blur information and the shake information, so that the shake degree of the video is adjusted according to the blur degree and an actual shake degree of the video, and the stability of the video is realized on a user perception level.
In one embodiment, as shown in fig. 4, the acquiring jitter information of the image frame of the video to be processed includes:
step 402, acquiring a jitter parameter of an image frame of the video to be processed, wherein the jitter parameter includes at least one of a jitter frequency and a jitter amplitude.
Wherein the jitter parameter comprises at least one of a jitter frequency and a jitter amplitude. The jitter frequency and the jitter amplitude can be detected by a gyroscope.
Step 404, determining the jitter information according to the jitter parameter.
In one embodiment, an average amplitude of the video jitter over a predetermined time, an average frequency of the video jitter over the predetermined time, and the jitter information may be determined based on the average amplitude of the video jitter over the predetermined time and the average frequency.
In the video anti-shake method in this embodiment, shake parameters of image frames of a video to be processed are obtained, the shake parameters include at least one of shake frequency and shake amplitude, and shake information is determined according to the shake parameters, so that accurate determination of the shake information is achieved.
In one embodiment, as shown in fig. 5, the determining the jitter information according to the jitter parameter includes:
step 502, obtaining a second mapping relationship between the pre-stored jitter parameter and the jitter information.
And the second mapping relation is used for representing the mapping relation between the jitter parameter and the jitter information. Specifically, the jitter parameter includes at least one of jitter frequency and jitter amplitude, and the jitter information may be video jitter within a predetermined timeAnd constructing a function of the average amplitude and the average amplitude of the video jitter in the preset time, wherein if the jitter information is Y, the average amplitude of the video jitter in the preset time is A, and the average amplitude of the video jitter in the preset time is F, Y is F2(A, F). Wherein the predetermined time may be 1-10 seconds, etc., and the function may be a linear function, etc. Step 504, determining the jitter information according to the jitter parameter and the second mapping relationship.
Specifically, a mapping relationship between the jitter parameter and the jitter information is preset, and the jitter information is determined according to the jitter parameter and the mapping relationship. It can be understood that the mapping relationship between the jitter parameters and the jitter information is obtained through a great deal of experiments.
In the video anti-shake method in this embodiment, the second mapping relationship between the pre-stored shake parameter and the shake information is obtained, and the shake information is determined according to the shake parameter and the second mapping relationship, so that the shake information is accurately determined. In one embodiment, as shown in fig. 6, the determining the anti-shake information according to the first blur information and the shake information includes:
step 602, obtaining a third mapping relationship between the first fuzzy information, the jitter information and the anti-jitter information, which are stored in advance.
And the third mapping relation is used for representing the mapping relation among the first fuzzy information, the jitter information and the anti-jitter information. The first fuzzy information can be definition (the higher the definition is, the lower the fuzzy degree is), or the first fuzzy information can be fuzzy grade (the relation between the fuzzy grade and the fuzzy degree can be set according to practical application, for example, the higher the fuzzy grade is, the higher the fuzzy degree is); the jitter information may be a jitter level (e.g., the more severe the jitter status of the video, the higher the jitter level); the anti-shake information may be an anti-shake level (a relationship between the anti-shake level and the anti-shake degree may be set according to actual applications, for example, the higher the anti-shake level is, the higher the anti-shake degree is). The mapping relationship between the first fuzzy information, the jitter information and the anti-jitter information may be a mapping relationship between a definition, an anti-jitter level and an anti-jitter level, or a mapping relationship between a fuzzy level, an anti-jitter level and an anti-jitter level.
In one embodiment, the higher the blurring degree of the image frame of the video to be processed is, the higher the shaking degree is, and the lower the anti-shaking degree of the video to be processed is; the higher the fuzzy degree of the image frame of the video to be processed is, the lower the jitter degree is, and the lower the anti-jitter degree of the video to be processed is; the lower the fuzzy degree of the image frame of the video to be processed is, the higher the jitter degree is, and the higher the anti-jitter degree of the video to be processed is; the lower the blurring degree of the image frame of the video to be processed is, the lower the shaking degree is, and the higher the anti-shaking degree of the video to be processed is.
Step 604, determining the anti-shake information according to the first fuzzy information, the shake information and the third mapping relation.
Specifically, a mapping relation between the first fuzzy information and the jitter information and the anti-shake information is preset, and the anti-shake information is determined according to the first fuzzy information and the jitter information and the mapping relation. It can be understood that the mapping relationship between the first blur information, the shake information and the anti-shake information, which can make the blur performance of the image frames of the video within a reasonable range, is obtained through a large number of experiments.
In the video anti-shake method in this embodiment, the first pre-stored blur information, the third mapping relationship between the shake information and the anti-shake information are obtained, and the anti-shake information is determined according to the first blur information, the shake information and the third mapping relationship, so that the shake degree of the video is adjusted according to the blur degree and the actual shake degree of the video, and the stability of the video is realized on the user perception level.
In an embodiment, as shown in fig. 7, the performing anti-shake processing on the video to be processed according to the anti-shake parameters includes:
step 702, a camera internal reference matrix is obtained.
The camera internal parameters are used as key parameters to participate in anti-shake calculation, and the camera internal parameters comprise camera optical center parameters.
Step 704, performing projection transformation on the image frame according to the camera internal parameter matrix and the anti-shake parameters to perform anti-shake processing on the video to be processed.
The anti-shake parameter may be a rotation matrix.
Specifically, for EIS electronic anti-shake, the euler angles are first converted into quaternions; then, smoothing is carried out, and the result of the smoothing is to output the conversion quaternion from the actual camera posture to the virtual camera posture of each frame; then, converting the quaternion into a rotation matrix to describe the transformation of each image frame; then, generating a transformation matrix by combining the rotation matrix and the camera internal reference matrix, wherein the transformation matrix is used for carrying out projection transformation on the image frame; and finally, carrying out projection transformation on the image frame through the transformation matrix so as to realize anti-shake of the image frame of the video.
The video anti-shake method in the embodiment obtains the camera internal parameter matrix, performs projection transformation on the image frame according to the camera internal parameter matrix and the anti-shake parameters to perform anti-shake processing on the video to be processed, and thus performs anti-shake processing on the video according to EIS electronic anti-shake processing, reduces the influence of motion blur on the video, improves the video shooting quality, adjusts the shake degree of the video according to the shake degree of the video, and realizes the video stability on the user perception level.
In a specific embodiment, a video anti-shake method includes:
firstly, acquiring first fuzzy information of an image frame of a video to be processed, wherein the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed;
then, acquiring the average amplitude of video jitter in unit time and the average frequency of the video jitter in unit time, and determining jitter information according to the average amplitude and the average frequency of the video jitter in unit time;
further, acquiring first fuzzy information stored in advance, and a mapping relation between jitter information and anti-jitter information, and determining the anti-jitter information according to the first fuzzy information, the jitter information and the mapping relation, wherein the anti-jitter information is used for representing the anti-jitter degree of the video to be processed, and the first fuzzy information is inversely proportional to the anti-jitter information;
then, acquiring a mapping relation between prestored anti-shake information and anti-shake parameters, and determining the anti-shake parameters according to the anti-shake information and the mapping relation;
and further, acquiring a camera internal parameter matrix, and performing projection transformation on the image frame according to the camera internal parameter matrix and the anti-shake parameters so as to perform anti-shake processing on the video to be processed.
The video anti-shake method in the embodiment performs anti-shake processing on the video according to EIS electronic anti-shake, reduces the influence of motion blur on the video, improves the video shooting quality, adjusts the shake degree of the video according to the blur degree of the video, and realizes video stability on the user perception level.
It should be understood that although the various steps in the flow charts of fig. 1-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-7 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
Fig. 8 is a block diagram of a video anti-shake apparatus 800 according to an embodiment. As shown in fig. 8, a video anti-shake apparatus 800 includes: an acquisition module 802, a determination module 804, and a processing module 806. Wherein:
an obtaining module 802, configured to obtain first blur information of an image frame of a video to be processed, where the first blur information is used to represent a blur degree of the image frame of the video to be processed;
a determining module 804, configured to determine anti-shake information according to first blur information of an image frame of the video to be processed, where the anti-shake information is used to represent an anti-shake degree of the video to be processed, and the first blur information is inversely proportional to the anti-shake information;
the determining module 804 is further configured to determine an anti-shake parameter of the video to be processed according to the anti-shake information;
and a processing module 806, configured to perform anti-shake processing on the video to be processed according to the anti-shake parameter.
The video anti-shake device 800 in this implementation acquires first blur information of an image frame of a video to be processed, the first blur information is used for representing a blur degree of the image frame of the video to be processed, anti-shake information is determined according to the first blur information of the image frame of the video to be processed, the anti-shake information is used for representing an anti-shake degree of the video to be processed, anti-shake parameters of the video to be processed are determined according to the anti-shake information, and anti-shake processing is performed on the video to be processed according to the anti-shake parameters, so that the influence of motion blur on the video is reduced, the video shooting quality is improved, the shake degree of the video is adjusted according to the blur degree of the video, and the video stability is realized on a user perception level.
In one embodiment, the obtaining module 802 is further configured to: acquiring second fuzzy information and third fuzzy information of an image frame of the video to be processed, wherein the second fuzzy information is fuzzy information generated by the motion of a shooting object, the third fuzzy information is fuzzy information generated by the motion of a shooting terminal, and the first fuzzy information is determined according to the second fuzzy information and the third fuzzy information.
The video anti-shake apparatus 800 in this embodiment acquires second blur information and third blur information of an image frame of a video to be processed, the second blur information being blur information generated by movement of a photographic subject, the third blur information being blur information generated by movement of a photographic terminal, and determines the first blur information according to the second blur information and the third blur information, so that the first blur information is refined into the second blur information and the third blur information, thereby realizing more accurate determination of the anti-shake information.
In one embodiment, the determining module 804 is further configured to: acquiring a first mapping relation between the first fuzzy information and the anti-shake information which are stored in advance, and determining the anti-shake information according to the first fuzzy information and the first mapping relation.
In this embodiment, the video anti-shake apparatus 800 obtains a first mapping relationship between pre-stored first blur information and anti-shake information, determines the anti-shake information according to the first blur information and the first mapping relationship, and adjusts the shake degree of the video according to the blur degree of the video, so that the blur performance of the video is suppressed on the user perception layer.
In one embodiment, the obtaining module 802 is further configured to: acquiring jitter information of an image frame of the video to be processed, wherein the jitter information is used for representing the jitter degree of the video to be processed; the determining module 804 is further configured to: and determining the anti-shake information according to the first fuzzy information and the shake information.
In this embodiment, the video anti-shake apparatus 800 obtains shake information of an image frame of a video to be processed, where the shake information is used to represent a shake degree of the video to be processed, and determines the anti-shake information according to the first blur information and the shake information, so that the shake degree of the video is adjusted according to the blur degree of the video and an actual shake degree, and video stability is achieved on a user perception level.
In one embodiment, the obtaining module 802 is further configured to: and acquiring jitter parameters of the image frame of the video to be processed, wherein the jitter parameters comprise at least one of jitter frequency and jitter amplitude, and determining the jitter information according to the jitter parameters.
In the present embodiment, the video anti-shake apparatus 800 obtains shake parameters of image frames of a video to be processed, where the shake parameters include at least one of shake frequency and shake amplitude, and determines shake information according to the shake parameters, thereby accurately determining the shake information.
In one embodiment, the obtaining module 802 is further configured to: and acquiring a second mapping relation between the pre-stored jitter parameter and the jitter information, and determining the jitter information according to the jitter parameter and the second mapping relation.
In this embodiment, the video anti-shake apparatus 800 obtains a second mapping relationship between the pre-stored shake parameter and the shake information, and determines the shake information according to the shake parameter and the second mapping relationship, thereby accurately determining the shake information.
In one embodiment, the obtaining module 802 is further configured to: and acquiring prestored first fuzzy information, a third mapping relation between the jitter information and the anti-jitter information, and determining the anti-jitter information according to the first fuzzy information, the jitter information and the third mapping relation.
In this embodiment, the video anti-shake apparatus 800 obtains the first blur information, the third mapping relationship between the shake information and the anti-shake information, and determines the anti-shake information according to the first blur information, the shake information and the third mapping relationship, so that the shake degree of the video is adjusted according to the blur degree and the actual shake degree of the video, and the stability of the video is achieved in the user perception level.
In one embodiment, the processing module 806 is further configured to: and acquiring a camera internal parameter matrix, and performing projection transformation on the image frame according to the camera internal parameter matrix and the anti-shake parameters so as to perform anti-shake processing on the video to be processed.
Video anti-shake device 800 in this implementation acquires camera internal reference matrix, carries out projection transformation to image frame according to camera internal reference matrix and anti-shake parameter to the video of treating processing carries out anti-shake and handles, and like this, carries out anti-shake according to EIS electronic anti-shake and handles to the video, has reduced motion blur to the video influence, has improved video shooting quality, adjusts video shake degree according to video blur degree moreover, has realized video stability on user's perception aspect.
For specific definition of the video anti-shake apparatus, reference may be made to the above definition of the video anti-shake method, which is not described herein again. The modules in the video anti-shake apparatus can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 9 is a schematic diagram of an internal structure of an electronic device in one embodiment. As shown in fig. 9, the electronic device includes a processor and a memory connected by a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by a processor for implementing a video anti-shake method provided by the above 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 video anti-shake 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 video anti-shake method.
A computer program product containing instructions which, when run on a computer, cause the computer to perform a video anti-shake method.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. A video anti-shake method, comprising:
acquiring first fuzzy information of an image frame of a video to be processed, wherein the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed;
determining anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed; the first fuzzy information is inversely proportional to the anti-shake information;
determining anti-shake parameters of the video to be processed according to the anti-shake information;
and carrying out anti-shake processing on the video to be processed according to the anti-shake parameters.
2. The method of claim 1, wherein the obtaining first blur information of image frames of the video to be processed comprises:
acquiring second fuzzy information and third fuzzy information of an image frame of the video to be processed, wherein the second fuzzy information is fuzzy information generated by the motion of a shooting object, and the third fuzzy information is fuzzy information generated by the motion of a shooting terminal;
and determining the first fuzzy information according to the second fuzzy information and the third fuzzy information.
3. The method according to claim 1, wherein the first blur information and the anti-shake information are in a first mapping relationship.
4. The method of claim 1, wherein determining anti-shake information from first blur information of image frames of the video to be processed comprises:
acquiring a first mapping relation between the pre-stored first fuzzy information and the anti-shake information;
and determining the anti-shake information according to the first fuzzy information and the first mapping relation.
5. The method of claim 1, wherein before determining anti-shake information from first blur information of image frames of the video to be processed, further comprising:
acquiring jitter information of an image frame of the video to be processed, wherein the jitter information is used for representing the jitter degree of the video to be processed;
the determining anti-shake information according to the first blur information of the image frame of the video to be processed includes:
and determining the anti-shake information according to the first fuzzy information and the shake information.
6. The method according to claim 5, wherein the obtaining the dithering information of the image frames of the video to be processed comprises:
acquiring jitter parameters of image frames of the video to be processed, wherein the jitter parameters comprise at least one of jitter frequency and jitter amplitude;
and determining the jitter information according to the jitter parameters.
7. The method of claim 6, wherein the determining the jitter information according to the jitter parameter comprises:
acquiring a second mapping relation between the pre-stored jitter parameters and the jitter information;
and determining the jitter information according to the jitter parameter and the second mapping relation.
8. The method according to claim 5, wherein the determining the anti-shake information according to the first blur information and the shake information comprises:
acquiring prestored first fuzzy information, and a third mapping relation between the jitter information and the anti-jitter information;
and determining the anti-shake information according to the first fuzzy information, the shake information and the third mapping relation.
9. The method according to claim 1, wherein the anti-shake processing the video to be processed according to the anti-shake parameters comprises:
acquiring a camera internal reference matrix;
and performing projection transformation on the image frame according to the camera internal parameter matrix and the anti-shake parameters so as to perform anti-shake processing on the video to be processed.
10. A video anti-shake apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring first fuzzy information of an image frame of a video to be processed, and the first fuzzy information is used for representing the fuzzy degree of the image frame of the video to be processed;
the determining module is used for determining anti-shake information according to first fuzzy information of an image frame of the video to be processed, wherein the anti-shake information is used for representing the anti-shake degree of the video to be processed; the first fuzzy information is inversely proportional to the anti-shake information;
the determining module is further configured to determine anti-shake parameters of the video to be processed according to the anti-shake information;
and the processing module is used for carrying out anti-shake processing on the video to be processed according to the anti-shake parameters.
11. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the video anti-shake method according to any of claims 1-9.
12. 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 video anti-shake method according to any one of claims 1 to 9.
CN202010186990.8A 2020-03-17 2020-03-17 Video anti-shake method and apparatus, electronic device, and computer-readable storage medium Active CN111372000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010186990.8A CN111372000B (en) 2020-03-17 2020-03-17 Video anti-shake method and apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010186990.8A CN111372000B (en) 2020-03-17 2020-03-17 Video anti-shake method and apparatus, electronic device, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN111372000A CN111372000A (en) 2020-07-03
CN111372000B true CN111372000B (en) 2021-08-17

Family

ID=71211877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010186990.8A Active CN111372000B (en) 2020-03-17 2020-03-17 Video anti-shake method and apparatus, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN111372000B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437283B (en) * 2020-11-09 2022-06-10 广景视睿科技(深圳)有限公司 Method and system for adjusting projection jitter
CN112532885B (en) * 2020-11-27 2022-05-03 维沃移动通信有限公司 Anti-shake method and device and electronic equipment
CN113436113B (en) * 2021-07-22 2023-04-18 黑芝麻智能科技有限公司 Anti-shake image processing method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06350895A (en) * 1993-06-10 1994-12-22 Fujitsu General Ltd Method for correcting jiggle in video camera
CN104135597A (en) * 2014-07-04 2014-11-05 上海交通大学 Automatic detection method of jitter of video
CN105262934A (en) * 2015-10-16 2016-01-20 浙江宇视科技有限公司 Adjusting method and adjusting device for video image
CN108307118A (en) * 2018-02-10 2018-07-20 北京理工大学 A kind of low delay video image stabilization method based on the optimization of inertial navigation parameter manifold
CN110166697A (en) * 2019-06-28 2019-08-23 Oppo广东移动通信有限公司 Camera anti-fluttering method, device, electronic equipment and computer readable storage medium
CN110493522A (en) * 2019-08-26 2019-11-22 Oppo广东移动通信有限公司 Anti-fluttering method and device, electronic equipment, computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253934A (en) * 2013-06-26 2014-12-31 中兴通讯股份有限公司 Jittering detection method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06350895A (en) * 1993-06-10 1994-12-22 Fujitsu General Ltd Method for correcting jiggle in video camera
CN104135597A (en) * 2014-07-04 2014-11-05 上海交通大学 Automatic detection method of jitter of video
CN105262934A (en) * 2015-10-16 2016-01-20 浙江宇视科技有限公司 Adjusting method and adjusting device for video image
CN108307118A (en) * 2018-02-10 2018-07-20 北京理工大学 A kind of low delay video image stabilization method based on the optimization of inertial navigation parameter manifold
CN110166697A (en) * 2019-06-28 2019-08-23 Oppo广东移动通信有限公司 Camera anti-fluttering method, device, electronic equipment and computer readable storage medium
CN110493522A (en) * 2019-08-26 2019-11-22 Oppo广东移动通信有限公司 Anti-fluttering method and device, electronic equipment, computer readable storage medium

Also Published As

Publication number Publication date
CN111372000A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN111372000B (en) Video anti-shake method and apparatus, electronic device, and computer-readable storage medium
CN110473159B (en) Image processing method and device, electronic equipment and computer readable storage medium
US10217200B2 (en) Joint video stabilization and rolling shutter correction on a generic platform
CN106060249B (en) Photographing anti-shake method and mobile terminal
US20140293074A1 (en) Generating a composite image from video frames
CN110740247B (en) Video stability augmentation method and device, computer equipment and storage medium
JP4307430B2 (en) Camera shake detection device
CN111314604A (en) Video anti-shake method and apparatus, electronic device, computer-readable storage medium
CN113824876B (en) Picture stability processing method and device under digital zooming, mobile terminal and medium
US20150063694A1 (en) Techniques for combining images with varying brightness degrees
US9172870B2 (en) Real-time image processing method and device enhancing the resolution of successive images
CN113436113A (en) Anti-shake image processing method, device, electronic equipment and storage medium
CN113556464A (en) Shooting method and device and electronic equipment
CN110611767A (en) Image processing method and device and electronic equipment
TW201707438A (en) Electronic device and image processing method
US10547785B2 (en) Photographing method including image registration based on reference image, shake information, and a motion vector table
JP6282133B2 (en) Imaging device, control method thereof, and control program
CN111371987B (en) Image processing method and device, electronic equipment and computer readable storage medium
US11069040B2 (en) Empirical exposure normalization
JP2021136461A (en) Imaging device, control method, program, and storage medium
CN115278103A (en) Security monitoring image compensation processing method and system based on environment perception
CN114092562A (en) Noise model calibration method, image denoising method, device, equipment and medium
CN112132879B (en) Image processing method, device and storage medium
US20160323490A1 (en) Extensible, automatically-selected computational photography scenarios
KR20220081168A (en) Method and Device for video stitching

Legal Events

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