A Bayer domain image spatial domain denoising method and chip
By sampled the R, G and B components of the Bayer domain image, and the HAAR wavelet decomposition, combined with the local threshold and gradient information, the noise reduction treatment has been solved. It has efficient noise reduction effect and savings of hardware resources.
Patent Information
- Application Number
- CN202411346828.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The existing bayer domain airspace noise reduction algorithm has problems such as high hardware costs, imbalance between Gr and Gb pixels, causing horizontal and vertical grain phenomena, thicker edges and difficult to remove large gradient noise in flat areas.
By sampling the neighbor data of R, G, and B components, the sampling matrix of the same structural characteristics is obtained, and the HAAR mini -wavel is decomposed to calculate the local threshold for proportional noise reduction, and the gradient information is used for weighted reconstruction. , Output the level of noise reduction and noise reduction value in vertical direction.
The noise reduction of the R, G, and B colors, saving hardware resources, avoiding the problem that the large gradient noise of large gradient regions becomes thick and flat in the edge is difficult to remove, and enhance the ability of bordering.
Smart Images

Figure CN118864301B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to image processing technology, and in particular to a method for reducing spatial domain noise of a Bayer domain image. Background Art
[0002] The existing Bayer domain spatial denoising algorithms are divided into R / G / B three-channel or R / Gr / Gb / B four-channel denoising. The denoising based on wavelet decomposition and reconstruction mainly includes three processes: wavelet decomposition, threshold denoising, and wavelet reconstruction.
[0003] The spatial distribution patterns of R, G, and B components in the Bayer domain are different. If three channels are used for noise reduction, the noise reduction methods used will also be different, and the hardware cost will increase; if four channels are used for noise reduction, it is easy to expand the imbalance between Gr and Gb pixels, resulting in horizontal and vertical lines. The wavelet noise reduction algorithm is easy to cause the edges to become coarse during the decomposition and reconstruction process, and the unreasonable selection of thresholds will also lead to blurred edges and difficulty in removing large gradient noise in flat areas. Summary of the invention
[0004] The present invention aims at at least one shortcoming of the wavelet denoising algorithm in the prior art and provides a method for denoising an image in the space domain of a Bayer domain, comprising the following steps:
[0005] The neighborhood data of the noise reduction points of the R, G, and B components are sampled respectively to obtain sampling matrices with the same structural characteristics;
[0006] The sampling matrices of the three components are decomposed using a Haar wavelet basis to obtain a first matrix of different frequency information; the sampling matrices of the three components are transposed to form a transposed matrix, and each transposed matrix is decomposed using a Haar wavelet basis to obtain a second matrix of different frequency information;
[0007] Calculate the brightness information and gradient information in the N×N neighborhood of the denoised points of the R, G, and B components respectively, and determine the local threshold of wavelet denoising according to the brightness information and gradient information; perform proportional denoising on the first matrix and the second matrix respectively with the local threshold of the R, G, and B components, and output a third matrix;
[0008] Using the gradient information of the sampling matrix, weighted reconstruction is performed on the third matrix after the first matrix is denoised, and the first denoised value in the horizontal direction of the denoised point is output;
[0009] Using the gradient information of the sampling matrix, weighted reconstruction is performed on the third matrix after the second matrix is denoised, and a second denoised value in the vertical direction of the denoised point is output;
[0010] Calculate and output the output value of the to-be-denoised point of each component according to the first denoising value and the second denoising value;
[0011] According to the above steps, all pixels are traversed to complete the Bayer domain image denoising.
[0012] Preferably, the method of calculating and outputting the output values of the points to be denoised of each component based on the first denoising value and the second denoising value includes: weighting the first denoising value and the second denoising value according to a preset weight, and outputting the output values of the points to be denoised of each component; or, respectively calculating the directional attribute parameters in the horizontal direction and the directional attribute parameters in the vertical direction of the sampling matrix of the three components; weighting the first denoising value and the second denoising value using the directional attribute parameters, and outputting the output values of the points to be denoised of each component; and further enhancing the edge preservation capability.
[0013] The present invention also provides a chip, comprising a circuit structure for implementing a method for reducing the spatial noise of a Bayer domain image.
[0014] The beneficial effects include at least: R, G, B color channels are sampled respectively according to different distribution conditions of neighboring pixels, ensuring that the sampled data can share a decomposition and reconstruction model, thus saving hardware resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0016] Figure 1 It is a flow chart of the spatial domain denoising method of Bayer domain image;
[0017] Figure 2 It is a schematic diagram of G component sampling;
[0018] Figure 3 It is a schematic diagram of R component sampling;
[0019] Figure 4 It is a schematic diagram of B component sampling;
[0020] Figure 5 This is a schematic diagram of the sampling matrix in which P is used to replace the three components of R, G, and B. DETAILED DESCRIPTION
[0021] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.
[0022] A method for spatial denoising of bayer domain images. For the overall flowchart, please refer to Figure 1 , including the following steps:
[0023] The neighborhood data of the noise reduction points of the R, G, and B components are sampled respectively to obtain sampling matrices with the same structural characteristics;
[0024] The sampling matrices of the three components are decomposed using a Haar wavelet basis to obtain a first matrix of different frequency information; the sampling matrices of the three components are transposed to form a transposed matrix, and each transposed matrix is decomposed using a Haar wavelet basis to obtain a second matrix of different frequency information;
[0025] Calculate the brightness information and gradient information in the neighborhood of the noise reduction point of the R, G, and B components respectively, and determine the local threshold of wavelet noise reduction according to the brightness information and gradient information; perform proportional noise reduction on the first matrix and the second matrix respectively with the local threshold of the R, G, and B components, and output a third matrix;
[0026] Using the gradient information of the sampling matrix, weighted reconstruction is performed on the third matrix after the first matrix is denoised, and the first denoised value in the horizontal direction of the denoised point is output;
[0027] Using the gradient information of the sampling matrix, weighted reconstruction is performed on the third matrix after the second matrix is denoised, and a second denoised value in the vertical direction of the denoised point is output;
[0028] Calculate and output the output value of the to-be-denoised point of each component according to the first denoising value and the second denoising value;
[0029] According to the above steps, all pixels are traversed to complete the Bayer domain image denoising.
[0030] The following is further explained through detailed description and examples:
[0031] Step 1, channel sampling: Sample the R, G, and B components separately to obtain a sampling matrix with the same structural characteristics; in this step, the R, G, and B color channels are sampled separately according to the different distributions of the neighborhood pixels to ensure that the sampled data can share a decomposition and reconstruction model to save resources.
[0032] In order to obtain a sampling matrix with the same structural characteristics, the R, G, and B components are sampled separately. For the R and B components, the data of the N×N neighborhood is taken, and direct sampling is performed with the noise reduction point as the center to obtain the sampling matrix for the R and B components;
[0033] For the G component, take the data of the N×N neighborhood, perform mean sampling with the noise reduction point as the center, and obtain the sampling matrix for the G component.
[0034] For R, G, and B components, take a 5×5 pixel matrix as an example. Centered on the noise reduction point, the 5×5 pixel matrix is sampled into a 3×3 matrix.
[0035] Figure 2For the G component, take the data of the surrounding 5×5 neighborhood and record it as the matrix Gmask. Take the mean sampling with the noise reduction point G33 as the center, and record the result as mask-1.
[0036] Figure 3 For the R component, take the data of the surrounding 5×5 neighborhood, recorded as matrix Rmask. Directly sample with the noise reduction point R33 as the center, and the result is recorded as mask-2.
[0037] Figure 4 For the B component, take the data of the surrounding 5×5 neighborhood, recorded as matrix Bmask. Directly sample with the noise reduction point B33 as the center, and the result is recorded as mask-3.
[0038] For the G component, median filtering or weighted filtering can also be used for sampling. Furthermore, different sampling methods are applied to neighborhoods of different sizes, such as 7×7 and 9×9. Other options include median filtering, weighted filtering, etc.
[0039] Step 2, wavelet decomposition: the sampling matrices of the three components are decomposed using the Haar wavelet basis to obtain a first matrix of different frequency information; the sampling matrices of the three components are transposed to form a transposed matrix, and each transposed matrix is decomposed using the Haar wavelet basis to obtain a second matrix of different frequency information;
[0040] For the convenience of description, Figure 5 , let P-mask represent the mask matrices (mask-1, mask-2, mask-3) of the three components of R, G, and B at the same time. The present application proposes that the three components share a decomposition and reconstruction model, thereby saving hardware costs.
[0041] Use the haar wavelet basis to decompose the P-mask matrix to obtain different frequency information. First, perform a haar wavelet basis decomposition on the P-mask matrix in the column direction to obtain a frequency matrix of different frequencies. Secondly, perform a haar wavelet basis secondary decomposition on the matrix after the primary decomposition in the column direction to further obtain a frequency matrix of different frequencies. Finally, perform a haar wavelet basis tertiary decomposition on the matrix after the secondary decomposition in the row direction, and finally obtain the first matrix of each frequency information with one row and two columns, for example: [A1A2], which includes low-frequency information LL_L1, medium-low frequency information LH_L1, HL_L1 and HH_L1, medium-high frequency information LL_H1, LH_H1 and HL_H1, and high-frequency information HH_H1.
[0042] Transpose the P-mask to form a matrix mask T The same method as the P-mask matrix is used to decompose the matrix mask. TPerform wavelet decomposition and finally output the second matrix, including low-frequency information LL_L2, medium-low-frequency information LH_L2, HL_L2, HH_L2, medium-high-frequency information LL_H2, LH_H2 and HL_H2, and high-frequency information HH_H2.
[0043] It should be noted that the above calculation method obtains the output parameters of the three components respectively. The above description repeats the calculation of the output data of the three components R, G, and B three times respectively. Since the wavelet decomposition method of the three components R, G, and B is the same or the same model is used for calculation, it is only described once in this article, which is also a favorable advantage of this solution.
[0044] Step 3, local threshold calculation: respectively calculate the brightness information and gradient information in the neighborhood of the noise reduction point of the R, G, and B components, and determine the local threshold of wavelet noise reduction based on the brightness information and gradient information;
[0045] Compared with the traditional wavelet threshold, the local noise reduction threshold is adaptively calculated by the mean value in the neighborhood and the absolute difference of pixels, which can achieve adaptive edge preservation capability.
[0046] This application discloses two ideas. First, the calculation is based on the following method:
[0047] Specifically, the calculation method of the brightness information Av and the gradient information As includes:
[0048] For R and B components, respectively, from the sampling matrix mask- 1 and the sampling matrix mask- 2, extract the pixel information of the noise reduction point and the four directions above, below, left and right of the noise reduction point, and calculate the first average pixel value of the five pixels Av , as brightness information Av , and calculate the first average pixel value Av The average of the absolute differences between the noise reduction point and the pixel information above, below, left, and right of the noise reduction point As , as gradient information As , R and B components share the same calculation model, as follows:
[0049] Av=(P13+P31+P33+P35+P53) / 5;
[0050] As=(|P13-Av|+ |P31-Av| + |P33-Av|+ |P35-Av|+|P53-Av|) / 5.
[0051] Here, P13 represents the pixel value in the first row and third column in the sampling matrix mask-1 and the sampling matrix mask-2 of the R and B components at the same time, and can represent both the R component (R13) and the B component (B13).
[0052] Av and As can represent R and B components at the same time. Since the calculation models of brightness information and gradient information of R and B components are the same, this article will use P instead of R and B.
[0053] However, since the input data of R and B components are different, the output will also be different. Therefore, for the R component, the output results are Av1 and As1 respectively; for the B component, the output results are Av2 and As2 respectively. When the input data is different, the operation process of the same model can be understood by the following formula:
[0054] Av1=(R13+R31+R33+R35+R53) / 5;
[0055] As1=(|R13-Av1|+ |R31-Av1| + |R33-Av1|+ |R35-Av1|+|R53-Av1|) / 5;
[0056] Av2=(B13+B31+B33+B35+B53) / 5;
[0057] As2=(|B13-Av1|+ |B31-Av1| + |B33-Av1|+ |B35-Av1|+|B53-Av1|) / 5.
[0058] For the G component, calculate the noise reduction point and the four green components around the noise reduction point, calculate the second average pixel value of the noise reduction point and the four green components around the noise reduction point, and calculate the average value of the absolute difference between the second average pixel value and the noise reduction point and the four green components around the noise reduction point as gradient information.
[0059] Specifically, for the G component: From the matrix Gmask In the above example, five green components are extracted, which are the noise reduction point and the four green components around the noise reduction point ( G twenty two, G twenty four, G 33. G 42. G 44), calculate the second average pixel value of the five green components Av 3 , and calculate the second average pixel value Av 3 The average of the absolute differences between these five pixels As 3 , and its calculation model is as follows:
[0060] Av3=(G22+G24+G33+G42+G44) / 5;
[0061] As3=(|G22-Av3|+ |G24-Av3| + |G33-Av3|+ |G42-Av3|+|G44-Av3|) / 5.
[0062] The first calculation method of local threshold is: th = (B × Av + (K × Av × (Av / 2 12 ))) / (As+1)
[0063] Among them, B and K are configuration parameters, B is used for coarse adjustment of noise reduction intensity, and K is related to brightness changes.
[0064] It should be noted that, preferably, for different color components, the parameter settings are different, which are respectively expressed as Br, R component configuration parameters; Bg, G component configuration parameters; Bb, B component configuration parameters; Kr, R component configuration parameters; Kg, G component configuration parameters; Kb, B component configuration parameters.
[0065] For example, since the green component has a higher impact on clarity, a smaller noise reduction intensity can be set, and a parameter in the range of 5-10 can be selected for Bg, and a parameter in the range of 5-10 can be selected for Kg. Br / Bb can select a parameter in the range of 10-20, and Kr and Kb can select a parameter in the range of 10-20.
[0066] Therefore, in this scheme, the local threshold is determined by the brightness information (Av) and the gradient information As (i.e., the pixel absolute difference As) in the neighborhood.
[0067] Furthermore, by using the absolute difference (gradient information) of pixels in different neighborhoods to assist in calculating the local noise reduction threshold, large gradient noise in flat areas can be processed in a targeted manner. In this solution, the first neighborhood is 3×3, and the second neighborhood is the neighborhood 5×5 disclosed by the sampling matrix.
[0068] Then, the method of respectively calculating the brightness information and gradient information in the neighborhood of the noise reduction point of the R, G, and B components includes calculating the first gradient information and brightness information in the M×M neighborhood, and calculating the second gradient information in the N×N neighborhood, and calculating the local threshold according to the brightness information, the first gradient information, and the second gradient information, N> M. Then, exemplarily, the method of calculating the average pixel and the average value of the absolute difference proposed above can be understood as the calculation of the brightness information and the first gradient information, M=3, N=5.
[0069] The calculation method of the second gradient information includes:
[0070] For the R and B components, the average of the absolute differences between their respective first average pixel values and all pixels in the sampling matrix (N×N) of the corresponding components is calculated as the second gradient information.
[0071] For the G component, all G components in the N×N neighborhood are extracted, and the average value of the absolute difference between the second average pixel value and all G components is calculated as the gradient information in different neighborhoods (the second neighborhood).
[0072] Specifically, for the R and B components, the average values of the absolute differences between Av1, Av2 and all pixels in the sampling matrix mask matrix of the corresponding components are calculated respectively, and the R component is recorded as Rs1 and the B component is recorded as Rs2.
[0073] ,
[0074] ,
[0075] Among them, yp1 and yp2 represent the values of pixel point p in the R and B component mask-1 and mask-2 matrices respectively.
[0076] For the G component, all G components are extracted from the matrix Gmask, and the average value Rs3 of the absolute difference between Av3 and all G components is calculated. The calculation model is as follows:
[0077] ,
[0078] ,
[0079] Where f is the filter matrix. p represents all G component pixels in Gmask. yp3 represents the value of pixel p.
[0080] In addition, the pixel extraction method is not fixed, and different neighborhoods of different sizes (such as 7x7, 9x9) should use different extraction methods. For example, when the neighborhood becomes larger, Av, As, and Rs can be calculated by sampling alternate points to avoid excessive circuit costs.
[0081] The R, G, and B components calculate their respective wavelet denoising local thresholds th according to their respective Av, As, and Rs. Preferably, the second calculation method of the local threshold is:
[0082] th = (B × Av + (K × Av × (Av / 2 12 ))) / (As+1)+max((S×(As-(Rs+1))) / (Rs+1),0).
[0083] Among them, B, K, and S are configuration parameters. B is used to roughly adjust the noise reduction intensity. K is related to the brightness change. S controls the noise reduction intensity of large-particle noise points in flat areas. It should be noted that for different color components, the parameter settings should be different, expressed as Br, R component configuration parameters; Bg, G component configuration parameters; Bb, B component configuration parameters; Kr, R component configuration parameters; Kg, G component configuration parameters; Kb, B component configuration parameters; Sr, R component configuration parameters; Sg, G component configuration parameters; Sb, B component configuration parameters.
[0084] For example, since the green component has a higher impact on clarity, a smaller noise reduction intensity can be set, and a parameter in the range of 5-10 can be selected for Bg, a parameter in the range of 5-10 can be selected for Kg, and a parameter in the range of 150-200 can be selected for Sg. Br and Bb can select a parameter in the range of 10-20, Kr and Kb can select a parameter in the range of 10-20, and Sr and Sb can select a parameter in the range of 200-300.
[0085] More specifically, a calculation model, when the input data is different, in the application, the formula can be understood as three formulas,
[0086] th1=(B×Av1+(K×Av1×(Av1 / 2 12 ))) / (As1+1)+max((S×(As1-(Rs1+1))) / (Rs1+1),0);
[0087] th2=(B×Av2+(K×Av2×(Av2 / 2 12 ))) / (As2+1)+max((S×(As2-(Rs2+1))) / (Rs2+1),0);
[0088] th3=(B×Av3+(K×Av3×(Av3 / 2 12 ))) / (As3+1)+max((S×(As3-(Rs3+1))) / (Rs3+1),0).
[0089] The preferred solution is to introduce gradient information (pixel absolute difference As, Rs) within different neighborhoods to assist in judgment, which can ensure the removal of large gradient noise in flat areas while protecting the edges. By assisting in the calculation of local noise reduction thresholds through the absolute difference of pixels in different neighborhoods, large gradient noise in flat areas can be processed in a targeted manner. Specifically, the calculation of the gradient information As proposed above can be understood as the use of data from a 3×3 neighborhood, while the calculation of the gradient information Rs uses data from a 5×5 neighborhood, that is, the data from the N×N neighborhood disclosed above. When there are other methods under the same idea that use parameters such as 7 or 9, the corresponding brightness information and gradient information are also adaptively modified.
[0090] Step 4, threshold denoising: perform proportional denoising on the first matrix and the second matrix respectively using local thresholds of the R, G, and B components, and output a third matrix. The third matrix includes the third matrix after denoising the first matrix and the third matrix after denoising the second matrix.
[0091] With the first matrix and the second matrix as input data Input, the output data Output is calculated by the following formula:
[0092] ,
[0093] Among them, K is a configuration parameter. The smaller its value, the stronger the mid-frequency noise reduction strength, and the value range is 0-255. t is a configuration parameter. The larger its value, the more detailed areas with larger gradients will be protected, and the value range is 0-255. Kh is a configuration parameter. The smaller its value, the stronger the high-frequency noise reduction strength, and the value range is 0-255. Among them, the formula is a unified model. According to different input data, the output is different. For the convenience of understanding, it is further explained as follows:
[0094] The input is the first matrix of the R component, and the output denoised third matrix can be recorded as Output_R1;
[0095] The input is the first matrix of the G component, and the third matrix after output denoising can be recorded as Output_G1;
[0096] The input is the first matrix of the B component, and the output denoised third matrix can be recorded as Output_B1;
[0097] The input is the second matrix of the R component, and the output denoised third matrix can be recorded as Output_R2;
[0098] The input is the second matrix of the G component, and the output denoised third matrix can be recorded as Output_G2;
[0099] The input is the second matrix of the B component, and the third matrix after output noise reduction can be recorded as Output_B2.
[0100] Step 5, wavelet weighted reconstruction:
[0101] The third matrix after the first matrix denoising is weighted and reconstructed using the gradient information of the sampling matrix, and the first denoising value in the horizontal direction of the denoising point is output, that is, the horizontal denoising value Pr of the denoising point; as shown in the figure, it is the horizontal denoising value of the denoising point P33. The input includes low-frequency information LL_L1, medium-low-frequency information LH_L1, HL_L1 and HH_L1, medium-high-frequency information LL_H1, LH_H1 and HL_H1, and high-frequency information HH_H1.
[0102] The specific reconstruction model is as follows:
[0103] ,
[0104] ,
[0105] ,
[0106] ,
[0107] ,
[0108] ,
[0109] The calculation of C1, C2, and D2 is a weighted reconstruction process, using the difference between pixels (for example, P23-P22) as the weight during reconstruction to reconstruct the frequency information after threshold noise reduction after three decompositions. The three reconstruction results of C1, D2, and C2, which represent low frequency, high frequency, and medium frequency, will act on the second reconstruction.
[0110] The calculation of Ga and Di is a secondary reconstruction process, which further reconstructs the frequency information obtained by the primary reconstruction. Ga and Di represent the high-frequency and low-frequency information obtained after the secondary reconstruction, respectively, and will participate in the final three reconstructions. The calculation of Pr is the three-time reconstruction process, which uses the difference between pixels as the weight to perform weighted reconstruction on Ga and Di. The final reconstructed result is the lateral noise reduction value Pr after noise reduction.
[0111] In the formula, LL_L 1 (1) represents the first value in a row and two columns. LL_L 1(2) represents the second value, and the other parameters are interpreted similarly; Di(1,1) represents the value of the first row and first column of the Di matrix, and the other values: such as Ga(2,1) are interpreted similarly.
[0112] The third matrix after the second matrix denoising is weighted and reconstructed using the gradient information of the sampling matrix, and the second denoising value in the vertical direction of the denoising point is output; that is, the horizontal denoising value Pc of the denoising point; as shown in the figure, it is the vertical denoising value of the denoising point P33. The second matrix includes low-frequency information LL_L2, medium-low-frequency information LH_L2, HL_L2, HH_L2, medium-high-frequency information LL_H2, LH_H2 and HL_H2, and high-frequency information HH_H2.
[0113] The reconstruction process is the same as the above-mentioned reconstruction sampling matrix reconstruction process, only the mask matrix is replaced by mask TThe model used is the same. Structurally, a transposition circuit needs to be set up at the front end, so P33 in the formula below represents the mask of each component at the same time. T The point to be denoised in the third row and third column of the matrix, and the rest of the points, such as P22, are similar. The reconstructed model is as follows:
[0114] ,
[0115] ,
[0116] ,
[0117] ,
[0118] ,
[0119] ,
[0120] The meanings of the parameters in the Pc reconstruction model are consistent with those in the Pr calculation model and will not be elaborated on here.
[0121] After obtaining the first noise reduction value and the second noise reduction value, the output value of the noise reduction point of each component is calculated and output according to the first noise reduction value and the second noise reduction value; the first method is to weight the first noise reduction value and the second noise reduction value according to a preset weight, and output the output value of the noise reduction point of each component. Exemplarily, the method adopts an equalization method, and the weight is 0.5.
[0122] Calculate the output value according to the following formula: P33=0.5*Pc+0.5*Pr.
[0123] A preferred solution is further proposed, which calculates the absolute difference in the horizontal direction of the sampling matrices of the three components as the directional attribute parameter M1 and the absolute difference in the vertical direction as the directional attribute parameter M2. The directional attribute parameters M1 and M2 are used to weight the first denoising value and the second denoising value, and the output value of the denoising point of each component is output.
[0124] Taking the noise reduction point P33 as an example, the output value of each component noise reduction point P33 is obtained, and the calculation model is as follows:
[0125] ,
[0126] The first noise reduction value and the second noise reduction value are adaptively weighted by using the attribute parameters in the horizontal direction and the attribute parameters in the vertical direction, thereby further enhancing the edge preservation effect of the present solution.
[0127] Finally, according to the method of steps 1 to 5 above, all pixels are traversed to complete the Bayer domain image denoising.
[0128] The adaptive weighted reconstruction is performed based on the gradient information in the sampling matrix of each component, and the adaptive weighted wavelet reconstruction is realized, which can effectively avoid the phenomenon of edge coarsening caused by the traditional wavelet denoising algorithm. The neighboring pixels of the edge pixels of the image are automatically filled, and then all the pixels of the image are traversed to complete the Bayer domain image denoising.
[0129] According to the pixel matrix (P-mask) with the same structural characteristics obtained after channel sampling, it is ensured that the three components of R, G, and B use the same wavelet decomposition and reconstruction model, and the circuit can be shared during hardware implementation, saving hardware costs. Therefore, in this application, P is used multiple times to replace the R, G, and B marks. More importantly, it is to express the main advantages of this solution, including that the method proposed in this application can realize the characteristics of the component calculation sharing circuit, saving hardware costs.
[0130] A chip is further disclosed, the hardware circuit structure of the chip includes electronic devices and connection relationships that can implement the above method.
[0131] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for spatial domain denoising of a Bayer domain image, characterized in that: The following steps are involved: The neighborhood data of the noise reduction points of the R, G, and B components are sampled respectively to obtain sampling matrices with the same structural characteristics; The sampling matrices of the three components are decomposed using the Haar wavelet basis to obtain the first matrix of different frequency information; The sampling matrices of the three components are transposed to form a transposed matrix, and each transposed matrix is decomposed using the Haar wavelet basis to obtain a second matrix with different frequency information; Calculate the brightness information and gradient information in the neighborhood of the noise reduction point of the R, G, and B components respectively, and determine the local threshold of wavelet noise reduction based on the brightness information and gradient information; Perform proportional noise reduction on the first matrix and the second matrix respectively using local thresholds of the R, G, and B components, and output a third matrix; Using the gradient information of the sampling matrix, weighted reconstruction is performed on the third matrix after the first matrix is denoised, and the first denoised value in the horizontal direction of the denoised point is output; Using the gradient information of the sampling matrix, weighted reconstruction is performed on the third matrix after the second matrix is denoised, and a second denoised value in the vertical direction of the denoised point is output; Calculate and output the output value of the to-be-denoised point of each component according to the first denoising value and the second denoising value; According to the above steps, all pixels are traversed to complete the Bayer domain image denoising.
2. The method for spatial domain denoising of a Bayer domain image according to claim 1, characterized in that: The method of using a Haar wavelet basis to decompose and obtain a first matrix and a second matrix of different frequency information includes: Perform a Haar wavelet-based primary decomposition on the sampling matrices of the three components in the column direction; perform a Haar wavelet-based secondary decomposition on the matrices after the primary decomposition in the column direction; perform a Haar wavelet-based tertiary decomposition on the matrices after the secondary decomposition in the row direction to obtain a first matrix with one row and two columns of different frequency information; The same method is used to operate the transposed matrix to obtain a second matrix with one row and two columns of different frequency information.
3. The method for spatial domain denoising of a Bayer domain image according to claim 1, characterized in that: The method for calculating and outputting the output value of the to-be-denoised point of each component according to the first denoising value and the second denoising value comprises: respectively calculating the directional attribute parameters in the horizontal direction and the directional attribute parameters in the vertical direction of the sampling matrix of the three components; weighting the first denoising value and the second denoising value by the directional attribute parameters, and outputting the output value of the to-be-denoised point of each component; Alternatively, the first noise reduction value and the second noise reduction value are weighted according to a preset weight, and the output value of the to-be-noised point of each component is output.
4. The method for spatial domain denoising of a Bayer domain image according to claim 1, wherein: The method of respectively calculating the brightness information and gradient information in the neighborhood of the noise reduction point of the R, G, and B components includes: For the R and B components, the first average pixel value is calculated as the brightness information according to the noise reduction point and the pixel information in the four directions above, below, left and right of the noise reduction point in the respective sampling matrices, and the average value of the absolute difference between the first average pixel value and the noise reduction point and the pixel information in the four directions above, below, left and right of the noise reduction point is calculated as the gradient information; For the G component, extract the noise reduction point and the four green components around the noise reduction point, calculate the second average pixel value of the noise reduction point and the four green components around the noise reduction point, and calculate the average value of the absolute difference between the second average pixel value and the noise reduction point and the four green components around the noise reduction point as gradient information.
5. The method for spatial domain denoising of a bayer domain image according to claim 4, characterized in that: A method for respectively calculating brightness information and gradient information in the neighborhood of a noise reduction point of R, G, and B components, comprising calculating first gradient information and brightness information in an M×M neighborhood, and calculating second gradient information in an N×N neighborhood, and calculating a local threshold according to the brightness information, the first gradient information, and the second gradient information, wherein N>M.
6. The method for spatial denoising of a bayer domain image according to claim 5, characterized in that: The calculation method of the second gradient information includes: For the R and B components, respectively calculate the average of the absolute differences between the first average pixel value of each component and all pixels in the sampling matrix of the corresponding component as the second gradient information; For the G component, all G components in the N×N neighborhood are extracted, and the average value of the absolute difference between the average pixel value and all G components is calculated as the second gradient information.
7. The method for spatial domain denoising of a Bayer domain image according to claim 1, characterized in that: The method of performing proportional noise reduction on a first matrix and a second matrix respectively using local thresholds of R, G, and B components to output a third matrix includes: With the first matrix and the second matrix as input data Input, the output data Output is calculated by the following formula: , Among them, th is the local threshold, K is a configuration parameter. The smaller its value is, the stronger the mid-frequency noise reduction is. The value range is 0-255. t is a configuration parameter. The larger its value is, the more detailed areas with larger gradients will be protected. The value range is 0-255. Kh is a configuration parameter. The smaller its value is, the stronger the high-frequency noise reduction is. The value range is 0-255.
8. The method for spatial denoising of a Bayer domain image according to claim 1, wherein: The method of respectively calculating the directional attribute parameters in the horizontal direction and the directional attribute parameters in the vertical direction of the sampling matrix of the three components includes: The absolute difference in the horizontal direction of the sampling matrices of the three components is calculated as the direction attribute parameter, and the absolute difference in the vertical direction is calculated as the direction attribute parameter.
9. The method for spatial domain denoising of a Bayer domain image according to claim 1, characterized in that: The method of sampling R, G, and B components respectively to obtain a sampling matrix with the same structural characteristics includes: For the G component, sampling is performed with the noise reduction point as the center. The sampling methods include mean sampling, median filtering or weighted filtering. For the R and B components, direct sampling is performed with the noise reduction point as the center.
10. A chip, characterized in that: It comprises a circuit structure, and the circuit structure is used to implement the bayer domain image spatial domain denoising method described in any one of claims 1-9.
Citation Information
Patent Citations
SAR image denoising method based on sampling matrix direction optimization
CN104574308A
Image enhancement algorithm based on wavelet transform and fusing high-frequency and low-frequency information
CN111583123A