An image hybrid denoising method, device, electronic device and medium
By calculating the noise weight of pixel points in the image and performing corresponding filtering processing, the problem of difficulty in adaptively judging noise types in the prior art is solved, efficient image denoising processing is achieved, and image quality is improved.
Patent Information
- Application Number
- CN202111423340.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-11-26
AI Technical Summary
The prior art is difficult to adaptively judge the noise type of image pixel points and adopt corresponding filtering methods, resulting in high or low denoising intensity, which may lead to image distortion or incomplete denoising.
By selecting a sub-region centered on the pixel point to be processed in the image to be denoised, the salt and pepper noise weights and Gaussian noise weights of the pixel point to be processed, and median filtering and bilateral filtering are performed based on these weights.
It realizes the simultaneous removal of mixed noise in the to-be-processed picture, improves image quality, and avoids the problems of image distortion and incomplete denoising.
Smart Images

Figure CN114037635B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to an image hybrid denoising method, device, electronic device and medium. Background Art
[0002] Noise will inevitably be introduced during the acquisition and transmission of images. Therefore, we need to remove the noise in image processing and try not to damage the quality details of the original image as much as possible. There are many types of image noise, but additive Gaussian noise and salt-and-pepper noise can represent the vast majority of image noise.
[0003] The characteristic of salt-and-pepper noise is that the values of a certain proportion of pixel points in the image are replaced by pixel values close to pure black or pure white, and the values of most pixel points contaminated by salt-and-pepper noise become significantly different from the surrounding pixels. Salt-and-pepper noise is mainly generated during the image transmission process. Additive Gaussian noise is manifested as adding a noise that satisfies a Gaussian distribution with a mean of zero to each pixel point. Gaussian noise is usually removed by the idea of local mean calculation, but this method will significantly make the image smoother, including the contour part of the image, and smear marks will appear.
[0004] In the current relatively simple denoising technologies, median filtering can well remove salt-and-pepper noise, and bilateral filtering can take into account both the pixel value difference and the distance, and can better remove Gaussian noise. However, the existing technologies cannot adaptively judge the main noise type of the pixel points to be processed and adopt the corresponding filtering method. If the main noise type is judged inaccurately, the denoising intensity of this noise type will be too high or too low accordingly. If the denoising intensity is too high, it is possible to misjudge the noise-free points as noise for processing, and the pixel values of the noise-free points themselves are severely distorted, resulting in image distortion. If the denoising intensity is too low, it will lead to incomplete denoising; Repeated filtering of the image to be denoised will cause smear marks to appear in the output image, making the fineness of the output image worse. Therefore, there is an urgent need for an image hybrid denoising method, device, electronic device and medium to improve the above problems. Summary of the Invention
[0005] The purpose of the present invention is to provide an image hybrid denoising method, device, electronic device and medium, and this method is used to judge the noise type of the pixel points of the image to be denoised and perform filtering processing on the image to be denoised by using the corresponding filtering method.
[0006] In a first aspect, the present invention provides an image hybrid denoising method, which includes: selecting a sub-region centered on a pixel point to be processed in the image to be denoised, where the sub-region includes N neighboring pixel points and one pixel point to be processed, N is taken as the square of an odd number minus one, and N is not zero; calculating the difference between the pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; calculating the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences; performing median filtering and bilateral filtering on the pixel point to be processed according to the proportion of the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed; sequentially selecting pixel points to be processed row by row and column by column, and repeating the above steps to perform median filtering and bilateral filtering on all pixel points in the image to be denoised, and outputting the denoised image after filtering.
[0007] The beneficial effects of the image hybrid denoising method of the present invention are as follows: it can automatically calculate the Gaussian noise weight and the salt-and-pepper noise weight of each pixel point in the image to be denoised, which is convenient for judging the main noise types of each pixel point. It can also perform denoising processing of median filtering and bilateral filtering on the image to be denoised in different proportions according to the weights between different noises, realizing the simultaneous removal of mixed noises in the image to be processed, which is beneficial to more efficiently improving the image quality.
[0008] Optionally, according to the result of partial summation after sorting the absolute values of the differences between the pixel value of the pixel to be processed and the pixel values of each neighboring pixel, calculate the salt-and-pepper noise weight and the Gaussian noise weight of the pixel to be processed. According to the salt-and-pepper noise weight and the Gaussian noise weight of the pixel to be processed, perform median filtering and bilateral filtering on the pixel to be processed according to the ratio of the salt-and-pepper noise weight and the Gaussian noise weight, including: calculating the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel to be processed according to the result of partial summation after sorting the absolute values of the differences and the first preset value of the first bilateral filtering parameter; performing median filtering and bilateral filtering on the pixel to be processed according to the ratio of the salt-and-pepper noise weight and the Gaussian noise weight according to the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel to be processed to obtain the intermediate pixel value of the pixel to be processed; calculating the intermediate difference between the intermediate pixel value of the pixel to be processed and the pixel values of each neighboring pixel; calculating the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel to be processed according to the intermediate difference and the second preset value of the first bilateral filtering parameter, wherein the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter; performing median filtering and bilateral filtering on the pixel to be processed according to the ratio between the second salt-and-pepper noise weight and the second Gaussian noise weight according to the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel to be processed. The beneficial effect is that: by adjusting the preset value of the first bilateral filtering parameter to adjust the focus direction of the two denoising processes, wherein the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter, so that the first denoising focuses on median filtering and suppresses bilateral filtering, and the second denoising focuses on bilateral filtering and suppresses median filtering; it realizes removing most of the salt-and-pepper noise in the first denoising and removing most of the Gaussian noise in the second denoising, which is beneficial to reducing the salt-and-pepper noise in the image obtained by the first denoising and reducing the influence of the salt-and-pepper noise on the second denoising.
[0009] Optionally, the intermediate pixel value satisfies the following formula:
[0010]
[0011] w(x, y) = ws(x, y)wr(x, y) 1-J(x,y) wi(y) J(x,y)
[0012] Wherein, Let \(x\) be the intermediate pixel value of the pixel point to be processed, \(y\) be the neighboring pixel points within the sub-region, \(u(y)\) be the pixel value of the neighboring pixel points within the sub-region, \(w(x, y)\) be the comprehensive weight of the pixel point \(x\) to be processed, \(ws(x, y)\) be the spatial distance weight of the bilateral filter, \(wr(x, y)\) be the pixel value difference weight, \(wi(y)\) be the salt-and-pepper noise weight of the neighboring pixel points, and \(J(x, y)\) be the combined salt-and-pepper noise ratio of the pixel point \(x\) to be processed and the neighboring pixel point \(y\).
[0013] It should be noted that in the comprehensive weight \(w(x, y)\) of the pixel point \(x\) to be processed, the sum of the exponents of the salt-and-pepper noise weight \(wi(y)\) of the neighboring pixel points and the pixel value difference weight \(wr(x, y)\) of the bilateral filter is 1. The beneficial effect is that when the denoising intensity of one type of noise increases, the denoising intensity of the other type of noise is automatically suppressed, facilitating the control of the denoising focus direction by adjusting parameters.
[0014] Optionally, the combined salt-and-pepper noise ratio \(J(x, y)\) of the pixel point \(x\) to be processed and the neighboring pixel point \(y\) satisfies the following formula:
[0015]
[0016] where \(dsum(x)\) is the sum of the absolute values of the smallest \(num\) differences when the pixel point \(x\) to be processed is the center point of the sub-region, \(dsum(y)\) represents the sum of the absolute values of the smallest \(num\) differences when \(y\) is the center point of the sub-region; \(num\) is a positive integer greater than 1 and less than or equal to \(N\); \(N\) is the square of an odd number minus 1, and \(N\) is not zero.
[0017] The spatial distance weight \(ws(x, y)\) of the bilateral filter satisfies the following formula:
[0018] The pixel value difference weight \(wr(x, y)\) satisfies the following formula:
[0019] where \(x\) is the coordinate of the pixel point to be processed, \(y\) is the coordinate of the neighboring pixel point within the window, \(u(x)\) is the pixel value of the pixel point to be processed, \(u(y)\) is the pixel value of the neighboring pixel point, \(\sigma_s\) is the first bilateral filter parameter, and \(\sigma_r\) is the second bilateral filter parameter.
[0020] Optionally, the second bilateral filter parameter \(\sigma_r\) satisfies the following formula:
[0021]
[0022] where represents the convolution of the input image \(u\) and the matrix \(L\), \(m\) and \(n\) are the height and width of the image respectively, \(wi(k, j)\) is the salt-and-pepper noise weight of the pixel point \(x\) to be processed, and \((k, j)\) is the coordinate of the pixel point \(x\).
[0023] In a second aspect, the present invention provides an image hybrid denoising device, and the device includes: a selection unit configured to select a sub-region centered on a pixel point to be processed in the image to be denoised, the sub-region including N neighboring pixel points and one pixel point to be processed, where N is a positive integer greater than 0; a calculation unit configured to calculate the difference between the pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; calculate the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences; a filtering unit configured to perform median filtering and bilateral filtering on the pixel point to be processed according to the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed in proportion to the salt-and-pepper noise weight and the Gaussian noise weight; the selection unit is further configured to sequentially select pixel points to be processed row by row and column by column, and the calculation unit is further configured to repeat the above steps, and the filtering unit is further configured to perform median filtering and bilateral filtering on all pixel units in the image to be denoised, and output the denoised image after filtering. The beneficial effects are as follows: It can automatically calculate the Gaussian noise weight and the salt-and-pepper noise weight of each pixel point in the image to be denoised, which is convenient for judging the main noise types of each pixel point, and can also perform denoising processing of median filtering and bilateral filtering in different proportions on the image to be denoised according to the weights between different noises, realizing the simultaneous removal of the mixed noise in the image to be processed, which is beneficial to more efficiently improving the image quality.
[0024] Optionally, the calculation unit is specifically configured to: calculate a first salt-and-pepper noise weight and a first Gaussian noise weight of a pixel point to be processed according to a result of partial summation after sorting the absolute values of the differences and a first preset value of a first bilateral filtering parameter; the filtering unit is specifically configured to: perform median filtering and bilateral filtering on the pixel point to be processed according to the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed in proportion to the salt-and-pepper noise weight and the Gaussian noise weight to obtain an intermediate pixel value of the pixel point to be processed; the calculation unit is further configured to: calculate an intermediate difference between the intermediate pixel value of the pixel point to be processed and the pixel value of each neighborhood pixel point; calculate a second salt-and-pepper noise weight and a second Gaussian noise weight of the pixel point to be processed according to the intermediate difference and a second preset value of the first bilateral filtering parameter, wherein the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter; the filtering unit is further configured to: perform median filtering and bilateral filtering on the pixel point to be processed in proportion to the second salt-and-pepper noise weight and the second Gaussian noise weight. The beneficial effect is that: by adjusting the preset value of the first bilateral filtering parameter to adjust the focus direction of the two denoising processes, where the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter, so that the first denoising focuses on median filtering and suppresses bilateral filtering, and the second denoising focuses on bilateral filtering and suppresses median filtering; most of the salt-and-pepper noise is removed during the first denoising, and most of the Gaussian noise is removed during the second denoising, which is beneficial to reducing the salt-and-pepper noise in the image obtained by the first denoising and reducing the influence of the salt-and-pepper noise on the second denoising.
[0025] Optionally, the intermediate pixel value satisfies the following formula:
[0026]
[0027] w(x, y) = ws(x, y)wr(x, y) 1-J(x,y) wi(y) J(x,y)
[0028] Wherein, is the intermediate pixel value of the pixel point to be processed x, y is the neighborhood pixel point in the sub-region, u(y) is the pixel value of the neighborhood pixel point in the sub-region, w(x, y) is the comprehensive weight of the pixel point to be processed x, ws(x, y) is the spatial distance weight of the bilateral filtering and wr(x, y) is the pixel value difference weight, wi(y) is the salt-and-pepper noise weight of the neighborhood pixel point, and J(x, y) is the joint salt-and-pepper noise ratio of the pixel point to be processed x and the neighborhood pixel point y.
[0029] Optionally, the joint salt-and-pepper noise ratio J(x, y) of the pixel point to be processed x and the neighborhood pixel point y satisfies the following formula:
[0030]
[0031] Among them, dsum(x) is the sum of the absolute values of the smallest num differences when the pixel point x to be processed is the center point of the sub-region, and dsum(y) represents the sum of the absolute values of the smallest num differences when y is the center point of the sub-region; the num is a positive integer greater than 1 and less than or equal to N, and N is taken as the square of an odd number minus one, and N is not zero;
[0032] The spatial distance weight ws(x, y) of bilateral filtering satisfies the following formula:
[0033] The pixel value difference weight wr(x, y) satisfies the following formula:
[0034] Among them, x is the coordinate of the pixel point to be processed, y is the coordinate of the neighborhood pixel point within the window, u(x) is the pixel value of the pixel point to be processed, u(y) is the pixel value of the neighborhood pixel point, σs is the first bilateral filtering parameter, and σr is the second bilateral filtering parameter.
[0035] Optionally, the salt-and-pepper noise weight wi(x) of the pixel point x to be processed can be obtained by substituting the dsum(x) into a smoothing curve based on the Sigmoid function; the salt-and-pepper noise weight wi(x) satisfies the following formula:
[0036]
[0037] Among them, dsum(x) is obtained by sorting the absolute values of the differences between u(x) and u(y) and summing the smallest num absolute values. The num is a positive integer greater than 1 and less than or equal to N. Similarly, wi(y) satisfies the following formula:
[0038]
[0039] The dsum(y) is obtained by sorting the absolute values of the differences between u(y) and u(z) and summing the smallest num absolute values; the num is a positive integer greater than 1 and less than or equal to N, and u(z) is the pixel value of the neighborhood pixel point with y as the coordinate of the pixel point to be processed.
[0040] Optionally, the second bilateral filtering parameter σr satisfies the following formula:
[0041]
[0042] Among them, represents the convolution of the input image u and the matrix L, m and n are the height and width of the image respectively, wi(k, j) is the salt-and-pepper noise weight of the pixel point x to be processed, and (k, j) is the coordinate of the pixel point x.
[0043] In a third aspect, the present invention provides an electronic device, including a memory and a processor. A program is stored on the memory and can run on the processor. When the program is executed by the processor, the electronic device is enabled to implement the method of any possible design in any of the above aspects.
[0044] In a fourth aspect, the present invention provides a readable storage medium. A program is stored in the readable storage medium. When the program is executed by a processor, an electronic device is enabled to execute the method of any possible design in any of the above aspects. Description of the Drawings
[0045] Figure 1 It is a schematic flowchart of an image hybrid denoising method provided by the present invention;
[0046] Figure 2 In (a) is a schematic diagram of a sub-region provided by the present invention;
[0047] Figure 2 In (b) is another schematic diagram of a sub-region provided by the present invention;
[0048] Figure 3 In (a) is a schematic diagram of the movement of a pixel point to be processed provided by the present invention;
[0049] Figure 3 In (b) is another schematic diagram of the movement of a pixel point to be processed provided by the present invention;
[0050] Figure 3 In (c) is yet another schematic diagram of the movement of a pixel point to be processed provided by the present invention;
[0051] Figure 4 In (a) is a schematic diagram of the movement of a sub-region provided by the present invention;
[0052] Figure 4 In (b) is a schematic diagram of the selection of a pixel point to be processed when filtering is completed provided by the present invention;
[0053] Figure 5 In (a) is an image to be processed in an embodiment provided by the present invention;
[0054] Figure 5 In (b) is a processed image in the first loop in an embodiment provided by the present invention;
[0055] Figure 5 In (c) is a processed image in the second loop in an embodiment provided by the present invention;
[0056] Figure 6 Among them, (a) is the diagram to be processed in the prior art;
[0057] Figure 6 Among them, (b) is the processed diagram of the prior art after median filtering and bilateral filtering successively.
[0058] Figure 7 It is a schematic diagram of a device provided by the present invention;
[0059] Figure 8 It is a schematic diagram of an electronic device provided by the present invention;
[0060] Reference numerals in the figure:
[0061] 700, device; 701, selection unit; 702, filtering unit; 703, calculation unit;
[0062] 800, electronic device; 801, memory; 802, processor. Detailed implementation manners
[0063] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein shall have the ordinary meanings understood by those of ordinary skill in the art in the field to which the present invention belongs. The words such as "including" used herein mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects.
[0064] In the description of the embodiments of the present invention, the terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification and appended claims of the present invention, the singular forms "a", "the", "above-mentioned", "this" and "this one" are also intended to include expressions such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present invention, "at least one" and "one or more" mean one or more than two (including two). The term "and / or" is used to describe the association relationship of associated objects and indicates that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0065] References to "one embodiment" or "some embodiments" etc. described in this specification mean that specific features, structures, or characteristics described in connection with that embodiment are included in one or more embodiments of the present invention. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprise", "include", "have" and their variants all mean "include but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise stated. "First" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features.
[0066] In the embodiments of the present invention, words such as "exemplarily" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present invention should not be construed as being more preferred or having more advantages than other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present relevant concepts in a specific manner.
[0067] As Figure 1 shown, Figure 1 is a schematic flow diagram of an image hybrid denoising method provided by the present invention. In view of the problems existing in the prior art, embodiments of the present invention provide an image hybrid denoising method, and the method includes:
[0068] S101. Select a sub-region centered on the pixel point to be processed in the image to be denoised. The sub-region includes N neighboring pixel points and one pixel point to be processed, where N is the square of an odd number minus one and N is not zero;
[0069] It should be noted that the sub-region is a pixel region composed of N + 1 adjacent pixel points. N can be a positive integer less than or equal to the number of pixel points included in the image to be denoised. Exemplarily, as shown in (a) of Figure 2 ; Figure 2 Figure (a) in is a schematic diagram of a sub-region provided by the present invention. When the sub-region takes a 3x3 region, N takes 8, that is, there are 8 neighboring pixel points y; Exemplarily, as shown in (b) of Figure 2 ; Figure 2 Figure (b) in is another schematic diagram of a sub-region provided by the present invention. When the sub-region takes a 5x5 region, N takes 24, that is, there are 24 neighboring pixel points y.
[0070] S102. Calculate the difference between the pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point;
[0071] Specifically, calculate the absolute value of the difference between the pixel value u(x) of the pixel point x to be processed and the pixel value u(y) of each neighboring pixel point y, sort the absolute values, and sum the smallest num absolute values to be denoted as dsum(x); Similarly, for each neighboring pixel point y, there is a neighboring pixel point z of the pixel point y. Calculate the absolute value of the difference between the pixel value u(y) of the pixel point y and the pixel value u(z) of each neighboring pixel point z, sort the absolute values, and sum the smallest num absolute values to be denoted as dsum(y). The u(z) is the pixel value of the neighboring pixel point with y as the coordinate of the pixel point to be processed; num takes a positive integer greater than 1 and less than or equal to N; Exemplarily, when taking a 3x3 sub-region, N takes a value of 8, and num generally takes a value of N / 2, and num takes a value of 4.
[0072] S103. Calculate the salt-and-pepper noise weight and Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences;
[0073] It should be noted that the salt-and-pepper noise weight and the Gaussian noise weight suppress each other. The Gaussian noise weight is strongly correlated with the joint salt-and-pepper noise J(x, y).
[0074] In a possible embodiment, the salt-and-pepper noise weight wi(x) of the pixel point x to be processed can be obtained by substituting the dsum(x) into a smoothing curve based on the Sigmoid function. The salt-and-pepper noise weight wi(x) satisfies the following formula:
[0075]
[0076] Among them, dsum(x) is obtained by sorting the absolute values of the differences between the u(x) and u(y), and summing the smallest num absolute values. The num is a positive integer greater than 1 and less than or equal to N. Similarly, wi(y) satisfies the following formula:
[0077]
[0078] The dsum(y) is obtained by sorting the absolute values of the differences between the u(y) and u(z), and summing the smallest num absolute values. The num is a positive integer greater than 1 and less than or equal to N, and the u(z) is the pixel value of the neighborhood pixel with the coordinate of the pixel point y to be processed.
[0079] In a possible embodiment, the joint salt-and-pepper noise ratio J(x, y) of the pixel point x to be processed and the neighborhood pixel point y satisfies the following formula:
[0080]
[0081] Among them, dsum(x) is the sum of the absolute values of the smallest num differences when the pixel point x to be processed is the center point of the sub-region, and dsum(y) represents the sum of the absolute values of the smallest num differences when y is the center point of the sub-region;
[0082] S104, according to the salt-and-pepper noise weight and Gaussian noise weight of the pixel point to be processed, perform median filtering and bilateral filtering on the pixel point to be processed according to the ratio of the salt-and-pepper noise weight and Gaussian noise weight;
[0083] In a possible embodiment, the bilateral filtering has a spatial distance weight and a pixel value difference weight;
[0084] The spatial distance weight ws(x, y) of the bilateral filtering satisfies the following formula:
[0085] Among them, σs is the first bilateral filtering parameter. It should be noted that the first bilateral filtering parameter σs can be preset artificially. When the coordinate x of the pixel point to be processed and the coordinate y of the neighborhood pixel point in the window are fixed, the first bilateral filtering parameter σs is positively correlated with the spatial distance weight ws(x, y) of the bilateral filtering; the smaller the parameter σs, the smaller the spatial distance weight ws(x, y) of the bilateral filtering, that is, the greater the inhibitory effect on the bilateral filtering. At this time, correspondingly, the greater the effect on the median filtering of the image to be denoised; similarly, the larger the parameter σs, the larger the spatial distance weight ws(x, y) of the bilateral filtering, that is, the smaller the inhibitory effect on the bilateral filtering. At this time, correspondingly, the smaller the effect on the median filtering of the image to be denoised.
[0086] The pixel value difference weight wr(x, y) satisfies the following formula:
[0087] where x is the coordinate of the pixel to be processed, y is the coordinate of the neighboring pixel within the window, u(x) is the pixel value of the pixel to be processed, u(y) is the pixel value of the neighboring pixel, and σr is the second bilateral filtering parameter.
[0088] where the second bilateral filtering parameter σr satisfies the following formula:
[0089]
[0090] where represents the convolution of the input image u and the matrix L, m and n are the height and width of the image respectively, wi(k, j) is the salt-and-pepper noise weight of the pixel point x to be processed, and (k, j) is the coordinate of the pixel point x.
[0091] In a possible embodiment, the intermediate pixel value satisfies the following formula:
[0092]
[0093] w(x, y) = ws(x, y)wr(x, y) 1-J(x,y) wi(y) J(x,y)
[0094] where is the intermediate pixel value of the pixel point x to be processed, y is the neighboring pixel within the sub-region, u(y) is the pixel value of the neighboring pixel within the sub-region, w(x, y) is the comprehensive weight of the pixel point x to be processed, ws(x, y) is the spatial distance weight of the bilateral filtering, wr(x, y) is the pixel value difference weight, wi(y) is the salt-and-pepper noise weight of the neighboring pixel, and J(x, y) is the joint salt-and-pepper noise ratio of the pixel point x to be processed and the neighboring pixel y.
[0095] It should be noted that in the comprehensive weight w(x, y) of the pixel point x to be processed, the sum of the exponents of the salt-and-pepper noise weight wi(y) of the neighboring pixel and the pixel value difference weight wr(x, y) of the bilateral filtering is 1.
[0096] S105. Select the pixels to be processed one by one in a row-by-row and column-by-column manner, and repeat the above steps to perform median filtering and bilateral filtering on all the pixels in the image to be denoised, and output the denoised image after filtering.
[0097] It should be noted that the order of performing median filtering and bilateral filtering on all pixel points in the denoised image can be changed, that is, the order of selecting the pixel points x to be processed can be changed; in one possible embodiment, by way of example, as Figure 3 shown in (a) of Figure 3 (a) in this figure is a schematic diagram of the movement of a pixel point to be processed provided by the present invention, and the pixel point to be processed moves in the order from left to right and from top to bottom; in another possible embodiment, by way of example, as Figure 3 shown in (b) of Figure 3 (b) in this figure is another schematic diagram of the movement of a pixel point to be processed provided by the present invention, and the pixel point to be processed moves along an S-shaped trajectory; in yet another possible embodiment, by way of example, as Figure 3 shown in (c) of Figure 3 (c) in this figure is yet another schematic diagram of the movement of a pixel point to be processed provided by the present invention, and the pixel point to be processed moves along a spiral trajectory.
[0098] As Figure 4 shown in (a) of Figure 4 (a) in this figure is a schematic diagram of the movement of a sub-region provided by the present invention, and the sub-region follows the pixel point x to be processed and moves along a certain trajectory in the image to be denoised. Until the pixel point x to be processed traverses all pixel points in the image to be denoised, as Figure 4 shown in (b) of Figure 4 (b) in this figure is a schematic diagram of the selection of the pixel point to be processed when the filtering is completed provided by the present invention, and the pixel point x to be processed traverses all pixels of the image to be denoised.
[0099] In a possible embodiment, according to the result of partial summation after sorting the absolute values of the differences between the pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point, calculate the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed. According to the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed, perform median filtering and bilateral filtering on the pixel point to be processed according to the ratio of the salt-and-pepper noise weight and the Gaussian noise weight. It includes: calculating the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences and the first preset value of the first bilateral filtering parameter; performing median filtering and bilateral filtering on the pixel point to be processed according to the ratio of the salt-and-pepper noise weight and the Gaussian noise weight according to the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed to obtain the intermediate pixel value of the pixel point to be processed; calculating the intermediate difference between the intermediate pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; calculating the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel point to be processed according to the intermediate difference and the second preset value of the first bilateral filtering parameter. Wherein, the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter. Perform median filtering and bilateral filtering on the pixel point to be processed according to the ratio between the second salt-and-pepper noise weight and the second Gaussian noise weight according to the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel point to be processed.
[0100] To further prove the effect of the method, the present invention also provides two groups of experiments, namely an experimental group and a control group. The experimental group performs denoising processing on the image to be denoised as shown in (a) of Figure 5 with num taking the value of 4 according to the above method. The first value of the first bilateral filtering parameter σs is 0.5, and the image obtained after the first denoising is as shown in (b) of Figure 5 ; the second value of the first bilateral filtering parameter σs is 5, and the output image obtained after the second denoising is as shown in (c) of Figure 5 ;
[0101] The control group performs denoising processing on the image to be denoised as shown in (a) of Figure 6 using the method of first performing bilateral filtering and then median filtering. It should be noted that Figure 6 (a) in Figure 5 is the same image as (a) in Figure 6 , and the output image obtained is as shown in (b) of
[0102] According to the comparison of (c) in Figure 5 and (b) in Figure 6 it can be concluded that: compared with the method of first performing bilateral filtering and then median filtering, the output image obtained by denoising the image to be denoised using the method of the present invention is more transparent, the details are shown more clearly, the light and dark contrast is more significant, and there are no obvious smearing traces.
[0103] Based on the above image hybrid denoising method, an embodiment of the present application also discloses an image hybrid denoising device. Referring to Figure 7 , the device includes:
[0104] A selection unit 703, configured to select a sub-region centered on a pixel point to be processed in the image to be denoised. The sub-region includes N neighboring pixel points and one pixel point to be processed, where N is a positive integer greater than 0;
[0105] A calculation unit 701, configured to calculate the difference between the pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; and calculate the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences;
[0106] A filtering unit 702, configured to perform median filtering and bilateral filtering on the pixel point to be processed according to the salt-and-pepper noise weight and the Gaussian noise weight of the pixel point to be processed in proportion to the salt-and-pepper noise weight and the Gaussian noise weight;
[0107] The selection unit 703 is further configured to sequentially select pixel points to be processed row by row and column by column, and the calculation unit 701 is further configured to repeat the above steps. The filtering unit 702 is further configured to perform median filtering and bilateral filtering on all pixel units in the image to be denoised, and output the denoised image after filtering.
[0108] In a possible embodiment, the calculation unit 701 is specifically configured to: calculate the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences and a first preset value of a first bilateral filtering parameter; the filtering unit 702 is specifically configured to: perform median filtering and bilateral filtering on the pixel point to be processed in proportion to the salt-and-pepper noise weight and the Gaussian noise weight according to the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed; obtain the intermediate pixel value of the pixel point to be processed; the calculation unit is further configured to: calculate the intermediate difference between the intermediate pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; calculate the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel point to be processed according to the intermediate difference and a second preset value of the first bilateral filtering parameter, where the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter; the filtering unit 702 is further configured to: perform median filtering and bilateral filtering on the pixel point to be processed in proportion to the second salt-and-pepper noise weight and the second Gaussian noise weight.
[0109] It should be noted that the first preset value σs1 of the first bilateral filtering parameter is less than the second preset value σs2 of the first bilateral filtering parameter, so that the spatial distance weight ws(x, y) of the bilateral filtering shows differences in the two successive denoising processes; specifically, the spatial distance weight ws(x, y) of the first bilateral filtering is smaller, and the inhibitory effect on the bilateral filtering is greater. At this time, correspondingly, the first denoising has a greater effect on the median filtering of the image to be denoised, and most of the salt-and-pepper noise in the image to be denoised can be removed, and a small part of the Gaussian noise in the image to be denoised is removed incidentally; after the first denoising, the noise in the image mainly appears as Gaussian noise; similarly, the spatial distance weight ws(x, y) of the second bilateral filtering is larger, that is, the inhibitory effect on the bilateral filtering is smaller. At this time, correspondingly, the effect on the median filtering of the image to be denoised is smaller, and most of the Gaussian noise in the processed image can be removed, and a small part of the remaining salt-and-pepper noise in the image to be denoised is removed incidentally; two kinds of noises are removed with emphasis in one denoising process is realized.
[0110] In an alternative embodiment, by way of example, the number of filtering times is two. In another alternative embodiment, by way of example, the number of filtering times is one. In still another alternative embodiment, by way of example, the number of filtering times is greater than two.
[0111] In a possible embodiment, the intermediate pixel value satisfies the following formula:
[0112]
[0113] w(x, y) = ws(x, y)wr(x, y) 1-J(x,y) wi(y) J(x,y)
[0114] Wherein, is the intermediate pixel value of the pixel point x to be processed, y is the neighborhood pixel point in the sub-region, u(y) is the pixel value of the neighborhood pixel point in the sub-region, w(x, y) is the comprehensive weight of the pixel point x to be processed, ws(x, y) is the spatial distance weight of the bilateral filtering, and wr(x, y) is the pixel value difference weight, wi(y) is the salt-and-pepper noise weight of the neighborhood pixel point, and J(x, y) is the joint salt-and-pepper noise ratio of the pixel point x to be processed and the neighborhood pixel point y.
[0115] It should be noted that in the comprehensive weight w(x, y) of the pixel point x to be processed, the sum of the exponents of the salt-and-pepper noise weight wi(y) of the neighborhood pixel point and the pixel value difference weight wr(x, y) of the bilateral filtering is 1.
[0116] In a possible embodiment, the salt-and-pepper noise weight wi(x) of the pixel point x to be processed can be obtained by substituting dsum(x) into a smoothing curve based on the Sigmoid function, and the salt-and-pepper noise weight wi(x) satisfies the following formula:
[0117]
[0118] Wherein, dsum(x) is obtained by taking the absolute value of the difference between u(x) and u(y), sorting them, and summing the smallest num absolute values. The num is a positive integer greater than 1 and less than or equal to N. Similarly, wi(y) satisfies the following formula:
[0119]
[0120] The dsum(y) is obtained by taking the absolute value of the difference between u(y) and u(z), sorting them, and summing the smallest num absolute values; the num is a positive integer greater than 1 and less than or equal to N, and u(z) is the pixel value of the neighborhood pixel with y as the coordinate of the pixel point to be processed.
[0121] In a possible embodiment, the joint salt-and-pepper noise ratio J(x, y) of the pixel point x to be processed and the neighborhood pixel point y satisfies the following formula:
[0122]
[0123] Wherein, dsum(x) is the sum of the absolute values of the smallest num differences when x is the center point of the sub-region, and dsum(y) represents the sum of the absolute values of the smallest num differences when y is the center point of the sub-region; the num is a positive integer greater than 1 and less than or equal to N; N is taken as the square of an odd number minus one, and N is not zero;
[0124] The spatial distance weight ws(x, y) of bilateral filtering satisfies the following formula:
[0125] The pixel value difference weight wr(x, y) satisfies the following formula:
[0126] Wherein, x is the coordinate of the pixel point to be processed, y is the coordinate of the neighborhood pixel point within the window, u(x) is the pixel value of the pixel point to be processed, u(y) is the pixel value of the neighborhood pixel point, σs is the first bilateral filtering parameter, and σr is the second bilateral filtering parameter.
[0127] In a possible embodiment, the second bilateral filtering parameter σr satisfies the following formula:
[0128]
[0129] Among them, represents the convolution of the input image u and the matrix L, m and n are the height and width of the image respectively, wi(k, j) is the salt-and-pepper noise weight of the pixel point x to be processed, and (k, j) is the coordinate of the pixel point x.
[0130] The computing unit 701 can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software in the decoding processor. The filtering unit 702 can be a median filter, a bilateral filter, or a hybrid filter, and can implement the filtering process of the image to be denoised.
[0131] It should be noted that the selection unit 703 can be a data reader and an image sensor. The data reader can read the pixel values in the image from a storage medium, and the image sensor has the ability to convert the optical image on the photosensitive surface into an electrical signal proportional to the optical image by using the photoelectric conversion function of optoelectronic devices. In the implementation process, the image sensor can be a charged coupled device (CCD), a complementary metal-oxide semiconductor (CMOS), or other photosensitive components, and can implement or execute the function of outputting an image to the processor in the embodiments of the present invention. It should be understood that the image sensors of the systems and methods described herein are intended to include, but are not limited to, these and any other suitable types of image sensors.
[0132] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, in each embodiment of the present invention, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0134] If the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing an electronic device (which can be a server, a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0135] The present invention provides an electronic device. Referring to Figure 8 , which is a schematic diagram of an electronic device provided by the present invention, including a memory 802 and a processor 801. A program that can run on the processor 801 is stored on the memory 802. When the program is executed by the processor, the electronic device is enabled to execute the method of any possible design in any of the above aspects.
[0136] The electronic device 800 includes a processor 801 and one or more filters 807. The processor 801 can be a general-purpose processor or a special-purpose processor, etc.
[0137] Optionally, the processor 801 can implement the method shown in the method embodiments.
[0138] Optionally, in addition to implementing the method shown in the method embodiments, the processor 801 can also implement other functions.
[0139] Optionally, in one design, the processor 801 can also include instructions 803, and the instructions 803 can be run on the processor 801 to enable the electronic device 800 to execute the method described in the above method embodiments.
[0140] In another possible design, the electronic device 800 can include one or more memories 802, on which instructions 804 are stored. The instructions 804 can be run on the processor 801 to enable the electronic device 800 to execute the method described in the above method embodiments. Optionally, data can also be stored in the memory.
[0141] Optionally, instructions and / or data may also be stored in the processor. For example, the one or more memories 802 may store the corresponding relationships described in the foregoing embodiments, or relevant parameters involved in the foregoing embodiments, etc. The processor 801 and the memory may be provided separately or integrated together.
[0142] In yet another possible design, the electronic device 800 may further include a communication interface 805 and an antenna 806. The processor 801 may be referred to as a processing unit to control a communication device (a terminal or a base station). The communication interface 805 may be referred to as a transceiver, a transceiver circuit, or a transceiver, etc., and is used to implement the transceiver function of the communication device through the antenna 806.
[0143] It should be understood that the processor 801 in the embodiments of the present invention may be a central processing unit (CPU) or a graphics processing unit (GPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0144] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0145] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above may refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0146] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0147] As described above, the above are only specific implementation manners of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
[0148] In a possible design, the processor 801 and the filter 807 can be provided separately or integrated on the same integrated circuit chip.
[0149] It should be noted that the processor in the embodiments of the present invention can be an image processing chip or an integrated circuit chip, having the ability to process image signals. During implementation, the steps of the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or by instructions in software form. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or by the combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.
[0150] It can be understood that the memory in the embodiments of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
[0151] The present invention provides a readable storage medium, in which a program is stored. When the program is executed by a processor, the electronic device is enabled to execute the method of any possible design in any of the above aspects.
[0152] The embodiments of the present invention further provide a program product, which implements the method described in any of the above method embodiments when executed by an electronic device.
[0153] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a program product. The program product includes one or more instructions. When the instructions are loaded and executed on an electronic device, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The instructions can be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium. For example, the instructions can be transmitted from a website, server, or data center to another website, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The readable storage medium can be any available medium that can be accessed by the electronic device or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a Digital Video Disc (DVD) with high density), or a semiconductor medium (such as a Solid State Disk (SSD)), etc.
[0154] It should be understood that the above device can be a chip. The processor 801 can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor that is implemented by reading software code stored in a memory. The memory can be integrated in the processor or can exist independently outside the processor 801.
[0155] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0156] In summary, the above description is only a preferred embodiment of the technical solution of the present invention and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An image hybrid denoising method, characterized in that, The method includes: Selecting a sub-region centered on the pixel point to be processed in the image to be denoised, the sub-region includes N neighboring pixel points and one pixel point to be processed, N is the square of an odd number minus one, and N is not zero; Calculating the difference between the pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; Calculating the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed according to the result of partial summation after sorting the absolute values of the differences and the first preset value of the first bilateral filtering parameter; according to the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel point to be processed, performing median filtering and bilateral filtering on the pixel point to be processed according to the ratio of the salt-and-pepper noise weight and the Gaussian noise weight, to obtain the intermediate pixel value of the pixel point to be processed; calculating the intermediate difference between the intermediate pixel value of the pixel point to be processed and the pixel values of each neighboring pixel point; Calculating the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel point to be processed according to the intermediate difference and the second preset value of the first bilateral filtering parameter, where the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter; performing median filtering and bilateral filtering on the pixel point to be processed according to the ratio between the second salt-and-pepper noise weight and the second Gaussian noise weight; Selecting the pixel points to be processed row by row and column by column in sequence, and repeating the above steps to perform median filtering and bilateral filtering on all pixel points in the image to be denoised, and outputting the denoised image after filtering.
2. The method according to claim 1, wherein The intermediate pixel value satisfies the following formula: w(x,y) = ws(x,y)wr(x,y) 1-J(x,y) wi(y) J(x,y) Among them, is the intermediate pixel value of the pixel point x to be processed, y is the neighborhood pixel point within the sub-region, u(y) is the pixel value of the neighborhood pixel point within the sub-region, w(x, y) is the comprehensive weight of the pixel point x to be processed, ws(x, y) is the spatial distance weight of the bilateral filter, wr(x, y) is the pixel value difference weight, wi(y) is the salt-and-pepper noise weight of the neighborhood pixel point, and J(x, y) is the combined salt-and-pepper noise ratio of the pixel point x to be processed and the neighborhood pixel point y.
3. The method according to claim 2, wherein The joint salt-and-pepper noise ratio J(x, y) of the pixel point to be processed x and the neighboring pixel point y satisfies the following formula: Where dsum(x) is the sum of the absolute values of the smallest num differences when the pixel point to be processed x is the center point of the sub-region, dsum(y) represents the sum of the absolute values of the smallest num differences when y is the center point of the sub-region; the num is a positive integer greater than 1 and less than or equal to N; N is the square of an odd number minus one, and N is not zero; The spatial distance weight ws(x, y) of bilateral filtering satisfies the following formula: The pixel value difference weight wr(x, y) satisfies the following formula: Where x is the coordinate of the pixel point to be processed, y is the coordinate of the neighboring pixel point within the window, u(x) is the pixel value of the pixel point to be processed, u(y) is the pixel value of the neighboring pixel point, σs is the first bilateral filtering parameter, and σr is the second bilateral filtering parameter.
4. The method according to claim 3, characterized in that, The second bilateral filtering parameter σr satisfies the following formula: Among them, represents the convolution of the input image u and the matrix L, where m and n are the height and width of the image respectively, wi(k,j) is the salt-and-pepper noise weight of the pixel point x to be processed, and (k,j) is the coordinate of the pixel point x.
5. An image hybrid denoising device, characterized in that, The device includes: A selection unit, configured to select a sub-region centered on the pixel point to be processed in the image to be denoised, the sub-region includes N neighboring pixel points and one pixel point to be processed, and N is a positive integer greater than 0; A calculation unit is configured to calculate the difference between the pixel value of the pixel to be processed and the pixel values of each neighboring pixel; calculate the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel to be processed according to the result of partial summation after sorting the absolute values of the differences and the first preset value of the first bilateral filtering parameter; calculate the intermediate difference between the intermediate pixel value of the pixel to be processed and the pixel values of each neighboring pixel; calculate the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel to be processed according to the intermediate difference and the second preset value of the first bilateral filtering parameter, wherein the first preset value of the first bilateral filtering parameter is less than the second preset value of the first bilateral filtering parameter. A filtering unit is configured to perform median filtering and bilateral filtering on the pixel to be processed according to the ratio of the first salt-and-pepper noise weight and the first Gaussian noise weight of the pixel to be processed, to obtain the intermediate pixel value of the pixel to be processed; perform median filtering and bilateral filtering on the pixel to be processed according to the ratio between the second salt-and-pepper noise weight and the second Gaussian noise weight of the pixel to be processed. The selection unit is further configured to sequentially select the pixels to be processed row by row and column by column, and the calculation unit is further configured to repeat the above steps, and the filtering unit is further configured to perform median filtering and bilateral filtering on all pixel units in the image to be denoised, and output the denoised image after filtering.
6. The device according to claim 5, characterized in that The intermediate pixel value satisfies the following formula: w(x,y) = ws(x,y)wr(x,y) 1-J(x,y) wi(y) J(x,y) Among them, is the intermediate pixel value of the pixel point x to be processed, y is the neighborhood pixel point within the sub-region, u(y) is the pixel value of the neighborhood pixel point within the sub-region, w(x, y) is the comprehensive weight of the pixel point x to be processed, ws(x, y) is the spatial distance weight of the bilateral filter, wr(x, y) is the pixel value difference weight, wi(y) is the salt-and-pepper noise weight of the neighborhood pixel point, and J(x, y) is the combined salt-and-pepper noise ratio of the pixel point x to be processed and the neighborhood pixel point y.
7. The device according to claim 6, characterized in that The joint salt-and-pepper noise proportion J(x, y) of the pixel to be processed x and the neighboring pixel y satisfies the following formula: Wherein, dsum(x) is the sum of the absolute values of the smallest num differences when x is the center point of the sub-region of the pixel to be processed, and dsum(y) represents the sum of the absolute values of the smallest num differences when y is the center point of the sub-region; the num is a positive integer greater than 1 and less than or equal to N, and N is the square of an odd number minus one, and N is not zero. The spatial distance weight ws(x, y) of bilateral filtering satisfies the following formula: The pixel value difference weight wr(x, y) satisfies the following formula: Wherein, x is the coordinate of the pixel to be processed, y is the coordinate of the neighboring pixel within the window, u(x) is the pixel value of the pixel to be processed, u(y) is the pixel value of the neighboring pixel, σs is the first bilateral filtering parameter, and σr is the second bilateral filtering parameter.
8. The device according to claim 7, wherein The salt-and-pepper noise weight wi(x) of the pixel to be processed x can be obtained by substituting the dsum(x) into a smooth curve based on the Sigmoid function; the salt-and-pepper noise weight wi(x) satisfies the following formula: Wherein, dsum(x) is obtained by sorting the absolute values of the differences between u(x) and u(y), and taking the sum of the smallest num absolute values; the num is a positive integer greater than 1 and less than or equal to N; similarly, wi(y) satisfies the following formula: The dsum(y) is obtained by sorting the absolute values of the differences between u(y) and u(z), and taking the sum of the smallest num absolute values; the num is a positive integer greater than 1 and less than or equal to N, and u(z) is the pixel value of the neighboring pixel with y as the coordinate of the pixel to be processed.
9. The device according to claim 7, characterized in that, The second bilateral filtering parameter σr satisfies the following formula: Among them, represents the convolution of the input image u and the matrix L, m and n are the height and width of the image respectively, wi(k, j) is the salt-and-pepper noise weight of the pixel point x to be processed, and (k, j) is the coordinate of the pixel point x.
10. An electronic device, characterized in that, It includes a memory and a processor. A program that can run on the processor is stored on the memory. When the program is executed by the processor, the electronic device implements the method described in any one of claims 1 to 4.
11. A readable storage medium, wherein a program is stored in the readable storage medium, characterized in that, When the program is executed by the processor, the method described in claim 1 is implemented.
Citation Information
Patent Citations
Image noise reduction method and storage medium
CN112614078A
Method and apparatus for enhancing detail based on noise elimination, and method and apparatus for calculating noise weight
US20090087121A1
Device and method for depth image dequantization
US20170091917A1