Image compression repair method and device, electronic equipment and storage medium

By combining a non-blind inpainting algorithm with a loss detection model, the problems of high complexity and poor results in compressed image inpainting are solved. This achieves efficient loss distribution calibration and image inpainting, improving the inpainting quality and reducing storage and transmission costs.

CN114240787BActive Publication Date: 2025-11-18BEIJING SENSETIME TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111565590.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-11-18
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

In the video encoding process, existing technologies for repairing compressed video frames perform blind noise reduction without calibrating the loss of video frames, which is too complex and has poor noise reduction effect.

Method used

The compressed image is initially repaired using a pre-set non-blind repair algorithm, and the loss is calibrated using a trained loss detection model. The repair intensity is adjusted according to the loss distribution image to determine the original image.

Benefits of technology

It improves the restoration quality of compressed images, reduces storage and transmission costs, and achieves accuracy and efficiency in calibrating the loss distribution of different compressed images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114240787B_ABST
    Figure CN114240787B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a compressed image repairing method and device, an electronic device and a storage medium. A compressed image is repaired by a preset non-blind repairing algorithm to obtain a pre-repaired image, and then the compressed image is input into a trained loss detection model to obtain a corresponding loss distribution image. The original image is determined according to the compressed image, the pre-repaired image and the loss distribution image. In the training process of the loss detection model, the input sample is a compressed video frame, and the labeled sample is determined according to the residual video frame of the corresponding compressed video frame and the original video frame. The present disclosure directly calibrates the loss of the compressed image through the trained loss detection model, and then corrects the preliminarily repaired image through the loss output by the model, thereby improving the repairing quality of the compressed image. Meanwhile, the present disclosure can calibrate the loss of different compressed images through one loss detection model, thereby reducing the storage and transmission costs.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a compressed image repairing method and device, an electronic device and a storage medium. BACKGROUND

[0002] In a video encoding process, each image frame in a video is compressed to reduce the volume of the video. When restoring the compressed video, since the loss of each video frame is difficult to calibrate, the related art performs blind denoising on the compressed video frame in the case where the loss of the video frame is not calibrated, which has high complexity and poor denoising effect. SUMMARY

[0003] The present disclosure provides a compressed image repairing method and device, an electronic device and a storage medium, which aims to calibrate the loss before repairing the compressed image, and directly performs denoising according to the calibrated loss to improve the effect of the repaired image.

[0004] According to a first aspect of the present disclosure, a compressed image repairing method is provided, comprising:

[0005] repairing the compressed image by using a preset non-blind repairing algorithm to obtain a pre-repaired image;

[0006] inputting the compressed image into a trained loss detection model to obtain a corresponding loss distribution image;

[0007] determining an original image according to the compressed image, the pre-repaired image and the loss distribution image,

[0008] wherein the loss detection model is trained by taking a compressed video frame corresponding to an original video frame as an input sample and taking a labeled distribution image corresponding to the compressed video frame as a labeled sample, and each labeled distribution image is determined by a corresponding compressed video frame and a residual video frame of the original video frame corresponding to the compressed video frame.

[0009] In a possible implementation, the determination of the original image according to the compressed image, the pre-repaired image and the loss distribution image comprises:

[0010] performing transparency mixing on the compressed image and the pre-repaired image based on the loss distribution image to obtain the original image.

[0011] In a possible implementation, the training process of the loss detection model comprises:

[0012] determining at least one original video frame and a compressed video frame corresponding to each original video frame;

[0013] determine a residual video frame of each of the compressed video frames according to each of the original video frames and the corresponding compressed video frame;

[0014] determine a label distribution image according to each of the residual video frames;

[0015] train a loss detection model by taking each of the compressed video frames as an input sample and the label distribution image corresponding to the compressed video frame as a label sample.

[0016] In a possible implementation, the determining of the at least one original video frame and the compressed video frame corresponding to each of the original video frames comprises:

[0017] determine at least one original video and a compressed video corresponding to each of the original videos;

[0018] randomly extract at least one video frame from each of the original videos as an original video frame, and extract a compressed video frame corresponding to the original video frame in the corresponding compressed video.

[0019] In a possible implementation, the determining of the at least one original video and the compressed video corresponding to each of the original videos comprises:

[0020] determine at least one original video;

[0021] for each of the original videos, randomly select a corresponding encoder and encoding strength;

[0022] perform video encoding on each of the original videos according to the corresponding encoder and encoding strength to obtain a compressed video.

[0023] In a possible implementation, the determining of the residual video frame of each of the compressed video frames according to each of the original video frames and the corresponding compressed video frame comprises:

[0024] perform preprocessing on each of the original video frames and the corresponding compressed video frame;

[0025] calculate a difference between each of the original video frames and the corresponding compressed video frame after preprocessing to obtain a residual video frame of each of the compressed video frames.

[0026] In a possible implementation, the preprocessing of each of the original video frames and the corresponding compressed video frame comprises:

[0027] perform high-pass filtering on each of the original video frames and the corresponding compressed video frame.

[0028] In a possible implementation, the determining of the label distribution image according to each of the residual video frames comprises:

[0029] For each of the residual video frames, the following steps are performed respectively:

[0030] determining a pixel region corresponding to each pixel position in the residual video frame;

[0031] determining a feature value of each pixel position corresponding to the pixel region;

[0032] determining a label distribution image according to the feature value of each pixel position.

[0033] In a possible implementation, the determining of the pixel region corresponding to each pixel position in the residual video frame comprises:

[0034] determining an image frame of a preset size;

[0035] determining the pixel region corresponding to each pixel position as a residual video frame region included in the image frame when the pixel position is at a center position of the image frame.

[0036] In a possible implementation, the pixel region corresponding to each pixel position can be obtained by sliding the image frame.

[0037] In a possible implementation, the determining of the feature value of each pixel position corresponding to the pixel region comprises:

[0038] for each of the pixel regions, calculating a square mean value of each pixel included therein to obtain the feature value.

[0039] In a possible implementation, the determining of the label distribution image according to the feature value of each pixel position comprises:

[0040] storing each of the feature values in the corresponding pixel position to obtain the label distribution image.

[0041] According to a second aspect of the present disclosure, a compressed image inpainting apparatus is provided, comprising:

[0042] an image inpainting module configured to inpaint a compressed image by using a preset non-blind inpainting algorithm to obtain a pre-inpainted image;

[0043] a loss determination module configured to input the compressed image into a trained loss detection model to obtain a corresponding loss distribution image;

[0044] an original image determination module configured to determine an original image according to the compressed image, the pre-inpainted image and the loss distribution image,

[0045] The loss detection model is trained by taking the compressed video frame corresponding to the original video frame as an input sample and taking the labeled distribution image corresponding to the compressed video frame as a labeled sample, wherein each labeled distribution image is determined by the corresponding compressed video frame and the residual video frame of the original video frame corresponding to the compressed video frame.

[0046] In a possible implementation, the original image determination module comprises:

[0047] An image fusion sub-module configured to perform transparency blending on the compressed image and the pre-repair image based on the loss distribution image to obtain an original image.

[0048] In a possible implementation, the training process of the loss detection model comprises:

[0049] determining at least one original video frame and a compressed video frame corresponding to each original video frame;

[0050] determining a residual video frame of each compressed video frame according to each original video frame and the corresponding compressed video frame;

[0051] determining a labeled distribution image according to each residual video frame;

[0052] training a loss detection model by taking each compressed video frame as an input sample and taking a labeled distribution image corresponding to each compressed video frame as a labeled sample.

[0053] In a possible implementation, the determining at least one original video frame and a compressed video frame corresponding to each original video frame comprises:

[0054] determining at least one original video and a compressed video corresponding to each original video;

[0055] randomly extracting at least one video frame from each original video as an original video frame and extracting a compressed video frame corresponding to the original video frame in the corresponding compressed video;

[0056] In a possible implementation, the determining at least one original video and a compressed video corresponding to each original video comprises:

[0057] determining at least one original video;

[0058] randomly selecting a corresponding encoder and encoding strength for each original video;

[0059] performing video encoding on each original video according to the corresponding encoder and encoding strength to obtain a compressed video.

[0060] In a possible implementation, the determining of the residual video frame of each compressed video frame according to each original video frame and the corresponding compressed video frame comprises:

[0061] preprocessing each original video frame and the corresponding compressed video frame;

[0062] calculating the difference between each preprocessed original video frame and the corresponding compressed video frame to obtain the residual video frame of each compressed video frame.

[0063] In a possible implementation, the preprocessing of each original video frame and the corresponding compressed video frame comprises:

[0064] high-pass filtering each original video frame and the corresponding compressed video frame.

[0065] In a possible implementation, the determining of the label distribution image according to each residual video frame comprises:

[0066] For each residual video frame, the following steps are performed respectively:

[0067] determining a pixel region corresponding to each pixel position in the residual video frame;

[0068] determining a feature value of the pixel position corresponding to each pixel region;

[0069] determining a label distribution image according to the feature value of each pixel position.

[0070] In a possible implementation, the determining of the pixel region corresponding to each pixel position in the residual video frame comprises:

[0071] determining an image frame of a preset size;

[0072] determining the pixel region corresponding to each pixel position as a residual video frame region included in the image frame when the pixel position is at the center position of the image frame.

[0073] In a possible implementation, the pixel region corresponding to each pixel position can be obtained by sliding the image frame.

[0074] In a possible implementation, the determining of the feature value of the pixel position corresponding to each pixel region comprises:

[0075] For each pixel region, calculating the square mean of each pixel included in the pixel region to obtain a feature value.

[0076] In a possible implementation, the determining of the label distribution image according to the feature value of each pixel position comprises:

[0077] The feature value is stored in the corresponding pixel position to obtain a label distribution image.

[0078] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the above method.

[0079] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which stores computer program instructions, the computer program instructions being executed by a processor to implement the above method.

[0080] In the embodiments of the present disclosure, a pre-repaired image is obtained by repairing the compressed image through a pre-set non-blind repair algorithm, and then the compressed image is input into the trained loss detection model to obtain a corresponding loss distribution image. The original image is determined according to the compressed image, the pre-repaired image and the loss distribution image. In the training process of the loss detection model, the input sample is a compressed video frame, and the label sample is determined according to the residual video frame of the corresponding compressed video frame and the original video frame. The present disclosure directly calibrates the loss of the compressed image through the trained loss detection model, and then corrects the image after preliminary repair through the loss output by the model, thereby improving the repair quality of the compressed image. At the same time, the present disclosure can calibrate the loss of different compressed images through one loss detection model, thereby reducing the storage and transmission costs.

[0081] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, but not limiting the present disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0082] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the technical solutions of the present disclosure.

[0083] Figure 1 A flowchart of a compressed image repair method according to an embodiment of the present disclosure is shown;

[0084] Figure 2 A schematic diagram of a process for determining a loss distribution image according to an embodiment of the present disclosure is shown;

[0085] Figure 3 A flowchart of a process for training a loss detection model according to an embodiment of the present disclosure is shown;

[0086] Figure 4FIG. 1 shows a schematic diagram of a video frame pre-processing process according to an embodiment of the present disclosure;

[0087] Figure 5 FIG. 2 shows a schematic diagram of a pixel position corresponding to a pixel region according to an embodiment of the present disclosure;

[0088] Figure 6 FIG. 3 shows a schematic diagram of a pixel region determination process according to an embodiment of the present disclosure;

[0089] Figure 7 FIG. 4 shows a schematic diagram of a raw image determination process according to an embodiment of the present disclosure;

[0090] Figure 8 FIG. 5 shows a schematic diagram of a compressed image inpainting apparatus according to an embodiment of the present disclosure;

[0091] Figure 9 FIG. 6 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure;

[0092] Figure 10 FIG. 7 shows a schematic diagram of another electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0093] Various exemplary embodiments, features, and aspects of the present disclosure will be described herein below with reference to the accompanying drawings. The same reference numbers in different drawings represent the same or similar elements unless otherwise noted. Although various aspects of embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless otherwise noted.

[0094] The term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations.

[0095] The term "and / or" used herein only means an association relationship of associated objects, and means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0096] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following detailed description. Those skilled in the art will understand that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, elements and circuits that are well known to those skilled in the art are not described in detail in order to highlight the main idea of the present disclosure.

[0097] Figure 1 A flowchart of a compressed image inpainting method according to an embodiment of the present disclosure is shown. In a possible implementation, the compressed image inpainting method of the present disclosure can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like mobile or fixed terminal. The server can be a single server or a server cluster composed of multiple servers. The compressed image inpainting method can be implemented by any electronic device by invoking computer-readable instructions stored in a memory through a processor.

[0098] The embodiments of the present disclosure can be applied to scenarios of inpainting any compressed image, for example, inpainting a compressed image of a single image, or sequentially inpainting each video frame of a compressed video. Further, the embodiments of the present disclosure can also be used to restore other lossless distribution calibrated loss images.

[0099] As shown in Figure 1 The compressed image inpainting method of the present disclosure can include the following steps S10-S30.

[0100] Step S10: Inpainting the compressed image by a preset non-blind inpainting algorithm to obtain a pre-inpainted image.

[0101] In a possible implementation, the compressed image is a loss image that has not been calibrated by loss distribution, which can be a compressed image obtained after a single image is compressed, or any video frame in a compressed video obtained after a video is encoded and compressed. The loss distribution of the compressed image is not known in advance. After obtaining the compressed image, the compressed image is inpainted by a preset non-blind inpainting algorithm to obtain a pre-inpainted image. Optionally, the preset non-blind inpainting algorithm can be any non-blind inpainting algorithm, for example, image denoising by inputting the compressed image into DnCNN (Denoising Convolutional Neural Network, feedforward denoising convolutional neural network) or CBDNeT (Convolutional Blind Denoising Network, convolutional blind denoising neural network).

[0102] Optionally, the non-blind repair algorithm is to repair the image under the condition that the loss distribution of the compressed image is known, while the loss of the compressed image in the embodiment of the present disclosure is unknown. In order to avoid missing some areas in the compressed image during the repair process, all areas in the compressed image are repaired, that is, the areas that need to be repaired and the areas that do not need to be repaired are repaired. Therefore, the pre-repaired image is an error image obtained by repairing all pixel positions of the compressed image.

[0103] Step S20, inputting the compressed image into the trained loss detection model to obtain a corresponding loss distribution image.

[0104] In a possible implementation, the loss distribution of the compressed image can be predicted by inputting the compressed image into the loss detection model to obtain a loss distribution image. The loss distribution image has the same size as the compressed image, and the pixel at each pixel position in the loss distribution image represents the pixel loss intensity of the corresponding pixel position in the compressed image. The loss detection model is trained by taking the compressed video frame corresponding to the original video frame as the input sample and the labeled distribution image corresponding to the compressed video frame as the labeled sample. Optionally, each labeled distribution image can be determined by the corresponding compressed video frame and the residual video frame of the original video frame corresponding to the compressed video frame.

[0105] Figure 2 A schematic diagram of a process for determining a loss distribution image according to an embodiment of the present disclosure is shown. As shown in Figure 2 After determining the compressed image 20 without loss distribution, the compressed image 20 can be input into the loss detection model 21. After the loss detection model 21 automatically labels the loss of the compressed image 20, the loss distribution image 22 is directly output. The above loss detection model can accurately and quickly realize the loss distribution labeling of the compressed image 20.

[0106] Figure 3 A flow chart of a process for training a loss detection model according to an embodiment of the present disclosure is shown. As shown in Figure 3 In the embodiment of the present disclosure, the training process of the loss detection model can also include the following steps S21-S24.

[0107] Step S21, determining at least one original video frame and the compressed video frame corresponding to each of the original video frames.

[0108] In a possible implementation, the original video frames are images that are not compressed by video encoding or the like, and can be randomly extracted from an uncompressed original video. Each original video frame has a corresponding compressed video frame, which can be extracted from a compressed video obtained after compressing the original video. The position of the original video frame in the original video is the same as the position of the corresponding compressed video frame in the compressed video. For example, when the original video frame is the i-th frame in the original video, the compressed video frame is the i-th frame in the compressed video obtained after compressing the original video.

[0109] Optionally, the process of determining the at least one original video frame and the corresponding compressed video frame of each original video frame can include determining at least one original video and a corresponding compressed video of each original video. At least one video frame is randomly extracted from each original video as an original video frame, and the original video frame corresponding compressed video frame is extracted from the corresponding compressed video. The corresponding compressed video frame in the compressed video is the video frame at the position of the original video frame in the compressed video. The determination of the original video and the corresponding compressed video can be to first determine at least one uncompressed original video, and for each original video, randomly select a corresponding encoder and encoding strength. Further, based on the corresponding encoder and encoding strength of each original video, each original video is video encoded to obtain the corresponding compressed video. That is, the original video is encoded by the corresponding encoder with the corresponding encoding strength to obtain the corresponding compressed video of the original video.

[0110] Step S22, determining a residual video frame of each compressed video frame according to each original video frame and the corresponding compressed video frame.

[0111] In a possible implementation, after determining the plurality of original video frames and the corresponding compressed video frame of each original video frame, a residual video frame of each compressed video frame can be determined according to each original video frame and the corresponding compressed video frame. Optionally, the determination of the residual video frame can be to directly calculate the difference between each original video frame and the compressed video frame. For example, when the original video frame is represented as a matrix X and the compressed video frame is represented as a matrix Y, the residual video frame can be represented by the matrix X-Y.

[0112] Optionally, for some special application scenarios, each original video frame and the corresponding compressed video frame can also be preprocessed first. Then the difference between each preprocessed original video frame and the corresponding compressed video frame is calculated to obtain the residual video frame of each compressed video frame. For example, since the low-frequency signal noise has less impact on human eye vision, and the high-frequency signal is mainly encoded in the video encoding process, when the compressed video frame is the compressed video obtained by video encoding the original video, the preprocessing process can be high-pass filtering of each original video frame and the corresponding compressed video frame. This filtering process can remove the low-frequency signal in the original video frame and the compressed video frame, and retain the high-frequency signal which has greater impact on human eye vision, thus simplifying the calculation amount while ensuring the accuracy of the extracted residual video frame.

[0113] Further, the high-pass filtering manner of the original video frame and the compressed video frame can be the same or different. The filtering manner of any video frame can be directly inputting the video frame into a high-pass filter to remove the low-frequency signal included therein to obtain the processed video frame. Alternatively, the video frame can also be inputted into a low-pass filter to obtain a low-pass video frame which removes the high-frequency signal, and then the preprocessing process is completed by subtracting the low-pass video frame from the inputted video frame.

[0114] Figure 4 A schematic diagram of a video frame preprocessing process according to an embodiment of the present disclosure is shown. As shown in Figure 4 For the original video frame X, it can be directly inputted into a high-pass filter to output the original video frame X' which removes the low-frequency signal to complete the preprocessing. Alternatively, the original video frame X can also be inputted into a low-pass filter 40 to obtain a low-pass video frame Z. Further, the preprocessed original video frame X' is obtained by subtracting the low-pass video frame Z from the original video frame X to complete the processing process. Optionally, the low-pass filter 40 can be a mean low-pass filter with a preset size, for example, 4x4. The preprocessing manner of the compressed video frame is the same as that of the original video frame, and the processed compressed video frame can also be obtained by the method shown in Figure 4

[0115] Step S23, determining a label distribution image according to each residual video frame.

[0116] ​In one possible implementation, after determining the residual video frame corresponding to each compressed video frame, a labeled distribution image for each compressed video frame can be determined based on the corresponding residual video frame. Specifically, for each residual video frame, determining the labeled distribution image can include: determining the pixel region corresponding to each pixel position in the residual video frame; determining the feature value of the pixel position corresponding to each pixel region; and determining the labeled distribution image based on the feature value of each pixel position. Optionally, the pixel regions corresponding to each pixel position in the residual video frame have the same size, which can be preset, for example, 3×3, with each pixel position at a specific location within the pixel region. For example, the pixel region corresponding to each pixel position can be determined as a region with the pixel position as its upper left corner and a preset size. Alternatively, the pixel region corresponding to each pixel position can also be determined as a region with the pixel position as its center and a preset size.

[0117] Optionally, when the pixel position is preset to the middle position of the corresponding pixel region, the pixel region corresponding to each pixel position in the residual video frame can be determined as an image frame of a preset size. The pixel region corresponding to each pixel position is the residual video frame region included in the image frame when the pixel position is at the center of the image frame.

[0118] Figure 5 This diagram illustrates a pixel location corresponding to a pixel region according to an embodiment of the present disclosure. For example... Figure 5 As shown, after determining the residual video frame 50, a pixel region corresponding to each pixel position is determined in the residual video frame 50 using an image frame 51 of a preset size. Specifically, when each pixel position is determined to be in the middle of its corresponding pixel region, the length and width of the preset size are both set to odd numbers; for example, the size of the image frame 51 can be 3×3. When each pixel position is determined to be at a specific edge position such as the upper left or lower right corner of its corresponding pixel region, the length and width of the preset size can be either odd or even numbers; for example, the size of the image frame 51 can be 3×3 or 4×4.

[0119] Taking the determination of the center position of each pixel within its corresponding pixel region as an example, when it is necessary to determine the pixel region corresponding to the pixel position with a pixel value of 111, the image frame 51 of a preset size can be moved to the exact center position, which is the position with a pixel value of 111, and the region in the image frame 51 at this time can be taken as the pixel region corresponding to the pixel position with a pixel value of 111. Optionally, when the pixel position of the corresponding pixel region to be determined is located at the edge of the residual video frame, and there are blank positions stored in the image frame 51 when the pixel position is in the center of the image frame 51, the blank areas in the image frame 51 can be filled by copying the edge of the residual video frame 50.

[0120] Further, the pixel region corresponding to each pixel position can be obtained by sliding the image frame. That is, the image frame with a fixed size can also be slid on the residual video frame with a preset step size of 1 to obtain the pixel region corresponding to each pixel position.

[0121] Figure 6 A schematic diagram of a process of determining a pixel region according to an embodiment of the present disclosure is shown as follows. Figure 6 As shown, after the residual video frame 50 is determined, an image frame 51 with a preset size is slid in the residual video frame 50 to determine the pixel region corresponding to each pixel position. Since when the pixel position for which the corresponding pixel region needs to be determined is located at the edge of the residual video frame 50, there will be a blank position in the image frame 51 when the pixel position is in the center of the image frame 51, the edge of the residual video frame 50 can be copied according to the size of the image frame 51 to obtain an expanded image 52, so as to ensure that each pixel position in the residual video frame 50 can obtain the corresponding pixel region completely. For example, when the size of the image frame 51 is 3x3, the edge of the residual video frame 50 can be copied once to obtain the expanded image 52, and when the size of the image frame 51 is 5x5, the edge of the residual video frame 50 can be copied twice to obtain the expanded image 52.

[0122] After the expanded image 52 is obtained, the image frame 51 can be slid from a preset position of the expanded image 52, such as the upper left corner or the upper right corner, with a preset step size of 1 to determine the pixel region corresponding to the pixel position at the center of the image frame 51 after each sliding.

[0123] In a possible implementation, for each residual video frame corresponding to a compressed video frame, after the pixel region of each pixel position in the residual video frame is determined by the above method, the feature value of the pixel position can be calculated according to all the pixel values in the pixel region. Alternatively, for each pixel region, the feature value can be obtained by calculating the square mean of each pixel included in the pixel region. Taking the case that the noise source in the compressed video frame is Gaussian noise with a mean value of 0 and the noise distribution of adjacent pixels is smooth as an example. Since the square mean of each pixel region is the maximum likelihood estimation of the noise distribution variance, the square mean of the pixel region can be taken as the feature value. For example, when the pixel region corresponding to the pixel position i has a size of 3x3, the square of the pixel position i and the eight adjacent pixel positions around the pixel position i are calculated respectively, and then divided by 9 to obtain the feature value of the pixel position i. Alternatively, other calculation methods can also be used to calculate the pixel value in each pixel region to obtain the feature value corresponding to the pixel position in the middle of the pixel region.

[0124] Optionally, after determining the feature value of each pixel position in the current residual video frame, each feature value can be stored in the corresponding pixel position to obtain a label distribution image. For example, a blank image with the same size as the residual video frame is first created, and the feature value corresponding to each pixel position in the residual video frame is written into the corresponding pixel position of the blank image to obtain the label distribution image.

[0125] S24, training a loss detection model by taking each compressed video frame as an input sample and the label distribution image corresponding to each compressed video frame as a label sample.

[0126] In a possible implementation, after determining the label distribution image corresponding to each compressed video frame through the above steps, a training set for training the information detection model can be created according to each compressed video frame and the corresponding label distribution image. Further, the compressed video frame in the training set is taken as an input sample of the loss detection model, and the label distribution image corresponding to the compressed video frame is taken as a label sample of the input sample, which is compared with the output of the loss detection model to obtain a model loss, so as to adjust the parameters of the loss detection model, and finally obtain the trained loss detection model.

[0127] In the embodiments of the present disclosure, the above method of training the loss detection model can accurately obtain the loss distribution in the compression process of the original video frame through the residual video frame of the original video frame and the compressed video frame, and train the loss detection model capable of accurately predicting the loss distribution of the compressed video frame. Therefore, after the compressed image is input into the loss detection model, the loss detection model can accurately detect the loss distribution of the compressed image and output the loss distribution image representing the loss distribution of the compressed image.

[0128] Step S30, determining the original image according to the compressed image, the pre-repair image, and the loss distribution image.

[0129] In a possible implementation, after determining the compressed image, the pre-repair image obtained by blindly repairing the compressed image, and the loss distribution image representing the loss distribution of the compressed image, the original image is determined according to the above three images. The loss intensity of different pixel positions in the compressed image is different in the compression process, that is, different position pixels need different repair intensity for repair, for example, pixels without loss do not need to be repaired, pixels with small loss need light intensity repair, and pixels with large loss need large intensity repair. The pre-repair image is an image obtained by repairing the compressed image through any non-blind repair algorithm, wherein each pixel is repaired by the same repair intensity. Therefore, the compressed image and the pre-repair image need to be adjusted and combined to obtain the original image through the loss distribution image representing the loss distribution of the compressed image, that is, the loss condition of different pixel positions.

[0130] Optionally, the original image can be determined based on the loss distribution image, and the compressed image and the pre-repair image are mixed in transparency to obtain the original image. The transparency mixing manner can be to calculate the weighted sum of the compressed image and the pre-repair image to obtain the original image. Wherein, the loss distribution image can be used as the weight of the pre-repair image, and then the inverse loss distribution image is obtained by subtracting the loss distribution image from a matrix with the same size as the loss distribution image and each pixel value being 1, the inverse loss distribution image is used as the weight of the compressed image, and the weighted sum of the pre-repair image and the compressed image is calculated to obtain the original image. Optionally, each pixel value in the loss distribution image ranges from 0 to 1. For example, when the loss distribution image is represented by matrix N, the compressed image is represented by matrix P, and the pre-repair image is represented by matrix Q, the original image can be QxN+Px(1-N).

[0131] Figure 7 A schematic diagram of determining an original image according to an embodiment of the present disclosure is shown. As shown in Figure 7 After determining the compressed image 71, the corresponding pre-repair image 70 and the corresponding loss distribution image 72, the inverse loss distribution image 73 is determined by the loss distribution image 72. Further, the loss distribution image 72 is used as the weight of the pre-repair image 70, the inverse loss distribution image 73 is used as the weight of the compressed image 71, and the pre-repair image 70 and the compressed image 71 are mixed in transparency to obtain the original image 74. That is, the product of the loss distribution image 72 and the pre-repair image 70 is calculated, and the product of the pre-repair image 70 and the compressed image 71 is calculated, and the two products are added to obtain the original image 74.

[0132] The embodiment of the present disclosure first preliminarily corrects the loss image by a preset non-blind repair algorithm, then directly calibrates the loss distribution of the compressed image by the trained loss detection model, and finally corrects the image after preliminary repair based on the loss distribution calibrated by the loss detection model, thereby improving the repair quality of the compressed image. At the same time, the present disclosure can realize loss distribution calibration of different compressed images by one loss detection model, thereby reducing storage and transmission costs.

[0133] It can be understood that the above-mentioned various method embodiments of the present disclosure can be combined with each other to form combined embodiments without violating the principle logic. Limited by the length, the present disclosure will not be repeated. Those skilled in the art can understand that the specific execution order of each step in the above-mentioned method should be determined according to its function and possible internal logic.

[0134] In addition, the disclosure also provides a compressed image repairing device, an electronic device, a computer readable storage medium, and a program, which can be used to implement any of the compressed image repairing methods provided by the disclosure. The corresponding technical solutions and descriptions are described in the method section and are not repeated here.

[0135] Figure 8 A schematic diagram of a compressed image repairing device according to an embodiment of the disclosure is shown. As shown in the figure, the compressed image repairing device of the embodiment of the disclosure can include an image repairing module 80, a loss determination module 81, and an original image determination module 82. Figure 8

[0136] The image repairing module 80 is configured to repair the compressed image by using a preset non-blind repairing algorithm to obtain a pre-repaired image.

[0137] The loss determination module 81 is configured to input the compressed image into a trained loss detection model to obtain a corresponding loss distribution image.

[0138] The original image determination module 82 is configured to determine an original image based on the compressed image, the pre-repaired image, and the loss distribution image.

[0139] The loss detection model is trained by taking a compressed video frame corresponding to an original video frame as an input sample and taking a labeled distribution image corresponding to the compressed video frame as a labeled sample. Each labeled distribution image is determined based on a residual video frame of the corresponding compressed video frame and an original video frame corresponding to the compressed video frame.

[0140] In one possible implementation, the original image determination module 82 includes:

[0141] An image fusion sub-module is configured to perform transparency blending on the compressed image and the pre-repaired image based on the loss distribution image to obtain an original image.

[0142] In one possible implementation, the training process of the loss detection model includes:

[0143] Determining at least one original video frame and a compressed video frame corresponding to each original video frame.

[0144] Determining a residual video frame of each compressed video frame based on each original video frame and the corresponding compressed video frame.

[0145] Determining a labeled distribution image based on each residual video frame.

[0146] Training a loss detection model by taking each compressed video frame as an input sample and taking a labeled distribution image corresponding to each compressed video frame as a labeled sample.​

[0147] In a possible implementation, the determining of the at least one original video frame and the compressed video frame corresponding to each original video frame comprises:

[0148] determining at least one original video and a compressed video corresponding to each original video;

[0149] randomly extracting at least one video frame from each original video as an original video frame, and extracting a compressed video frame corresponding to the original video frame in the corresponding compressed video.

[0150] In a possible implementation, the determining of the at least one original video and the compressed video corresponding to each original video comprises:

[0151] determining at least one original video;

[0152] for each original video, randomly selecting a corresponding encoder and encoding strength;

[0153] performing video encoding on each original video according to the corresponding encoder and encoding strength to obtain a compressed video.

[0154] In a possible implementation, the determining of the residual video frame of each compressed video frame according to each original video frame and the corresponding compressed video frame comprises:

[0155] preprocessing each original video frame and the corresponding compressed video frame;

[0156] calculating the difference between each original video frame and the corresponding compressed video frame after preprocessing to obtain a residual video frame of each compressed video frame.

[0157] In a possible implementation, the preprocessing of each original video frame and the corresponding compressed video frame comprises:

[0158] performing high-pass filtering on each original video frame and the corresponding compressed video frame.

[0159] In a possible implementation, the determining of the label distribution image according to each residual video frame comprises:

[0160] for each residual video frame, the following steps are performed respectively:

[0161] determining a pixel region corresponding to each pixel position in the residual video frame;

[0162] determining a feature value of each pixel position corresponding to each pixel region;

[0163] Determine a label distribution image according to the feature value of each pixel position.

[0164] In a possible implementation, the determining of the pixel region corresponding to each pixel position in the residual video frame comprises:

[0165] Determine an image frame of a preset size.

[0166] The pixel region corresponding to each pixel position is determined as a residual video frame region included in the image frame when the pixel position is at a center position of the image frame.

[0167] In a possible implementation, the pixel region corresponding to each pixel position can be obtained by sliding the image frame.

[0168] In a possible implementation, the determining of the feature value of each pixel position corresponding to the pixel region comprises:

[0169] For each pixel region, the square mean of each pixel included in the pixel region is calculated to obtain the feature value.

[0170] In a possible implementation, the determining of the label distribution image according to the feature value of each pixel position comprises:

[0171] Each feature value is stored in the corresponding pixel position to obtain the label distribution image.

[0172] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or includes modules that can be used to execute the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, it will not be repeated here.

[0173] The embodiments of the present disclosure also propose a computer-readable storage medium having computer program instructions stored thereon, and the computer program instructions are executed by a processor to implement the above method. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0174] The embodiments of the present disclosure also propose an electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.

[0175] The embodiments of the present disclosure also provide a computer program product, comprising computer readable code or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code is run in the processor of the electronic device, the processor in the electronic device executes the above method.

[0176] An electronic device can be provided as a terminal, a server, or other forms of device.

[0177] Figure 9 A schematic diagram of an electronic device 800 according to an embodiment of the disclosure is shown. The electronic device 800 can be, for example, a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0178] Referring to Figure 9 The electronic device 800 can include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0179] The processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to complete all or part of steps of the methods described above. In addition, the processing component 802 can include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0180] The memory 804 is configured to store various types of data to support operations of the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disc or optical disc.

[0181] The power component 806 provides power to the various components of the electronic device 800. The power component 806 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0182] The multimedia component 808 includes a screen to provide an output interface between the electronic device 800 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. The front camera and / or the rear camera can receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.

[0183] The audio component 810 is configured to output and / or input an audio signal. For example, the audio component 810 includes a microphone (MIC) to receive an external audio signal when the electronic device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker to output an audio signal.

[0184] The I / O interface 812 provides an interface for the processing component 802 and peripheral interface modules, such as a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0185] The sensor component 814 includes one or more sensors to provide various state assessments for the electronic device 800. For example, the sensor component 814 can detect an open / closed position of the electronic device 800, relative positioning of components, such as a display and a keypad of the electronic device 800, a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a temperature change of the electronic device 800. The sensor component 814 can include a proximity sensor configured to detect the presence of a nearby object without any physical touch. The sensor component 814 can further include a light sensor such as a complementary metal oxide semiconductor (CMOS) or charge coupled device (CCD) image sensor, useful for image- and / or light- capturing applications. In some embodiments, the sensor component 814 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0186] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as Wireless Fidelity (WiFi), 2nd Generation (2G) or 3rd Generation (3G) cellular telecommunication, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, Ultra-WideBand (UWB) techniques, Bluetooth (BT) techniques, and other techniques.

[0187] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.

[0188] In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804 including computer program instructions, is also provided, which can be executed by the processor 820 of the electronic device 800 to complete the above-described methods.

[0189] Figure 10 A schematic diagram of another electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 can be provided as a server. Referring to Figure 10 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932, for storing instructions executable by the processing component 1922, such as an application program. The application program stored in the memory 1932 can include one or more than one module each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute the instructions to perform the above-described methods.

[0190] The electronic device 1900 can further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as a Microsoft Windows Server operating system (Windows Server OS) or a Linux operating system. TM), a graphical user interface-based operating system (Mac OSX TM ), a multi-user, multi-tasking computer operating system (Unix TM ), a free and open-source Unix-like operating system (Linux TM ), an open-source Unix-like operating system (FreeBSD TM ), or the like.

[0191] In an example embodiment, a non-transitory computer-readable storage medium, such as memory 1932 including computer program instructions, is also provided, which can be executed by processing component 1922 of electronic device 1900 to complete the above method.

[0192] The present disclosure can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.

[0193] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.

[0194] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0195] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, for example, through the Internet using an Internet Service Provider. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0196] The computer readable program instructions can also be loaded onto a computing / processing device, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computing / processing device, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computing / processing device, other programmable apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0197] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can be a computer readable storage medium having no data signals on it. The instructions can be executed by one or more processors to generate a computer-implemented process such that the instructions, which execute via one or more processors of the computer or other programmable data processing apparatus, create software means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0198] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable data processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0199] The flow diagrams and the block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical functions (‘instruction(s)’). In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and

[0200] The computer program product can be embodied by a hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) or the like.

[0201] Having described above several embodiments of the disclosure, any modifications and variations that fall within the scope of the described embodiments are also intended to be within the scope of the disclosure. As will be apparent to those skilled in the art, some modifications and variations to the embodiments described above can be practiced while staying within the scope and spirit of the described embodiments. The foregoing description of the described embodiments has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the described embodiments to the precise form disclosed. Many modifications and variations are possible in light of the above teachings. It is intended that the disclosed embodiments be limited only by the claims.

Claims

1. A method for compressing image restoration, characterized in that, The method includes: The compressed image is repaired using a preset non-blind repair algorithm to obtain a pre-repaired image; The compressed image is input into the trained loss detection model to obtain the corresponding loss distribution image; The original image is determined based on the compressed image, the pre-repaired image, and the loss distribution image. The loss detection model is trained by using the compressed video frame corresponding to the original video frame as input sample and the labeled distribution image corresponding to the compressed video frame as labeled sample. Each labeled distribution image is determined by the corresponding compressed video frame and the residual video frame of the original video frame corresponding to the compressed video frame.

2. The method according to claim 1, characterized in that, Determining the original image based on the compressed image, the pre-repaired image, and the loss distribution image includes: Based on the loss distribution image, the compressed image and the pre-repaired image are mixed with transparency to obtain the original image.

3. The method according to claim 1 or 2, characterized in that, The training process of the loss detection model includes: Determine at least one original video frame, and a compressed video frame corresponding to each original video frame; Based on each original video frame and the corresponding compressed video frame, determine the residual video frame for each compressed video frame; A labeled distribution image is determined based on each of the residual video frames; The loss detection model is trained by using each compressed video frame as an input sample and the labeled distribution image corresponding to each compressed video frame as a labeled sample.

4. The method according to claim 3, characterized in that, The step of determining at least one original video frame and the compressed video frame corresponding to each original video frame includes: Identify at least one original video and a compressed video corresponding to each of the original videos; At least one video frame is randomly selected from each of the original videos as an original video frame, and the compressed video frame corresponding to the original video frame is extracted from the corresponding compressed video.

5. The method according to claim 4, characterized in that, The determination of at least one original video and the compressed video corresponding to each original video includes: Identify at least one original video; For each of the original videos, a corresponding encoder and encoding intensity are randomly selected; Based on the corresponding encoder and encoding intensity, each of the original videos is encoded to obtain a compressed video.

6. The method according to claim 3, characterized in that, The step of determining the residual video frame for each compressed video frame based on each original video frame and the corresponding compressed video frame includes: Preprocess each of the original video frames and the corresponding compressed video frames; The difference between each preprocessed original video frame and its corresponding compressed video frame is calculated to obtain the residual video frame for each compressed video frame.

7. The method according to claim 6, characterized in that, The preprocessing of each original video frame and the corresponding compressed video frame includes: High-pass filtering is performed on each of the original video frames and the corresponding compressed video frames.

8. The method according to claim 3, characterized in that, Determining the labeled distribution image based on each residual video frame includes: For each of the residual video frames, perform the following steps: Determine the pixel region corresponding to each pixel position in the residual video frame; Determine the feature value of the pixel position corresponding to each pixel region; The labeled distribution image is determined based on the feature value of each pixel location.

9. The method according to claim 8, characterized in that, Determining the pixel region corresponding to each pixel position in the residual video frame includes: Define the image frame of the preset size; The pixel region corresponding to each pixel position is determined as the residual video frame region included in the image frame when the pixel position is at the center of the image frame.

10. The method according to claim 9, characterized in that, The pixel region corresponding to each pixel position is obtained by sliding the image frame.

11. The method according to claim 8, characterized in that, The feature values ​​used to determine the pixel position corresponding to each pixel region include: For each pixel region, the feature value is obtained by calculating the mean square of the squares of the pixels included therein.

12. The method according to claim 8, characterized in that, Determining the labeled distribution image based on the feature value of each pixel location includes: Each feature value is stored in the corresponding pixel position to obtain the labeled distribution image.

13. A compressed image restoration device, characterized in that, The device includes: The image restoration module is used to restore compressed images using a preset non-blind restoration algorithm to obtain a pre-restored image; The loss determination module is used to input the compressed image into the trained loss detection model to obtain the corresponding loss distribution image; The original image determination module is used to determine the original image based on the compressed image, the pre-repaired image, and the loss distribution image. The loss detection model is trained by using the compressed video frame corresponding to the original video frame as input sample and the labeled distribution image corresponding to the compressed video frame as labeled sample. Each labeled distribution image is determined by the corresponding compressed video frame and the residual video frame of the original video frame corresponding to the compressed video frame.

14. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 12.

15. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Image enhancement method achieved by intelligently increasing field depth

    CN103593834A

  • Video processor training method and device, video processing device and video processing method

    CN111988621A