Image adaptive noise reduction method

Through local area analysis and dynamic filter selection, the noise type is distinguished by kurtitude value and information entropy, and the filter intensity is adjusted in combination with the signal-to-noise ratio, the calculation complexity and resource requirements of the existing adaptive noise reduction method are solved, and better image noise reduction effect and visual fidelity are achieved.

CN120387946APending Publication Date: 2025-07-29HEFEI JUNZHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410123067.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The existing adaptive noise reduction method has problems such as high computational complexity, difficult parameter tuning, and large resource requirements in different application scenarios, making it difficult to effectively adapt to different noise characteristics and image characteristics, resulting in poor image processing effects.

Method used

Through local area analysis, the kurtitude value and information entropy are used to distinguish Gaussian noise from impulse noise, and the intensity of Gaussian bilateral filtering and median filtering is adjusted in combination with the signal-to-noise ratio, and the appropriate filter is dynamically selected for adaptive noise reduction.

Benefits of technology

It improves the robustness and effect of image noise reduction, can better preserve image details and edge information, adapt to different noise types and intensity, and provide a more natural visual effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387946A_ABST
    Figure CN120387946A_ABST
Patent Text Reader

Abstract

The invention provides an image adaptive noise reduction method, which comprises the following steps: S1, inputting an image with the resolution of M * N, and selecting a square sliding window region with n pixel points as side lengths from a pixel point P (1, 1) by taking a noise reduction point P (i, j) as a center; s2, calculating a kurtosis value K in a sliding window area; s3, setting a kurtosis threshold value Kthreshold, and if the kurtosis threshold value Kthreshold is greater than the threshold value Kthreshold, S6; otherwise, S4; s4, calculating an information entropy H in a sliding window area; s5, setting an information entropy threshold value Hthreshold, if the information entropy threshold value Hthreshold is greater than the set threshold value, executing the step S7, otherwise, executing the step S6; s6, selecting a median filter for filtering; further S8; s7, calculating a signal-to-noise ratio SNR in a local area of the sliding window, and adjusting the noise reduction intensity of Gaussian bilateral filtering according to the signal-to-noise ratio; and S8, repeating the steps for each pixel until each pixel of the image is traversed. According to the method, targeted noise reduction processing is performed according to noise characteristics of different areas, image characteristics are adapted, information such as image textures, details and edges is protected, and the image noise reduction effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and particularly relates to an image adaptive noise reduction method. Background Art

[0002] In real life, Gaussian noise and salt-and-pepper noise are the most common, and image information acquisition is often interfered by these two types of noise. In order to be able to cope with different noise characteristics, a large number of researchers have proposed their respective adaptive noise reduction methods. Adaptive noise reduction methods can be applied to various image processing and computer vision projects, including but not limited to the following fields:

[0003] Medical image processing: In medical images, such as X-ray, MRI, CT and other image data, various noises often exist. Adaptive noise reduction methods can help improve the image quality and enable doctors to make more accurate diagnoses and analyses.

[0004] Photography and image enhancement: In the field of photography, adaptive noise reduction methods can improve the photo quality, especially for images taken under low-light conditions, which helps to retain image details and textures and enhance the visual effect of the photos.

[0005] Computer vision tasks: For computer vision applications, such as object detection, face recognition, image segmentation, etc., adaptive noise reduction can improve the extraction and recognition of image features by the algorithm and improve the accuracy and stability of the tasks.

[0006] Monitoring and security systems: In the images captured by surveillance cameras, due to light changes and other environmental factors, a large amount of noise may exist. Adaptive noise reduction methods can improve the quality of surveillance images and enhance the accuracy of target recognition.

[0007] Driverless and autonomous driving: In the field of driverless, the images captured by in-vehicle cameras may be affected by different weather and lighting conditions. Adaptive noise reduction helps to improve the image quality and enhance the vehicle's perception and recognition capabilities.

[0008] Remote sensors and remote sensing image processing: In remote sensor and satellite remote sensing image processing, adaptive noise reduction methods can improve the recognition and monitoring capabilities of ground objects and improve the image interpretation results.

[0009] Generally speaking, the application of adaptive noise reduction methods can improve the performance of image processing and computer vision projects, making them more robust and reliable in various complex scenarios. The existing technologies related to image adaptive noise reduction cover multiple directions, including traditional filter-based methods, wavelet transform, deep learning, etc. The following are some existing technologies related to image adaptive noise reduction.

[0010] Wavelet transform denoising: Wavelet transform is a method of decomposing a signal or image into frequency bands of different scales. Wavelet transform denoising removes noise by performing threshold processing on these frequency bands. It can adapt to noises of different scales while retaining the details of the image.

[0011] Non-local means filtering: Non-local means filtering reduces noise by comparing the similarities of different regions in the image. It uses the non-local means in the image to replace the value of each pixel. It is applicable to different types of noises and can maintain the details of the image while denoising.

[0012] Bilateral filtering: Bilateral filtering combines the spatial distance and the gray similarity between pixels and has a good effect on retaining the edge details of the image. It can smooth the image while maintaining the edge information and has a certain inhibitory effect on noise.

[0013] Denoising methods based on variational models: Variational models are based on minimizing the combination of data terms and regularization terms, and achieve image denoising through optimization problems. Total variation denoising, full variation denoising, etc. are common variational model methods. While smoothing the image, they retain the edge and texture information of the image.

[0014] Deep learning methods: Deep learning methods have achieved remarkable results in the field of image denoising. Using structures such as convolutional neural networks (CNNs), deep learning methods can learn the complex noise patterns in the image and achieve more accurate denoising. They have good generality and can adapt to different scenarios and noise distributions.

[0015] These techniques are often applied to specific scenarios, and different techniques may have different performance in different scenarios. Although the above-mentioned adaptive denoising techniques have made remarkable progress in the field of image processing, they also have some disadvantages and limitations, which specifically depend on the application scenario and the characteristics of the problem. The following are the respective disadvantages of the existing technologies:

[0016] Disadvantages of wavelet transform denoising: Over-smoothing, wavelet transform may cause the image to be over-smoothed, especially for images containing fine structures and textures, and it is easy to lose detail information. Difficult parameter selection, for wavelet transform denoising, selecting an appropriate threshold is usually a challenge because it may be affected by the image content and noise characteristics.

[0017] Disadvantages of non-local means filtering: High computational complexity, the computational complexity of non-local means filtering is relatively high, especially for large images and high-resolution images, which may require a large amount of computing resources. Limited edge preservation, in some cases, non-local means filtering may over-smooth the image and retain limited fine edge structures.

[0018] Disadvantages of bilateral filtering: High computational cost. Bilateral filtering has a relatively high computational cost when dealing with large-sized images and is not suitable for applications with strict real-time requirements. Difficulty in parameter tuning. For bilateral filtering, parameter tuning may require some experience or repeated attempts, and it is not easy to directly determine the appropriate parameters.

[0019] Disadvantages of denoising methods based on variational models: High computational complexity. Some denoising methods based on variational models may involve complex optimization problems and have relatively high computational complexity, making them unsuitable for real-time processing or mobile devices. Sensitive to hyperparameters. The selection of hyperparameters in some methods has a significant impact on the performance of the algorithm, and careful adjustment is required for different images and noise situations.

[0020] Disadvantages of deep learning methods: High data requirements. Deep learning methods usually require large-scale labeled training datasets, and it may be difficult to obtain sufficient data in some specific fields or tasks. High computational resource requirements. Training deep learning models and performing inference require a large amount of computational resources, which may become a limiting factor for some applications with limited device resources.

[0021] It should be noted that these disadvantages do not mean that these methods are applicable in all cases, but they are feasible methods in some specific situations. Therefore, when choosing a denoising method, it is necessary to consider comprehensively according to the specific application scenario, image characteristics, and performance requirements. Summary of the Invention

[0022] In order to adaptively perform image denoising according to specific application scenarios, image characteristics, and performance requirements, the present application proposes an adaptive denoising method that can adapt different denoising algorithms and adjust the denoising strength according to the regional characteristics in the image. For example, the proportion of different noise types in different regions of an image varies. If the proportion of Gaussian noise is relatively large, the Gaussian bilateral filtering method needs to be used; conversely, if the proportion of salt-and-pepper noise is relatively large, the median filtering method needs to be used to adapt to different noise types. At the same time, it is also necessary to adaptively adjust the denoising intensity according to the noise intensity in different regions. The key to adaptive denoising lies in the dynamic analysis and parameter adjustment of local regions of the image. First, by dynamically analyzing the local kurtosis value of the image, the denoising algorithm can better adapt to the noise characteristics of different image regions, thereby improving the robustness of the denoising algorithm. Second, information entropy and signal-to-noise ratio are introduced during the denoising process. These statistical information respectively reflect the noise magnitude and texture and other characteristics of the image to a certain extent. Dynamically adjusting the filter type and denoising degree according to these statistical characteristics can better protect image texture details, edges, and other information. Finally, by integrating the respective advantages of median filtering and Gaussian bilateral filtering, it can better adapt to the characteristics of the image and improve the denoising effect of the image.

[0023] ​

[0024] S1: Input an image of size M×N. Set a square sliding window area with side length of n pixel points centered on the noise reduction point P(i, j). The noise reduction points are processed one by one starting from P(1, 1).

[0025] S2: Calculate the kurtosis value K of the sliding window area. The kurtosis value can distinguish Gaussian noise from impulse noise, so as to select different filters according to the noise type.

[0026] S3: Set the kurtosis threshold K threshold , and compare the calculated kurtosis value with the kurtosis threshold. If it is greater than the set threshold K threshold it indicates that the proportion of impulse noise is large, and then go to step S6; otherwise, go to step S4.

[0027] S4: Calculate the information entropy H of the sliding window area. The entropy value is used to reflect the uniformity of the gray scale distribution in the image. The higher the entropy value of the image, the more uneven the gray scale distribution of the image and the more complex the texture of the image.

[0028] S5: Set the information entropy threshold H threshold , compare the calculated kurtosis value with the kurtosis threshold. If it is greater than the set threshold H threshold it indicates that there are more textures in the image, and then go to step S7. If it is less than or equal to the set threshold, the texture of the local area is relatively simple, and then go to step S6.

[0029] S6: Select a median filter with good denoising effect on impulse noise for filtering; further execute step S8.

[0030] S7: Calculate the signal-to-noise ratio SNR of the local area. The signal-to-noise ratio is an index used to measure the relationship between the signal and the noise intensity. Its SNR calculation formula is:

[0031]

[0032] where P(i, j) is the gray value of the pixel point, is the average gray value calculated for the sliding window area; then, adjust the denoising intensity of the Gaussian bilateral filter according to the signal-to-noise ratio. The Gaussian bilateral filter takes into account the spatial distance between pixels and the gray value difference between pixels during the filtering process. This way of considering the gray value difference enables the bilateral filter to better retain the edge information of the image; S8: Move the sliding window n×n with a step size of 1, and repeat the above steps for each pixel until all pixels in the image are traversed.

[0033] In the said step S1, before image denoising, it is necessary to determine the size of the sliding window area, and n is usually an odd number. The window size determines the neighborhood size considered for denoising at each pixel position. The denoising process is carried out pixel by pixel starting from pixel point P(1,1).

[0034] In the said step S2, calculate the kurtosis value K of the window area. The calculation formula of kurtosis can be expressed as:

[0035]

[0036] From the kurtosis calculation formula, it can be seen that the numerator of kurtosis is the fourth power of the sample mean, and the denominator is the square of the mean square value. This will inevitably lead to the numerator increasing faster than the denominator, and the K value will increase as P(i,j) increases, indicating that the larger the impulse noise, the larger the K value. In fact, the kurtosis coefficient is a measure of the steepness of the probability density function of the vibration amplitude, so the kurtosis value can reflect the size of the impulse characteristic noise. As Figure 1 shown in the relationship between the kurtosis value and the normal distribution: Assume that when K = 3, the image pixel values are approximately normally distributed, that is, zero kurtosis; assume that when K > 3, the peak height of the pixel distribution curve is higher than that of the normal normal distribution curve, that is, the standard deviation is smaller than that in the normal state, reflecting that the dispersion degree of the image pixels is smaller; assume that when K < 3, the peak height of the pixel distribution curve is lower than that of the normal normal distribution curve, that is, the standard deviation is larger than that in the normal state, reflecting that the dispersion degree of the image pixels is larger.

[0037] In the said step S3, it is necessary to determine the kurtosis threshold K threshold to distinguish Gaussian noise from salt-and-pepper noise, so as to adaptively adapt different denoising methods according to different noise types; according to the above relationship between kurtosis and normal distribution, the kurtosis threshold can be set to K threshold = 3.

[0038] In the said step S4, calculate the information entropy H of the window area. The calculation formula is as follows:

[0039]

[0040] where p(x i ) is the probability of the x i th gray level; L is the number of gray levels. If the bit depth of the pixel value is 8bit, then L = 2 8 ; when using information entropy to evaluate image texture, the denoising intensity can be adjusted according to the following two aspects:

[0041] (1) High entropy value: A high entropy value is usually related to the complex texture, noise or areas with rich details in the image. If the image contains many small structures, textures or noises, the information entropy value is high. At this time, the denoising intensity of the Gaussian bilateral filter should be increased;

[0042] (2) Low entropy value: A low entropy value indicates that the gray level distribution in the image is relatively uniform, and the image is relatively smooth or uniform. For some uniform backgrounds or low-contrast images, at this time, the noise reduction intensity of the Gaussian bilateral filter should be reduced or median filtering should be directly performed.

[0043] The process of calculating the information entropy described in step S4 further includes:

[0044] S4.1: Image grayscale conversion. If the image is not a grayscale image, it needs to be converted to a grayscale image, which can be achieved by merging the RGB channels of the color image into a single grayscale channel;

[0045] S4.2: Grayscale histogram calculation. Calculate the histogram of the grayscale image and count the number of pixels at each grayscale level in the image;

[0046] S4.3: Probability calculation. Calculate the probability of each grayscale level in the image accounting for the total number of pixels;

[0047] S4.4: Information entropy calculation. Calculate the information entropy using the probability values.

[0048] In step S5, it is necessary to determine the information entropy threshold H threshold , to distinguish high-entropy signals from low-entropy signals, so as to adaptively match noise reduction methods with different noise reduction intensities according to the noise intensity; according to the meaning of the above low entropy value, it can be known that if the H value is too low, it is considered that the Gaussian noise interference is small and can be ignored, and median filtering can be directly performed. This kurtosis threshold is set to H threshold = log2(2 8 ) / 4 = 2.

[0049] In step S7, the calculation method of the comprehensive weight of each pixel point in the sliding window neighborhood of the noise reduction point is as follows:

[0050] (1) Spatial weight: First, calculate a spatial weight according to the spatial distance between pixels; use the Gaussian function as the calculation method of the spatial weight to ensure that the pixels closer to the center have a greater weight;

[0051] (2) Gray weight: Calculate the gray value difference between pixels and use a gray weight to measure the difference; this weight function also uses the Gaussian function to ensure that the pixels with smaller differences have a greater weight;

[0052] (3) Comprehensive weight: Multiply the spatial weight and the gray weight to obtain the final comprehensive weight;

[0053] (4) Filtering operation: Use the calculated combined weight to perform weighted averaging on the pixels in the neighborhood to obtain the filtered pixel value;

[0054] In Gaussian bilateral filtering, Gaussian functions are usually used to calculate the spatial weight and the gray-level weight. Specifically, given the pixel value P(i,j) at the center position (i,j) of the window, the spatial weight w s and the gray-level weight w r are calculated as follows:

[0055]

[0056] where d is the spatial distance between pixels, and the calculation formula is:

[0057]

[0058] σ s is the spatial standard deviation. This weight measures the spatial relationship between pixels. The closer the distance, the greater the weight. r is the difference in gray-level values between pixels, and the calculation formula is:

[0059]

[0060] σ r is the gray-level standard deviation. This weight measures the gray-level difference between pixels. The smaller the difference, the greater the weight.

[0061] Combined, the weight calculation formula of the bilateral filter is as follows:

[0062]

[0063] where C represents the pixel area within the sliding window (n×n), and W(i,j) represents the comprehensive weight of the pixel point (i,j) within the sliding window centered on P(i,j). It can be seen from the formula that the degree of noise reduction can be adjusted by adjusting the value of σ s . The larger the value of σ s , the greater the weight assigned to the noise reduction reference area, which is reflected as an increase in the noise reduction intensity. Then, calculate the signal-to-noise ratio SNR within the window area and use it to dynamically adjust the noise reduction intensity. The expression is as follows:

[0064]

[0065] where; is a hyperparameter that can be adjusted according to the image effect. In this application, this is set to σ r is also a hyperparameter. This value can adjust the edge preservation degree. The smaller the value of σ s , the better the edge preservation effect of the Gaussian bilateral filter. In this application, this is set to σ r = 1.

[0066] The median filtering replaces the original pixel value of the noise reduction point with the median value of the pixels within the sliding window neighborhood, thereby reducing the influence of noise in the local area of the image. The implementation steps are as follows: (1) Select the filtering window size: Determine the window size of the median filtering, usually an odd number n; the window size determines the neighborhood size considered when calculating the median at each pixel position;

[0067] (2) Apply median filtering to each pixel: Traverse each pixel of the image. For each pixel, sort the pixel values within its surrounding window and select the middle value after sorting as the new pixel value.

[0068] In the method described above, for each pixel, when using median filtering, the pixel values within its surrounding window are sorted, and the middle value after sorting is selected as the new pixel value; when using Gaussian bilateral filtering, the pixel values within the window are weighted and averaged according to the comprehensive weight to obtain the new pixel value; the traversal process of its filtering sliding window is to traverse in the order of first from left to right and then from top to bottom, which also conforms to the law of rolling shutter exposure.

[0069] In the method described above, when denoising the pixel points at the image boundary, the sliding window will exceed the image boundary. At this time, the weights of the parts of the sliding window that exceed the image boundary are set to zero.

[0070] Therefore, the advantages of this application are as follows: The image adaptive denoising method of this application has some advantages compared with the global denoising method, which are mainly reflected in the following aspects:

[0071] Better local performance: The image adaptive denoising method can better adapt to the noise levels in different regions of the image because they automatically adjust parameters within each local area, making the noise estimation and processing more accurate.

[0072] Better detail retention: Adaptive denoising methods can usually better distinguish the details and noise of the image. Therefore, while denoising, the useful information and structure of the image are better retained.

[0073] Strong adaptability: Such methods have good adaptability to different types of noise and different noise intensities. When facing variable environments and noises generated by different devices, they can adjust parameters more flexibly to achieve better results.

[0074] More natural visual effect: Since the adaptive denoising method can better retain the details of the image, the processed image usually has a more natural and realistic visual effect without being overly smoothed or distorted.

[0075] Do not rely on prior knowledge: Different from some global noise reduction methods that require prior knowledge of the statistical characteristics of noise, the adaptive noise reduction method is more general and can perform noise reduction without prior knowledge.

[0076] Suitable for complex scenarios: Adaptive noise reduction methods perform better when dealing with complex scenarios and coexisting multiple noises. They can dynamically adjust parameters to adapt to the noise conditions in different regions.

[0077] Generally speaking, although choosing the appropriate adaptive noise reduction method still requires trade-offs and adjustments according to specific situations, the image adaptive noise reduction method of this application can better meet the requirements for image quality in different application scenarios through the advantages of locality and flexibility, especially in the face of complex noise distributions and changes. Description of the Drawings

[0078] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention.

[0079] Figure 1 It is a schematic diagram of the relationship between kurtosis and normal distribution.

[0080] Figure 2 It is a schematic diagram of Gaussian bilateral filtering.

[0081] Figure 3 It is a schematic diagram of median filtering.

[0082] Figure 4 It is a schematic diagram of the process of this method.

[0083] Figure 5 It is the traversal rule of the sliding window of this application. Detailed Implementation Modes

[0084] In order to more clearly understand the technical content and advantages of the present invention, the present invention will be further described in detail below with reference to the drawings.

[0085] During the image acquisition process, it is mainly affected by Gaussian noise and impulse noise, and different noise reduction methods are required for these two types of noises. Therefore, it is necessary to introduce a metric to distinguish these two types of noises, so as to adaptively apply different noise reduction methods according to this metric. Then, the kurtosis value based on signal statistics can meet the property of distinguishing Gaussian noise and impulse noise to a certain extent. At the same time, in order to measure the magnitude of the noise and thus achieve the purpose of adaptively adjusting the noise reduction intensity, the information entropy index is introduced. The following describes these two metrics:

[0086] 1. Kurtosis value: Kurtosis is one of the statistical measures used to describe the shape of a probability distribution. It measures the peakedness or kurtosis of a probability distribution. The formula for kurtosis can be expressed as:

[0087]

[0088] From the formula for kurtosis, it can be seen that the numerator of kurtosis is the fourth power of the sample mean, and the denominator is the square of the mean square value. This will necessarily result in the numerator increasing faster than the denominator, and the K value will increase as it gets larger, indicating that the larger the impulsive noise, the larger the K value. In fact, the kurtosis coefficient is a measure of the steepness of the probability density function of the vibration amplitude. Therefore, the kurtosis value can reflect the magnitude of the impulsive characteristic noise.

[0089] Figure 1 The relationship between the kurtosis value and the normal distribution is shown: when K = 3, the image pixel values are approximately normally distributed, that is, zero kurtosis; when K > 3, the height of the peak of the pixel distribution curve is higher than that of the normal normal distribution curve, that is, the standard deviation is smaller than the standard deviation in the normal state, reflecting that the dispersion degree of the image pixels is smaller; when K < 3, the height of the peak of the pixel distribution curve is lower than that of the normal normal distribution curve, that is, the standard deviation is larger than the standard deviation in the normal state, reflecting that the dispersion degree of the image pixels is larger.

[0090] 2. Information entropy: Information entropy is a measure of the uncertainty or information chaos of data. Its calculation formula is as follows:

[0091]

[0092] where L is the number of gray levels, and p(x i ) is the probability of the x i th gray level.

[0093] In image processing, information entropy can be used to represent the uniformity of the gray distribution in an image. Specifically, the higher the entropy value of the image, the more uneven the gray distribution of the image and the more complex the texture of the image. When using information entropy to evaluate image texture, the following aspects can generally be considered: (1) High entropy value: A high entropy value is usually related to complex textures, noise, or regions with rich details in the image. If the image contains many small structures, textures, or noise, the information entropy value may be high. In this case, the noise reduction intensity of the Gaussian bilateral filter should be increased;

[0094] (2) Low entropy value: A low entropy value indicates that the gray distribution in the image is relatively uniform, and the image is relatively smooth or uniform. For some uniform backgrounds or low-contrast images, the noise reduction intensity of the Gaussian bilateral filter should be reduced or median filtering should be performed directly.

[0095] Calculating the information entropy of an image helps to understand the gray-scale distribution and brightness changes of the image. Information entropy can be used to measure the complexity and uncertainty of an image, providing some important statistical information about the image content. The process of calculating the information entropy of an image generally involves the following steps:

[0096] Step 1: Image grayscale conversion. If the image is not a grayscale image, it needs to be converted to a grayscale image. This can be achieved by merging the RGB channels of a color image into a single grayscale channel;

[0097] Step 2: Grayscale histogram calculation. Calculate the histogram of the grayscale image to count the number of pixels at each grayscale level in the image;

[0098] Step 3: Probability calculation. Calculate the probability of each grayscale level in the image accounting for the total number of pixels;

[0099] Step 4: Information entropy calculation. Calculate the information entropy using the probability values.

[0100] 3. Gaussian bilateral filtering: Different from traditional Gaussian filters, bilateral filters consider the spatial distance between pixels and the gray-value differences between pixels during the filtering process. This way of considering gray-scale differences enables bilateral filters to better preserve the edge information of the image. The calculation method of the comprehensive weight of each pixel point within the sliding window area of the noise reduction point is as follows:

[0101] (1) Spatial weight: First, calculate a spatial weight based on the spatial distance between pixels. Usually, the Gaussian function is used as the calculation method for the spatial weight to ensure that pixels closer to the center have a greater weight.

[0102] (2) Gray-scale weight: Calculate the gray-value difference between pixels and use a gray-scale weight to measure the difference. This weight function usually also adopts the Gaussian function to ensure that pixels with smaller differences have a greater weight.

[0103] (3) Comprehensive weight: Multiply the spatial weight and the gray-scale weight to obtain the final comprehensive weight.

[0104] (4) Filtering operation: Use the calculated combined weight to perform weighted averaging on the pixels within the neighborhood to obtain the filtered pixel value.

[0105] Figure 2 shows the process of Gaussian bilateral filtering. In Gaussian bilateral filtering, the calculation of spatial weight and gray-scale weight usually adopts the Gaussian function. Specifically, given the pixel value P(i,j) at the center position (i,j) of the window, the spatial weight w s and the gray-scale weight w r are calculated as follows:

[0106]

[0107] where d is the spatial distance between pixels, and the calculation formula is:

[0108]

[0109] σ s is the spatial standard deviation. This weight measures the spatial relationship between pixels. The closer the distance, the greater the weight. r is the difference in gray values between pixels, and the calculation formula is:

[0110]

[0111] σ r is the standard deviation of gray level. This weight measures the gray level difference between pixels. The smaller the difference, the greater the weight.

[0112] Combined, the weight calculation formula of the bilateral filter is as follows:

[0113]

[0114] where C represents the pixel area within the sliding window (n×n), and W(i,j) represents the comprehensive weight of the pixel point (i,j) within the sliding window centered on P(i,j). It can be seen from the formula that the noise reduction degree can be adjusted by adjusting the value of σ s The larger the value of σ s , the greater the weight of the noise reduction reference area, which is reflected as an increase in the noise reduction intensity. Then, calculate the signal-to-noise ratio SNR within the window area and use it to dynamically adjust the noise reduction intensity. The expression is as follows:

[0115]

[0116] where; is a hyperparameter that can be adjusted according to the image effect. In this application, this is set to σ r is also a hyperparameter. This value can adjust the edge preservation degree. The smaller the value of σ s , the better the edge preservation effect of the Gaussian bilateral filter. In this application, this is set to σ r = 1.

[0117] 4. Median filtering: The basic idea of median filtering is to replace the original pixel value with the median of the pixel values, so as to reduce the influence of noise in the local area of the image. Figure 3 shows the implementation process of median filtering. The specific steps are as follows:

[0118] (1) Select the filter window size: Determine the window size of the median filter, which is usually an odd number, such as 5×5, etc. The window size determines the neighborhood size considered when calculating the median at each pixel position.

[0119] (2) Apply median filtering to each pixel: Traverse each pixel of the image. For each pixel, sort the pixel values within its surrounding window and select the median value after sorting as the new pixel value.

[0120] The advantages of median filtering have a good denoising effect on salt-and-pepper noise type of noise. At the same time, compared with some linear filtering methods, it can better preserve the edge information in the image. However, the disadvantage of median filtering is that it may blur fine textures and details while processing the noise in the image.

[0121] In summary, the implementation details of the adaptive noise reduction of this application are as follows:

[0122] 1. Local area analysis: Divide the image into local areas and perform noise reduction within each local area. This can be achieved by moving a sliding window. The size of each area can be adjusted according to the characteristics of the image and the requirements of the application.

[0123] 2. Noise estimation: Estimate the noise level within each local area, including characteristics such as noise type, noise magnitude, and image texture. Use metrics such as kurtosis, information entropy, and signal-to-noise ratio to quantify these characteristics to understand the image features in the local area.

[0124] 3. Filter selection: Dynamically select an appropriate filter according to the noise type of the local area.

[0125] 4. Noise reduction intensity adjustment: Adjust the noise reduction intensity according to the noise estimation results. For areas with more details, the noise reduction strength can be reduced to retain more detail information; for areas with more noise, the noise reduction strength can be increased to better reduce the noise.

[0126] 5. Dynamically update parameters: During the process of processing the image, it is necessary to dynamically update the noise reduction parameters of each local area. It can be selected to recalculate the parameters every time a new area is processed, or to continuously adjust the parameters during the processing.

[0127] Figure 4 Shows the implementation process of the adaptive noise reduction method of this application. It is necessary to determine the size of the sliding window before image noise reduction. The window size determines the size of the neighborhood considered for noise reduction at each pixel position. This application takes a window size of 5×5 as an example. As Figure 4 shown, the execution steps of the adaptive noise reduction method are as follows:

[0128] S1: Input an image of size M×N. With the noise reduction point P(i, j) as the center, set a square sliding window area with n pixel points as the side length; thereafter, the reference point of the noise reduction point is carried out within the square sliding window area, and noise reduction processing is carried out one by one starting from P(1, 1);

[0129] S2: Calculate the kurtosis value K of the sliding window area. The kurtosis value can distinguish Gaussian noise from impulse noise, so as to select different filters according to the noise type;

[0130] S3: Set the kurtosis threshold K threshold = 3, and compare the calculated kurtosis value with the kurtosis threshold. If it is greater than the set threshold K threshold it indicates that the proportion of impulse noise is large, then go to step S6; otherwise, go to step S4;

[0131] S4: Calculate the information entropy H of the sliding window area. The entropy value is used to reflect the uniformity of the gray level distribution in the image. The higher the entropy value of the image, the more uneven the gray level distribution of the image, and the more complex the texture of the image;

[0132] S5: Set the information entropy threshold H threshold = 2, compare the calculated kurtosis value with the kurtosis threshold. If it is greater than the set threshold H threshold it indicates that there are more textures in the image, then go to step S7; if it is less than or equal to the set threshold, the texture of the local area is relatively simple, then go to step S6; S6: Select a median filter with better denoising effect for impulse noise to perform filtering, and further execute step S8;

[0133] S7: Calculate the signal-to-noise ratio SNR of the local area. The signal-to-noise ratio is an index used to measure the relationship between the signal and the noise intensity. Its approximate calculation formula for SNR is:

[0134]

[0135] where P(i,j) is the gray value of the pixel point, is to calculate the gray mean value of the sliding window area; then adjust the denoising intensity of the Gaussian bilateral filter according to the signal-to-noise ratio. The Gaussian bilateral filter takes into account the spatial distance between pixels and the gray value difference between pixels during the filtering process. This way of considering the gray difference enables the bilateral filter to better retain the edge information of the image;

[0136] S8: Move the sliding window n×n with a step size of 1, and repeat the above steps for each pixel until all pixels in the image are traversed.

[0137] For each pixel, when selecting the median filter, the pixel values within its surrounding window are sorted, and the middle value after sorting is selected as the new pixel value. If the Gaussian bilateral filter is selected, the pixel values within the window are weighted and averaged according to the comprehensive weight to obtain the new pixel value. Figure 5 It shows the traversal rule of the sliding filter window from left to right first and then from top to bottom, which also conforms to the law of rolling shutter exposure.

[0138] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. An image adaptive noise reduction method, characterized in that, The method includes the following steps: S1: Input an image of size M×N. With the noise reduction point P(i,j) as the center, set a square sliding window area with a side length of n pixel points. Thereafter, the reference point of the noise reduction point is carried out within the square sliding window area, and noise reduction processing is carried out one by one starting from P(1,1); S2: Calculate the kurtosis value K of the sliding window area. The kurtosis value can distinguish Gaussian noise from impulse noise, so as to select different filters according to the noise type; S3: Set the kurtosis threshold K threshold , and compare the calculated kurtosis value with the kurtosis threshold. If it is greater than the set threshold K threshold , it indicates that the proportion of impulse noise is large, and then step S6 is performed; otherwise, step S4 is performed. S4: Calculate the information entropy H of the sliding window area. The entropy value is used to reflect the uniformity of the gray level distribution in the image. The higher the entropy value of the image, the more uneven the gray level distribution of the image and the more complex the texture of the image; S5: Set the information entropy threshold H threshold , compare the calculated kurtosis value with the kurtosis threshold. If it is greater than the set threshold H threshold it indicates that there are more textures in the image, then proceed to step S7. If it is less than or equal to the set threshold, the texture of the local area is relatively simple, then proceed to step S6; S6: Select a median filter with a good noise reduction effect on impulse noise for filtering, and further execute step S8; S7: Calculate the signal-to-noise ratio SNR of the local area. The signal-to-noise ratio is an index used to measure the relationship between the signal strength and the noise strength. Its approximate calculation formula for SNR is: where P(i,j) is the gray value of the pixel point, and P is the gray mean value calculated for the sliding window area; Then adjust the noise reduction intensity of the Gaussian bilateral filter according to the signal-to-noise ratio. The Gaussian bilateral filter takes into account the spatial distance between pixels and the gray value difference between pixels during the filtering process. This way of considering the gray difference enables the bilateral filter to better retain the edge information of the image; S8: Move the sliding window n×n with a step size of 1, and repeat the above steps for each pixel until each pixel of the image is traversed.

2. The image adaptive noise reduction method according to claim 1, wherein In the step S1, before image noise reduction, it is necessary to determine the size of the sliding window area. Usually, n is an odd number. The window size determines the neighborhood size for noise reduction at each pixel position, and noise reduction processing is carried out for each pixel point starting from the pixel point P(1,1).

3. The image adaptive noise reduction method according to claim 1, characterized in that, In the step S2, calculate the kurtosis value K of the window area. The calculation formula for kurtosis can be expressed as: It can be seen from the kurtosis calculation formula that the numerator of kurtosis is the fourth power of the sample mean, and the denominator is the square of the mean square value. This will inevitably lead to the numerator increasing faster than the denominator, and the K value will increase as P(i,j) increases, which can reflect that the larger the impulse noise, the larger the K value. In fact, the kurtosis coefficient is a measure of the steepness of the probability density function of the vibration amplitude, so the kurtosis value can reflect the size of the impulse characteristic noise. The relationship between the kurtosis value and the normal distribution: Assume that when K = 3, the image pixel values are approximately normally distributed, that is, zero kurtosis; Assume that when K>3, the peak height of the pixel distribution curve is higher than the normal normal distribution curve, that is, the standard deviation is smaller than the standard deviation in the normal state, reflecting that the dispersion degree of the image pixels is smaller; Assume that when K<3, the peak height of the pixel distribution curve is lower than the normal normal distribution curve, that is, the standard deviation is larger than the standard deviation in the normal state, reflecting that the dispersion degree of the image pixels is larger.

4. A method for image adaptive noise reduction according to claim 1, characterized in that In the said step S3, it is necessary to determine the kurtosis threshold K threshold to distinguish Gaussian noise from salt-and-pepper noise, so as to adaptively match different noise reduction methods according to different noise types. According to the relationship between kurtosis and normal distribution, the kurtosis threshold can be set to K threshold = 3.

5. A method for image adaptive noise reduction according to claim 1, characterized in that Calculate the information entropy H of the window area in the step S4. The calculation formula is as follows: Among them, p(x i ) is the probability of the x i -th gray level; L is the number of gray levels. If the bit depth of the pixel value is 8 bit, then L = 2 8 ; When using information entropy to evaluate image texture, the noise reduction intensity can be adjusted according to the following two aspects: (1) High entropy value: A high entropy value is usually related to the complex texture, noise or areas with rich details in the image. If the image contains many small structures, textures or noises, the information entropy value is high. At this time, the noise reduction intensity of the Gaussian bilateral filter should be increased; (2) Low entropy value: A low entropy value indicates that the gray-scale distribution in the image is relatively uniform, and the image is relatively smooth or homogeneous. For some uniform backgrounds or low-contrast images, at this time, the noise reduction intensity of the Gaussian bilateral filter should be reduced or median filtering should be directly performed.

6. An image adaptive noise reduction method according to claim 5, characterized in that, The process of calculating the information entropy of the image described in step S4 further includes: S4.1: Image grayscale conversion. If the image is not a grayscale image, it needs to be converted to a grayscale image, which can be achieved by merging the RGB channels of the color image into a single grayscale channel; S4.2: Grayscale histogram calculation. Calculate the histogram of the grayscale image and count the number of pixels at each grayscale level in the image; S4.3: Probability calculation. Calculate the probability of each grayscale level in the image accounting for the total number of pixels; S4.4: Information entropy calculation. Calculate the information entropy using the probability values.

7. An image adaptive noise reduction method according to claim 1, characterized in that, In the step S5, it is necessary to determine the information entropy threshold H threshold , to distinguish high-entropy signals from low-entropy signals, so as to adaptively match noise reduction methods with different noise reduction intensities according to the noise intensity; according to the meaning of low entropy value, if the value of H is too low, it is considered that the Gaussian noise interference is negligible and median filtering can be directly performed. This kurtosis threshold is set to H threshold = log2(2 8 ) / 4 = 2。 8. An image adaptive noise reduction method according to claim 1, characterized in that In step S7, the calculation method of the comprehensive weight of each pixel point within the sliding window neighborhood of the noise reduction point is as follows: (1) Spatial weight: First, calculate a spatial weight based on the spatial distance between pixels; Use the Gaussian function as the calculation method of the spatial weight to ensure that the pixels closer to the center have a greater weight; (2) Grayscale weight: Calculate the difference in grayscale values between pixels and use a grayscale weight to measure the difference; this weight function also uses the Gaussian function to ensure that the pixels with smaller differences have a greater weight; (3) Comprehensive weight: Multiply the spatial weight and the grayscale weight to obtain the final comprehensive weight; (4) Filtering operation: Use the calculated combined weight to perform weighted averaging on the pixels within the neighborhood to obtain the filtered pixel value; In Gaussian bilateral filtering, Gaussian functions are usually used to calculate spatial weights and gray-level weights; specifically, given the pixel value P(i,j) at the center position (i,j) of the window, the calculation formulas for the spatial weight w s and the gray-level weight w r are as follows: where d is the spatial distance between pixels, and the calculation formula is: σ s is the spatial standard deviation, and this weight measures the spatial relationship between pixels. The closer the distance, the greater the weight; r is the gray value difference between pixels, and the calculation formula is: σ r is the standard deviation of grayscale; this weight measures the grayscale difference between pixels, and the smaller the difference, the larger the weight; Overall, the weight calculation formula of the bilateral filter is as follows: where C represents the pixel region within the sliding window (n×n), and W(i,j) represents the comprehensive weight of the pixel point (i,j) within the sliding window centered on P(i,j); As can be seen from the formula, the noise reduction level can be adjusted by adjusting the value of σ s . The larger the value of σ s , the greater the weight assigned to the pixels in the area involved in noise reduction, which is then reflected as an increase in the noise reduction intensity. Then, calculate the signal-to-noise ratio SNR within the window area and use it to dynamically adjust the noise reduction intensity. The expression is as follows: Among them; is a hyperparameter that can be adjusted according to the image effect, and this can be set to σ r is also a hyperparameter. This value can adjust the edge-preserving degree. The smaller the value of σ s is, the better the edge-preserving effect of the Gaussian bilateral filter. This can be set to σ r = 1.

9. A method for image adaptive noise reduction according to claim 1, characterized in that The median filtering replaces the original pixel value of the noise reduction point with the median value of the pixels within the sliding window neighborhood, thereby reducing the influence of noise in the local area of the image. The implementation steps are as follows: (1) Select the filter window size: Determine the window size of the median filtering, usually an odd number n; the window size determines the neighborhood size considered when calculating the median at each pixel position; (2) Apply median filtering to each pixel: Traverse each pixel of the image. For each pixel, sort the pixel values within its surrounding window and select the middle value after sorting as the new pixel value.

10. An image adaptive noise reduction method according to claim 1, characterized in that, In the method, for each pixel, when median filtering is selected, the pixel values within its surrounding window are sorted, and the middle value after sorting is selected as the new pixel value; when Gaussian bilateral filtering is selected, the pixel values within the window are weighted averaged according to the comprehensive weight to obtain the new pixel value; The traversal process of its filtering sliding window is to traverse in the order from left to right and then from top to bottom, which also conforms to the law of rolling shutter exposure; in the method, when denoising the pixel points at the image boundary, the sliding window will exceed the image boundary. At this time, the weights of the parts of the sliding window that exceed the image boundary are set to zero.