Image processing method
By calculating the noise elimination weight and using the trend changes of pixel values and surrounding pixel values, the noise suppression and elimination in the image is achieved, which solves the problem of low noise filtering efficiency in the existing technology and improves the image quality.
Patent Information
- Application Number
- CN202310302839.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-09-24
AI Technical Summary
It is difficult for the existing technology to effectively distinguish image details and noise, resulting in low noise filtering efficiency and affecting image quality.
By calculating the noise elimination weight of the pixel, using the trend changes in pixel values and surrounding pixel values to calculate the noise degree value, and adjusting the noise elimination intensity, more effective noise suppression and elimination can be achieved.
It improves the image quality, enhances the efficiency of noise suppression and elimination, and avoids distortion caused by the simultaneous elimination of image signals and noise.
Smart Images

Figure CN118694869A
Abstract
Description
Technical Field
[0001] The invention relates to an image processing method, in particular to an image processing method for eliminating noise. Background Art
[0002] Noise elimination is one of the ways to improve image quality during image processing. Therefore, how to effectively distinguish image details from noise and filter out noise has become one of the important issues in this field. Summary of the invention
[0003] An embodiment of the present invention relates to an image processing method, comprising: reading n×m pixels in an input image frame, wherein the pixels are arranged in a matrix; calculating the noise elimination weight of a currently processed pixel among the pixels; and performing noise elimination on the currently processed pixel according to the noise elimination weight to update the pixel value of the currently processed pixel. The step of calculating the noise elimination weight comprises: obtaining a gain according to the pixel value of the currently processed pixel and assigning it to the currently processed pixel; calculating the noise level value of the currently processed pixel according to the trend change of the pixel values of the currently processed pixel and its surrounding pixels in at least one direction; calculating an adjustment score according to the noise level value of the currently processed pixel; and multiplying the gain by the adjustment score to obtain the noise elimination weight.
[0004] The image processing method of the present invention utilizes the pixel value variation trend in one or more directions to help determine the degree of noise, thereby making the noise suppression and elimination operations more efficient and improving the image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] When read in conjunction with the accompanying drawings, aspects of the present disclosure are better understood from the following embodiments. It should be noted that, in accordance with standard practice in the industry, various structures are not drawn to scale. In fact, for clarity of discussion, the dimensions of various structures may be arbitrarily increased or reduced.
[0006] Figure 1 FIG. 4 is a schematic diagram of an image processing system in some embodiments of the present invention.
[0007] Figure 2 FIG. 4 is a flowchart of an image processing method in some embodiments of the present invention.
[0008] Figure 3 FIG. 1 is a comparison between the brightness value and gain of a pixel in some embodiments of the present invention.
[0009] Figure 4 FIG. 1 is a schematic diagram of inputting an image frame in some embodiments of the present invention.
[0010] Figure 5 This is a schematic diagram of calculating the lateral score in some embodiments of the present invention.
[0011] Figure 6 Schematic diagram of calculation of longitudinal scores in some embodiments of the present invention.
[0012] Figure 7 Schematic diagram of calculation of oblique scores in some embodiments of the present invention.
[0013] Figure 8 Schematic diagram of calculation of oblique scores in some embodiments of the present invention. DETAILED DESCRIPTION
[0014] Figure 1 Schematic diagram of an image processing system 100 according to some embodiments of the present invention. The image processing system 100 is used to eliminate noise of an input image frame 10 to generate an output image frame 20. In this embodiment, the image processing system 100 may include a noise elimination unit 110, a gain comparison unit 120, and a noise level value calculation unit 130. In some embodiments, the noise elimination unit 110, the gain comparison unit 120, and the noise level value calculation unit 130 may be implemented by circuits having specific corresponding functions, but the present disclosure is not limited thereto. In some other embodiments, the noise elimination unit 110, the gain comparison unit 120, and the noise level value calculation unit 130 may also be implemented by the same or different processors executing corresponding programs.
[0015] Generally speaking, before using the noise elimination unit 110 to perform noise elimination, the image processing system 100 can first determine the noise level in the input image frame 10. When the noise is higher, the noise elimination unit 110 can be made to perform noise reduction processing at a stronger level; conversely, if the noise is lower, the noise elimination unit 110 can be made to perform noise reduction processing at a weaker level. In the present disclosure, the strength of noise elimination is represented by a noise elimination weight W, and a larger noise elimination weight W represents a higher noise elimination strength. For each pixel in the input image frame 10, the image processing system 100 can generate a corresponding noise elimination weight W, and the noise elimination weight W corresponding to each pixel is not necessarily the same. In some embodiments, noise elimination is based on weighted blending of the pixel value of each pixel in the input image frame 10 and the pixel value of the corresponding pixel in the previous image frame adjacent to the input image frame 10, and the weight of the weighted blending is the noise elimination weight W. In this embodiment, when the noise elimination weight W of a pixel in the input image frame 10 is larger, the pixel value of the pixel will account for a smaller proportion in the weighted blending.
[0016] Figure 2A flow chart of an image processing method 200 is shown. In some embodiments, the image processing system 100 may execute the image processing method 200 to eliminate noise in the input image frame 10. The image processing method 200 includes steps S202, S204, and S206. For ease of explanation, the following operations are only explained for a pixel in the input image frame 10, and the pixel is referred to as a "currently processed pixel P". It should be understood that the present invention is not limited to which pixel in the input image frame 10 is processed, and the image processing system 100 may execute the method for all pixels in the input image frame 10, or may execute the method for only some pixels in the input image frame 10.
[0017] For ease of understanding, the image processing method 200 is as follows: Figure 1 and Figures 2 to 8 In step S202 , the image processing system 100 reads n×m pixels in the input image frame 10 , wherein the n×m pixels are arranged in an n×m matrix, and n and m are positive integers greater than 1.
[0018] In step S204, the image processing system 100 calculates the noise elimination weight W of the current processing pixel P among the n×m pixels. In some embodiments, the noise elimination weight W can be determined based on the pixel value change relationship between the pixels in the input image frame 10. The noise elimination weight W includes two variables: a gain G and an adjustment score S. Specifically, the gain comparison unit 120 can be used to obtain the gain G of the current processing pixel P, and the noise level value unit 130 can be used to calculate the adjustment score S of the current processing pixel P. The noise elimination weight W is the product of the gain G and the adjustment score S, and is represented by equation (1).
[0019] W = G × S, equation (1).
[0020] In some embodiments, step S204 includes: according to the pixel value of the current processing pixel P, the gain comparison unit 120 can obtain the gain G and assign it to the current processing pixel P; according to the current processing pixel P and a plurality of surrounding pixels PP (shown in FIG. Figure 4 ) according to the pixel value trend change in at least one direction, the noise level value unit 130 can calculate at least one noise level value of the currently processed pixel P; the noise level value unit 130 can calculate the adjustment score S according to at least one noise level value of the currently processed pixel P; and the image processing system 100 can multiply the gain G by the adjustment score S to obtain the noise elimination weight W of the currently processed pixel P.
[0021] The gain G is related to the size of the pixel value. Figure 3The comparison relationship 300 between the brightness L (luminance) and the gain G of a pixel in some embodiments of the present invention is shown. In some embodiments, the gain comparison unit 120 obtains the gain G required for calculating the noise elimination weight W of the pixel according to the brightness-gain comparison relationship 300. When the brightness L of the pixel is known, the corresponding gain G can be obtained according to the brightness-gain comparison relationship 300. Then, the obtained gain G is assigned to the pixel.
[0022] The higher the pixel value of a pixel, the greater the brightness L of the pixel. In some embodiments, the pixel value and the brightness L are in a fixed proportional relationship. Generally speaking, the input image data includes the image signal itself and noise. Usually, in the brighter part of the picture, the size of the noise is much smaller than the image signal itself, while in the darker part of the picture, the size of the noise and the image signal itself may be similar. In this case, in the brighter part where the image signal itself is much larger than the noise, the image processing system 100 can use stronger noise elimination because the separation between the image signal and the noise is more obvious. In contrast, in the darker part where the size of the image signal itself is similar to the size of the noise, the image processing system 100 can use weaker noise elimination to avoid the image distortion caused by the image signal itself and the noise being eliminated at the same time. In some embodiments, when the brightness L of a pixel is larger, it means that the probability that the data contained in the pixel is the image signal itself is greater, so the gain G assigned to the pixel is lower; and when the brightness L of a pixel is smaller, it means that the probability that the data contained in the pixel is noise is greater, so the gain G assigned to the pixel is higher. In some embodiments, when the brightness L of a pixel is greater than a threshold value Lth, the gain G assigned to the pixel is no longer reduced. It should be understood that the pixel value can be the sum of the R, G, and B values of the pixel. However, the present disclosure is not limited thereto, and various reference values that can represent the luminescence of a pixel can be used as the pixel value.
[0023] The adjustment score S is related to the pixel value change relationship between pixels in the input image frame 10. In some embodiments, the noise level value calculation unit 130 determines the size of the noise by the change of the adjacent pixel values. When the determined noise level is higher, the adjustment score S is higher. Conversely, when the determined noise level is lower, the adjustment score S is lower. Figure 1 As shown, the image processing system 100 uses the noise level value calculation unit 130 to evaluate the noise level value (the degree of noise existence) and calculate the adjustment score S accordingly.
[0024] Figures 4 to 8 FIG. 1 is a schematic diagram of the operation of evaluating the trend change of pixel values and calculating the adjustment score S in some embodiments of the present invention. Figure 4The noise level value calculation unit 130 is used to determine a surrounding area A centered on the current processing pixel P, and calculate at least one noise level value of the current processing pixel P based on the surrounding area A. The surrounding area A includes (2a+1) rows and (2a+1) columns of pixels. Figure 4 In the embodiment of , a is equal to 3, that is, the pixels in the surrounding area A are in a matrix of 7 columns and 7 rows, and the currently processed pixel P is located at the 4th column (i.e., the (a+1)th column) and the 4th row (i.e., the (a+1)th row) in the surrounding area A. In addition to the currently processed pixel P, the other pixels in the surrounding area A are called surrounding pixels PP. It should be understood that Figure 4 The range of the surrounding area A is for illustration only, and surrounding areas A of various different ranges are within the consideration and scope of the present invention.
[0025] The noise level value includes a horizontal score SH, a vertical score SV, a first oblique score S1, a second oblique score S2 or a combination thereof, for example, the noise level value may include only the horizontal score SH, or the noise level value may include the horizontal score SH and the vertical score SV. In some embodiments, the adjustment score S represents the noise level value and is equal to the sum of the horizontal score SH, the vertical score SV, the first oblique score S1 and the second oblique score S2 included therein. For example, if the noise level value includes only one of the horizontal score SH, the vertical score SV, the first oblique score S1 and the second oblique score S2, then the adjustment score S is equal to the horizontal score SH, the vertical score SV, the first oblique score S1 or the second oblique score S2; if the noise level value includes four of the horizontal score SH, the vertical score SV, the first oblique score S1 and the second oblique score S2, then the adjustment score S is equal to the sum of the horizontal score SH, the vertical score SV, the first oblique score S1 and the second oblique score S2. Figures 5 to 8 The calculation of the horizontal score SH, the vertical score SV, the first oblique score S1 and the second oblique score S2 are respectively illustrated.
[0026] After determining the surrounding area A, the noise level value calculation unit 130 reads the pixel values of the surrounding pixels PP and the current processing pixel P, and sequentially calculates the difference between the pixel values of two adjacent pixels in each column of the surrounding area A. For ease of understanding, Figures 5 to 8 The pixel values of a portion of the surrounding area A are indicated and used as examples for illustration, but the present disclosure is not limited to these values.
[0027] In some embodiments, if the trend of pixel value changes in one direction is examined in units of pixels in an image frame, the degree of noise (i.e., the noise level value) can be estimated. Generally speaking, since noise is randomly distributed, when the trend of pixel value changes is uncertain, it can be determined that the trend causing the uncertain trend has a higher probability of being noise. Therefore, in a given direction, if the trend of pixel value changes is uncertain, it usually indicates a higher noise level value. In other words, the size of the noise level value can be determined based on the trend of pixel value changes. Figures 5 to 8 The embodiments are used to respectively illustrate how to determine the size of the noise level value according to the trend change of pixel values in four different directions. In these embodiments, the noise level value calculation unit 130 can compare the differences between adjacent pixel values in the corresponding direction to evaluate the trend change of pixel values in this direction. It should be understood that the present disclosure is not limited to Figures 5 to 8 Four directions shown.
[0028] refer to Figure 5 When calculating the horizontal score SH, the noise level value calculation unit 130 subtracts the pixel values of any two adjacent pixels in each row of 7 (i.e., 2a+1) pixels to obtain 6 (i.e., 2a) horizontal difference values DH. In the entire surrounding area A, these horizontal difference values DH correspond to the surrounding area A in a 7×6 (i.e., (2a+1)×2a) matrix MH.
[0029] After obtaining 7×6 horizontal difference values DH, the positive-negative alternation calculation unit 135 in the noise level value calculation unit 130 performs positive-negative alternation calculation. The positive-negative alternation calculation unit 135 adds up the number of positive-negative alternations of the adjacent horizontal difference values DH in the first row of the matrix MH as a score SH1, and adds up the number of positive-negative alternations of the adjacent horizontal difference values DH in the second row as a score SH2, and so on to obtain scores SH1 to SH7. Taking the first row of the matrix MH as an example, the horizontal difference value DH from the second to the third changes from -8 to 6, and there is a positive-negative alternation. In addition, the horizontal difference value DH from the third to the fourth changes from 6 to -4, and there is a second positive-negative alternation. The positive-negative alternation calculation unit 135 adds up the number of positive-negative alternations in the first row, and obtains a score SH1 equal to 2. Finally, the positive-negative alternation calculation unit 135 adds up the scores SH1 to SH7 to obtain the horizontal score SH. When the horizontal score SH is higher, it means that the trend of the pixel value changes more frequently, and it also means that the noise level value in the horizontal direction is higher.
[0030] refer to Figure 6When calculating the vertical score SV, the noise level value calculation unit 130 subtracts the pixel values of any two adjacent pixels in each column of 7 (i.e. 2a+1) pixels to obtain 6 (i.e. 2a) vertical difference values DV. In the entire surrounding area A, these vertical difference values DV correspond to the surrounding area A in a 6×7 (i.e. 2a×(2a+1)) matrix MV.
[0031] After obtaining 6×7 longitudinal difference values DV, the positive-negative alternation calculation unit 135 sums up the number of positive-negative alternations of the first column of adjacent longitudinal difference values DV in the matrix MV as a score SV1, and sums up the number of positive-negative alternations of the second column of adjacent longitudinal difference values DV as a score SV2, and so on to obtain scores SV1 to SV7. Taking the first column of the matrix MV as an example, the longitudinal difference value DV from the first to the second changes from 33 to -3, and there is a positive-negative alternation. In addition, there are positive-negative alternations from the third to the fourth, the fourth to the fifth, and the fifth to the sixth. The positive-negative alternation calculation unit 135 sums up the number of positive-negative alternations in the first column and obtains a score SV1 equal to 4. Finally, the positive-negative alternation calculation unit 135 sums up the scores SV1 to SV7 to obtain the longitudinal score SV. When the horizontal score SV is higher, it means that the trend of the pixel value changes more frequently, and it also means that the noise level value in the longitudinal direction is higher.
[0032] refer to Figure 7 When calculating the first oblique score S1, the noise level value calculation unit 130 subtracts the pixel values of the two diagonally adjacent pixels of the 1st to 6th pixels in each row from the 2nd to 7th pixels in the next row to obtain six oblique difference values DS. In the entire surrounding area A, these oblique difference values DS correspond to the surrounding area A in a 6×6 (i.e., 2a×2a) matrix MS.
[0033] After obtaining 6×6 oblique difference values DS, the positive-negative alternation calculation unit 135 sums up the number of times the adjacent oblique difference values DS in the first row of the matrix MS alternate between positive and negative as a score S11, and sums up the number of times the adjacent oblique difference values DS in the second row alternate between positive and negative as a score S12, and so on to obtain scores S11 to S16. Taking the first row of the matrix MS as an example, the third to fourth oblique difference values DS change from 13 to -2, and there is a positive-negative alternation. The positive-negative alternation calculation unit 135 sums up the number of positive-negative alternations in the first row, and obtains a score S11 equal to 1. Finally, the positive-negative alternation calculation unit 135 sums up the scores S11 to S16 to obtain the first oblique score S1. When the first oblique score S1 is higher, it means that the trend of the pixel value changes more frequently, and it also means that the noise level value in this direction is higher.
[0034] refer to Figure 8When calculating the second oblique score S2, the noise level value calculation unit 130 subtracts the pixel values of the two diagonally adjacent pixels of the 1st to 6th pixels in each column from the 2nd to 7th pixels in the next column to obtain 6 oblique difference values DS. In this way, a matrix MS formed by 6×6 (i.e., 2a×2a) difference values DS is generated from the surrounding area A. It should be understood that Figure 7 and Figure 8 The calculated matrices MS are substantially the same. However, because the number of positive and negative alternations observed along different directions may be different, even with the same matrix MS, the noise level values in different directions can still be evaluated. More specifically, the first oblique direction and the second oblique direction are based on the same "oblique direction", and the number of positive and negative alternations are summed up in different directions. For example, the first oblique direction refers to the number of positive and negative alternations of each row of the matrix MS in the horizontal direction after the matrix MS is obtained based on an oblique direction, and the second oblique direction refers to the number of positive and negative alternations of each column of the matrix MS in the vertical direction after the matrix MS is obtained based on the same oblique direction.
[0035] After obtaining 6×6 oblique difference values DS, the positive-negative alternation calculation unit 135 sums up the number of times the adjacent oblique difference values DS in the first column of the matrix MS alternate positively and negatively as a score S21, and sums up the number of times the adjacent oblique difference values DS in the second column alternate positively and negatively as a score S22, and so on to obtain scores S21 to S26. Taking the first column of the matrix MS as an example, the first to second and the fifth to sixth oblique difference values DS each alternate positively and negatively once. The positive-negative alternation calculation unit 135 sums up the number of times the first column alternates positively and negatively, and obtains a score S21 equal to 2. Finally, the positive-negative alternation calculation unit 135 sums up the scores S21 to S26 to obtain a second oblique score S2. When the second oblique score S2 is higher, it means that the trend of the pixel value changes more frequently, and it also means that the noise level value in this direction is higher.
[0036] If there are real boundaries, contours, lines, etc. of the scene in the image frame, the pixel values of the corresponding adjacent pixels will have a large difference, which is usually much larger than the difference caused by random distribution of noise. Therefore, in some embodiments, in order to avoid treating the real boundaries, contours and / or lines as noise, when the positive and negative alternating calculation unit 135 is calculating, it can first determine whether the horizontal difference DH, the vertical difference DV and / or the oblique difference DS are greater than a preset threshold value β (shown in FIG. Figure 1), when the lateral difference DH (longitudinal difference DV and / or oblique difference DS) is greater than the preset threshold β and the lateral difference DH (longitudinal difference DV and / or oblique difference DS) causes positive and negative alternation, it means that this positive and negative alternation may be caused by boundaries, contours and / or lines, so this positive and negative alternation will not be counted in the lateral score SV (longitudinal score SV, first oblique score S1 and / or second oblique score S2).
[0037] In step S206, noise removal is performed on the current processing pixel P according to the noise removal weight W obtained from equation (1) to update the pixel value of the current processing pixel P. In some embodiments, the noise removal unit 110 may perform a motion compensated temporal noise reduction operation, and the image processing system 100 generates the output image frame 20 using the updated pixel value of the current processing pixel P.
[0038] The above description briefly presents the features of certain embodiments of the present application, so that those skilled in the art can more fully understand the various aspects of the present application. Those skilled in the art should understand that they can easily use the present application as a basis to design or change other processes and structures to achieve the same purpose and / or achieve the same advantages as the implementation here. Those skilled in the art should understand that these equal implementations still belong to the spirit and scope of the present application, and they can be variously changed, replaced and modified without deviating from the spirit and scope of the present application.
Claims
1. An image processing method, characterized in that: Include: Reading n×m pixels in an input image frame, wherein the n×m pixels are arranged in an n×m matrix, and n and m are positive integers greater than 1; Calculating the noise removal weight of the current processing pixel among the n×m pixels includes: According to the pixel value of the currently processed pixel, a gain is obtained and allocated to the currently processed pixel; Calculating at least one noise level value of the current processing pixel according to the pixel value trend change of the current processing pixel and a plurality of surrounding pixels around the pixel in at least one direction; Calculating an adjustment score according to the at least one noise level value of the currently processed pixel; and multiplying the gain and the adjustment score to obtain the noise removal weight of the current processing pixel; and Noise removal is performed on the current processing pixel according to the noise removal weight to update the pixel value of the current processing pixel.
2. The image processing method as claimed in claim 1, wherein the noise level value is higher when the total number of times the pixel value trend changes from positive to negative and from negative to positive in the at least one direction is higher. 3 . The image processing method as claimed in claim 1 , wherein the gain assigned to the current processing pixel decreases as the brightness corresponding to the pixel value of the current processing pixel increases.
4. The image processing method of claim 1 , wherein the step of calculating the at least one noise level value of the current processing pixel according to the pixel value trend change of the current processing pixel and the surrounding pixels around the pixel in at least one direction comprises: determining a surrounding area of the current processing pixel, wherein the surrounding area includes the current processing pixel located at the center of the surrounding area and the surrounding pixels adjacent to the current processing pixel, wherein the current processing pixel and the surrounding pixels are arranged in (2a+1) rows and (2a+1) columns, each row of the surrounding area includes (2a+1) pixels, and each column of the surrounding area includes (2a+1) pixels, wherein a is a positive integer; and The at least one noise level value of the currently processed pixel is calculated according to the surrounding area.
5. The image processing method as claimed in claim 4, wherein the step of calculating the at least one noise level value of the currently processed pixel according to the surrounding area comprises: For each row of pixels in the (2a+1) rows of pixels in the surrounding area, sequentially calculate the lateral difference between the pixel values of two adjacent pixels; and The number of alternating positive and negative values between the horizontal differences of each row of pixels is summed up as the horizontal score. The at least one noise level value includes the horizontal score.
6. The image processing method as claimed in claim 5, wherein the step of calculating the at least one noise level value of the current processing pixel according to the surrounding area further comprises: For each column of pixels in the (2a+1) columns of pixels in the surrounding area, sequentially calculate the vertical difference between the pixel values of two adjacent pixels; and The number of alternating positive and negative values between the vertical differences of each column of pixels is summed up as the vertical score. The at least one noise level value includes the vertical score. 7 . The image processing method as claimed in claim 5 , wherein when one of the lateral differences is greater than a preset threshold and the lateral difference greater than the preset threshold causes positive and negative alternation, the positive and negative alternation is not counted in the lateral score.
8. The image processing method as claimed in claim 4, wherein the step of calculating the at least one noise level value of the currently processed pixel according to the surrounding area comprises: For the pixels in the first to the 2ath rows and the pixels in the second to the (2a+1)th rows of the surrounding area, respectively, the oblique differences of the pixel values of two diagonally adjacent pixels are calculated in sequence to obtain a total of (2a)×(2a) oblique differences, wherein the (2a)×(2a) oblique differences are arranged in a (2a)×(2a) matrix relative to the surrounding area; and The number of alternating positive and negative values in each row of the (2a)×(2a) diagonal differences is summed up as the first diagonal score. The at least one noise level value includes the first slant score.
9. The image processing method as claimed in claim 8, wherein the step of calculating the at least one noise level value of the current processing pixel according to the surrounding area further comprises: The number of alternating positive and negative values in each column of the (2a)×(2a) diagonal differences is summed up as the second diagonal score. The at least one noise level value includes the second slant score. 10 . The image processing method of claim 8 , wherein when one of the oblique differences is greater than a preset threshold and the oblique difference greater than the preset threshold causes positive and negative alternation, the positive and negative alternation is not counted in the first oblique score.
