An image denoising method, device, equipment and medium

By determining the reference block and candidate block of the block matching area in the image denoising method, combining principal component analysis and masking algorithms to optimize image edge processing, the problems of poor image noise reduction and edge blur in the prior art are solved, and better image quality is achieved.

CN115578288BActive Publication Date: 2025-07-29ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211344480.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2025-07-29
Estimated Expiration
2042-10-31

Smart Images

  • Figure CN115578288B_ABST
    Figure CN115578288B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image denoising method, apparatus, device, and medium. In the embodiments of the present application, for each first pixel point in the first image to be denoised, for each second pixel point in the block matching region containing the first pixel point and a preset region size, a reference block containing the second pixel point is determined. A candidate block is determined according to the similarity between the target reference block and each reference block, and according to the pixel values of the central pixel points of multiple candidate blocks similar to the target reference block of the first pixel point and the weight corresponding to each candidate block, the pixel value of the central pixel point of the target reference block is denoised, so as to determine the denoised first pixel value of the first pixel point, that is, by synthesizing the pixel values of the pixel points at the same position in multiple similar regions, the denoised pixel value of the pixel point at the same position in the target reference block is determined, effectively improving the image denoising effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technologies, and in particular, to an image noise reduction method, apparatus, device, and medium. Background Art

[0002] Images are widely used in various fields, such as biomedical, military, traffic security, and machine vision. The quality of images directly affects their effectiveness in these fields. However, during the acquisition, processing, and transmission of images, they are inevitably interfered by noise. Therefore, filtering out the noise in images is of great significance.

[0003] Common image noise reduction methods in related technologies can be divided into spatial domain image noise reduction, frequency domain image noise reduction, and hybrid spatial and frequency domain image noise reduction. Among them, the main representative algorithms for spatial domain image noise reduction include mean filtering, Gaussian filtering, median filtering, bilateral filtering, and non-local mean algorithms, etc. However, these algorithms do not protect the texture of the image well during noise reduction and will lose a lot of image information. The main representative algorithms for frequency domain image noise reduction include wavelet noise reduction algorithms, discrete cosine transform (DCT) filtering algorithms, etc. These algorithms do not have a good effect on suppressing large noise in images. The main representative algorithms for hybrid spatial and frequency domain image noise reduction include the block matching 3D (BM3D) algorithm, wavelet neural network model (WNNM), etc. Although this type of algorithm combines spatial and frequency domain noise reduction and greatly improves the image noise reduction ability, under the influence of noise, during the image noise reduction process, this type of algorithm is prone to cause the transition of the edge area of the image to be blurred, thereby causing a decrease in the overall transparency of the image and resulting in a poor image noise reduction effect.

[0004] Therefore, how to improve the effect of image noise reduction has become an urgent problem to be solved. Summary of the Invention

[0005] The embodiments of this application provide an image noise reduction method, apparatus, device, and medium to solve the problem of poor image noise reduction effect in the prior art.

[0006] In a first aspect, this application provides an image noise reduction method, and the method includes:

[0007] For each first pixel point of the first image to be denoised, determine each second pixel point in the block matching region containing the first pixel point; for each second pixel point and a preset region size, determine a reference block containing the second pixel point; according to the similarity between the target reference block containing the first pixel point and each reference block, determine candidate blocks with similarities within a preset threshold; according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, determine the denoised first pixel value of the first pixel point.

[0008] In a second aspect, the present application further provides an image denoising device, and the device includes:

[0009] A determination module, configured to, for each first pixel point of the first image to be denoised, determine each second pixel point in the block matching region containing the first pixel point; for each second pixel point and a preset region size, determine a reference block containing the second pixel point; according to the similarity between the target reference block containing the first pixel point and each reference block, determine candidate blocks with similarities within a preset threshold;

[0010] A denoising module, configured to, according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, determine the denoised first pixel value of the first pixel point.

[0011] In a third aspect, the present application further provides an electronic device, and the electronic device at least includes a processor and a memory, and the processor is configured to implement the steps of the image denoising method described in any one of the above when executing a computer program stored in the memory.

[0012] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the steps of the image denoising method described in any one of the above when executed by a processor.

[0013] The embodiments of the present application provide an image denoising method, apparatus, device, and medium. In this method, for each first pixel point of the first image to be denoised, each second pixel point in the block matching region containing the first pixel point is determined. For each second pixel point and a preset region size, a reference block containing the second pixel point is determined. According to the similarity between the target reference block containing the first pixel point and each reference block, candidate blocks with similarities within a preset threshold are determined. According to the pixel values of the central pixel points of each candidate block and the weights corresponding to each candidate block, the first pixel value after denoising of the first pixel point is determined. Since in the embodiments of the present application, for each first pixel point in the first image to be denoised, and for each second pixel point in the block matching region containing the first pixel point and a preset region size, a reference block containing the second pixel point is determined. Candidate blocks are determined according to the similarity between the target reference block and each reference block, and the pixel value of the central pixel point of the target reference block is denoised according to the pixel values of the central pixel points of multiple candidate blocks similar to the target reference block of the first pixel point and the weights corresponding to each candidate block, so as to determine the first pixel value after denoising of the first pixel point, that is, the pixel values of the pixel points at the same position in multiple similar regions are integrated to determine the pixel value after denoising of the pixel point at the same position in the target reference block, effectively improving the effect of image denoising. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the present application, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0015] Figure 1 Schematic diagram of the image denoising process provided by the embodiments of the present application;

[0016] Figure 2 Schematic diagram of the candidate block provided by the embodiments of the present application;

[0017] Figure 3 Schematic diagram of the image denoising process provided by the embodiments of the present application;

[0018] Figure 4 Schematic diagram of the structure of the image denoising apparatus provided by the embodiments of the present application;

[0019] Figure 5 Schematic diagram of the structure of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings. Apparently, the described embodiments are only a part of the embodiments of this application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application fall within the scope of protection of this application.

[0021] An image denoising method, apparatus, device, and medium are provided in an embodiment of this application. In this method, for each first pixel point of a first image to be denoised, each second pixel point in the block matching region containing this first pixel point is determined. For each second pixel point and a preset region size, a reference block containing this second pixel point is determined. According to the similarity between the target reference block containing this first pixel point and each reference block, candidate blocks with similarities within a preset threshold are determined. According to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the first pixel value after denoising of this first pixel point is determined.

[0022] Embodiment 1:

[0023] Figure 1 It is a schematic diagram of the image denoising process provided in an embodiment of this application, and this process specifically includes the following steps:

[0024] S101: For each first pixel point of a first image to be denoised, each second pixel point in the block matching region containing this first pixel point is determined; for each of the second pixel points and a preset region size, a reference block containing this second pixel point is determined.

[0025] The image denoising process provided in an embodiment of this application is applicable to an electronic device, and this electronic device can be a device such as a server, a PC, or an image acquisition device.

[0026] To improve the effect of image denoising, in an embodiment of this application, for each first pixel point in a first image to be denoised, each second pixel point in the block matching region containing this first pixel point can be determined. In an embodiment of this application, the pixel size of the block matching region can be pre-configured. For example, the pixel size of the block matching region can be 25*25. When determining the block matching region containing this first pixel point, this first pixel point can be used as the first pixel point in the upper left corner of the 25*25 pixel-sized block matching region, or this first pixel point can be used as the central pixel point of the 25*25 pixel-sized block matching region.

[0027] In the embodiments of the present application, for each second pixel point in the block matching region and a preset region size, a reference block containing the second pixel point can be determined. Specifically, for each second pixel point in the block matching region, a reference block can be determined with the second pixel point as the center according to the preset region size.

[0028] S102: Determine candidate blocks with similarities within a preset threshold according to the similarity between the target reference block containing the first pixel point and each reference block.

[0029] After determining each reference block, the reference block containing the first pixel point can be determined as the target reference block. Preferably, the reference block with the first pixel point as the central pixel point can be determined as the target reference block. In the embodiments of the present application, the similarity between the target reference block and each reference block can be determined, and the reference blocks with similarities within the preset threshold can be determined as candidate blocks. In the embodiments of the present application, candidate blocks with similarities within the preset threshold can be found based on the block matching algorithm, or the similarity between the target reference block and each reference block can be determined based on a pre-stored image similarity algorithm. In the related art, there are many methods for determining the similarity between two images and have been described in detail, which will not be elaborated in the embodiments of the present application.

[0030] To improve the efficiency of image denoising, in the embodiments of the present application, the number of candidate blocks can also be reduced to a certain extent to reduce the computational amount in the subsequent image denoising process. In the embodiments of the present application, a minimum similarity threshold can be pre-configured. After determining the pixel similarity between the target reference block and each reference block, the reference blocks with similarities greater than the minimum similarity threshold can be determined as candidate blocks; a maximum ratio of candidate blocks can also be pre-configured. After determining the similarity between the target reference block and each reference block, a certain number of candidate blocks can be selected according to the maximum ratio of the candidate blocks.

[0031] Specifically, after determining the similarity between the target reference block and each reference block, each reference block can be arranged in descending order of similarity. For the convenience of description, the reference blocks arranged in descending order of similarity can be expressed as canBlock1, canBlock2, canBlock3,…, canBlock M×M , where M×M is the total number of reference blocks included. Assuming that the pre-configured maximum ratio of candidate blocks is alpha, and this maximum ratio is a positive number not greater than 1, then, in the embodiments of the present application, the upper limit of the number of candidate blocks is For example, the preset threshold is simiThr. In the embodiments of the present application, the first a reference block, and determine whether the similarity corresponding to the last sorted reference block among the selected reference blocks is greater than the preset threshold simiThr. If so, the selected reference blocks are determined as candidate blocks. Otherwise, the reference blocks among the selected reference blocks with similarity greater than the preset threshold simiThr are determined as candidate blocks. For the convenience of description, the process of determining candidate blocks can be represented by the following formula: canBlock N > simiThr and where N represents the number of currently determined candidate blocks. That is to say, during the process of determining candidate blocks, while ensuring that the similarity corresponding to the candidate blocks is greater than the preset threshold, it is also necessary to ensure that the number of determined candidate blocks does not reach the upper limit of the number of candidate blocks. The candidate blocks determined according to the above process of determining candidate blocks can be expressed as: canBlock1, canBlock2, canBlock3, …, canBlock N .

[0032] S103: Determine the first denoised pixel value of this first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each said candidate block.

[0033] After determining each candidate block, the first denoised pixel value of this first pixel point can be determined according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

[0034] Specifically, the first denoised pixel value of this first pixel point can be determined based on the following filtering formula:

[0035]

[0036] where, represents the first denoised pixel value of the central pixel point of the target reference block, that is, the first denoised pixel value of this first pixel point, represents the pixel value of the central pixel point of the i-th candidate block, weight i represents the weight corresponding to the i-th candidate block, represents the pixel value of the central pixel point of the target reference block, and sigma represents the weight corresponding to the target reference block.

[0037] In the embodiments of the present application, for each first pixel point in the first image to be denoised, for each second pixel point in the block matching region containing the first pixel point and a preset region size, a reference block containing the second pixel point is determined. A candidate block is determined according to the similarity between the target reference block and each reference block. According to the pixel values of the central pixel points of multiple candidate blocks similar to the target reference block of the first pixel point and the weight corresponding to each candidate block, the pixel value of the central pixel point of the target reference block is denoised, so as to determine the first pixel value after denoising of the first pixel point, that is, by integrating the pixel values of the pixel points at the same position in multiple similar regions, the pixel value after denoising of the pixel point at the same position in the target reference block is determined, effectively improving the image denoising effect.

[0038] Embodiment 2:

[0039] In order to further improve the image denoising effect, on the basis of the above embodiments, in the embodiments of the present application, after determining the candidate blocks with similarity within a preset threshold and before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes:

[0040] According to the coordinates of the central pixel points of each candidate block and the target reference block, a first matrix is determined, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point, and the average value corresponding to each element in each row of the first matrix is determined;

[0041] Based on the principal component analysis (PCA) algorithm, the first matrix is processed to obtain a target eigenvector. According to the target eigenvector and the transposed vector corresponding to the target eigenvector, a second matrix is determined;

[0042] For each candidate block, a third matrix composed of the coordinates of the central pixel point of the candidate block is determined. Each row of the third matrix corresponds to the abscissa or ordinate of the central pixel point. A fourth matrix corresponding to the difference between the elements in the third matrix and the average value corresponding to the row is determined; the product of the second matrix and the fourth matrix is determined to obtain a fifth matrix, and the first sum value of the elements in the fifth matrix and the average value corresponding to the row is determined to obtain a sixth matrix; based on the sixth matrix, the target coordinates of the central pixel point of the candidate block are determined, and according to the target coordinates and the preset region size, the candidate block is updated.

[0043] Figure 2 Schematic diagram of the candidate block provided by the embodiment of the present application, as Figure 2As shown in the figure, the rectangular frames numbered 1, 2, 3, 5, 6, 7, and 8 in the figure are determined candidate blocks, and the rectangular frame numbered 4 is the target reference block. It can be seen from the figure that the central pixel point of the target reference block is located on the edge line, while the central pixel points of the candidate blocks are not located on the edge line. If noise reduction is performed according to the pixel value corresponding to the central pixel point of the current candidate block, the problem of edge blurring may occur, affecting the effect of noise reduction. Therefore, in order to further improve the effect of image noise reduction, after each candidate block is determined, before determining the first pixel value after noise reduction of the first pixel point according to the central pixel point of each candidate block and the weight corresponding to each candidate block, in the embodiments of the present application, the target coordinates of the central pixel point of each candidate block can be determined, and the candidate block can be updated according to the target coordinates and the preset region size.

[0044] In the embodiments of the present application, the first matrix can be determined according to the coordinates of the central pixel points of each candidate block and the target reference block, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point.

[0045] Specifically, the first matrix can be expressed as:

[0046]

[0047] Among them, the first row of the first matrix X is the abscissa of each central pixel point, and the second row is the ordinate of the corresponding central pixel point. Specifically, x1 represents the abscissa of the central pixel point of candidate block 1, y1 represents the ordinate of the central pixel point of candidate block 1, x N is the abscissa of the central pixel point of candidate block N, y N is the ordinate of the central pixel point of candidate block N, x ref is the abscissa of the central pixel point of the target reference block, y ref is the ordinate of the central pixel point of the target reference block.

[0048] After the first matrix is determined, the average value corresponding to each element in each row of the first matrix can be determined, and the first matrix can be processed based on the principal components analysis (PCA) algorithm to obtain the target eigenvector.

[0049] Specifically, the average value corresponding to each row can be determined to obtain and where the average value of each row is the average value of the abscissas of each central pixel point and the average value of the ordinates, and for each element in the first matrix, the difference between the element and the average value corresponding to the row where the element is located is calculated to obtain matrix X2. For the convenience of understanding, matrix X2 can be expressed as:

[0050]

[0051] Calculate the eigenvalues and eigenvectors of the matrix using the eigenvalue decomposition method, where N is the number of candidate blocks. After determining the eigenvalues of matrix A, the eigenvalues can be sorted in descending order, and the eigenvector corresponding to the largest eigenvalue is determined as the target eigenvector. In the embodiments of the present application, this target eigenvector can be referred to as the main direction. After determining the target eigenvector, a second matrix can be determined based on the target eigenvector and the transposed vector corresponding to the target eigenvector. Assuming the target eigenvector is q1 and the transposed vector corresponding to the target eigenvector is

[0052] Then the second matrix can be expressed as In the embodiments of the present application, for each candidate block, a third matrix composed of the coordinates of the central pixel points of the candidate block can be determined. Each row of this third matrix corresponds to the abscissa or ordinate of the central pixel point. Specifically, this third matrix can be expressed as

[0053] where the first row of the third matrix is the abscissa of the central pixel point of the candidate block, and the second row is the ordinate of the central pixel point of the candidate block.

[0054] After determining the third matrix, the difference between each element in the third matrix and the average value corresponding to that row or is determined to obtain a fourth matrix, that is, the matrix corresponding to the difference between each element in the third matrix and the average value of the abscissas and ordinates of the central pixel points. Specifically, this fourth matrix can be expressed as

[0055] After determining the fourth matrix, the product of the second matrix and the fourth matrix is determined to obtain a fifth matrix. For the sake of easy understanding, this fifth matrix can be expressed as And the first sum value of each element in this fifth matrix and the average value corresponding to that row is determined to obtain a sixth matrix, which can be expressed as where is the average value corresponding to each row, that is, the matrix composed of the average value of the abscissas of the central pixel points and the average value of the ordinates.

[0056] After determining the sixth matrix, the target coordinates of the central pixel points of the candidate block can be determined based on this sixth matrix. Specifically, in the embodiments of the present application, the elements x' of the first row of the sixth matrix can be determined as the abscissa of the central pixel point of the candidate block, and the elements y' of the second row i can be determined as the ordinate of the central pixel point of the candidate block. iDetermine the ordinate of the central pixel point of the candidate block, so as to determine that the target coordinates of the central pixel point of the candidate block are (x' i , y' i ). After determining the target coordinates, the candidate block can be updated according to the target coordinates and the preset region size corresponding to the candidate block.

[0057] Embodiment 3:

[0058] In order to improve the efficiency of image denoising, based on the above embodiments, in the embodiments of the present application, after determining the candidate blocks within the preset threshold of similarity, before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes:

[0059] Count the number of the candidate blocks;

[0060] If the number is greater than the preset number threshold, then continue to execute the step of determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

[0061] In order to improve the efficiency of image denoising, in the embodiments of the present application, after determining the candidate blocks, before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the corresponding weight of each candidate block, the number of candidate blocks can be counted. If the number is greater than the preset number threshold, this can continue to execute the step of determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block. If the number of the candidate blocks is not greater than the preset number threshold, then the subsequent image denoising operation is not performed.

[0062] Specifically, assuming that the preset number threshold is NuThr, when the number of candidate blocks exceeds the preset number threshold NuThr, the subsequent step of determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block can be continued. Otherwise, directly output the pixel value of the first pixel point without performing denoising processing on the first pixel point.

[0063] Embodiment 4:

[0064] In order to further improve the effect of image denoising, based on the above embodiments, in the embodiments of the present application, the process of determining the weight corresponding to each candidate block includes:

[0065] For each second pixel point in the candidate block, determine the third pixel point corresponding to the relative position in the target reference block according to the relative position of the second pixel point in the candidate block; determine the third difference between the pixel value of the second pixel point and the pixel value of the third pixel point;

[0066] According to each of the third differences, determine a fifth matrix, and determine the first quotient of the L2 norm of the fifth matrix and the first preset parameter; determine the fourth difference between the second preset parameter and the first quotient as the candidate weight of the candidate block;

[0067] Select the maximum value between the candidate weight and the first preset value as the weight corresponding to the candidate block.

[0068] In order to further improve the effect of image denoising, in the embodiments of the present application, the weight corresponding to each candidate block may be determined according to the pixel value of each second pixel point in the candidate block. For each second pixel point in the candidate block, the third pixel point corresponding to the relative position in the target reference block may be determined according to the relative position of the second pixel point in the candidate block.

[0069] Specifically, assume that the second pixel point 1 in candidate block 1 is the first pixel point in the first row in candidate block 1, then the third pixel point corresponding to the relative position in the target reference block, that is, the third pixel point is the first pixel point in the first row in the target reference block.

[0070] After determining the third pixel point, the third difference between the pixel value of the second pixel point and the pixel value of the third pixel point can be determined. After determining each third difference, according to each third difference, determine a fifth matrix. In the embodiments of the present application, the fifth matrix may be a row matrix or a column matrix, and determine the L2 norm of the fifth matrix. Whether the fifth matrix is a row matrix or a column matrix, its L2 norm is the same. For the convenience of description, the L2 norm of the fifth matrix may be expressed as ‖canBlock′ - ref‖2, where canBlock′ represents the matrix composed of the pixel values of each second pixel point in the candidate block, and ref represents the matrix composed of the pixel values of each third pixel point in the target reference block.

[0071] After determining the L2 norm of the fifth matrix, the first quotient of the L2 norm and the first preset parameter can be determined. The first preset parameter may be the square root of the number of second pixel points in the candidate block. In the embodiments of the present application, the fourth difference between the second preset parameter and the first quotient may be determined as the candidate weight of the candidate block, and the second preset parameter may be the weight corresponding to the target reference block saved in advance.

[0072] Specifically, the process of determining the candidate weight of the candidate block can be expressed as:

[0073]

[0074] Among them, sigma represents the weight corresponding to the pre-saved target reference block, that is, the second preset parameter, the symbol ‖‖2 is the L2 norm of the matrix, and size is the number of the second pixel points in the candidate block.

[0075] After determining the candidate weight of the candidate block, the maximum value of the candidate weight and the first preset value can be selected as the weight corresponding to the candidate block. In the embodiment of the present application, the first preset value can be 0. For the convenience of understanding, the process of determining the weight corresponding to the candidate block can be expressed as:

[0076]

[0077] where weight i is the weight corresponding to the i-th candidate block.

[0078] Next, a specific embodiment is combined to illustrate the image denoising process. Figure 3 is a schematic diagram of the image denoising process provided by the embodiment of the present application. As Figure 3 shown, it includes the following steps:

[0079] S301: For each first pixel point of the first image to be denoised, based on the similarity between the target reference block containing the first pixel point and each reference block, perform block matching to determine candidate blocks.

[0080] S302: Determine whether the number of candidate blocks is greater than the preset number threshold NuThr. If so, execute S303; otherwise, do not perform the subsequent image denoising steps for this first pixel point, and directly output the pixel value corresponding to this first pixel point.

[0081] S303: Determine the target coordinates of the central pixel point of each candidate block, and update the candidate block according to the target coordinates and the preset region size.

[0082] S304: According to the pixel value of the central pixel point of the updated candidate block, the weight corresponding to each candidate block, and the filtering formula, determine the denoised first pixel value of this first pixel point.

[0083] Embodiment 5:

[0084] In order to further improve the effect of image denoising, on the basis of the above embodiments, in the embodiment of the present application, the method further includes:

[0085] Perform denoising processing on the texture area and the flat area of the first image to be denoised based on a preset denoising algorithm to obtain a second image to be denoised after denoising;

[0086] For each first pixel point in the first image to be denoised, obtain a preset number of fourth pixel points adjacent to the first pixel point. According to the pixel values of the fourth pixel points and the pixel value of the first pixel point, determine the variance corresponding to the first pixel point. According to the variance and a preset masking algorithm, determine the first mask value of the first pixel point, and determine the difference between a second preset value and the first mask value as the second mask value of the first pixel point. And determine the first product of the first pixel value corresponding to the first pixel point and the first mask value, and the second product of the pixel value corresponding to the first pixel point in the second image to be denoised and the second mask value. Determine the sum value of the first product and the second product as the second pixel value after denoising the first pixel point.

[0087] In order to further improve the effect of image denoising, in the embodiments of the present application, image denoising processing can be performed on the edge area, texture area, and flat area of the first image to be denoised respectively. Since the edge area is relatively easy to distinguish from the flat area and the texture area, and the edge area is more likely to have the problem of excessive edge blurring, which affects the overall transparency of the denoised image. Therefore, in the embodiments of the present application, different mask values can be assigned to the edge area, texture area, and flat area to achieve the purpose of separately performing denoising processing on the edge area, texture area, and flat area.

[0088] In the embodiments of the present application, the texture area and the flat area of the first image to be denoised can be extracted, and based on a preset denoising algorithm, denoising processing is performed on the texture area and the flat area of the first image to be denoised to obtain the second image to be denoised after denoising. Among them, the preset denoising algorithm can be a wavelet denoising algorithm, a non-local means (NLM) algorithm, a block matching 3D (BM3D) algorithm, a wavelet neural network model (WNNM) algorithm, etc.

[0089] In the embodiments of the present application, the mask value corresponding to each pixel point can be determined. Specifically, for each first pixel point in the first image to be denoised, a preset number of fourth pixel points adjacent to the first pixel point can be obtained, where the preset number can be any integer such as 2, 4, 6, 9, etc. According to the pixel values of each fourth pixel point and the pixel value of the first pixel point, determine the variance corresponding to the first pixel point. And according to the variance and a preset masking algorithm, determine the first mask value of the first pixel point, and determine the difference between a second preset value and the first mask value as the second mask value of the first pixel point, where the second preset value can be 1.

[0090] To further improve the effect of image denoising, based on the above embodiments, in the embodiments of the present application, determining the first mask value of the first pixel point according to the variance and a preset mask algorithm includes:

[0091] If the variance corresponding to the first pixel point is less than a preset configuration parameter, then determine the second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel point; otherwise, determine the preset second value as the first mask value of the first pixel point; or,

[0092] Determine the maximum value among the variances corresponding to each first pixel point as the target variance; determine the third quotient value of the variance corresponding to the first pixel point and the target variance, and determine the first mask value of the first pixel point according to the third quotient value and the preset configuration parameter.

[0093] In the embodiments of the present application, when determining the first mask value of the first pixel point, it is possible to determine whether the variance corresponding to the first pixel point is less than a preset configuration parameter. Those skilled in the art can set the preset configuration parameter according to experience. The preset configuration parameter can be 10 or 1.2. If it is determined that the variance corresponding to the first pixel point is less than the preset configuration parameter, then determine the second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel point; otherwise, determine the second preset value as the first mask value of the first pixel point.

[0094] Specifically, the process of determining the first mask value of the first pixel point can be expressed as:

[0095]

[0096] Where Dx is the variance corresponding to the first pixel point, and DxThr is the preset configuration parameter.

[0097] In a possible embodiment, the process of determining the first mask value of the first pixel point in the embodiments of the present application can also be to determine the maximum value among the variances corresponding to each first pixel point as the target variance, and determine the third quotient value of the variance corresponding to the first pixel point and the target variance, and determine the first mask value of the first pixel point according to the third quotient value and the preset configuration parameter.

[0098] Specifically, in the embodiments of the present application, the first mask value of the first pixel point can also be determined by the following formula:

[0099]

[0100] Where Dx is the variance corresponding to the first pixel point, DxMax is the target variance, and DxThr is the preset configuration parameter.

[0101] After determining the first mask value and the second mask value of the first pixel point, the first product of the first pixel value corresponding to the first pixel point and the first mask value, and the second product of the pixel value corresponding to the first pixel point in the second image to be denoised and the second mask value can be determined, and the sum value of the first product and the second product is determined as the second pixel value of the first pixel point after denoising. After determining the second pixel value of each first pixel point after denoising, the image of the first image to be denoised after denoising can also be determined.

[0102] Specifically, the process of determining the second pixel value of the first pixel point after denoising can be expressed by the following formula:

[0103] IDe = TextureDe × (1 - mask) + EdgeDe × mask

[0104] Wherein, IDe is the second pixel value of the first pixel point after denoising, TextureDe is the pixel value corresponding to the first pixel point in the second image to be denoised, 1 - mask is the second mask value of the first pixel point, EdgeDe is the first pixel value corresponding to the first pixel point, and mask is the first mask value of the first pixel point.

[0105] In the embodiments of the present application, the edge area is distinguished from the texture area and the flat area through the mask value, so that the edge area can be processed separately, and the denoising intensity of the edge area can be adjusted by adjusting the mask value. Moreover, the position of the candidate block is adjusted according to the target coordinates of the candidate block, effectively improving the image denoising effect and avoiding the problem of edge blurring.

[0106] In the embodiments of the present application, the image denoising process described in the above embodiments can be applied to single-channel images, multi-channel images, or fused images including visible light and infrared. Specifically, when applied to multi-channel images or fused images of visible light and infrared, it can be independently processed according to single-channel images, or the image can be converted into an image in other color domains and then the image denoising process is performed. For example, after converting a multi-channel image or a fused image of visible light and infrared into an image encoded in the YUV color space, the image denoising process described in the above embodiments is performed.

[0107] Embodiment 6:

[0108] Figure 4 The structural schematic diagram of the image denoising device provided by the embodiments of the present application is as Figure 4 shown, and the device includes:

[0109] A determination module 401 is configured to, for each first pixel point of a first image to be denoised, determine each second pixel point in a block matching region containing the first pixel point; for each of the second pixel points and a preset region size, determine a reference block containing the second pixel point; and determine candidate blocks whose similarities are within a preset threshold according to the similarity between a target reference block containing the first pixel point and each reference block.

[0110] A denoising module 402 is configured to determine a first denoised pixel value of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

[0111] In a possible implementation manner, the determination module 401 is specifically configured to determine a first matrix according to the coordinates of the central pixel points of each candidate block and the target reference block, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point, and determine the average value corresponding to each element in each row of the first matrix; process the first matrix based on the principal component analysis (PCA) algorithm to obtain a target feature vector, and determine a second matrix according to the target feature vector and the transposed vector corresponding to the target feature vector; for each candidate block, determine a third matrix formed by the coordinates of the central pixel point of the candidate block, where each row in the third matrix corresponds to the abscissa or ordinate of the central pixel point, and determine a fourth matrix corresponding to the difference between the elements in the third matrix and the average value corresponding to the row; determine the product of the second matrix and the fourth matrix to obtain a fifth matrix, and determine the first sum value between the elements in the fifth matrix and the average value corresponding to the row to obtain a sixth matrix; determine the target coordinates of the central pixel point of the candidate block based on the sixth matrix, and update the candidate block according to the target coordinates and the preset region size.

[0112] In a possible implementation manner, the apparatus further includes:

[0113] A statistics module 403 is configured to count the number of candidate blocks; if the number is greater than a preset number threshold, continue to execute the step of determining the first denoised pixel value of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

[0114] In a possible implementation manner, the determining module 401 is further configured to, for each second pixel point in the candidate block, determine a third pixel point corresponding to the relative position in the target reference block according to the relative position of the second pixel point in the candidate block; determine a third difference between the pixel value of the second pixel point and the pixel value of the third pixel point; determine a fifth matrix according to each of the third differences, and determine a first quotient value of the L2 norm of the fifth matrix and a first preset parameter; determine a fourth difference between a second preset parameter and the first quotient value as the candidate weight of the candidate block; and select the maximum value of the candidate weight and a first preset value as the weight corresponding to the candidate block.

[0115] In a possible implementation manner, the noise reduction module 402 is further configured to perform noise reduction processing on the texture area and the flat area of the first image to be noise-reduced based on a preset noise reduction algorithm, so as to obtain a second image to be noise-reduced after noise reduction.

[0116] The determining module 401 is further configured to, for each first pixel point in the first image to be noise-reduced, obtain a preset number of fourth pixel points adjacent to the first pixel point, and determine a variance corresponding to the first pixel point according to the pixel values of the fourth pixel points and the pixel value of the first pixel point; determine a first mask value of the first pixel point according to the variance and a preset mask algorithm, and determine a difference between a second preset value and the first mask value as a second mask value of the first pixel point; and determine a first product of the first pixel value corresponding to the first pixel point and the first mask value, and a second product of the pixel value corresponding to the first pixel point in the second image to be noise-reduced and the second mask value; and determine a sum value of the first product and the second product as the second pixel value of the first pixel point after noise reduction.

[0117] In a possible implementation manner, the determining module 401 is specifically configured to, if the variance corresponding to the first pixel point is less than a preset configuration parameter, determine a second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel point; otherwise, determine the preset second value as the first mask value of the first pixel point; or, determine a maximum value of the variances corresponding to each first pixel point as a target variance; determine a third quotient value of the variance corresponding to the first pixel point and the target variance, and determine the first mask value of the first pixel point according to the third quotient value and the preset configuration parameter.

[0118] Embodiment 7:

[0119] Figure 5 This is a schematic structural diagram of an electronic device provided by an embodiment of the present application. On the basis of the above embodiments, the present application further provides an electronic device, such as Figure 5As shown in the figure, it includes: a processor 501, a communication interface 502, a memory 503, and a communication bus 504. Among them, the processor 501, the communication interface 502, and the memory 503 complete communication with each other through the communication bus 504;

[0120] The memory 503 stores a computer program. When the program is executed by the processor 501, the processor 501 is caused to execute the following steps:

[0121] For each first pixel point of the first image to be denoised, determine each second pixel point in the block matching region containing the first pixel point; for each of the second pixel points and a preset region size, determine a reference block containing the second pixel point; according to the similarity between the target reference block containing the first pixel point and each reference block, determine candidate blocks whose similarity is within a preset threshold; according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, determine the denoised first pixel value of the first pixel point.

[0122] In a possible implementation manner, after determining the candidate blocks whose similarity is within the preset threshold and before determining the denoised first pixel value of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes:

[0123] According to the coordinates of the central pixel points of each candidate block and the target reference block, determine a first matrix, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point, and determine the average value corresponding to each element in each row of the first matrix;

[0124] Process the first matrix based on the principal component analysis (PCA) algorithm to obtain a target eigenvector, and determine a second matrix according to the target eigenvector and the transposed vector corresponding to the target eigenvector;

[0125] For each candidate block, determine a third matrix composed of the coordinates of the central pixel point of the candidate block, where each row of the third matrix corresponds to the abscissa or ordinate of the central pixel point, determine a fourth matrix corresponding to the difference between the elements in the third matrix and the average value corresponding to that row; determine the product of the second matrix and the fourth matrix to obtain a fifth matrix, and determine the first sum value of the elements in the fifth matrix and the average value corresponding to that row to obtain a sixth matrix; based on the sixth matrix, determine the target coordinates of the central pixel point of the candidate block, and update the candidate block according to the target coordinates and the preset region size.

[0126] In a possible implementation, after determining the candidate blocks whose similarity is within the preset threshold, and before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes:

[0127] Count the number of the candidate blocks;

[0128] If the number is greater than the preset quantity threshold, continue to execute the step of determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

[0129] In a possible implementation, the process of determining the weight corresponding to each candidate block includes:

[0130] For each second pixel point in the candidate block, according to the relative position of the second pixel point in the candidate block, determine the third pixel point corresponding to the relative position in the target reference block; determine the third difference between the pixel value of the second pixel point and the pixel value of the third pixel point;

[0131] According to each third difference, determine a fifth matrix, and determine the first quotient of the L2 norm of the fifth matrix and the first preset parameter; determine the fourth difference between the second preset parameter and the first quotient as the candidate weight of the candidate block;

[0132] Select the maximum value between the candidate weight and the first preset value as the weight corresponding to the candidate block.

[0133] In a possible implementation, the method further includes:

[0134] Perform denoising processing on the texture area and the flat area of the first image to be denoised based on a preset denoising algorithm to obtain a second image to be denoised after denoising;

[0135] For each first pixel point in the first image to be denoised, obtain a preset number of fourth pixel points adjacent to the first pixel point, determine the variance corresponding to the first pixel point according to the pixel values of the fourth pixel points and the pixel value of the first pixel point; determine the first mask mask value of the first pixel point according to the variance and a preset mask algorithm, and determine the difference between the second preset value and the first mask value as the second mask value of the first pixel point; and determine the first product of the first pixel value corresponding to the first pixel point and the first mask value, and the second product of the pixel value corresponding to the first pixel point in the second image to be denoised and the second mask value; determine the sum value of the first product and the second product as the second pixel value after denoising of the first pixel point.

[0136] In a possible implementation manner, determining the first mask value of the first pixel point according to the variance and a preset mask algorithm includes:

[0137] If the variance corresponding to the first pixel point is less than a preset configuration parameter, determining the second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel point; otherwise, determining the preset second numerical value as the first mask value of the first pixel point; or,

[0138] Determining the maximum value among the variances corresponding to each first pixel point as the target variance; determining the third quotient value of the variance corresponding to the first pixel point and the target variance, and determining the first mask value of the first pixel point according to the third quotient value and the preset configuration parameter.

[0139] Since the principle of the above electronic device for solving problems is similar to that of the image denoising method, the implementation of the above electronic device can refer to the above embodiments, and the repeated parts will not be described again.

[0140] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 502 is used for communication between the above electronic device and other devices. The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor. The above processor may be a general-purpose processor, including a Central Processing Unit, a Network Processor (NP), etc.; it may also be a Digital Signal Processing (DSP), an Application Specific Integrated Circuit, a Field Programmable Gate Array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0141] Embodiment 8:

[0142] Based on the above embodiments, the present application further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the following steps are implemented when the processor executes:

[0143] For each first pixel point of the first image to be denoised, determine each second pixel point in the block matching region containing the first pixel point; for each second pixel point and a preset region size, determine a reference block containing the second pixel point; according to the similarity between the target reference block containing the first pixel point and each reference block, determine candidate blocks whose similarity is within a preset threshold; according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, determine the first pixel value after denoising of the first pixel point.

[0144] In a possible implementation manner, after determining the candidate blocks whose similarity is within a preset threshold and before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes:

[0145] According to the coordinates of the central pixel points of each candidate block and the target reference block, determine a first matrix, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point, and determine the average value corresponding to each element in each row of the first matrix;

[0146] Process the first matrix based on the principal component analysis PCA algorithm to obtain a target eigenvector, and determine a second matrix according to the target eigenvector and the transposed vector corresponding to the target eigenvector;

[0147] For each candidate block, determine a third matrix formed by the coordinates of the central pixel point of the candidate block, where each row of the third matrix corresponds to the abscissa or ordinate of the central pixel point, determine a fourth matrix corresponding to the difference between the elements in the third matrix and the average value corresponding to that row; determine the product of the second matrix and the fourth matrix to obtain a fifth matrix, and determine the first sum value of the elements in the fifth matrix and the average value corresponding to that row to obtain a sixth matrix; based on the sixth matrix, determine the target coordinates of the central pixel point of the candidate block, and update the candidate block according to the target coordinates and the preset region size.

[0148] In a possible implementation manner, after determining the candidate blocks whose similarity is within a preset threshold and before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes:

[0149] Count the number of the candidate blocks;

[0150] If the quantity is greater than a preset quantity threshold, then continue to execute the step of determining the first pixel value after noise reduction of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

[0151] In a possible implementation manner, the process of determining the weight corresponding to each candidate block includes:

[0152] For each second pixel point in the candidate block, according to the relative position of the second pixel point in the candidate block, determine the third pixel point corresponding to the relative position in the target reference block; determine the third difference between the pixel value of the second pixel point and the pixel value of the third pixel point;

[0153] According to each third difference, determine a fifth matrix, and determine the first quotient of the L2 norm of the fifth matrix and a first preset parameter; determine the fourth difference between a second preset parameter and the first quotient as the candidate weight of the candidate block;

[0154] Select the maximum value between the candidate weight and a first preset value as the weight corresponding to the candidate block.

[0155] In a possible implementation manner, the method further includes:

[0156] Perform noise reduction processing on the texture area and the flat area of the first image to be noise-reduced based on a preset noise reduction algorithm to obtain a second image to be noise-reduced after noise reduction;

[0157] For each first pixel point in the first image to be noise-reduced, obtain a preset quantity of fourth pixel points adjacent to the first pixel point, determine the variance corresponding to the first pixel point according to the pixel values of the fourth pixel points and the pixel value of the first pixel point; determine the first mask value of the first pixel point according to the variance and a preset mask algorithm, and determine the difference between a second preset value and the first mask value as the second mask value of the first pixel point; and determine the first product of the first pixel value corresponding to the first pixel point and the first mask value, and the second product of the pixel value corresponding to the first pixel point in the second image to be noise-reduced and the second mask value; determine the sum value of the first product and the second product as the second pixel value after noise reduction of the first pixel point.

[0158] In a possible implementation manner, determining the first mask value of the first pixel point according to the variance and a preset mask algorithm includes:

[0159] If the variance corresponding to the first pixel is less than a preset configuration parameter, then determine the second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel; otherwise, determine the preset second value as the first mask value of the first pixel; or,

[0160] Determine the maximum value among the variances corresponding to each first pixel as the target variance; determine the third quotient value of the variance corresponding to the first pixel and the target variance, and determine the first mask value of the first pixel according to the third quotient value and the preset configuration parameter.

[0161] Since the principle of the computer-readable medium provided above for solving problems is similar to the image denoising method, after the processor executes the computer program in the computer-readable medium, the implemented steps can refer to the above embodiments, and the repeated parts will not be described again.

[0162] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.

[0163] For the system / device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.

[0164] The present application is described with reference to the flowcharts and / or block diagrams of the method, device (system), and computer program product according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in one Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0165] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device realizes the functions in the process Figure 1One or more processes and / or blocks Figure 1 The functions specified in one or more blocks.

[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 One or more processes and / or blocks Figure 1 The steps of the functions specified in one or more blocks.

[0167] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application.

[0168] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. An image noise reduction method, characterized in that, The method includes: For each first pixel point of the first image to be denoised, determine each second pixel point in the block matching region containing the first pixel point, where the block matching region is an image region of a preset pixel size; for each second pixel point and a preset region size, determine a reference block containing the second pixel point; according to the similarity between the target reference block containing the first pixel point and each reference block, determine candidate blocks whose similarity is within a preset threshold, where the target reference block is a reference block with the first pixel point as the central pixel point; according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, determine the first pixel value after denoising of the first pixel point; Among them, the process of determining the weight corresponding to each candidate block includes: For each second pixel point in the candidate block, according to the relative position of the second pixel point in the candidate block, determine the third pixel point corresponding to the relative position in the target reference block; determine the third difference between the pixel value of the second pixel point and the pixel value of the third pixel point; According to each third difference, determine a fifth matrix, and determine the first quotient of the L2 norm of the fifth matrix and a first preset parameter; determine the fourth difference between a second preset parameter and the first quotient as the candidate weight of the candidate block; Select the maximum value between the candidate weight and a first preset value as the weight corresponding to the candidate block.

2. The method according to claim 1, characterized in that, After determining the candidate blocks whose similarity is within the preset threshold and before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes: According to the coordinates of the central pixel points of each candidate block and the target reference block, determine a first matrix, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point, and determine the average value corresponding to each element in each row of the first matrix; Process the first matrix based on the principal component analysis (PCA) algorithm to obtain a target eigenvector, and determine a second matrix according to the target eigenvector and the transposed vector corresponding to the target eigenvector; For each candidate block, determine a third matrix composed of the coordinates of the central pixel point of the candidate block, where each row in the third matrix corresponds to the abscissa or ordinate of the central pixel point, determine a fourth matrix corresponding to the difference between the elements in the third matrix and the average value corresponding to the row; determine the product of the second matrix and the fourth matrix to obtain a fifth matrix, and determine the first sum value of the elements in the fifth matrix and the average value corresponding to the row to obtain a sixth matrix; based on the sixth matrix, determine the target coordinates of the central pixel point of the candidate block, and update the candidate block according to the target coordinates and the preset region size.

3. The method according to claim 1 or 2, characterized in that, After determining the candidate blocks whose similarity is within the preset threshold and before determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block, the method further includes: Count the number of candidate blocks; If the quantity is greater than a preset quantity threshold, continue to execute the step of determining the first pixel value after noise reduction of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

4. The method according to claim 1, characterized in that The method further includes: Performing noise reduction processing on the texture area and the flat area of the first image to be noise-reduced based on a preset noise reduction algorithm to obtain a second image to be noise-reduced after noise reduction; For each first pixel point in the first image to be noise-reduced, obtain a preset number of fourth pixel points adjacent to the first pixel point, and determine the variance corresponding to the first pixel point according to the pixel values of the fourth pixel points and the pixel value of the first pixel point; according to the variance and a preset mask algorithm, determine the first mask value of the first pixel point, and determine the difference between a second preset value and the first mask value as the second mask value of the first pixel point; and determine the first product of the first pixel value corresponding to the first pixel point and the first mask value, and the second product of the pixel value corresponding to the first pixel point in the second image to be noise-reduced and the second mask value; determine the sum value of the first product and the second product as the second pixel value after noise reduction of the first pixel point.

5. The method according to claim 4, characterized in that, Determining the first mask value of the first pixel point according to the variance and a preset mask algorithm includes: If the variance corresponding to the first pixel point is less than a preset configuration parameter, determine the second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel point; otherwise, determine the preset second value as the first mask value of the first pixel point; or, Determine the maximum value of the variances corresponding to each first pixel point as the target variance; determine the third quotient value of the variance corresponding to the first pixel point and the target variance, and determine the first mask value of the first pixel point according to the third quotient value and the preset configuration parameter.

6. An image noise reduction device, characterized in that, The device includes: A determination module, configured to determine, for each first pixel point of a first image to be noise-reduced, each second pixel point in a block matching region including the first pixel point, where the block matching region is an image region with a preset pixel size; for each second pixel point and a preset region size, determine a reference block including the second pixel point; and determine candidate blocks with a similarity within a preset threshold according to the similarity between a target reference block including the first pixel point and each reference block, where the target reference block is a reference block with the first pixel point as the central pixel point; A noise reduction module, configured to determine the first pixel value after noise reduction of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block; The determining module is further configured to, for each second pixel point in the candidate block, determine a third pixel point corresponding to the relative position in the target reference block according to the relative position of the second pixel point in the candidate block; determine a third difference between the pixel value of the second pixel point and the pixel value of the third pixel point; determine a fifth matrix according to each of the third differences, and determine a first quotient value of the L2 norm of the fifth matrix and a first preset parameter; determine a fourth difference between a second preset parameter and the first quotient value as the candidate weight of the candidate block; and select the maximum value between the candidate weight and a first preset value as the weight corresponding to the candidate block.

7. The device according to claim 6, characterized in that, The determining module is specifically configured to determine a first matrix according to the coordinates of the central pixel points of each candidate block and the target reference block, where each row in the first matrix corresponds to the abscissa or ordinate of the central pixel point, and determine the average value corresponding to each element in each row of the first matrix; process the first matrix based on the principal component analysis (PCA) algorithm to obtain a target eigenvector, and determine a second matrix according to the target eigenvector and the transposed vector corresponding to the target eigenvector; for each candidate block, determine a third matrix formed by the coordinates of the central pixel point of the candidate block, where each row in the third matrix corresponds to the abscissa or ordinate of the central pixel point, and determine a fourth matrix corresponding to the difference between the element in the third matrix and the average value corresponding to the row. Determine the product of the second matrix and the fourth matrix to obtain a fifth matrix, and determine a first sum value of the elements in the fifth matrix and the average value corresponding to the row to obtain a sixth matrix. Based on the sixth matrix, determine the target coordinates of the central pixel point of the candidate block, and update the candidate block according to the target coordinates and the preset region size.

8. The device according to claim 6 or 7, characterized in that, The apparatus further includes: A statistics module, configured to count the number of candidate blocks; if the number is greater than a preset number threshold, continue to execute the step of determining the first pixel value after denoising of the first pixel point according to the pixel value of the central pixel point of each candidate block and the weight corresponding to each candidate block.

9. The device according to claim 6, characterized in that, The denoising module is further configured to perform denoising processing on the texture region and the flat region of the first image to be denoised based on a preset denoising algorithm to obtain a second image to be denoised after denoising. The determining module is further configured to, for each first pixel point in the first image to be denoised, obtain a preset number of fourth pixel points adjacent to the first pixel point, and determine the variance corresponding to the first pixel point according to the pixel values of the fourth pixel points and the pixel value of the first pixel point. According to the variance and a preset masking algorithm, determine the first mask value of the first pixel point, and determine the second mask value of the first pixel point as the difference between a second preset value and the first mask value. Determine the first product of the first pixel value corresponding to the first pixel point and the first mask value, and the second product of the pixel value corresponding to the first pixel point in the second image to be denoised and the second mask value; determine the sum value of the first product and the second product as the second pixel value after denoising of the first pixel point.

10. The device according to claim 9, characterized in that, The determining module is specifically configured to, if the variance corresponding to the first pixel point is less than a preset configuration parameter, determine the second quotient value of the variance and the preset configuration parameter as the first mask value of the first pixel point; otherwise, determine the preset second numerical value as the first mask value of the first pixel point; Alternatively, determine the maximum value among the variances corresponding to each first pixel point as the target variance; Determine the third quotient value of the variance corresponding to the first pixel point and the target variance, and determine the first mask value of the first pixel point according to the third quotient value and the preset configuration parameter.

11. An electronic device, characterized in that, The electronic device at least includes a processor and a memory. When the processor executes the computer program stored in the memory, it implements the steps of the image denoising method according to any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed by the processor, it implements the steps of the image denoising method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Image processing method and device, equipment and storage medium

    CN109697699A

  • Image noise reduction method and system

    CN114596229A