Video denoising and corresponding relation construction method and device, equipment and storage medium
By constructing the corresponding relationship between distortion degree and noise intensity, directly querying the noise intensity estimate for video denoising processing, the problem of complex noise intensity estimation in the existing technology is solved, and the efficiency and effect of video denoising are improved.
Patent Information
- Application Number
- CN202310171024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2024-08-23
AI Technical Summary
In existing video denoising methods, the process of determining the estimated value of image noise intensity is complex, resulting in low video denoising efficiency and large computing resource usage.
By constructing the corresponding relationship between the distortion degree and the noise intensity, and using the distortion degree of the preset image under different noises, the noise intensity estimate of the current image is directly queried for denoising processing.
It reduces the complexity of noise intensity estimation, improves video denoising efficiency, saves computing resources, and improves denoising effect.
Smart Images

Figure CN118537244A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a method, device, equipment and storage medium for video denoising and corresponding relationship establishment. Background Art
[0002] Video noise is the random variation of brightness or color of an image generated by a sensor, scanner circuit, or digital camera, and is considered an unwanted component in image acquisition. Therefore, in order to improve the display effect of the video or improve the accuracy of video-based task analysis, it is necessary to remove the noise in the video.
[0003] In the current video denoising method, for each frame of the video, a noise intensity is first estimated for the current image, and then the current image is denoised based on the noise intensity estimation value. However, the current method for determining the noise intensity estimation value of the current image is relatively complicated, which makes the video denoising process inefficient and occupies a large amount of computing resources. Summary of the invention
[0004] The present application provides a video denoising and corresponding relationship construction method, device, equipment and storage medium to simplify the process of determining the noise intensity estimation value of the current image, improve the denoising efficiency of the video, save computing resources, and improve the denoising effect.
[0005] In a first aspect, the present application provides a method for constructing a corresponding relationship between distortion and noise intensity, comprising:
[0006] For a j-th noise among P noises of different intensities, use the j-th noise to perform noise addition processing on a preset image to obtain a j-th noisy image, where j is a positive integer less than or equal to P;
[0007] Determine a reconstructed block of each image block in the j-th noisy image, and determine at least one flat block from each reconstructed block of the j-th noisy image;
[0008] Determining a distortion degree of each flat block in the at least one flat block, and determining a distortion degree of the preset image under the j-th noise based on the distortion degree of each flat block in the at least one flat block;
[0009] Based on the distortion degree of the preset image under each of the P noises, a corresponding relationship between the distortion degree and the noise intensity is obtained, and the corresponding relationship between the distortion degree and the noise intensity is used for video denoising.
[0010] In a second aspect, the present application provides a video denoising method, comprising:
[0011] Determine a reconstructed block of N image blocks included in the current image, where N is a positive integer;
[0012] Determine M flat blocks from the reconstructed blocks of the N image blocks, where M is a positive integer less than or equal to N;
[0013] Determine the distortion of each of the M flat blocks, and determine, based on the distortion of each of the M flat blocks, a noise intensity estimation value corresponding to the current image in a pre-established correspondence relationship between the distortion and the noise intensity, wherein the correspondence relationship between the distortion and the noise intensity is established by the method shown in the first aspect above;
[0014] Based on the noise intensity estimation value corresponding to the current image, denoising is performed on the current image.
[0015] In a third aspect, the present application provides a device for establishing a corresponding relationship between distortion and noise intensity, comprising:
[0016] a noise adding unit, configured to perform noise adding processing on a preset image using a j-th noise among P noises of different intensities, to obtain a j-th noisy image, where j is a positive integer less than or equal to P;
[0017] a processing unit, configured to determine a reconstructed block of each image block in the j-th noisy image, and determine at least one flat block from each reconstructed block of the j-th noisy image;
[0018] a distortion determination unit, configured to determine the distortion of each flat block in the at least one flat block, and determine the distortion of the preset image under the j-th noise based on the distortion of each flat block in the at least one flat block;
[0019] The relationship determination unit is used to obtain the corresponding relationship between the distortion degree and the noise intensity based on the distortion degree of the preset image under each of the P noises, and the corresponding relationship between the distortion degree and the noise intensity is used for video denoising.
[0020] In a fourth aspect, the present application provides a video denoising device, comprising:
[0021] A reconstruction unit, used to determine a reconstructed block of N image blocks included in the current image, where N is a positive integer;
[0022] A processing unit, configured to determine M flat blocks from the reconstructed blocks of the N image blocks, where M is a positive integer less than or equal to N;
[0023] an estimating unit, configured to determine a distortion degree of each of the M flat blocks, and determine a noise intensity estimation value corresponding to the current image in a pre-established correspondence relationship between the distortion degree and the noise intensity based on the distortion degree of each of the M flat blocks, wherein the correspondence relationship between the distortion degree and the noise intensity is established by the method described in the first aspect;
[0024] The denoising unit is used to perform denoising processing on the current image based on the noise intensity estimation value corresponding to the current image.
[0025] In a fifth aspect, the present application provides a computing device, comprising a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method of the first aspect or the second aspect.
[0026] In a sixth aspect, a chip is provided for implementing the method in each implementation of the first aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory so that a device equipped with the chip executes the method in the first aspect.
[0027] In a seventh aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method of the first aspect or the second aspect.
[0028] In an eighth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method of the first aspect or the second aspect.
[0029] In a ninth aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method of the first aspect or the second aspect.
[0030] In summary, in the present application, a preset image is firstly subjected to noise processing by using noises of different intensities to determine the distortion of the preset image under different noises, and then the corresponding relationship between the distortion and the noise intensity is determined, that is, for the jth noise among P noises of different intensities, the preset image is subjected to noise processing by using the jth noise to obtain the jth noisy image, the reconstructed blocks of each image block in the jth noisy image are determined, and at least one flat block is determined from each reconstructed block of the jth noisy image, the distortion of at least one flat block is determined, and based on the distortion of at least one flat block, the distortion of the preset image under the jth noise is determined, and then based on the distortion of the preset image under each of the P noises, the corresponding relationship between the distortion and the noise intensity is obtained. In this way, during actual denoising, the noise intensity estimation value corresponding to the current image is directly queried in the correspondence between the distortion and noise intensity constructed above, and then the current image is denoised based on the noise intensity estimation value corresponding to the current image, which reduces the complexity of noise intensity estimation, improves video denoising efficiency, saves computing resources, and improves video denoising effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 A schematic diagram of an application scenario involved in an embodiment of the present application;
[0033] Figure 2 is a schematic block diagram of a video encoder provided in an embodiment of the present application;
[0034] Figure 3 is a schematic block diagram of a video decoder provided in an embodiment of the present application;
[0035] Figure 4 A flowchart of a method for constructing a corresponding relationship between distortion and noise intensity provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of the corresponding relationship between distortion and noise intensity involved in an embodiment of the present application;
[0037] Figure 6 A flowchart of a video denoising method provided by an embodiment of the present application;
[0038] Figure 7 A flowchart of a video denoising method provided by an embodiment of the present application;
[0039] Figure 8 A schematic diagram of video denoising involved in an embodiment of the present application;
[0040] Fig. 9 A schematic diagram of the structure of a device for establishing a correspondence relationship between distortion and noise intensity provided in an embodiment of the present application;
[0041] Fig.10 A schematic diagram of the structure of a video denoising device provided in one embodiment of the present application;
[0042] Fig.11 It is a schematic block diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0045] The video denoising method provided in the embodiments of the present application can be applied to cloud computing, real-time video, video encoding and decoding and other fields to denoise the video to improve the video playback effect.
[0046] In order to facilitate understanding of the embodiments of the present application, the relevant concepts involved in the embodiments of the present application are briefly introduced as follows:
[0047] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0048] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0049] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0050] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0051] Figure 1 A schematic diagram of an application scenario involved in an embodiment of the present application, including a collection device 101 and a computing device 102.
[0052] The acquisition device 101 is used to acquire video data. Optionally, the acquisition device 101 can be any device with a video acquisition function, such as a camera, a smart phone, etc.
[0053] The computing device 102 is used to denoise the video captured by the acquisition device 101 by using the video denoising method provided in the embodiment of the present application to obtain high-quality video data. For example, the computing device 102 uses P noises of different intensities to perform noise processing on the preset image respectively, and determines the distortion of the preset image under each of the P noises; based on the distortion of the preset image under each of the P noises, obtains the corresponding relationship between the distortion and the noise intensity; based on the corresponding relationship between the distortion and the noise intensity, determines the noise intensity estimation value corresponding to the previous image; based on the noise intensity estimation value corresponding to the current image, denoises the current image.
[0054] Optionally, the computing device 102 may be a terminal device, such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a mobile internet device (MID), or other terminal devices with a browser installed.
[0055] Optionally, the computing device may be a server. The server may be one or more servers. When there are multiple servers, there are at least two servers for providing different services, and / or there are at least two servers for providing the same service, such as providing the same service in a load balancing manner, which is not limited in the embodiments of the present application.
[0056] Optionally, the above server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server can also become a node of the blockchain.
[0057] In some embodiments, the acquisition device 101 is connected to the computing device 102 via a network. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or a call network.
[0058] In some embodiments, the present application can be applied to any video denoising field. For example, in the field of intelligent task analysis, when performing task analysis based on denoised videos, the accuracy of task analysis can be improved.
[0059] In some embodiments, the present application can be applied to the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, the field of real-time video coding and decoding, etc. For example, the scheme of the present application can be combined with an audio video coding standard (AVS), such as the H.264 / audio video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Alternatively, the scheme of the present application can be combined with other proprietary or industry standards and operate, and the standards include ITU-TH.261, ISO / IECMPEG-1Visual, ITU-TH.262 or ISO / IECMPEG-2Visual, ITU-TH.263, ISO / IECMPEG-4Visual, ITU-TH.264 (also known as ISO / IECMPEG-4AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. It should be understood that the technology of the present application is not limited to any specific coding standard or technology.
[0060] The following is an introduction to the video encoding framework involved in the embodiments of the present application.
[0061] Figure 22 is a schematic block diagram of a video encoder provided in an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression on an image, or can be used to perform lossless compression on an image. The lossless compression can be visually lossless compression or mathematically lossless compression.
[0062] The video encoder 200 may be applied to image data in luminance and chrominance (YCbCr, YUV) format.
[0063] For example, the video encoder 200 reads video data, and for each frame of the video data, divides the frame into a number of coding tree units (CTUs). In some examples, CTB may be referred to as a "tree block", "largest coding unit" (LCU) or "coding tree block" (CTB). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to a luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU may be associated with a luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU may be further divided into a number of coding units (CUs) for encoding, and a CU may be a rectangular block or a square block. CU can be further divided into prediction unit (PU) and transform unit (TU), so that coding, prediction and transform are separated and more flexible in processing. In one example, CTU is divided into CU in quadtree mode, and CU is divided into TU and PU in quadtree mode.
[0064] The video encoder and video decoder may support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder may support PU sizes of 2N×2N or N×N for intra-frame prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N or similar sizes for inter-frame prediction. The video encoder and video decoder may also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.
[0065] In some embodiments, Figure 2 As shown, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components.
[0066] Optionally, in the present application, the current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), etc. A prediction block may also be referred to as a prediction image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.
[0067] In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame estimation unit 212. Since there is a strong correlation between adjacent pixels in a frame of a video, an intra-frame prediction method is used in the video coding and decoding technology to eliminate spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in a video, an inter-frame prediction method is used in the video coding and decoding technology to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0068] The inter-frame prediction unit 211 can be used for inter-frame prediction. Inter-frame prediction can refer to the image information of different frames. Inter-frame prediction uses motion information to find reference blocks from reference frames, and generates prediction blocks based on reference blocks to eliminate temporal redundancy. The frames used for inter-frame prediction can be P frames and / or B frames. P frames refer to forward prediction frames, and B frames refer to bidirectional prediction frames. Motion information includes a reference frame list where the reference frame is located, a reference frame index, and a motion vector. The motion vector can be an integer pixel or a sub-pixel. If the motion vector is a sub-pixel, it is necessary to use interpolation filtering in the reference frame to make the required sub-pixel block. Here, the integer pixel or sub-pixel block in the reference frame found according to the motion vector is called a reference block. Some technologies will directly use the reference block as a prediction block, and some technologies will generate a prediction block based on the reference block. Reprocessing the prediction block based on the reference block can also be understood as using the reference block as a prediction block and then processing the prediction block to generate a new prediction block.
[0069] The most commonly used inter-frame prediction methods currently include: geometric partitioning mode (GPM) in the VVC video codec standard and angular weighted prediction (AWP) in the AVS3 video codec standard. These two intra-frame prediction modes have something in common in principle.
[0070] The intra-frame estimation unit 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy. The frame used for intra-frame prediction can be an I frame.
[0071] The intra-frame prediction modes used by HEVC are Planar, DC, and 33 angle modes, for a total of 35 prediction modes. The intra-frame modes used by VVC are Planar, DC, and 65 angle modes, for a total of 67 prediction modes. The intra-frame modes used by AVS3 are DC, Plane, Bilinear, and 63 angle modes, for a total of 66 prediction modes.
[0072] In some embodiments, the intra-frame estimation unit 212 may be implemented using an intra-frame block copy technology and an intra-frame string copy technology.
[0073] The residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate a residual block of the CU so that each sample in the residual block has a value equal to the difference between the following two: a sample in the pixel blocks of the CU and a corresponding sample in the prediction blocks of the PUs of the CU.
[0074] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of the CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.
[0075] The inverse transform / quantization unit 240 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct a residual block from the quantized transform coefficients.
[0076] The reconstruction unit 250 may add the samples of the reconstructed residual block to the corresponding samples of one or more prediction blocks generated by the prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of the CU in this manner, the video encoder 200 may reconstruct the pixel blocks of the CU.
[0077] Loop filtering unit 260 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU.
[0078] In some embodiments, the loop filter unit 260 includes a deblocking filter unit and a sample adaptive offset / adaptive loop filter (SAO / ALF) unit, wherein the deblocking filter unit is used to remove the block effect, and the SAO / ALF unit is used to remove the ringing effect.
[0079] The decoded image buffer 270 may store the reconstructed pixel blocks. The inter prediction unit 211 may use the reference image containing the reconstructed pixel blocks to perform inter prediction on PUs of other images. In addition, the intra estimation unit 212 may use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra prediction on other PUs in the same image as the CU.
[0080] The entropy encoding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data.
[0081] Figure 3 It is a schematic block diagram of a video decoder provided in an embodiment of the present application.
[0082] like Figure 3 As shown, the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filter unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.
[0083] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the syntax elements in the bitstream that have been entropy encoded. The prediction unit 320, the inverse quantization / transformation unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data according to the syntax elements extracted from the bitstream, that is, generate decoded video data.
[0084] In some embodiments, the prediction unit 320 includes an intra-prediction unit 321 and an inter-prediction unit 322 .
[0085] The intra prediction unit 321 may perform intra prediction to generate a prediction block of a PU. The intra prediction unit 321 may use an intra prediction mode to generate a prediction block of a PU based on a pixel block of a spatially neighboring PU. The intra prediction unit 321 may also determine an intra prediction mode of a PU according to one or more syntax elements parsed from a code stream.
[0086] The inter prediction unit 322 may construct a first reference image list (list 0) and a second reference image list (list 1) according to the syntax elements parsed from the code stream. In addition, if the PU is encoded using inter prediction, the entropy decoding unit 310 may parse the motion information of the PU. The inter prediction unit 322 may determine one or more reference blocks of the PU according to the motion information of the PU. The inter prediction unit 322 may generate a prediction block of the PU according to the one or more reference blocks of the PU.
[0087] The inverse quantization / transform unit 330 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
[0088] After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU.
[0089] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
[0090] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU.
[0091] The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
[0092] The basic process of video encoding and decoding is as follows: at the encoding end, a frame of image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block. The residual unit 220 can calculate the residual block based on the original block of the prediction block and the current block, that is, the difference between the original block of the prediction block and the current block, and the residual block can also be called residual information. The residual block can remove information that is not sensitive to the human eye through the transformation and quantization process of the transformation / quantization unit 230 to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transformation / quantization unit 230 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 receives the quantized change coefficient output by the change quantization unit 230, and can entropy encode the quantized change coefficient and output a bit stream. For example, the entropy coding unit 280 can eliminate character redundancy according to the target context model and the probability information of the binary bit stream.
[0093] At the decoding end, the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction unit 320 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block based on the prediction information. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or on the block to obtain a decoded image. The encoding end also requires similar operations as the decoding end to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference frame for inter-frame prediction for subsequent frames.
[0094] It should be noted that the block division information determined by the encoder, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder by analyzing the existing information, thereby ensuring that the decoded image obtained by the encoder is the same as the decoded image obtained by the decoder.
[0095] The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
[0096] The application scenarios of the embodiment of the present application combined with the video coding and decoding technology include but are not limited to the following:
[0097] In scenario 1, a video encoder obtains a video, and uses the video denoising method provided in an embodiment of the present application to denoise at least one image in the video to obtain a denoised video. Then, the denoised video is encoded to obtain a bitstream.
[0098] In scenario 2, the video encoder obtains the original video, encodes the original video, and obtains a bitstream. After obtaining the bitstream, the video decoder decodes the bitstream to obtain a decoded reconstructed video. Then, the video decoder uses the video denoising method provided in the embodiment of the present application to denoise at least one image in the reconstructed video to obtain a denoised video.
[0099] In the current video denoising method, for each frame of the video, a noise intensity is first estimated for the current image, and then the current image is denoised based on the noise intensity estimation value. However, the current method for determining the noise intensity estimation value of the current image is relatively complicated, which makes the video denoising process inefficient and occupies a large amount of computing resources.
[0100] In order to solve the above technical problems, the present application first adds noise to a preset image by using noises of different intensities, determines the distortion of the preset image under different noises, and then determines the corresponding relationship between the distortion and the noise intensity. In this way, when denoising the current image in the video, the reconstruction block of the N image blocks included in the current image is determined; from the reconstruction blocks of the N image blocks, M flat blocks are determined; the distortion of each of the M flat blocks is determined, and based on the distortion of each of the M flat blocks, the noise intensity estimation value corresponding to the current image is directly queried in the corresponding relationship between the distortion and the noise intensity constructed above, and then based on the noise intensity estimation value corresponding to the current image, the current image is denoised, which reduces the complexity of noise intensity estimation, improves video denoising efficiency, saves computing resources, and improves video denoising effect.
[0101] The technical solutions of the embodiments of the present application are described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0102] First, the process of constructing the corresponding relationship between distortion and noise intensity is introduced.
[0103] Figure 4 A flowchart of a method for constructing a correspondence between distortion and noise intensity provided in an embodiment of the present application. The execution subject of the present application is a device with a data processing function, such as a device for constructing a correspondence between distortion and noise intensity. The construction device may be a computing device, or a part of a computing device, such as a processor in a computing device. For ease of description, the following description is made by taking the execution subject as an example of a computing device. Figure 4 As shown, the method of the embodiment of the present application includes the following steps:
[0104] S101 . For a j-th noise among P noises of different intensities, use the j-th noise to perform noise addition processing on a preset image to obtain a j-th noisy image.
[0105] Wherein, j is a positive integer less than or equal to P.
[0106] In this embodiment, different noises are used to add noise to the preset image to obtain the distortion of the preset image under different noises, and then based on the distortion of the preset image under different noises, the corresponding relationship between the distortion and the noise intensity is obtained. For example, the preset image is added noise by using noise 1 to obtain the distortion of the preset image under noise 1, and the preset image is added noise by using noise 2 to obtain the distortion of the preset image under noise 2. By analogy, the preset image can be added noise by using noise P to obtain the distortion of the preset image under noise P. Then, based on the distortion of the preset image under P different noises, the corresponding relationship between the distortion and the noise intensity is obtained.
[0107] The embodiment of the present application does not limit the specific content and quantity of the preset images. That is, the preset images can be images of any content, and the number of preset images can be 1 or more.
[0108] In a specific example, the preset image is a noise-free image.
[0109] The embodiment of the present application does not limit the specific strength of the P noises. For example, the strength sigma of the P noises gradually increases from 1 to 20 or other values.
[0110] Since the process of determining the distortion of the preset image under each of the P noises is the same, the process of determining the distortion of the preset image under the j-th noise among the P noises is taken as an example for description.
[0111] For the jth noise under P noises, the computing device uses the jth noise to perform noise processing on the preset image to obtain the noisy preset image. For the convenience of description, the preset image after the jth noise is added is recorded as the jth noisy image.
[0112] S102: Determine a reconstructed block of each image block in the j-th noisy image, and determine at least one flat block from each reconstructed block of the j-th noisy image.
[0113] The specific methods of reconstructing each image block in the j-th noisy image in the embodiment of the present application include but are not limited to the following:
[0114] Method 1: The computing device predicts the image block to obtain the prediction block of the image block. Then, the image block is subtracted from the prediction block to obtain the residual value of the image block. Then, the computing device transforms the residual value of the image block to obtain the transformation coefficient of the image block, and quantizes the transformation coefficient of the image block to obtain the quantization coefficient of the image block. Finally, the quantization coefficient of the image block is inversely quantized to obtain the transformation coefficient of the image block, and the transformation coefficient of the image block is inversely transformed to obtain the residual value of the image block, and the reconstruction value of the image block is obtained based on the prediction block and the residual value of the image block.
[0115] Mode 2: The computing device determines a reconstructed block of the image block through the following steps S102-A1 to S102-A3:
[0116] S102-A1, for any image block among the image blocks in the j-th noisy image, perform transformation processing on the image block to obtain a transformation coefficient of the image block;
[0117] S102-A2, setting the transformation coefficients of the image block that are less than a preset value to 0 to obtain the sheared transformation coefficients;
[0118] S102-A3, performing inverse transformation on the sheared transformation coefficients to obtain a reconstructed block of the image block.
[0119] The embodiment of the present application performs transformation processing on the image block, and the specific method of obtaining the transformation coefficient of the image block is not limited.
[0120] In an example, the image block may be transformed by using Fourier transform to obtain the transform coefficients of the image block.
[0121] In another example, a discrete cosine transform (DCT) method may be used to transform the image block to obtain a transform coefficient of the image block.
[0122] For example, the image block is transformed using a one-dimensional DCT transform as shown in formula (1) to obtain the transform coefficient of the image block:
[0123]
[0124] Where N is the sum of the elements of one-dimensional data, x n is the nth element.
[0125] For another example, the image block is transformed using the two-dimensional DCT transformation method shown in formula (2) to obtain the transformation coefficient of the image block:
[0126]
[0127] Among them, N1XN2 is the total number of elements of the two-dimensional data, x n1 , n2 is the (n1, n2)th element, k 1 =0,…N1-1,k 2 =0,…N2-1.
[0128] In some embodiments, in areas with high texture complexity, DCT transform will affect the texture while removing noise, resulting in greater distortion. Therefore, 2D-DCT is generally not used for noise reduction, but other methods are used for transformation.
[0129] Based on the above method, the computing device transforms the image block to obtain the transformation coefficients of the image block, and then sets the transformation coefficients of the image block that are less than the preset value to 0 through HARD_CLIP to obtain the clipped transformation coefficients.
[0130] Exemplarily, the computing device shears the transform coefficients of the image block through the following code:
[0131]
[0132] Among them, min_val is the preset value.
[0133] The specific value of the preset value min_val in the embodiment of the present application is not limited.
[0134] In one example, the computing device may determine the preset value min_val by using the following formula (3):
[0135] min_val=(int32_t)(lamda3D*sigma1*2)(3)
[0136] The embodiment of the present application does not limit the specific values of the parameters lamda3D and sigma1 in the above formula (3).
[0137] Exemplarily, lamda3D is set to 2.7.
[0138] For example, sigma1 is 7.
[0139] The computing device sets the transform coefficients of the image block that are less than a preset value to 0 through the above method, obtains the sheared transform coefficients, and then inversely transforms the sheared transform coefficients to obtain a reconstructed block of the image block.
[0140] The embodiment of the present application does not limit the specific manner in which the computing device performs an inverse transformation on the sheared transformation coefficients to obtain a reconstructed block of the image block.
[0141] In a possible implementation, the inverse transformation method used by the computing device corresponds to the transformation method used above. For example, when the computing device transforms the image block using the DCT method to obtain the transformation coefficient of the image block, the computing device inversely transforms the sheared transformation coefficient using the IDCT method to obtain a reconstructed block of the image block.
[0142] The computing device adopts the above method to determine the reconstructed blocks of each image block in the j-th noisy image, and determines at least one flat block from each reconstructed block of the j-th noisy image.
[0143] In the flat area of the image, the high-frequency signal is mainly noise, and there is a linear relationship between the distortion of the flat block and the actual noise intensity sigma. Therefore, after the computing device determines the reconstructed blocks of each image block in the j-th noisy image, it selects a flat block from the reconstructed blocks of each image block in the j-th noisy image, and then obtains at least one flat block. Then, the computing device can determine the distortion of the preset image under the j-th noise based on the distortion of at least one flat block.
[0144] The specific process of determining at least one flat block from each reconstructed block of the j-th noisy image is introduced below.
[0145] In some embodiments, the method of determining whether the reconstructed block is a flat block may be to determine the texture features of the reconstructed block, and determine whether the reconstructed block is a flat block based on the texture features of the reconstructed block. For example, the grayscale values of the pixels in the reconstructed block are counted to obtain the texture features of the reconstructed block. If the texture features of the reconstructed block meet the preset requirements, for example, the texture features of the reconstructed block are continuous and no mutation occurs, then the reconstructed block is determined to be a flat block.
[0146] In some embodiments, the computing device may further determine whether the reconstructed block is a flat block through the following steps S102-B1 and S102-B2:
[0147] S102-B1, determining the texture complexity of the i-th reconstructed block among the reconstructed blocks of the j-th noisy image, where i is a positive integer;
[0148] S102-B2: If the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, determine that the i-th reconstructed block is a flat block.
[0149] In the embodiment of the present application, the method of determining whether each reconstructed block is a flat block is the same. For ease of description, the method of determining whether the i-th reconstructed block is a flat block is used as an example for explanation.
[0150] In this implementation, the computing device determines whether the reconstructed block is a flat block by the texture complexity of the reconstructed block. Specifically, taking the i-th reconstructed block as an example, the computing device first determines the texture complexity of the i-th reconstructed block. If the texture complexity of the i-th reconstructed block is greater than a preset threshold, it means that the texture of the i-th reconstructed block is more complex, that is, the i-th reconstructed block is an area with higher texture complexity, rather than a flat area. Therefore, it is determined that the i-th reconstructed block is not a flat block. If the texture complexity of the i-th reconstructed block is less than or equal to the above preset threshold, it means that the texture of the i-th reconstructed block is simpler, that is, the i-th reconstructed block is a flat area, rather than an area with higher texture complexity. Therefore, it is determined that the i-th reconstructed block is a flat block.
[0151] The specific process of determining the texture complexity of the i-th reconstructed block in the above S102-B1 is introduced below.
[0152] The embodiment of the present application does not limit the specific manner in which the computing device determines the texture complexity of the i-th reconstructed block.
[0153] In a possible implementation, the computing device counts the grayscale values of the pixels in the ith reconstructed block to obtain the texture complexity of the ith reconstructed block. For example, the minimum grayscale value and the maximum grayscale value in the ith reconstructed block are compared to determine the texture complexity of the ith reconstructed block.
[0154] In another possible implementation, the computing device determines the texture complexity of the i-th reconstructed block through the following steps S102-B11 and S102-B12:
[0155] S102-B11, determining the grayscale average value of the i-th reconstructed block based on the grayscale value of each pixel in the i-th reconstructed block;
[0156] S102-B12. Determine the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0157] In this implementation, when the computing device determines the texture complexity of the i-th reconstructed block, it first determines the grayscale average value of the i-th reconstructed block. For example, the grayscale values of each pixel in the i-th reconstructed block are added and the average value is taken to obtain the grayscale average value of the i-th reconstructed block.
[0158] Exemplarily, the computing device may obtain the grayscale average value of the i-th reconstructed block through the following code:
[0159]
[0160] The size of the i-th reconstructed block is N*N, and iBAVG represents the grayscale average value of the i-th reconstructed block.
[0161] After the grayscale average value of the i-th reconstructed block is determined through the above steps, step S102 - B2 is executed to determine the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0162] The embodiment of the present application does not limit the specific method of determining the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0163] In one example, the computing device may compare the grayscale average value of the i-th reconstructed block with the minimum grayscale value and the maximum grayscale value of the pixel points in the i-th reconstructed block to obtain the texture complexity of the i-th reconstructed block. For example, the absolute value of the difference between the grayscale average value of the i-th reconstructed block and the minimum grayscale value of the pixel points in the i-th reconstructed block is determined, recorded as value 1, the absolute value of the difference between the grayscale average value of the i-th reconstructed block and the maximum grayscale value of the pixel points in the i-th reconstructed block is determined, recorded as value 2, and the value 1 is added to the value 2 to obtain the texture complexity of the i-th reconstructed block.
[0164] In another example, the computing device determines the texture complexity of the i-th reconstructed block through the following steps:
[0165] S102-B121, determining the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block;
[0166] S102-B122. Obtain the texture complexity of the i-th reconstructed block based on the sum of the absolute values of the differences.
[0167] In this implementation, the computing device compares the grayscale value of each pixel in the i-th reconstructed block with the grayscale average value of the i-th reconstructed block calculated above to calculate the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block. The sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block calculated can reflect the texture complexity of the i-th reconstructed block, and the texture complexity of the i-th reconstructed block is determined based on the sum of the absolute values of the differences.
[0168] The embodiment of the present application does not limit the specific manner in which the computing device obtains the texture complexity of the i-th reconstructed block based on the sum of the absolute values of the differences.
[0169] In one possible implementation, the computing device performs preset processing on the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block, such as multiplying by a preset coefficient, etc., to obtain the texture complexity of the i-th reconstructed block.
[0170] In another possible implementation, the computing device directly determines the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block as the texture complexity of the i-th reconstructed block.
[0171] Exemplarily, the computing device may obtain the texture complexity of the i-th reconstructed block through the following code:
[0172]
[0173] Where iBTV represents the texture complexity of the i-th reconstructed block.
[0174] After the computing device determines the texture complexity of the i-th reconstructed block based on the above steps, it determines whether the i-th reconstructed block is a flat block based on the texture complexity of the i-th reconstructed block. For example, if the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, the i-th repeated block is determined to be a flat block.
[0175] Exemplarily, the computing device may determine whether the i-th reconstructed block is a flat block by using the following code:
[0176] Int32_t IsPlainBlock(uint8_t*block,int32_t N){
[0177] return GetBTV(block,N,GetBAVG(block,N))<64;
[0178] }
[0179] In the above code, the preset threshold is 64. It should be noted that in addition to 64, the preset threshold can also be 128 or other values. The embodiment of the present application does not limit this and is determined based on actual needs.
[0180] The above describes the specific process of determining whether the i-th reconstructed block is a flat block. The computing device can refer to the above method to determine at least one flat block from each reconstructed block of the j-th noisy image. Next, the following step S103 is performed.
[0181] S103: Determine the distortion degree of each flat block in at least one flat block, and determine the distortion degree of the preset image under the jth noise based on the distortion degree of each flat block in at least one flat block.
[0182] Based on the above steps, the computing device determines at least one flat block from each reconstructed block of the j-th noisy image, and then determines the distortion of each flat block in the at least one flat block.
[0183] The embodiment of the present application does not limit the specific method of determining the distortion degree of the flat block.
[0184] In a possible implementation, the MSE (Mean Square Error) of the flat block is calculated. For example, the mean square error MSE between the flat block and each pixel in the original image block corresponding to the flat block is determined, and the MSE is used to represent the distortion of the flat block.
[0185] In another possible implementation manner, a PSNR (Peak Signal to Noise Ratio) of a flat block is calculated, and the PSNR of the flat block is used to represent the distortion of the flat block.
[0186] Exemplarily, the PSNR of the flat block is determined based on the following formula (4):
[0187]
[0188] Where MSE is the mean square error of the flat block, n is the number of bits per sample value, and the unit of PSNR is dB. The larger the PSNR, the smaller the distortion of the flat block.
[0189] After obtaining the distortion of each flat block in at least one flat block corresponding to the j-th noisy image based on the above method, the computing device determines the distortion of the preset image under the j-th noise based on the distortion of each flat block in the at least one flat block. The embodiment of the present application does not limit the specific manner of determining the distortion of the preset image under the j-th noise based on the distortion of each flat block in the at least one flat block.
[0190] In a possible implementation manner, the computing device determines the sum of the distortion of each flat block in the at least one flat block as the distortion of the preset image under the j-th noise.
[0191] In a possible implementation manner, the computing device determines the distortion degree of the flat block with the largest distortion among the at least one flat block as the distortion degree of the preset image under the j-th noise.
[0192] In a possible implementation, the computing device selects a portion of flat blocks whose distortion is greater than a preset value from the at least one flat block, and determines the distortion of the preset image under the jth noise based on the distortion of the portion of flat blocks. For example, the sum or average of the distortion of the portion of flat blocks is determined as the distortion of the preset image under the jth noise.
[0193] In a possible implementation manner, the computing device determines an average value of the distortion of each flat block in the at least one flat block as the distortion of the preset image under the j-th noise.
[0194] The computing device may refer to the above method to determine the degree of distortion of the preset image under each of the P noises.
[0195] Exemplarily, after adding different noises to the preset image, the distortion corresponding to the preset image is shown in Table 1:
[0196] Table 1
[0197] Sigma Distortion PNSR Sigma = 1 psrn=44 Sigma = 2 PSRN=42 …… …… Sigma = 20 PSRN=27 …… ……
[0198] S104 . Based on the distortion of the preset image under each of the P noises, a corresponding relationship between the distortion and the noise intensity is obtained. The corresponding relationship between the distortion and the noise intensity is used for video denoising.
[0199] The embodiment of the present application does not limit the specific expression form of the corresponding relationship between distortion and noise intensity.
[0200] In an example, the corresponding relationship between the distortion and the noise intensity may be as shown in Table 2:
[0201] Table 2
[0202] Distortion Noise intensity a0 b0 a1 b1 …… …… ai bi …… ……
[0203] It can be seen from Table 1 above that one distortion degree corresponds to one noise intensity, that is, the distortion degree and the noise intensity correspond one to one.
[0204] In an example, the corresponding relationship between the distortion and the noise intensity may be as shown in Table 3:
[0205] Table 3
[0206] Distortion range Noise intensity [a0, a1) b0 [a1, a2) b1 …… …… [ai,ai+1) bi-1 …… ……
[0207] It can be seen from Table 3 above that one distortion interval corresponds to one noise intensity.
[0208] In another example, curve fitting can be performed based on the lookup table shown in Table 1 to obtain Figure 5 The distortion and noise intensity curve shown.
[0209] The technical solution of the embodiment of the present application firstly performs noise processing on the preset image by using noises of different intensities, determines the distortion of the preset image under different noises, and then determines the corresponding relationship between the distortion and the noise intensity, that is, for the jth noise among P noises of different intensities, uses the jth noise to perform noise processing on the preset image, obtains the jth noisy image, determines the reconstruction block of each image block in the jth noisy image, and determines at least one flat block from each reconstructed block of the jth noisy image, determines the distortion of at least one flat block, and determines the distortion of the preset image under the jth noise based on the distortion of at least one flat block, and then obtains the corresponding relationship between the distortion and the noise intensity based on the distortion of the preset image under each noise in the P noises. In this way, in actual denoising, the noise intensity estimation value corresponding to the current image is directly queried in the corresponding relationship between the distortion and the noise intensity constructed above, and then the current image is denoised based on the noise intensity estimation value corresponding to the current image, which reduces the complexity of noise intensity estimation, improves video denoising efficiency, saves computing resources, and improves video denoising effect.
[0210] The above describes the process of constructing the correspondence between the distortion and the noise intensity. The following describes the process of performing video denoising based on the correspondence.
[0211] Figure 6 The flowchart of the video denoising method provided by an embodiment of the present application. The execution subject of the present application is a device with a video denoising function, such as a video denoising device, and the video denoising device is a computing device, or a part of a computing device, such as a processor in a computing device. In some embodiments, if the method of the embodiment of the present application is applied to a video encoding end, the computing device can be Figure 2 In some embodiments, if the method of the embodiment of the present application is applied to a video decoding end, the computing device may be Figure 3 In some embodiments, if the method of the embodiment of the present application is applied to other fields, the computing device may be a terminal device or a server, and the present application does not limit this. For ease of description, the method of the embodiment of the present application is introduced below by taking the execution subject as a computing device as an example.
[0212] like Figure 6 As shown, the method comprises the following steps:
[0213] S201: Determine a reconstructed block of N image blocks included in a current image.
[0214] Wherein, N is a positive integer.
[0215] A video is composed of a series of image frames, and for each frame of an image in a video, the method of denoising the image is the same. Therefore, for ease of description, the present embodiment of the application takes the current image in the video as an example to introduce the video denoising method provided by the present embodiment of the application.
[0216] In the process of video encoding and decoding, the current image is divided into image blocks, and each image block is encoded and decoded. For example, the current image is divided into several coding units (Coding Unit, CU) for encoding, and the CU can be a rectangular block or a square block. The embodiment of the present application does not limit the size of the image block. For example, the current image can be divided into several image blocks of 64×64, 32×32, 16×16 or 8×8 sizes for processing.
[0217] The embodiment of the present application does not limit the specific number of N image blocks that need to be denoised in the current image.
[0218] In one example, the N image blocks are all image blocks in the current image. That is, the computing device uses the denoising method provided in the embodiment of the present application to perform denoising on all image blocks included in the current image to obtain a denoised image.
[0219] In another example, the N image blocks are part of all image blocks included in the current image. That is, the computing device uses the denoising method provided in the embodiment of the present application to denoise a part of the current image to obtain a denoised image.
[0220] The video denoising method provided in the embodiment of the present application can be understood as preprocessing of the video.
[0221] If the video denoising method provided in the embodiment of the present application is applied to the above Figure 2 When encoding the video shown in the figure, the computing device first performs denoising on the video before encoding the video, and then encodes the denoised video to obtain a bit stream. In this way, the decoding end decodes the bit stream and obtains the denoised video for display, thereby improving the display effect of the video.
[0222] In the embodiment of the present application, the specific method of determining the reconstructed block of each of the N image blocks in the current image is the same. For the convenience of description, the following is explained by taking determining the reconstructed block of one image block as an example.
[0223] The computing device determines the reconstructed block of the image block in at least the following ways:
[0224] Method 1: A computing device (such as a video encoder) predicts the image block to obtain a prediction block of the image block. Next, the image block is subtracted from the prediction block to obtain a residual value of the image block. Then, the computing device transforms the residual value of the image block to obtain a transformation coefficient of the image block, and quantizes the transformation coefficient of the image block to obtain a quantization coefficient of the image block. Finally, the quantization coefficient of the image block is inversely quantized to obtain a transformation coefficient of the image block, and the transformation coefficient of the image block is inversely transformed to obtain a residual value of the image block, and a reconstructed value of the image block is obtained based on the prediction block and the residual value of the image block.
[0225] Mode 2: A computing device (e.g., a video encoder) determines a reconstructed block of an image block through the following steps S201-A to S201-C:
[0226] S201-A, for any image block among the N image blocks, perform transformation processing on the image block to obtain a transformation coefficient of the image block;
[0227] S201-B, setting the transformation coefficients of the image block that are less than a preset value to 0 to obtain the sheared transformation coefficients;
[0228] S201-C, performing inverse transformation on the sheared transformation coefficients to obtain a reconstructed block of the image block.
[0229] In the embodiment of the present application, for some videos, such as still continuous-tone images, the method shown in the above-mentioned method 2 can be used to determine the reconstructed block of the image block.
[0230] Specifically, the image block is transformed to obtain the transformation coefficient of the image block. The specific manner in which the image block is transformed to obtain the transformation coefficient of the image block in the embodiment of the present application is not limited.
[0231] In an example, the image block may be transformed by using Fourier transform to obtain the transform coefficients of the image block.
[0232] In another example, a discrete cosine transform (DCT) method may be used to transform the image block to obtain a transform coefficient of the image block.
[0233] For example, the image block is transformed using a one-dimensional DCT transform as shown in formula (1) to obtain a transform coefficient of the image block.
[0234] For another example, the image block is transformed using a two-dimensional DCT transform as shown in formula (2) to obtain a transform coefficient of the image block.
[0235] Based on the above method, the computing device transforms the image block to obtain the transform coefficients of the image block, and then sets the transform coefficients of the image block that are less than the preset value to 0 through HARD_CLIP to obtain the sheared transform coefficients. Then, the sheared transform coefficients are inversely transformed to obtain the reconstructed block of the image block.
[0236] The embodiment of the present application does not limit the specific manner in which the computing device performs an inverse transformation on the sheared transformation coefficients to obtain a reconstructed block of the image block.
[0237] In a possible implementation, the inverse transformation method used by the computing device corresponds to the transformation method used above. For example, when the computing device transforms the image block using the DCT method to obtain the transformation coefficient of the image block, the computing device inversely transforms the sheared transformation coefficient using the IDCT method to obtain a reconstructed block of the image block.
[0238] After the computing device adopts the above method to determine the reconstructed block of each of the N image blocks included in the current image, the following step S202 is executed.
[0239] S202: Determine M flat blocks from the reconstructed blocks of the N image blocks.
[0240] Wherein, M is a positive integer less than or equal to N.
[0241] In the flat area of the image, the high-frequency signal is mainly noise, and there is a linear relationship between the distortion of the flat block and the actual noise intensity sigma. Therefore, after the computing device determines the reconstructed blocks of the N image blocks of the current image, it selects the flat blocks from the N reconstructed blocks to obtain M flat blocks. Then, the computing device can determine the noise intensity estimation value of the current image based on the distortion of the M flat blocks.
[0242] The specific process of determining M flat blocks from the reconstructed blocks of N image blocks is introduced below.
[0243] In some embodiments, the method of determining whether the reconstructed block is a flat block may be to determine the texture features of the reconstructed block, and determine whether the reconstructed block is a flat block based on the texture features of the reconstructed block. For example, the grayscale values of the pixels in the reconstructed block are counted to obtain the texture features of the reconstructed block. If the texture features of the reconstructed block meet the preset requirements, for example, the texture features of the reconstructed block are continuous and no mutation occurs, then the reconstructed block is determined to be a flat block.
[0244] In some embodiments, the computing device may further determine whether the reconstructed block is a flat block through the following steps S202-A and S202-B:
[0245] S202-A, determining the texture complexity of the i-th reconstructed block among the reconstructed blocks of the N image blocks, where i is a positive integer;
[0246] S202-B: If the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, determine that the i-th reconstructed block is a flat block.
[0247] In the embodiment of the present application, the method of determining whether each reconstructed block is a flat block is the same. For ease of description, the method of determining whether the i-th reconstructed block is a flat block is used as an example for explanation.
[0248] In this implementation, the computing device determines whether the reconstructed block is a flat block by the texture complexity of the reconstructed block. Specifically, taking the i-th reconstructed block as an example, the computing device first determines the texture complexity of the i-th reconstructed block. If the texture complexity of the i-th reconstructed block is greater than a preset threshold, it means that the texture of the i-th reconstructed block is more complex, that is, the i-th reconstructed block is an area with higher texture complexity, rather than a flat area. Therefore, it is determined that the i-th reconstructed block is not a flat block. If the texture complexity of the i-th reconstructed block is less than or equal to the above preset threshold, it means that the texture of the i-th reconstructed block is simpler, that is, the i-th reconstructed block is a flat area, rather than an area with higher texture complexity. Therefore, it is determined that the i-th reconstructed block is a flat block.
[0249] The specific implementation process of determining the texture complexity of the i-th reconstructed block in the above S202-A is substantially the same as that of the above embodiment.
[0250] For example, the computing device determines the texture complexity of the i-th reconstructed block through the following steps S202-A1 and S202-A2:
[0251] S202-A1, determining the grayscale average value of the i-th reconstructed block based on the grayscale value of each pixel in the i-th reconstructed block;
[0252] S202-A2: Determine the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0253] In this implementation, when the computing device determines the texture complexity of the i-th reconstructed block, it first determines the grayscale average value of the i-th reconstructed block. For example, the grayscale values of each pixel in the i-th reconstructed block are added and the average value is taken to obtain the grayscale average value of the i-th reconstructed block.
[0254] The embodiment of the present application does not limit the specific method of determining the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0255] In one example, the computing device may compare the grayscale average value of the i-th reconstructed block with the minimum grayscale value and the maximum grayscale value of the pixel points in the i-th reconstructed block to obtain the texture complexity of the i-th reconstructed block. For example, the absolute value of the difference between the grayscale average value of the i-th reconstructed block and the minimum grayscale value of the pixel points in the i-th reconstructed block is determined, recorded as value 1, the absolute value of the difference between the grayscale average value of the i-th reconstructed block and the maximum grayscale value of the pixel points in the i-th reconstructed block is determined, recorded as value 2, and the value 1 is added to the value 2 to obtain the texture complexity of the i-th reconstructed block.
[0256] In another example, the computing device determines the texture complexity of the i-th reconstructed block through the following steps:
[0257] S202-A21, determining the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block;
[0258] S202-A22. Obtain the texture complexity of the i-th reconstructed block based on the sum of the absolute values of the differences.
[0259] In this implementation, the computing device compares the grayscale value of each pixel in the i-th reconstructed block with the grayscale average value of the i-th reconstructed block calculated above to calculate the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block. The sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block calculated can reflect the texture complexity of the i-th reconstructed block, and the texture complexity of the i-th reconstructed block is determined based on the sum of the absolute values of the differences.
[0260] The embodiment of the present application does not limit the specific manner in which the computing device obtains the texture complexity of the i-th reconstructed block based on the sum of the absolute values of the differences.
[0261] In one possible implementation, the computing device performs preset processing on the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block, such as multiplying by a preset coefficient, etc., to obtain the texture complexity of the i-th reconstructed block.
[0262] In another possible implementation, the computing device directly determines the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value of the i-th reconstructed block as the texture complexity of the i-th reconstructed block.
[0263] After the computing device determines the texture complexity of the i-th reconstructed block based on the above steps, it determines whether the i-th reconstructed block is a flat block based on the texture complexity of the i-th reconstructed block. For example, if the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, the i-th repeated block is determined to be a flat block.
[0264] In addition to 64, the above preset threshold can also be 128 or other values. The embodiment of the present application does not limit this and is determined based on actual needs.
[0265] The above describes the specific process of determining whether the i-th reconstructed block is a flat block. The computing device can refer to the above method to select M flat blocks from the reconstructed blocks of N image blocks. Next, the following step S203 is performed.
[0266] S203: Determine the distortion of each of the M flat blocks, and based on the distortion of each of the M flat blocks, determine a noise intensity estimation value corresponding to the current image in a pre-established correspondence relationship between the distortion and the noise intensity.
[0267] It can be seen from the above that in the flat area of the image, the distortion of the flat block is linearly related to the noise intensity. Therefore, based on the distortion of the flat block, the noise intensity estimation value corresponding to the current image can be queried in the corresponding relationship between the distortion and the noise intensity constructed above.
[0268] Specifically, after the computing device determines M flat blocks from the reconstructed blocks of the current image, it calculates the distortion of each of the M flat blocks.
[0269] The embodiment of the present application does not limit the specific method of determining the distortion degree of the flat block.
[0270] In a possible implementation, the MSE (Mean Square Error) of the flat block is calculated. For example, the mean square error MSE between the flat block and each pixel in the original image block corresponding to the flat block is determined, and the MSE is used to represent the distortion of the flat block.
[0271] In another possible implementation manner, a Peak Signal to Noise Ratio (PSNR) of the flat block is calculated, and the PSNR of the flat block is used to represent the distortion of the flat block.
[0272] After obtaining the distortion of each of the M flat blocks based on the above method, the computing device determines the noise intensity estimation value corresponding to the current image in the correspondence between the distortion and the noise intensity constructed above based on the distortion of each of the M flat blocks.
[0273] That is to say, the embodiment of the present application first constructs a correspondence between distortion and noise intensity. In this way, when the current image in the video is actually denoised, the distortion of each of the M flat blocks corresponding to the current image can be determined through the above steps, and then based on the distortion of each of the M flat blocks, the noise intensity estimation value corresponding to the current image is determined in the pre-constructed correspondence between distortion and noise intensity.
[0274] The embodiment of the present application does not limit the specific manner in which the computing device determines the noise intensity estimation value corresponding to the current image based on the distortion of each flat block in the M flat blocks and in the pre-constructed correspondence between the distortion and the noise intensity.
[0275] In a possible implementation, the computing device determines, for each flat block among the M flat blocks, the noise intensity corresponding to the distortion of the flat block in the pre-established correspondence relationship between the distortion and the noise intensity based on the distortion of the flat block. In this way, the noise intensity corresponding to the distortion of each flat block among the M flat blocks can be determined, and then based on the noise intensity corresponding to the distortion of each flat block among the M flat blocks, the noise intensity estimation value corresponding to the current image can be determined, for example, the average value or weighted average value of the noise intensity corresponding to the distortion of each flat block among the M flat blocks is determined as the noise intensity estimation value corresponding to the current image.
[0276] In another possible implementation, the computing device determines the noise intensity estimation value corresponding to the current image through the following steps:
[0277] S203-A1, determining the distortion degree of the current image based on the distortion degree of each flat block in the M flat blocks;
[0278] S203-A2: Based on the distortion of the current image, in the corresponding relationship between the distortion and the noise intensity, find out the noise intensity estimation value corresponding to the current image.
[0279] In this implementation, the computing device can determine the distortion of the current image based on the distortion of each of the M flat blocks, and then based on the distortion of the current image, find the noise intensity estimation value corresponding to the current image in the corresponding relationship between the distortion and the noise intensity.
[0280] The embodiment of the present application does not limit the specific method of determining the distortion degree of the current image based on the distortion degree of each flat block in the M flat blocks.
[0281] In an example, the distortion degree of the current image is determined by summing the distortion degree of each flat block in the M flat blocks.
[0282] In another example, the average value of the distortion of each flat block in the M flat blocks is determined as the distortion of the current image.
[0283] After the computing device determines the distortion of the current image, based on the distortion of the current image, the target noise intensity is found in the corresponding relationship between the distortion and the noise intensity. For example, as shown in Table 1, assuming that the calculated distortion of the current image is PSRN=42, it can be determined that the noise intensity estimation value corresponding to the current image is sigma=2.
[0284] As can be seen from the above, in the embodiment of the present application, the correspondence between the distortion and the noise intensity is pre-constructed. In the actual denoising process, it is only necessary to determine the distortion of the flat block corresponding to the current image, and then find the noise intensity estimation value corresponding to the current image in the pre-constructed correspondence between the distortion and the noise intensity based on the distortion of the flat block. The entire noise intensity estimation process is simple, has low computational complexity, fast computational speed, and occupies few computing resources, and can be implemented on computing devices with low real-time performance and computing power.
[0285] Figure 7 A schematic diagram of a video denoising method flow chart provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, including:
[0286] S300 , using P noises of different intensities to perform noise processing on the preset image respectively, and determining the distortion degree of the preset image under each of the P noises, where P is a positive integer greater than 1.
[0287] The implementation process of the above S300 may refer to the specific description of the above S101 to S103.
[0288] For example, for the jth noise among P noises, use the jth noise to perform noise processing on the preset image to obtain the jth noisy image, where j is a positive integer less than or equal to P; determine the reconstructed block of each image block in the jth noisy image; determine at least one flat block from each reconstructed block of the jth noisy image; determine the distortion of each flat block in the at least one flat block, and determine the distortion of the preset image under the jth noise based on the distortion of each flat block in the at least one flat block.
[0289] Referring to the above method, after the distortion of the preset image under each of the P noises is determined, the following step S301 is performed to construct a corresponding relationship between the distortion and the noise intensity.
[0290] S301 . Obtain a corresponding relationship between the distortion degree and the noise intensity based on the distortion degree of a preset image under each of P noises.
[0291] The specific implementation process of the above S301 can refer to the specific description of the above S104, which will not be repeated here.
[0292] The above S300 and S301 are the process of constructing the corresponding relationship between the distortion and the noise intensity. The corresponding relationship between the distortion and the noise intensity has been constructed before the actual denoising operation.
[0293] Based on the distortion of the preset image under each of the P noises, construct Figure 5 After understanding the correspondence between the distortion degree and the noise intensity shown, the video denoising process can be performed as shown below.
[0294] The following S310 to S316 can be understood as a process of performing video denoising based on the correspondence between the distortion degree and the noise intensity constructed above.
[0295] S310. Determine a reconstructed block of N image blocks included in the current image, where N is a positive integer.
[0296] The specific implementation process of the above S310 may refer to the specific description of the above S201.
[0297] For example, for each of the N image blocks included in the current image, the image block is transformed to obtain the transformation coefficient of the image block; the transformation coefficients of the image block that are less than a preset value are set to 0 to obtain the sheared transformation coefficient; the sheared transformation coefficient is inversely transformed to obtain a reconstructed block of the image block.
[0298] S312 . Determine M flat blocks from the reconstructed blocks of the N image blocks, where M is a positive integer less than or equal to N.
[0299] The specific process of determining whether the reconstructed block is a flat block may refer to the specific description of S202 above.
[0300] For example, for the i-th reconstructed block in the reconstructed blocks, the texture complexity of the i-th reconstructed block is determined. Exemplarily, based on the grayscale values of each pixel in the i-th reconstructed block, the grayscale average value of the i-th reconstructed block is determined; based on the grayscale average value of the i-th reconstructed block, the texture complexity of the i-th reconstructed block is determined, for example, the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value is determined; based on the sum of the absolute values of the differences, the texture complexity of the i-th reconstructed block is obtained. If the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, the i-th reconstructed block is determined to be a flat block.
[0301] S313: Determine the distortion of each flat block in the M flat blocks.
[0302] For example, the PSNR of a flat block is calculated, and the PSNR of the flat block is used to measure the distortion of the flat block.
[0303] S314: Determine the ratio of the number of M flat blocks to the number of N image blocks.
[0304] S315: Determine whether the ratio is greater than or equal to a preset ratio.
[0305] If the ratio is greater than or equal to a preset ratio (eg, 15%), the following step S316 is executed.
[0306] If the ratio is less than a preset ratio (eg, 15%), the following step S317 is executed.
[0307] Because in areas with high texture complexity, DCT transform will affect the texture while removing noise, resulting in a large degree of distortion. Therefore, 2D-DCT is generally not used for noise reduction. In addition, the correspondence between the above distortion and noise intensity is constructed based on flat blocks. Therefore, in order to improve the estimation accuracy of noise intensity, before determining the noise intensity estimation value of the current image, first determine whether the flat area of the current image meets the preset requirements. If the flat area of the current image meets the preset requirements (that is, the noise of the current image is globally uniformly distributed), the noise intensity estimation value of the current image is determined by searching the corresponding relationship constructed by this application. If the texture of the current image is more complex, other methods can be used to determine the noise intensity estimation value of the current image.
[0308] S316 , based on the distortion of each flat block in the M flat blocks, determine a noise intensity estimation value corresponding to the previous image in a pre-constructed correspondence relationship between the distortion and the noise intensity.
[0309] For example, based on the distortion of each flat block in the M flat blocks, the distortion of the current image is determined. Exemplarily, the average of the distortion of each flat block in the M flat blocks is determined as the distortion of the current image. Then, based on the distortion of the current image, in the corresponding relationship between the distortion and the noise intensity, the noise intensity estimation value corresponding to the previous image is found.
[0310] For example, Figure 8As shown, the first image block in the current image is taken as the current block, and a 2D DCT transform is used to remove the high-frequency information of the video data to obtain the transform coefficients of the current block. Next, the HARD_CLIP pruning method is used to prune the transform coefficients of the current block that are less than the preset value (i.e., set them to 0) to obtain the pruned transform coefficients. The pruned transform coefficients are then inversely transformed to obtain a reconstructed block of the current block. Determine whether the reconstructed block is a flat block. If the reconstructed block is a flat block, calculate the distortion of the reconstructed block, such as PSNR, and take the next image block of the current image as the current block, and repeat the above steps. If the reconstructed block is not a flat block, take the next image block of the current image as the current block, and repeat the above steps. Based on the above steps, the M flat blocks in the current image and the distortion of the M flat blocks can be determined, and the average of the distortion of the M flat blocks is determined as the distortion of the current image. Then, based on the distortion of the current image, Figure 5 From the corresponding relationship between the distortion and the noise intensity shown, the noise intensity estimation value corresponding to the previous image is determined.
[0311] S317: Use other methods to obtain a noise intensity estimation value corresponding to the current image.
[0312] S318: Perform denoising processing on the current image based on the noise intensity estimation value corresponding to the current image.
[0313] The video denoising method provided in the embodiment of the present application pre-constructs a correspondence between distortion and noise intensity. In the actual denoising process, a reconstructed block of N image blocks included in the current image is determined; M flat blocks are determined from the reconstructed blocks of the N image blocks; the distortion of each of the M flat blocks is determined, and based on the distortion of each of the M flat blocks, a target noise intensity is determined in the pre-constructed correspondence between distortion and noise intensity; based on the target noise intensity, a noise intensity estimation value corresponding to the current image is determined, and then based on the noise intensity estimation value corresponding to the current image, denoising is performed on the current image, thereby reducing the complexity of noise intensity estimation, improving video denoising efficiency, saving computing resources, and improving video denoising effect.
[0314] It should be understood that Figures 4 to 8 This is only an example of the present application and should not be construed as limiting the present application.
[0315] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.
[0316] Combination of the above Figures 4 to 8 , a method embodiment of the present application is described in detail, and an apparatus embodiment of the present application is described in detail below.
[0317] Fig. 9 A schematic diagram of the structure of a device for establishing a correspondence between distortion and noise intensity provided in an embodiment of the present application.
[0318] like Fig. 9 As shown, the device 10 comprises:
[0319] A noise adding unit 11 is used for performing noise adding processing on the preset image using the j-th noise among P noises of different intensities to obtain a j-th noisy image, where j is a positive integer less than or equal to P;
[0320] A processing unit 12 is used to determine a reconstructed block of each image block in the j-th noisy image, and determine at least one flat block from each reconstructed block of the j-th noisy image;
[0321] a distortion determination unit 13, configured to determine the distortion of each flat block in the at least one flat block, and determine the distortion of the preset image under the j-th noise based on the distortion of each flat block in the at least one flat block;
[0322] The relationship determination unit 14 is used to obtain a corresponding relationship between the distortion degree and the noise intensity based on the distortion degree of the preset image under each of the P noises, and the corresponding relationship between the distortion degree and the noise intensity is used for video denoising.
[0323] In some embodiments, the processing unit 12 is specifically used to transform any image block among the image blocks in the j-th noisy image to obtain the transformation coefficient of the image block; set the transformation coefficients of the image block that are less than a preset value to 0 to obtain the sheared transformation coefficient; and perform inverse transformation on the sheared transformation coefficient to obtain a reconstructed block of the image block.
[0324] In some embodiments, the processing unit 12 is specifically used to determine the texture complexity of the i-th reconstructed block among the reconstructed blocks of the j-th noisy image, where i is a positive integer; if the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, then determine that the i-th reconstructed block is the flat block.
[0325] In some embodiments, the processing unit 12 is specifically used to determine the grayscale average value of the i-th reconstructed block based on the grayscale value of each pixel in the i-th reconstructed block; and determine the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0326] In some embodiments, the processing unit 12 is specifically used to determine the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value; based on the sum of the absolute values of the differences, obtain the texture complexity of the i-th reconstructed block.
[0327] In some embodiments, the distortion determination unit 13 is configured to determine an average value of the distortion of each flat block in the at least one flat block as the distortion of the preset image under the j-th noise.
[0328] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Fig. 9 The device 10 shown can perform the above Figure 4 The method embodiment shown in the figure, and the above-mentioned and other operations and / or functions of each module in the device 9 are respectively to achieve the above-mentioned Figure 4 For the sake of brevity, the method embodiments shown are not described in detail here.
[0329] Fig.10 A schematic diagram of the structure of a video denoising device provided in one embodiment of the present application.
[0330] like Fig.10 As shown, the device 20 comprises:
[0331] A reconstruction unit 21, configured to determine a reconstructed block of N image blocks included in a current image, where N is a positive integer;
[0332] A processing unit 22, configured to determine M flat blocks from the reconstructed blocks of the N image blocks, where M is a positive integer less than or equal to N;
[0333] The estimation unit 23 is used to determine the distortion of each flat block in the M flat blocks, and determine the noise intensity estimation value corresponding to the current image in a pre-established correspondence relationship between the distortion and the noise intensity based on the distortion of each flat block in the M flat blocks, wherein the correspondence relationship between the distortion and the noise intensity is determined by Figure 4 The method described is constructed to obtain;
[0334] The denoising unit 24 is configured to perform denoising processing on the current image based on the noise intensity estimation value corresponding to the current image.
[0335] In some embodiments, the reconstruction unit 21 is specifically used to transform any image block among the N image blocks to obtain the transformation coefficient of the image block; set the transformation coefficients of the image block that are less than a preset value to 0 to obtain the sheared transformation coefficient; and perform inverse transformation on the sheared transformation coefficient to obtain a reconstructed block of the image block.
[0336] In some embodiments, the processing unit 22 is specifically used to determine the texture complexity of the i-th reconstructed block among the reconstructed blocks of the N image blocks, where i is a positive integer; if the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, the i-th reconstructed block is determined to be the flat block.
[0337] In some embodiments, the processing unit 22 is specifically used to determine the grayscale average value of the i-th reconstructed block based on the grayscale value of each pixel in the i-th reconstructed block; and determine the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block.
[0338] In some embodiments, the processing unit 22 is specifically used to determine the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value; based on the sum of the absolute values of the differences, obtain the texture complexity of the i-th reconstructed block.
[0339] In some embodiments, the estimation unit 23 is further used to determine the ratio of the number of the M flat blocks to the number of the N image blocks before determining the noise intensity estimation value corresponding to the current image in a pre-constructed correspondence between the distortion and the noise intensity based on the distortion of each of the M flat blocks; if the ratio is greater than or equal to the preset ratio, the estimation unit 23 is used to determine the noise intensity estimation value corresponding to the current image in the correspondence between the distortion and the noise intensity based on the distortion of each of the M flat blocks.
[0340] In some embodiments, the estimation unit 23 is specifically used to determine the distortion of the current image based on the distortion of each flat block in the M flat blocks; based on the distortion of the current image, in the corresponding relationship between the distortion and the noise intensity, find out the noise intensity estimation value corresponding to the current image.
[0341] In some embodiments, the estimation unit 23 is specifically configured to determine an average value of the distortion of each flat block in the M flat blocks as the distortion of the current image.
[0342] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Fig.10 The device 20 shown can perform the above Figure 6 The method embodiment shown in the figure, and the aforementioned and other operations and / or functions of each module in the device 10 are respectively to achieve the above Figure 6 For the sake of brevity, the method embodiments shown are not described in detail here.
[0343] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.
[0344] Fig.11 It is a schematic block diagram of a computing device provided in an embodiment of the present application. The computing device can be the above-mentioned correspondence construction device, video denoising device, or video encoder, or video decoder.
[0345] like Fig.11 As shown, the computing device 40 may include:
[0346] The memory 41 and the processor 42, the memory 41 is used to store the computer program and transmit the program code to the processor 42. In other words, the processor 42 can call and run the computer program from the memory 41 to implement the method in the embodiment of the present application.
[0347] For example, the processor 42 may be configured to execute the above method embodiments according to instructions in the computer program.
[0348] In some embodiments of the present application, the processor 42 may include but is not limited to:
[0349] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0350] In some embodiments of the present application, the memory 41 includes but is not limited to:
[0351] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0352] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 41 and executed by the processor 42 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the video production device.
[0353] like Fig.11 As shown, the computing device 40 may also include:
[0354] The transceiver 40 and the transceiver 43 may be connected to the processor 42 or the memory 41 .
[0355] The processor 42 may control the transceiver 43 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 43 may include a transmitter and a receiver. The transceiver 43 may further include an antenna, and the number of antennas may be one or more.
[0356] It should be understood that the various components in the video production device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0357] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.
[0358] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.
[0359] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0360] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0361] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0362] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing a corresponding relationship between distortion and noise intensity, It is characterized in that include: For a j-th noise among P noises of different intensities, use the j-th noise to perform noise processing on a preset image to obtain a j-th noisy image, where j is a positive integer less than or equal to P; Determine a reconstructed block of each image block in the j-th noisy image, and determine at least one flat block from each reconstructed block of the j-th noisy image; Determining a distortion degree of each flat block in the at least one flat block, and determining a distortion degree of the preset image under the j-th noise based on the distortion degree of each flat block in the at least one flat block; Based on the distortion degree of the preset image under each of the P noises, a corresponding relationship between the distortion degree and the noise intensity is obtained, and the corresponding relationship between the distortion degree and the noise intensity is used for video denoising.
2. The method according to claim 1, It is characterized in that The determining of the reconstructed block of each image block in the j-th noisy image comprises: For any image block among the image blocks in the j-th noisy image, transform the image block to obtain a transform coefficient of the image block; The transformation coefficients of the image block that are smaller than a preset value are set to 0 to obtain the sheared transformation coefficients; The sheared transformation coefficients are inversely transformed to obtain a reconstructed block of the image block.
3. The method according to claim 1, It is characterized in that The step of determining at least one flat block from each reconstructed block of the j-th noisy image comprises: For an i-th reconstructed block among the reconstructed blocks of the j-th noisy image, determine the texture complexity of the i-th reconstructed block, where i is a positive integer; If the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, the i-th reconstructed block is determined to be the flat block.
4. The method according to claim 3, It is characterized in that The determining the texture complexity of the i-th reconstructed block comprises: Determining a grayscale average value of the i-th reconstructed block based on the grayscale value of each pixel in the i-th reconstructed block; Based on the grayscale average value of the i-th reconstructed block, the texture complexity of the i-th reconstructed block is determined.
5. The method according to claim 4, It is characterized in that The determining the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block comprises: Determine the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value; Based on the sum of the absolute values of the differences, the texture complexity of the i-th reconstructed block is obtained.
6. The method according to claim 1, It is characterized in that The determining, based on the distortion degree of each flat block in the at least one flat block, the distortion degree of the preset image under the j-th noise comprises: An average value of the distortion of each flat block in the at least one flat block is determined as the distortion of the preset image under the j-th noise.
7. A video denoising method, It is characterized in that include: Determine a reconstructed block of N image blocks included in the current image, where N is a positive integer; Determine M flat blocks from the reconstructed blocks of the N image blocks, where M is a positive integer less than or equal to N; Determine the distortion of each of the M flat blocks, and determine the noise intensity estimation value corresponding to the current image in a pre-established correspondence relationship between the distortion and the noise intensity based on the distortion of each of the M flat blocks, wherein the correspondence relationship between the distortion and the noise intensity is established by the method according to any one of claims 1 to 6; Based on the noise intensity estimation value corresponding to the current image, denoising is performed on the current image.
8. The method according to claim 7, It is characterized in that The determining of the reconstructed block of the N image blocks included in the current image comprises: For any image block among the N image blocks, transform the image block to obtain a transform coefficient of the image block; The transformation coefficients of the image block that are smaller than a preset value are set to 0 to obtain the sheared transformation coefficients; The sheared transformation coefficients are inversely transformed to obtain a reconstructed block of the image block.
9. The method according to claim 7, It is characterized in that Determining M flat blocks from the reconstructed blocks of the N image blocks comprises: For an i-th reconstructed block among the reconstructed blocks of the N image blocks, determine the texture complexity of the i-th reconstructed block, where i is a positive integer; If the texture complexity of the i-th reconstructed block is less than or equal to a preset threshold, the i-th reconstructed block is determined to be the flat block.
10. The method according to claim 9, It is characterized in that The determining the texture complexity of the i-th reconstructed block comprises: Determining a grayscale average value of the i-th reconstructed block based on the grayscale value of each pixel in the i-th reconstructed block; Based on the grayscale average value of the i-th reconstructed block, the texture complexity of the i-th reconstructed block is determined.
11. The method according to claim 10, It is characterized in that The determining the texture complexity of the i-th reconstructed block based on the grayscale average value of the i-th reconstructed block comprises: Determine the sum of the absolute values of the differences between the grayscale value of each pixel in the i-th reconstructed block and the grayscale average value; Based on the sum of the absolute values of the differences, the texture complexity of the i-th reconstructed block is obtained.
12. The method according to claim 7, It is characterized in that Before determining the noise intensity estimation value corresponding to the current image in the pre-established correspondence relationship between the distortion degree and the noise intensity based on the distortion degree of each flat block in the M flat blocks, the method further includes: Determining a ratio of the number of the M flat blocks to the number of the N image blocks; The step of determining the noise intensity estimation value corresponding to the current image based on the distortion of each of the M flat blocks in a pre-established correspondence relationship between the distortion and the noise intensity includes: If the ratio is greater than or equal to the preset ratio, based on the distortion of each of the M flat blocks, in the corresponding relationship between the distortion and the noise intensity, a noise intensity estimation value corresponding to the current image is determined.
13. The method according to claim 12, It is characterized in that The determining, based on the distortion of each flat block in the M flat blocks and in the corresponding relationship between the distortion and the noise intensity, a noise intensity estimation value corresponding to the current image includes: Determining a distortion degree of the current image based on a distortion degree of each of the M flat blocks; Based on the distortion of the current image, the noise intensity estimation value corresponding to the current image is searched in the corresponding relationship between the distortion and the noise intensity.
14. The method according to claim 13, It is characterized in that The step of determining the distortion degree of the current image based on the distortion degree of each flat block in the M flat blocks comprises: An average value of the distortion of each flat block in the M flat blocks is determined as the distortion of the current image.
15. A device for constructing a corresponding relationship between distortion and noise intensity, It is characterized in that include: a noise adding unit, configured to perform noise adding processing on a preset image using a j-th noise among P noises of different intensities, to obtain a j-th noisy image, where j is a positive integer less than or equal to P; a processing unit, configured to determine a reconstructed block of each image block in the j-th noisy image, and determine at least one flat block from each reconstructed block of the j-th noisy image; a distortion determination unit, configured to determine the distortion of each flat block in the at least one flat block, and determine the distortion of the preset image under the j-th noise based on the distortion of each flat block in the at least one flat block; The relationship determination unit is used to obtain the corresponding relationship between the distortion degree and the noise intensity based on the distortion degree of the preset image under each of the P noises, and the corresponding relationship between the distortion degree and the noise intensity is used for video denoising.
16. A video denoising device, It is characterized in that include: A reconstruction unit, used to determine a reconstructed block of N image blocks included in the current image, where N is a positive integer; A processing unit, configured to determine M flat blocks from the reconstructed blocks of the N image blocks, where M is a positive integer less than or equal to N; an estimating unit, configured to determine a distortion degree of each of the M flat blocks, and determine a noise intensity estimation value corresponding to the current image in a pre-established correspondence relationship between the distortion degree and the noise intensity based on the distortion degree of each of the M flat blocks, wherein the correspondence relationship between the distortion degree and the noise intensity is established by the method according to any one of claims 1 to 6; The denoising unit is used to perform denoising processing on the current image based on the noise intensity estimation value corresponding to the current image.
17. A computing device, It is characterized in that include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 6 or 7 to 14.
18. A computer-readable storage medium, It is characterized in that Used to store a computer program, the computer program causing a computer to execute the method as claimed in any one of claims 1 to 6 or 7 to 14.
