CN112822474A - Video processing method, video repairing method and device and electronic equipment - Google Patents

Video processing method, video repairing method and device and electronic equipment Download PDF

Info

Publication number
CN112822474A
CN112822474A CN201911126554.5A CN201911126554A CN112822474A CN 112822474 A CN112822474 A CN 112822474A CN 201911126554 A CN201911126554 A CN 201911126554A CN 112822474 A CN112822474 A CN 112822474A
Authority
CN
China
Prior art keywords
video
original
parameter
target
original video
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
CN201911126554.5A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911126554.5A priority Critical patent/CN112822474A/en
Priority to PCT/CN2020/127717 priority patent/WO2021093718A1/en
Publication of CN112822474A publication Critical patent/CN112822474A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a video processing method, a video repairing device and electronic equipment, and relates to the technical field of deep learning, wherein the method comprises the following steps: acquiring an original video; adjusting quality influence parameters of the original video to obtain a target video corresponding to the original video, wherein the video quality of the target video is lower than that of the original video; wherein the quality-affecting parameters include at least two of: a noise parameter, a brightness parameter, and a sharpness parameter; constructing a video training set based on the original video and the target video; the video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video repairing model, and the trained video repairing model is used for repairing the video. The invention can obtain the video training set for training the neural network, thereby solving the problem that the video repairing work can not be directly finished based on the neural network because the training set is difficult to obtain.

Description

Video processing method, video repairing method and device and electronic equipment
Technical Field
The invention relates to the technical field of deep learning, in particular to a video processing method, a video repairing device and electronic equipment.
Background
Old video repair (Old video repair) is mainly used to repair early unclear dramas or movies. In general, compared with the existing film, the old film is mostly affected by the current acquisition equipment and has the problem of low definition and the like, so that the old film needs to be repaired to be clear, and a better visual and sensory effect is brought to people.
The existing old patch repair mainly adopts a manual repair mode, and wastes time and labor. The inventor researches and discovers that although a deep learning mode is newly proposed to repair the old film, the method is limited in that a training set of a neural network capable of integrally repairing the old film is difficult to obtain, and only a plurality of neural network models can be adopted to perform a more complicated staged repairing mode.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a video processing method, a video repairing device, and an electronic device, which can obtain a video training set for training a video repairing model, and further solve a problem that it is difficult to obtain the training set and thus it is impossible to directly complete a video repairing work based on the video repairing model.
In a first aspect, an embodiment of the present invention provides a video processing method, including: acquiring an original video; adjusting quality influence parameters of the original video to obtain a target video corresponding to the original video, wherein the video quality of the target video is lower than that of the original video; wherein the quality-affecting parameters include at least two of: a noise parameter, a brightness parameter, and a sharpness parameter; constructing a video training set based on the original video and the target video; the video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video restoration model, and the trained video restoration model is used for restoring the video.
In an embodiment, the step of adjusting the quality-affecting parameter of the original video to obtain a target video corresponding to the original video includes: adding random noise to each image frame in the original video if the quality-affecting parameter comprises the noise parameter; in the event that the quality-affecting parameter comprises the brightness parameter, performing a random brightness adjustment on each image frame in the original video; under the condition that the quality influence parameters comprise the definition parameters, adjusting the first resolution of each image frame in the original video to a target resolution, and then adjusting the first resolution to the first resolution; wherein the target resolution is less than the first resolution; and taking the original video after the quality influence parameters are adjusted as the target video corresponding to the original video.
In one embodiment, the adding random noise to each image frame in the original video comprises: performing the following operations for each image frame in the original video: determining a first random noise level within a preconfigured random noise interval; adding compression noise at the first random noise level to image frames in the original video.
In one embodiment, the randomly adjusting brightness of each image frame in the original video includes: converting the color image format of each image frame in the original video into a YUV format under the condition that the color format of the image frame in the original video frame is a color format other than the YUV format; and carrying out random numerical value down regulation on the brightness parameter of each image frame after format conversion under the Y channel.
In one embodiment, after the adjusting the first resolution of each image frame in the original video to the target resolution, the adjusting to the first resolution further includes: performing the following operations for each image frame in the original video: randomly selecting one resolution from the resolution set, and determining the randomly selected resolution as the target resolution; and after the first resolution of each image frame in the original video is adjusted to the target resolution, adjusting the first resolution to the first resolution.
In one embodiment, after constructing a video training set based on the original video and the target video, the method further comprises: training a video restoration model according to the video training set to obtain a trained video restoration model, wherein the trained video restoration model is used for restoring each frame of image in a video; and inputting the video to be restored to the trained video restoration model to obtain the restored video output by the trained video restoration model.
In a second aspect, an embodiment of the present invention further provides a video repair method, including: acquiring a video to be repaired; inputting the video to be repaired into a video repair model to obtain a repaired video output by the video repair model; the video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set includes an original video and a target video corresponding to the original video, the target video is obtained by adjusting a quality influence parameter of the original video, the video quality of the target video is lower than that of the original video, and the quality influence parameter includes at least two of the following: a noise parameter, a brightness parameter, and a sharpness parameter.
In a third aspect, an embodiment of the present invention further provides a video processing apparatus, including: the original video acquisition module is used for acquiring an original video; the parameter adjusting module is used for adjusting quality influence parameters of the original video to obtain a target video corresponding to the original video, wherein the video quality of the target video is lower than that of the original video; wherein the quality-affecting parameters include at least two of: a noise parameter, a brightness parameter, and a resolution parameter; a training set construction module for constructing a video training set based on the original video and the target video; the video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video restoration model, and the trained video restoration model is used for restoring the video.
In a fourth aspect, an embodiment of the present invention further provides a video repair apparatus, including: the video to be repaired acquisition module is used for acquiring a video to be repaired; the restoration module is used for inputting the video to be restored into a video restoration model to obtain a restoration result output by the video restoration model; the video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set includes an original video and a target video corresponding to the original video, the target video is obtained by adjusting a quality influence parameter of the original video, the video quality of the target video is lower than that of the original video, and the quality influence parameter includes at least two of the following: a noise parameter, a brightness parameter, and a sharpness parameter.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory; the memory has stored thereon a computer program which, when executed by the processor, performs the method of any one of the aspects as provided in the first aspect, or performs the method as provided in the second aspect.
In a sixth aspect, the present invention further provides a computer storage medium for storing computer software instructions for performing any one of the methods provided in the first aspect, or performing the method provided in the second aspect.
The embodiment of the invention has the following beneficial effects:
the video processing method, the video processing device and the electronic equipment provided by the embodiment of the invention firstly obtain an original video, adjust the quality influence parameters of the original video to obtain a target video with the video quality lower than that of the original video, and construct a video training set based on the original video and the target video, wherein the quality influence parameters comprise at least two of the following parameters: the method comprises the steps of obtaining a video training set, obtaining a video restoration model, obtaining a noise parameter, a brightness parameter and a definition parameter, storing a corresponding relation between a target video and an original video in the video training set, and training by using the video restoration model of the video training set, wherein the trained video restoration model can be used for restoring the video. According to the method, the target video with the video quality lower than that of the original video can be obtained by adjusting at least two quality influence parameters, the target video can be effectively adopted to directly simulate the old film, and finally, a video training set can be constructed based on the original video and the target video. The video training set comprises the original video and the target video, so that the video training set can be directly used for training the video restoration model, and the problem that the training set of the video restoration model which can directly and integrally restore the old film is difficult to obtain is effectively solved.
The video restoration method, the video restoration device and the electronic equipment provided by the embodiment of the invention firstly obtain a video to be restored, then input the video to be restored into a video restoration model to obtain a restoration result output by the video restoration model, wherein the video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set comprises an original video and a target video corresponding to the original video, the target video is obtained by adjusting quality influence parameters of the original video, the video quality of the target video is lower than that of the original video, and the video quality influence parameters comprise at least two of the following parameters: a noise parameter, a brightness parameter, and a sharpness parameter. Compared with the prior art that a plurality of neural network models are adopted to carry out complicated and complicated staged repairing modes, each processing process has certain influence on the repairing result, and accumulated errors exist in the repaired video.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a video processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a video repair method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a video repair apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the embodiments, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The existing method for repairing the old film based on deep learning mainly adopts multiple neural network models to carry out staged repair, specifically, the old film repairing process is split into multiple processing processes, each processing process needs to be realized by adopting a corresponding neural network model, and the method is complex and tedious. In addition, each processing procedure has a certain influence on the repair result, so that the repaired video has an accumulated error. However, the inventor researches and discovers that the reason that the whole neural network model is not directly adopted in the prior art for the whole course is that a training set for training the whole neural network model cannot be obtained at present.
Based on this, embodiments of the present invention provide a video processing method, a video repairing method, an apparatus, and an electronic device, which can obtain a video training set for training a video repairing model, and can directly and integrally repair an old film by using the video repairing model obtained by training the video training set.
To facilitate understanding of the present embodiment, first, a detailed description is given of a video processing method disclosed in the present embodiment, referring to a flowchart of a video processing method shown in fig. 1, where the method may include the following steps:
step S102, acquiring an original video.
In one embodiment, high definition video may be selected as the original video, such as high definition video captured by a user via a device with capture capabilities (e.g., a smartphone or camera), or high definition video downloaded by a user from the internet. The high-definition video can be a video with a definition parameter higher than a preset first threshold, a noise parameter lower than a preset second threshold, and a brightness parameter higher than a preset third threshold. In practical application, a video uploading channel can be provided for a user, so that the user can select and upload a high-definition video by himself, and the high-definition video uploaded by the user is used as an original video.
And step S104, adjusting the quality influence parameters of the original video to obtain a target video corresponding to the original video.
Wherein the video quality of the target video is lower than the video quality of the original video, and the quality-affecting parameters include at least two of: considering that the old video has noise, dark regions and fuzzy problems in different degrees, at least two of the quality influence parameters are adjusted, in practical application, the noise can be randomly added into the original video to enable the original video to have the noise in different degrees, the brightness parameter of the original video can be randomly reduced to increase the dark regions in the original video, the definition of the original video can be reduced to enable the original video to be more fuzzy, the target video with lower video quality is obtained through the method, and the obtained target video can be used for simulating the old video.
And step S106, constructing a video training set based on the original video and the target video.
The video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video repairing model, and the trained video repairing model is used for repairing the video. Because the training process of the neural network is to learn the mapping relation between input and output, the embodiment of the invention adopts the original video and the target video corresponding to the original video to construct a video training set for training the neural network to obtain the video repairing model for repairing the video. In one embodiment, the target video may be used to simulate an "old film" and use it as an input of the neural network, and the original video may be used to simulate a "repair result" of the "old film" and use it as an output of the neural network, so that the neural network learns the mapping relationship between the "old film" and the "repair result" to obtain a video repair model for repairing the old film.
According to the construction method of the video training set provided by the embodiment of the invention, the target video with the video quality lower than that of the original video can be obtained by adjusting at least two quality influence parameters, the old film can be directly simulated by effectively adopting the target video, and finally the video training set can be constructed based on the original video and the target video. The video training set comprises the original video and the target video, so that the video training set can be directly used for training the video restoration model, and the problem that the training set of the video restoration model which can directly and integrally restore the old film is difficult to obtain is effectively solved.
In order to facilitate the execution of the step S104, in the embodiment of the present invention, the original video is cut into frames to obtain a plurality of image frames in the original video, and the target video with a video quality lower than that of the original video can be obtained by adjusting at least two parameters of the noise parameter, the brightness parameter, and the sharpness parameter of each image frame. The embodiment of the present invention provides a specific implementation manner for adjusting quality influence parameters of an original video to obtain a target video corresponding to the original video, which is shown in the following steps 1 to 4:
step 1, adding random noise to each image frame in the original video under the condition that the quality influence parameters comprise noise parameters. In one embodiment, the following operations may be performed for each image frame in the original video, see steps 1.1 to 1.2 below:
step 1.1, determining a first random noise level within a preconfigured random noise interval. Because there are different levels of noise in the old patch, in one embodiment, random noise intervals are set using random numbers, where random noise (i.e., compression noise) of different first random noise levels is randomly generated within the random noise intervals. The compression noise may include multiple noises such as JPEG (Joint Photographic Experts Group), salt and pepper noise, poisson noise, and white gaussian noise.
Step 1.2, adding compression noise of a first random noise level to image frames in the original video. In one embodiment, the same first random noise level may be added to each image frame in the original video, or different first random noise levels may be added to each image frame, and the added first noise level may be selected based on actual conditions, so that the noise parameter in the original video after the addition of the compressed noise is closer to the noise parameter of the old film.
And 2, carrying out random brightness adjustment on each image frame in the original video under the condition that the quality influence parameters comprise brightness parameters. The embodiment of the present invention provides a specific implementation manner for performing random brightness adjustment on each image frame in an original video, and if a color format of an image frame in an original video is a color format other than a YUV (Luminance, Chroma) format, a color image format of each image frame in an original video may be converted into a YUV format, and a random value of a brightness parameter of each image frame after format conversion is adjusted downward in a Y channel. Because the early old film shooting technology is poor and the environment influences shooting, the obtained film has dark areas in many places, and the enhancement of the dark areas in old film repair is also an important work, so that the effect of the dark areas in the old film is simulated through the step 2 in the embodiment of the invention. In a specific implementation, if the color format of the image frame in the original video is a color format other than the YUV format, such as RGB (Red, Green, Blue) format, directly adjusting the brightness value of the image frame may cause a problem of color distortion of the image frame, therefore, the present invention converts the image format of the image frame into the YUV format, and adjusts the brightness parameter of the image frame in the YUV format by a gamma (gamma) correction method, wherein a Y channel in the YUV format represents brightness (Luminance), a U channel represents Chroma (Chrominance), and a V channel represents saturation (Chroma), and the Y channel is adjusted by the gamma correction method, and color distortion of the image frame can be avoided to a certain extent without adjusting the U channel and the V channel. In addition, in order to make the dark area in the image frame after adjusting the brightness parameter random, in one embodiment, the parameter of the gamma correction method may be randomly set, and gamma variation of the Y channel may be performed to a random degree, so that the brightness parameter of different image frames may be varied to different degrees.
If the format of the second image is RGB format, an embodiment of the present invention further provides a method for converting RGB format into YUV format, where Y is 0.299R +0.587G + 0.114B; U-0.1687R-0.3313G +0.5B + 128; and V is 0.5R-0.4187G-0.0813B +128, and the image frame in the RGB format can be converted into the image frame in the YUV format according to the formula.
And 3, under the condition that the quality influence parameters comprise definition parameters, adjusting the first resolution of each image frame in the original video to the target resolution, and then adjusting the first resolution to the first resolution. Wherein the target resolution is less than the first resolution. To facilitate understanding of the above-mentioned adjusting to the first resolution after adjusting the first resolution of each image frame in the original video to the target resolution, the embodiment of the present invention performs, on each image frame in the original video, operations of first randomly selecting one resolution from a resolution set, determining the randomly selected resolution as the target resolution, and adjusting to the first resolution after adjusting the first resolution of each image frame in the original video to the target resolution. Assuming that the resolution set includes multiple resolutions, such as 480P, 720P, 1080P, 2K, 4K, 8K, etc., if the first resolution of each image frame of the original image frame is 8K and the selected target resolution is 480P, the image frame may be down-sampled at random scale to obtain a 480P image frame, and then the 480P image frame may be up-sampled to restore the resolution to 8K. In another embodiment, the third image may be upsampled and then downsampled to obtain a blurred image frame.
And 4, taking the original video with the quality influence parameters adjusted as a target video corresponding to the original video. It should be emphasized that the invention does not limit the sequence of adjusting the noise parameter, the brightness parameter and the definition parameter of the original video, and the sequence of adjusting the parameters can be set based on the actual situation.
The invention implements the video restoration model trained by the video training set obtained from the step S102 to the step S106, so that the video restoration model can restore the old film integrally, and therefore, after the video training set is constructed based on the original video and the target video, the embodiment of the invention also provides an implementation mode for restoring the old film by using the video restoration model, the video restoration model is trained according to the video training set to obtain the trained video restoration model, and then the video to be restored is input into the trained video restoration model, so that the restored video output by the trained video restoration model can be obtained, wherein the definition parameter of the video to be restored is lower than the preset fourth threshold, the noise parameter is higher than the preset fifth threshold, the brightness parameter is lower than the video of the preset sixth threshold, and the trained video restoration model is used for restoring each frame of image in the video, the definition parameter of the input video to be restored can be higher than a preset first threshold value by adjusting the noise parameter, the brightness parameter or the definition parameter of each image frame, the noise parameter is lower than a preset second threshold value, and the brightness parameter is higher than a preset third threshold value. The fourth threshold is lower than the first threshold, the fifth threshold is lower than the second threshold, and the sixth threshold is lower than the third threshold.
Considering that in the prior art, the old film restoration is divided into a plurality of processing processes, and each processing process uses a different neural network to perform restoration processing on the old film in sequence, because each processing process has a certain influence on the video processing result, and the obtained restoration result has an accumulated error, an embodiment of the present invention further provides a video restoration method, which refers to a flow chart of a video restoration method shown in fig. 2, and the method may include the following steps:
step S202, a video to be repaired is obtained. The video to be restored may be a movie or television work such as an early-stage television show or a movie, or may be a damaged low-quality video. In one embodiment, the low-quality video may be a video with a resolution lower than a preset fourth threshold, a noise higher than a preset fifth threshold, and a brightness lower than a preset sixth threshold.
And step S204, inputting the video to be repaired into the video repairing model to obtain the repaired video output by the video repairing model.
The video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set comprises an original video and a target video corresponding to the original video, the target video is obtained by adjusting quality influence parameters of the original video, the video quality of the target video is lower than that of the original video, and the quality influence parameters comprise at least two of the following parameters: a noise parameter, a brightness parameter, and a sharpness parameter. Because Convolutional Neural Networks (CNNs) exhibit better performance in image processing and speech recognition, the repair model provided by the present invention may include Convolutional Neural networks. For understanding, the embodiment of the present invention provides a training method of a repair model, see the following steps 1 to 2:
step 1, a video training set is obtained. The video training set is obtained by the method for constructing the video training set provided by the foregoing embodiment, and includes a large number of original videos and target videos corresponding to the original videos.
And 2, taking the target video in the video training set as the input of the convolutional neural network, taking the original video in the video training set as the output of the convolutional neural network, and training the convolutional neural network. The convolutional neural network is trained to learn the mapping relation between input and output, a video restoration model required by video restoration is obtained, and low-quality film and television works or videos are restored through the video restoration model.
The processing of the video repairing model on the model to be repaired is equivalent to the drying removal, dark field stretching and deblurring treatment of the video to be repaired, so that a high-definition repairing result corresponding to the low-quality video to be repaired is obtained. In specific implementation, the high-definition video after being restored (that is, the restoration result) can be obtained only by inputting the video to be restored into the video restoration model obtained by training in advance.
Compared with the prior art that a plurality of neural network models are adopted to carry out complicated and complicated staged repairing modes, each processing process has certain influence on the repairing result, and the repaired video has accumulated errors.
As to the video processing method provided in the foregoing embodiment, an embodiment of the present invention further provides a video processing apparatus, and referring to a schematic structural diagram of a video processing apparatus shown in fig. 3, the apparatus may include the following components:
an original video obtaining module 302, configured to obtain an original video.
The parameter adjusting module 304 is configured to adjust quality-affecting parameters of the original video to obtain a target video corresponding to the original video, where the video quality of the target video is lower than that of the original video; wherein the quality-affecting parameters include at least two of: a noise parameter, a brightness parameter, and a resolution parameter.
A training set construction module 306, configured to construct a video training set based on the original video and the target video; the video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video repairing model, and the trained video repairing model is used for repairing the video.
According to the video processing device provided by the embodiment of the invention, the target video with the video quality lower than that of the original video can be obtained by adjusting at least two quality influence parameters, the old film can be directly simulated by effectively adopting the target video, and finally, a video training set can be constructed based on the original video and the target video. The video training set comprises the original video and the target video, so that the video training set can be directly used for training the video restoration model, and the problem that the training set of the video restoration model which can directly and integrally restore the old film is difficult to obtain is effectively solved.
In one embodiment, the parameter adjusting module 304 is further configured to: in the event that the quality-affecting parameter comprises a noise parameter, adding random noise to each image frame in the original video; under the condition that the quality influence parameters comprise brightness parameters, carrying out random brightness adjustment on each image frame in the original video; under the condition that the quality influence parameters comprise definition parameters, adjusting the first resolution of each image frame in the original video to the target resolution, and then adjusting the first resolution to the first resolution; wherein the target resolution is less than the first resolution; and taking the original video with the quality influence parameters adjusted as a target video corresponding to the original video.
Further, the parameter adjusting module 304 is further configured to: performing the following operations for each image frame in the original video: determining a first random noise level within a preconfigured random noise interval; compression noise at a first random noise level is added to image frames in an original video.
Further, the parameter adjusting module 304 is further configured to: under the condition that the color format of the image frame in the original video frame is a color format other than the YUV format, converting the color image format of each image frame in the original video into the YUV format; and carrying out random numerical value down regulation on the brightness parameter of each image frame after format conversion under the Y channel.
Further, the parameter adjusting module 304 is further configured to: performing the following operations for each image frame in the original video: randomly selecting one resolution from the resolution set, and determining the randomly selected resolution as a target resolution; and after the first resolution of each image frame in the original video is adjusted to the target resolution, the first resolution is adjusted to the first resolution.
Further, the video processing apparatus further includes a repair module, configured to: after a video training set is constructed based on an original video and a target video, training a video restoration model according to the video training set to obtain a trained video restoration model, wherein the trained video restoration model is used for restoring each frame of image in the video; and inputting the video to be restored to the trained video restoration model to obtain the restored video output by the trained video restoration model.
With respect to the video repair method provided in the foregoing embodiment, an embodiment of the present invention further provides a video repair apparatus, referring to a schematic structural diagram of a video repair apparatus shown in fig. 4, where the apparatus may include the following components:
a to-be-repaired video obtaining module 402, configured to obtain a to-be-repaired video.
A repairing module 404, configured to input the video to be repaired into a video repairing model, so as to obtain a repaired video output by the video repairing model; the video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set includes an original video and a target video corresponding to the original video, the target video is obtained by adjusting a quality influence parameter of the original video, the video quality of the target video is lower than that of the original video, and the quality influence parameter includes at least two of the following: a noise parameter, a brightness parameter, and a sharpness parameter.
Compared with the prior art in which an old piece repairing process is divided into a plurality of processing processes, each processing process needs to be realized by adopting a corresponding neural network model, and each processing process has certain influence on a repairing result, so that an accumulated error exists in the repaired video.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
The device is an electronic device, and particularly, the electronic device comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the above described embodiments.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 100 includes: the device comprises a processor 50, a memory 51, a bus 52 and a communication interface 53, wherein the processor 50, the communication interface 53 and the memory 51 are connected through the bus 52; the processor 50 is arranged to execute executable modules, such as computer programs, stored in the memory 51.
The Memory 51 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 53 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
The bus 52 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
The memory 51 is used for storing a program, the processor 50 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 50, or implemented by the processor 50.
The processor 50 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 50. The Processor 50 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 51, and the processor 50 reads the information in the memory 51 and completes the steps of the method in combination with the hardware thereof.
The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the foregoing method embodiment, which is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. A method for processing video, comprising:
acquiring an original video;
adjusting quality influence parameters of the original video to obtain a target video corresponding to the original video, wherein the video quality of the target video is lower than that of the original video; wherein the quality-affecting parameters include at least two of: a noise parameter, a brightness parameter, and a sharpness parameter;
constructing a video training set based on the original video and the target video; the video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video restoration model, and the trained video restoration model is used for restoring the video.
2. The method according to claim 1, wherein the step of adjusting the quality-affecting parameter of the original video to obtain the target video corresponding to the original video comprises:
adding random noise to each image frame in the original video if the quality-affecting parameter comprises the noise parameter;
in the event that the quality-affecting parameter comprises the brightness parameter, performing a random brightness adjustment on each image frame in the original video;
under the condition that the quality influence parameters comprise the definition parameters, adjusting the first resolution of each image frame in the original video to a target resolution, and then adjusting the first resolution to the first resolution; wherein the target resolution is less than the first resolution;
and taking the original video after the quality influence parameters are adjusted as the target video corresponding to the original video.
3. The method of claim 2, wherein said adding random noise to each image frame in the original video comprises:
performing the following operations for each image frame in the original video:
determining a first random noise level within a preconfigured random noise interval;
adding compression noise at the first random noise level to image frames in the original video.
4. The method of claim 2, wherein said randomly adjusting the brightness of each image frame in the original video comprises:
converting the color image format of each image frame in the original video into a YUV format under the condition that the color format of the image frame in the original video is a color format other than the YUV format;
and carrying out random numerical value down regulation on the brightness parameter of each image frame after format conversion under the Y channel.
5. The method of claim 2, wherein after the adjusting the first resolution of each image frame in the original video to the target resolution, the adjusting to the first resolution comprises:
performing the following operations for each image frame in the original video:
randomly selecting one resolution from the resolution set, and determining the randomly selected resolution as the target resolution;
and after the first resolution of each image frame in the original video is adjusted to the target resolution, adjusting the first resolution to the first resolution.
6. The method of any of claims 1-5, wherein after constructing a video training set based on the original video and the target video, the method further comprises:
training a video restoration model according to the video training set to obtain a trained video restoration model, wherein the trained video restoration model is used for restoring each frame of image in a video;
and inputting the video to be restored to the trained video restoration model to obtain the restored video output by the trained video restoration model.
7. A method of video repair, comprising:
acquiring a video to be repaired;
inputting the video to be repaired into a video repair model to obtain a repaired video output by the video repair model; the video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set includes an original video and a target video corresponding to the original video, the target video is obtained by adjusting a quality influence parameter of the original video, the video quality of the target video is lower than that of the original video, and the quality influence parameter includes at least two of the following: a noise parameter, a brightness parameter, and a sharpness parameter.
8. An apparatus for processing video, comprising:
the original video acquisition module is used for acquiring an original video;
the parameter adjusting module is used for adjusting quality influence parameters of the original video to obtain a target video corresponding to the original video, wherein the video quality of the target video is lower than that of the original video; wherein the quality-affecting parameters include at least two of: a noise parameter, a brightness parameter, and a resolution parameter;
a training set construction module for constructing a video training set based on the original video and the target video; the video training set stores the corresponding relation between the target video and the original video, the video training set is used for training a video restoration model, and the trained video restoration model is used for restoring the video.
9. A video repair apparatus, comprising:
the video to be repaired acquisition module is used for acquiring a video to be repaired; the restoration module is used for inputting the video to be restored into a video restoration model to obtain a restoration result output by the video restoration model; the video restoration model is obtained by training an initial video restoration model according to a video training set, the video training set includes an original video and a target video corresponding to the original video, the target video is obtained by adjusting a quality influence parameter of the original video, the video quality of the target video is lower than that of the original video, and the quality influence parameter includes at least two of the following: a noise parameter, a brightness parameter, and a sharpness parameter.
10. An electronic device comprising a processor and a memory;
the memory has stored thereon a computer program which, when executed by the processor, performs the method of any one of claims 1 to 6, or performs the method of claim 7.
11. A computer storage medium for storing computer software instructions for use in the method of any one of claims 1 to 6 or for performing the method of claim 7.
CN201911126554.5A 2019-11-15 2019-11-15 Video processing method, video repairing method and device and electronic equipment Pending CN112822474A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911126554.5A CN112822474A (en) 2019-11-15 2019-11-15 Video processing method, video repairing method and device and electronic equipment
PCT/CN2020/127717 WO2021093718A1 (en) 2019-11-15 2020-11-10 Video processing method, video repair method, apparatus and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911126554.5A CN112822474A (en) 2019-11-15 2019-11-15 Video processing method, video repairing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112822474A true CN112822474A (en) 2021-05-18

Family

ID=75852433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911126554.5A Pending CN112822474A (en) 2019-11-15 2019-11-15 Video processing method, video repairing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112822474A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108364267A (en) * 2018-02-13 2018-08-03 北京旷视科技有限公司 Image processing method, device and equipment
CN109801209A (en) * 2019-01-29 2019-05-24 北京旷视科技有限公司 Parameter prediction method, artificial intelligence chip, equipment and system
CN110163237A (en) * 2018-11-08 2019-08-23 腾讯科技(深圳)有限公司 Model training and image processing method, device, medium, electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108364267A (en) * 2018-02-13 2018-08-03 北京旷视科技有限公司 Image processing method, device and equipment
CN110163237A (en) * 2018-11-08 2019-08-23 腾讯科技(深圳)有限公司 Model training and image processing method, device, medium, electronic equipment
CN109801209A (en) * 2019-01-29 2019-05-24 北京旷视科技有限公司 Parameter prediction method, artificial intelligence chip, equipment and system

Similar Documents

Publication Publication Date Title
US11182877B2 (en) Techniques for controlled generation of training data for machine learning enabled image enhancement
US11138478B2 (en) Method and apparatus for training, classification model, mobile terminal, and readable storage medium
CN109862389B (en) Video processing method, device, server and storage medium
US9813635B2 (en) Method and apparatus for auto exposure value detection for high dynamic range imaging
CN112102204B (en) Image enhancement method and device and electronic equipment
CN111598799A (en) Image toning enhancement method and image toning enhancement neural network training method
CN108600783B (en) Frame rate adjusting method and device and terminal equipment
CN112819699A (en) Video processing method and device and electronic equipment
CN110807735A (en) Image processing method, image processing device, terminal equipment and computer readable storage medium
CN110838088B (en) Multi-frame noise reduction method and device based on deep learning and terminal equipment
CN114998122A (en) Low-illumination image enhancement method
CN108881876B (en) Method and device for carrying out white balance processing on image and electronic equipment
CN111784580A (en) Super-resolution method and device for image and server
US8970739B2 (en) Devices and methods for creating structure histograms for use in image enhancement
JP2021114180A (en) Image processing device, image processing method, and program
CN112822474A (en) Video processing method, video repairing method and device and electronic equipment
JP2008263313A (en) Image processing apparatus and image processing program
WO2021093718A1 (en) Video processing method, video repair method, apparatus and device
CN109308690B (en) Image brightness balancing method and terminal
CN107481199B (en) Image defogging method and device, storage medium and mobile terminal
WO2022052820A1 (en) Data processing method, system, and apparatus
CN116977190A (en) Image processing method, apparatus, device, storage medium, and program product
CN115278103A (en) Security monitoring image compensation processing method and system based on environment perception
CN114663300A (en) DCE-based low-illumination image enhancement method, system and related equipment
CN112950509A (en) Image processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210518

RJ01 Rejection of invention patent application after publication