Image denoising method, device, electronic device, medium and program product

By calculating the variance and initial weight between the area block and the neighboring block, correcting the weight based on the noise direction difference, and adjusting the noise reduction algorithm, the problem of insufficient image detail retention in the prior art is solved, and a better image denoising effect is achieved.

CN114066765BActive Publication Date: 2025-08-26SHANGHAI WINGTECH INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111394551.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2025-08-26
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

Existing image denoising algorithms have shortcomings in preserving image edges and details, especially the original non-local mean algorithm proposed by Buades et al. will cause image details to be smeared.

Method used

By calculating the variance and initial weight between the area block and the neighboring block, correcting the weight based on the noise direction difference, adjusting the noise reduction algorithm to preserve image details, and using a centrally symmetric neighboring block for directional noise determination.

Benefits of technology

It improves the effect of the noise removal algorithm, makes image details more complete, and enhances the edge and detail retention capabilities of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114066765B_ABST
    Figure CN114066765B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device, medium, and program product for denoising an image, comprising: obtaining a region block and each neighboring block of the region block in an image, and calculating the variance and initial weight between the region block and each neighboring block; obtaining a noise direction difference in the first direction based on the variance between the neighboring block and the region block in a first direction, wherein the neighboring blocks in the first direction are centrally symmetric with the region block; correcting the initial weight between the region block and the neighboring block in the first direction based on the noise direction difference in the first direction, and obtaining a final weight between the region block and the neighboring block in the first direction; and denoising pixels in the region block based on the final weight between the region block and each neighboring block. The present application achieves the purpose of adjusting the noise reduction weight by adding directional noise determination, thereby improving the effect of the denoising algorithm and preserving more complete image details.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of image denoising, and in particular to an image denoising method, device, electronic device, medium, and program product. Background Art

[0002] Image denoising is the most fundamental and widely studied hot topic in the field of image processing. Its purpose is to remove various types of noise pollution introduced during image acquisition and transmission. Image denoising algorithms are widely used in calculations such as mobile phone photography, image fusion, and video processing. For example, in the field of mobile phone photography, noise reduction technology is generally designed. Among the many image denoising algorithms, the original non-local means algorithm proposed by Buades et al. has been proven to outperform other classic denoising methods. The basic idea of ​​this algorithm is to utilize the large amount of redundant information in the image and conduct a global search for similar blocks in the image block of each pixel in the image. The weighted average of similar structured blocks is used to reduce random noise and achieve the denoising effect. However, this method preserves the edge image of the image, but smooths out the details in the image. Summary of the Invention

[0003] To overcome the problems existing in the related art, the present disclosure provides an image denoising method, apparatus, electronic device, medium and program product.

[0004] The present invention provides an image denoising method, comprising:

[0005] Obtaining a region block and each neighboring block of the region block in an image, and calculating a variance and an initial weight between the region block and each neighboring block;

[0006] Obtaining a noise direction difference in the first direction based on a variance between a neighborhood block in a first direction and the regional block, wherein the neighborhood blocks in the first direction are centrally symmetric with respect to the regional block;

[0007] Correcting an initial weight between the region block and the neighboring block in the first direction according to the noise direction difference in the first direction to obtain a final weight between the region block and the neighboring block in the first direction;

[0008] Based on the final weight between the region block and each neighboring block, denoising is performed on the pixels in the region block.

[0009] In some embodiments, the correcting the initial weight between the region block and the neighboring block in the first direction according to the noise direction difference in the first direction to obtain the final weight between the region block and the neighboring block in the first direction includes:

[0010] Determining whether the noise direction difference in the first direction is greater than a preset threshold;

[0011] If so, reduce the initial weight between the regional block and the neighboring block in the first direction to obtain the final weight between the regional block and the neighboring block in the first direction; otherwise, increase the initial weight between the regional block and the neighboring block in the first direction to obtain the final weight between the regional block and the neighboring block in the first direction.

[0012] In some embodiments, it further includes:

[0013] Obtaining a difference between the noise direction difference in the first direction and a preset threshold;

[0014] Based on the difference, obtaining a correction amount of the initial weight between the regional block and the neighboring block in the first direction;

[0015] An initial weight between the region block and the neighboring blocks in the first direction is reduced or increased based on the correction amount to obtain a final weight between the region block and the neighboring blocks in the first direction.

[0016] In the above embodiment, the region block is a region block consisting of 3*3 pixels, and obtaining the noise direction difference in the first direction based on the variance between the neighboring block and the region block in the first direction includes:

[0017] Obtaining an average value of variances between the region block and two neighboring blocks that are centrally symmetric about the region block in a first direction;

[0018] A noise direction difference in the first direction is obtained according to the average value, wherein the first direction is a diagonal direction, a horizontal direction and / or a vertical direction centered on the area block.

[0019] In some embodiments, acquiring a region block in an image and each neighboring block of the region block, and calculating a variance and an initial weight between the region block and each neighboring block, includes:

[0020] Obtaining a variance between the region block and each of the neighborhood blocks based on pixel values ​​of pixel points at corresponding positions in the region block and each of the neighborhood blocks;

[0021] An initial weight between the region block and each of the neighboring blocks is obtained according to the variance and a preset filter coefficient, wherein the filter coefficient is a constant greater than 0 and less than 1.

[0022] In some embodiments, the denoising of pixels in the region block based on the final weight between the region block and each neighboring block includes:

[0023] Based on the final weight between the region block and each neighboring block, performing weighted summation on the pixel values ​​of the pixel points in the region block to obtain a filtered value;

[0024] Based on the filter value, denoising is performed on the pixels in the area block.

[0025] The present invention provides an image denoising device, comprising:

[0026] An acquisition module, configured to acquire a region block and each neighboring block of the region block in an image, and calculate a variance and an initial weight between the region block and each neighboring block;

[0027] a noise direction difference determining module, configured to obtain a noise direction difference in a first direction based on a variance between a neighborhood block in a first direction and the regional block, wherein the neighborhood blocks in the first direction are centrally symmetric with respect to the regional block;

[0028] a correction module, configured to correct an initial weight between the region block and the neighboring block in the first direction according to the noise direction difference in the first direction, to obtain a final weight between the region block and the neighboring block in the first direction;

[0029] The denoising module is configured to denoise the pixels in the region block based on the final weight between the region block and each neighboring block.

[0030] An embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the instruction, the program, the code set, or the instruction set is loaded and executed by the processor to implement the image denoising method provided in any embodiment of the present application.

[0031] An embodiment of the present application provides a non-temporary computer-readable storage medium, characterized in that when the instructions in the storage medium are executed by a processor of a mobile terminal, the smart terminal is enabled to execute the image denoising method provided in any embodiment of the present application.

[0032] An embodiment of the present application provides a computer program product, characterized in that when the instructions in the computer program product are executed by a processor of a mobile terminal, the smart terminal is enabled to perform the image denoising method provided in any embodiment of the present application.

[0033] The image denoising method, device, electronic device, medium and program product provided in the embodiments of the present application achieve the adjustment of noise reduction weights by adding directional noise judgment, thereby improving the effect of the denoising algorithm and preserving image details more completely.

[0034] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0036] Figure 1 FIG. 4 is a flowchart of an image denoising method shown in an embodiment.

[0037] Figure 2 FIG. 4 is a block diagram of an image denoising device shown in an embodiment.

[0038] Figure 3 FIG. 1 is a schematic diagram of pixel value distribution of a region block and its surrounding neighborhood blocks shown in an embodiment.

[0039] Figure 4 for Figure 3 Schematic diagram of the 3*3 pixel values ​​of the upper left corner neighborhood block adjacent to the region block.

[0040] Figure 5 for Figure 3 The calculated variance distribution map of the 3*3 pixel value area block and its surrounding neighborhood blocks.

[0041] Figure 6 For Figure 5 The weight distribution graph corresponding to the variance distribution graph.

[0042] Figure 7 FIG. 1 is a diagram showing the internal structure of an electronic device according to an embodiment. DETAILED DESCRIPTION

[0043] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0044] Figure 1 FIG. 1 is a flow chart of an image denoising method according to an exemplary embodiment. Figure 1 As shown, the following steps are included:

[0045] In step S101 , a region block and each neighboring block of the region block in an image are obtained, and the variance and initial weight between the region block and each neighboring block are calculated.

[0046] Specifically, such as Figure 3 As shown, taking a region block with a 3*3 pixel value as an example, the variance and initial weight between the region block and each neighboring block with a 3*3 pixel value are obtained by a non-local algorithm based on the region block and the neighboring blocks.

[0047] Furthermore, the acquiring of a region block in an image and each neighboring block of the region block, and calculating a variance and an initial weight between the region block and each neighboring block, includes:

[0048] Obtaining a variance between the region block and each of the neighborhood blocks based on pixel values ​​of pixel points at corresponding positions in the region block and each of the neighborhood blocks;

[0049] An initial weight between the region block and each of the neighboring blocks is obtained according to the variance and a preset filter coefficient, wherein the filter coefficient is a constant greater than 0 and less than 1.

[0050] Specifically, such as Figure 3 As shown in the figure, the shaded part is the area block. Taking the area block and the neighboring block as an example, the variance between the area block and each neighboring block is calculated by the pixel values ​​of the corresponding pixels in each neighboring block. Figure 3 Take the upper left corner neighborhood block in as an example, the upper left corner neighborhood block is as follows Figure 4 As shown:

[0051] d0=(13-3)^2+(15-6)^2+(100-9)^2+(6-15)^2+(3-18)^2+(6-20)^2+(8-21)^2+(15-35)^2+(18-0)^2

[0052] After calculating the variance d0 between the upper left corner neighborhood block and the region block, translate one unit to the left to calculate d1, and then calculate the variance between the region block and all neighboring blocks from left to right and from top to bottom, which are d0 to d8 respectively. The specific distribution is as follows Figure 5 shown.

[0053] Similarly, the initial weights between the region block and each of the neighboring blocks are calculated using the variance and the preset filter coefficients. Figure 4 Take the upper left corner neighborhood block in as an example:

[0054] w0=-exp[(13-3)^2+(15-6)^2+(100-9)^2+(6-15)^2+(3-18)^2+(6-20)^2+(8-21)^2+(15-35)^2+(18-0)^2)]. / (2*sigma^2)

[0055] Where sigma is the filter coefficient, and the weights w0 to w8 are calculated in sequence by the user according to the custom settings. The specific distribution is as follows Figure 6 As shown, w0 to w8 correspond to d0 to d8 one by one.

[0056] In step S102 , a noise direction difference in a first direction is obtained based on a variance between a neighborhood block in a first direction and the region block, wherein the neighborhood blocks in the first direction are centrally symmetric with respect to the region block.

[0057] Specifically, such as Figure 5 As shown in FIG, it is a variance distribution diagram between the neighborhood block and the regional block. The noise direction difference in the first direction can be calculated through the variance between the neighborhood block and the regional block.

[0058] Furthermore, the region block is a region block composed of 3*3 pixels, and obtaining the noise direction difference in the first direction based on the variance between the neighboring block and the region block in the first direction includes:

[0059] Obtaining an average value of variances between the region block and two neighboring blocks that are centrally symmetric about the region block in a first direction;

[0060] A noise direction difference in the first direction is obtained according to the average value, wherein the first direction is a diagonal direction, a horizontal direction and / or a vertical direction centered on the area block.

[0061] Specifically, Figure 5 For example,

[0062] S[0] = (d[0] + d[8]) / 2, calculate the noise direction difference in the diagonal direction from the upper left corner to the lower right corner;

[0063] S[1]=(d[1]+d[7]) / 2, calculate the noise direction difference from top to bottom vertically;

[0064] S[2] = (d[2] + d[6]) / 2, calculate the noise direction difference in the diagonal direction from the upper right corner to the lower left corner;

[0065] S[3]=(d[3]+d[5]) / 2, calculate the noise direction difference from right to left;

[0066] Where S[X] is the noise direction difference.

[0067] Of course, the area block can also be composed of 5*5 pixels or 7*7 pixels, which is specifically limited to an odd number greater than 3.

[0068] In step S103 , the initial weight between the region block and the neighboring block in the first direction is corrected according to the noise direction difference in the first direction to obtain the final weight between the region block and the neighboring block in the first direction.

[0069] Specifically, the noise direction difference in the first direction can be obtained through the above steps, and the initial weights between neighboring blocks in a direction are adjusted based on the noise direction difference, thereby obtaining the final weights. Furthermore, the initial weights between the region block and the neighboring blocks in the first direction are corrected based on the noise direction difference in the first direction to obtain the final weights between the region block and the neighboring blocks in the first direction, including:

[0070] Determining whether the noise direction difference in the first direction is greater than a preset threshold;

[0071] If so, reduce the initial weight between the regional block and the neighboring block in the first direction to obtain the final weight between the regional block and the neighboring block in the first direction; otherwise, increase the initial weight between the regional block and the neighboring block in the first direction to obtain the final weight between the regional block and the neighboring block in the first direction.

[0072] Specifically, taking the above embodiment as an example, it is determined whether S[0], S[1], S[2], and S[3] are greater than a preset threshold. When S[0] is greater than the preset threshold, it indicates that the noise in the diagonal direction from the upper left corner to the lower right corner is too large, that is, the noise in the direction of d0 to d8 is too large. Therefore, the initial weight in the direction of d0 to d8 is reduced, that is, w0 and w8 are reduced to obtain the final w0 and w8. When S[1] is less than the preset threshold, it indicates that the noise in the vertical direction from top to bottom is too small, that is, the noise in the direction of d1 to d7 is too small. Therefore, the initial weight in the direction of d1 to d7 is reduced, that is, w1 and w7 are reduced to obtain the final w1 and w7.

[0073] Furthermore, in some embodiments, the method further includes:

[0074] Obtaining a difference between the noise direction difference in the first direction and a preset threshold;

[0075] Based on the difference, obtaining a correction amount of the initial weight between the regional block and the neighboring block in the first direction;

[0076] An initial weight between the region block and the neighboring blocks in the first direction is reduced or increased based on the correction amount to obtain a final weight between the region block and the neighboring blocks in the first direction.

[0077] Specifically, a weight correction value can be obtained based on the difference between the noise direction difference in the first direction and a preset threshold. Based on the correction value, the initial weights between the region block and its neighboring blocks in the first direction are adjusted. That is, the greater the difference between the noise direction difference and the preset threshold, the greater the degree of weight correction.

[0078] In step S104, denoising is performed on the pixels in the region block based on the final weight between the region block and each neighboring block.

[0079] Specifically, Figure 3 For example, the initial weights and correction values ​​of w0 to w8 are obtained by the above method, the initial weights are corrected by the obtained correction values ​​to obtain the final weights, and the pixels in the region block are denoised by the final weights. Further, the denoising of the pixels in the region block based on the final weights between the region block and each neighboring block includes:

[0080] Based on the final weight between the region block and each neighboring block, performing weighted summation on the pixel values ​​of the pixel points in the region block to obtain a filtered value;

[0081] Denoising is performed on the pixels in the area block based on the filter value.

[0082] Specifically, the pixel values ​​of the pixels in the regional block are weighted and summed by the final weight between the regional block and each neighboring block to obtain a filtered value, and the pixels in the regional block are denoised based on the filtered value to finally obtain the denoised regional block.

[0083] In summary, the image denoising method provided by the present application adjusts the noise reduction weight by adding directional noise judgment, improves the effect of the denoising algorithm, and preserves image details more completely.

[0084] In one embodiment, Figure 2 As shown, an image denoising device is provided, comprising: an acquisition module 201, a noise direction difference determination module 202, a correction module 203, and a denoising module 204, wherein:

[0085] An acquisition module 201 is configured to acquire a region block and each neighboring block of the region block in an image, and calculate a variance and an initial weight between the region block and each neighboring block;

[0086] a noise direction difference determining module 202, configured to obtain a noise direction difference in a first direction based on a variance between a neighborhood block in a first direction and the regional block, wherein the neighborhood blocks in the first direction are centrally symmetric with respect to the regional block;

[0087] a correction module 203, configured to correct an initial weight between the region block and the neighboring block in the first direction according to the noise direction difference in the first direction, to obtain a final weight between the region block and the neighboring block in the first direction;

[0088] The denoising module 204 is configured to denoise the pixels in the region block based on the final weight between the region block and each of the neighboring blocks.

[0089] In summary, the image denoising device provided in this application adds directional noise judgment and adjusts the noise reduction weight through an acquisition module, a noise direction difference determination module, a correction module, and a denoising module, thereby improving the effect of the denoising algorithm and preserving image details more completely.

[0090] The specific definition of the image denoising device can be found in the definition of the image denoising method above and will not be repeated here. The various modules in the above-mentioned image denoising device can be implemented in whole or in part through software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of the above-mentioned modules.

[0091] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an image denoising method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.

[0092] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0093] In one embodiment, the image denoising apparatus provided by the present application can be implemented in the form of a computer program, which can be used in Figure 7 The memory of the electronic device may store various program modules constituting the image denoising device, such as: Figure 2 The computer program shown includes an acquisition module 201, a noise direction difference determination module 202, a correction module 203, and a denoising module 204. The computer program composed of various program modules enables the processor to execute the steps of the image denoising method of various embodiments of the present application described in this specification.

[0094] For example, Figure 7 The electronic device shown can be Figure 2 The acquisition module 201 in the denoising device for the image shown is used to acquire a region block in the image and each neighboring block of the region block, and calculate the variance and initial weight between the region block and each neighboring block. The noise direction difference determination module 202 is used to obtain the noise direction difference in a first direction based on the variance between the neighboring blocks in a first direction and the region block, wherein the neighboring blocks in the first direction are centrally symmetric with respect to the region block. The correction module 203 is used to correct the initial weight between the region block and the neighboring blocks in the first direction based on the noise direction difference in the first direction, and obtain the final weight between the region block and the neighboring blocks in the first direction. The denoising module 204 is used to denoise the pixels in the region block based on the final weight between the region block and each neighboring block.

[0095] The electronic device provided in this application can open various modules of the image denoising device through the memory and processor, and adjust the noise reduction weight by adding directional noise judgment, thereby improving the effect of the denoising algorithm and preserving image details more completely.

[0096] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a region block in an image and each neighboring block of the region block, and calculating the variance and initial weight between the region block and each neighboring block; obtaining a noise direction difference in a first direction based on the variance between the neighboring blocks in a first direction and the region block, wherein the neighboring blocks in the first direction are centrally symmetric with the region block; correcting the initial weight between the region block and the neighboring blocks in the first direction based on the noise direction difference in the first direction to obtain a final weight between the region block and the neighboring blocks in the first direction; and denoising pixels in the region block based on the final weight between the region block and each neighboring block.

[0097] The non-temporary computer-readable storage medium provided in this application can execute the image denoising method in the above-mentioned embodiment through the instructions in the storage medium, and adjust the noise reduction weight by adding directional noise judgment, thereby improving the effect of the denoising algorithm and preserving image details more completely.

[0098] In one embodiment, a computer program product is provided. When instructions in the computer program product are executed by a processor of a mobile terminal, the mobile terminal is capable of performing the following steps: obtaining a region block in an image and each neighboring block of the region block, and calculating the variance and initial weight between the region block and each neighboring block; obtaining a noise direction difference in a first direction based on the variance between the neighboring blocks in a first direction and the region block, wherein the neighboring blocks in the first direction are centrally symmetric with the region block; correcting the initial weight between the region block and the neighboring blocks in the first direction based on the noise direction difference in the first direction to obtain a final weight between the region block and the neighboring blocks in the first direction; and denoising pixels in the region block based on the final weight between the region block and each neighboring block.

[0099] The computer program product provided in this application enables a mobile terminal to execute the image denoising method of the above embodiment, and adjusts the noise reduction weight by adding directional noise judgment, thereby improving the effect of the denoising algorithm and preserving image details more completely.

[0100] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).

[0101] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0102] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A method for denoising an image, characterized in that: include: Obtaining a region block and each neighboring block of the region block in an image, and calculating a variance and an initial weight between the region block and each neighboring block, including: obtaining a variance between the region block and each neighboring block based on pixel values ​​of pixels at corresponding positions in the region block and each neighboring block; and obtaining an initial weight between the region block and each neighboring block based on the variance and a preset filter coefficient, wherein the filter coefficient is a constant greater than 0 and less than 1; Obtaining a noise direction difference in a first direction based on a variance between a neighboring block and the regional block in a first direction, including: obtaining an average of variances between the regional block and two neighboring blocks that are centrally symmetric about the regional block in the first direction; and obtaining the noise direction difference in the first direction based on the average, wherein the first direction is a diagonal direction, a horizontal direction, and / or a vertical direction centered on the regional block, and the neighboring blocks in the first direction are centrally symmetric about the regional block; Correcting, based on the noise direction difference in the first direction, an initial weight between the regional block and the neighboring block in the first direction to obtain a final weight between the regional block and the neighboring block in the first direction, includes: determining whether the noise direction difference in the first direction is greater than a preset threshold; if so, reducing the initial weight between the regional block and the neighboring block in the first direction to obtain a final weight between the regional block and the neighboring block in the first direction; otherwise, increasing the initial weight between the regional block and the neighboring block in the first direction to obtain a final weight between the regional block and the neighboring block in the first direction; Denoising the pixels in the area block based on the final weight between the area block and each neighboring block, including: performing weighted summation on the pixel values ​​of the pixels in the area block based on the final weight between the area block and each neighboring block to obtain a filtered value; and denoising the pixels in the area block based on the filtered value.

2. The image denoising method according to claim 1, wherein: Also includes: Obtaining a difference between the noise direction difference in the first direction and a preset threshold; Based on the difference, obtaining a correction amount of the initial weight between the regional block and the neighboring block in the first direction; An initial weight between the region block and the neighboring blocks in the first direction is reduced or increased based on the correction amount to obtain a final weight between the region block and the neighboring blocks in the first direction.

3. The image denoising method according to any one of claims 1 to 2, characterized in that: The area block is an area block composed of 3*3 pixels.

4. An image denoising device, characterized in that: include: an acquisition module, configured to acquire a region block and each neighboring block of the region block in an image, and calculate a variance and an initial weight between the region block and each neighboring block, including: obtaining the variance between the region block and each neighboring block based on pixel values ​​of pixels at corresponding positions in the region block and each neighboring block; and obtaining the initial weight between the region block and each neighboring block based on the variance and a preset filter coefficient, wherein the filter coefficient is a constant greater than 0 and less than 1; a noise direction difference determination module, configured to obtain a noise direction difference in a first direction based on a variance between a neighboring block in a first direction and the regional block, comprising: obtaining an average of variances between the regional block and two neighboring blocks that are centrally symmetric about the regional block in the first direction; and obtaining the noise direction difference in the first direction based on the average, wherein the first direction is a diagonal direction, a horizontal direction, and / or a vertical direction centered on the regional block, the neighboring blocks in the first direction are centrally symmetric about the regional block, and the neighboring blocks in the first direction are centrally symmetric about the regional block; a correction module, configured to correct, based on the noise direction difference in the first direction, an initial weight between the regional block and the neighboring block in the first direction, to obtain a final weight between the regional block and the neighboring block in the first direction, the correction module comprising: determining whether the noise direction difference in the first direction is greater than a preset threshold; if so, reducing the initial weight between the regional block and the neighboring block in the first direction to obtain a final weight between the regional block and the neighboring block in the first direction; otherwise, increasing the initial weight between the regional block and the neighboring block in the first direction to obtain a final weight between the regional block and the neighboring block in the first direction; The denoising module is used to denoise the pixels in the regional block based on the final weight between the regional block and each neighboring block, including: performing weighted summation on the pixel values ​​of the pixels in the regional block based on the final weight between the regional block and each neighboring block to obtain a filtered value; and denoising the pixels in the regional block based on the filtered value.

5. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the instruction, the program, the code set or the instruction set is loaded and executed by the processor to implement the image denoising method according to any one of claims 1 to 3.

6. A non-transitory computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image denoising method according to any one of claims 1 to 3.

7. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to perform the image denoising method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method of reducing noise, terminal and computer readable storage medium

    CN108038834A

  • Image denoising method and device, electronic equipment and readable storage medium

    CN111861938A