CN114742727B - Noise processing method and system based on image smoothing - Google Patents
Noise processing method and system based on image smoothing Download PDFInfo
- Publication number
- CN114742727B CN114742727B CN202210346740.5A CN202210346740A CN114742727B CN 114742727 B CN114742727 B CN 114742727B CN 202210346740 A CN202210346740 A CN 202210346740A CN 114742727 B CN114742727 B CN 114742727B
- Authority
- CN
- China
- Prior art keywords
- image
- gray
- filtering
- pixel point
- variance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003706 image smoothing Methods 0.000 title claims abstract description 24
- 238000003672 processing method Methods 0.000 title claims abstract description 20
- 238000001914 filtration Methods 0.000 claims abstract description 102
- 230000003044 adaptive effect Effects 0.000 claims abstract description 28
- 238000000034 method Methods 0.000 claims abstract description 23
- 238000003708 edge detection Methods 0.000 claims abstract description 12
- 238000012216 screening Methods 0.000 claims abstract description 10
- 230000014759 maintenance of location Effects 0.000 claims description 41
- 238000004590 computer program Methods 0.000 claims description 6
- 238000005192 partition Methods 0.000 abstract description 4
- 238000004364 calculation method Methods 0.000 description 10
- 238000009499 grossing Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 6
- 238000004321 preservation Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 230000009467 reduction Effects 0.000 description 3
- 238000001228 spectrum Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Classifications
-
- G06T5/70—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
Abstract
The invention relates to the technical field of image processing, in particular to a noise processing method and system based on image smoothing. The method comprises the steps of obtaining a noise image, graying the noise image to obtain a gray image, and carrying out edge detection on the gray image to obtain a gray edge image; dividing a gray image into a plurality of areas, obtaining variances of pixel values in each area, filtering areas with the variances larger than or equal to preset area variances to obtain a filtered image, and determining the whole variances of the gray filter image obtained by filtering the gray image in the value range of the preset area variances; and continuously adjusting the preset regional variance to obtain a plurality of filter images, and screening the adaptive filter images from the plurality of filter images. The method achieves the purposes of carrying out partition filtering on the gray level image, selecting proper preset region variance to eliminate noise points in the region and keeping normal points in the normal region.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a noise processing method and system based on image smoothing.
Background
Today society is an information-based age, and the form of information is not simply voice, but rather is developed into a multimedia form including data, text, images, video, and the like. Image processing technology plays an increasingly important role in aspects of human production and life, such as downloading or browsing multimedia information such as images, videos and the like on a network, however, digital images are often affected by interference of imaging equipment and external environment noise and the like in the processes of digitizing and transmitting, and are called noisy images or noise images.
At present, a common method for processing image noise is to perform adaptive filtering on an image, but when the adaptive filtering is performed on the image at present, the value of an adaptive threshold is difficult to accurately judge, the selection of the adaptive threshold is complicated, and when the value of the adaptive threshold is inaccurate, the situation that normal points are removed as noise points or a large number of noise points are not removed is caused, so that the complete normal image is difficult to keep.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a noise processing method and system based on image smoothing, and the adopted technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a noise processing method based on image smoothing, the method including the steps of:
acquiring a noise image, graying the noise image to obtain a gray image, and performing edge detection on the gray image to obtain a gray edge image;
dividing the gray image into a plurality of areas, obtaining the variance of pixel values in each area, filtering the areas with the variance larger than or equal to the preset area variance to obtain a filtered image, wherein the value range of the preset area variance is determined by the integral variance of a gray filter image obtained by filtering the gray image; continuously adjusting the preset region variance to obtain a plurality of filter images, and screening the self-adaptive filter images from the plurality of filter images;
the method for screening the self-adaptive filtering image comprises the following steps:
performing edge detection on each filtering image to obtain a filtering edge image; the ratio of the number of pixels in the filtered edge image to the number of pixels in the gray edge image is used as the pixel retention; obtaining the density degree according to a first distance average value among all pixel points in the filter edge image and a second distance average value among all pixel points in the gray edge image; the degree of density and the degree of pixel point retention are weighted and summed to obtain the degree of normal point retention; calculating the signal-to-noise ratio of the filtered image, and obtaining the self-adaptive denoising degree by weighted summation of the signal-to-noise ratio and the normal point retention degree; and selecting a filtered image corresponding to the maximum adaptive denoising degree as an adaptive filtered image.
Preferably, the filtering the region with the variance greater than the preset region variance to obtain a filtered image includes:
and filtering the area with variance larger than or equal to the preset area variance, wherein the area with variance smaller than the preset area variance is kept unchanged, and a filtered image is obtained.
Preferably, the value range of the preset area variance is as follows:wherein (1)>The variance of the region corresponding to the filter kernel when half of the pixels in the filter kernel are pure black and half of the pixels are pure white.
Preferably, the value range of the preset area variance is determined by the integral variance of a gray level filter map obtained by filtering a gray level image, and the method further includes:
calculating the signal-to-noise ratio of the filtered image after filtering; and scaling the value range of the preset area variance according to the signal-to-noise ratio by using a dichotomy.
Preferably, the scaling the value range of the preset area variance according to the signal-to-noise ratio by using a dichotomy includes:
when the signal-to-noise ratio is greater than or equal to a preset scaling signal-to-noise ratio, selecting the right half part of the value range of the preset region variance as the updated value range of the preset region variance;
and when the signal-to-noise ratio is smaller than the preset scaling signal-to-noise ratio, selecting the left half part of the value range of the preset area variance as the updated value range of the preset area variance.
Preferably, the first distance average value between each pixel point in the filtered edge image is:
selecting any pixel point from the filtering edge image as a first filtering pixel point, acquiring a point closest to the first filtering pixel point as a second filtering pixel point, and calculating the distance between the first filtering pixel point and the second filtering pixel point; acquiring a pixel point closest to the second filtering pixel point as a third filtering pixel point, and calculating the distance between the second filtering pixel point and the third filtering pixel point; acquiring a pixel point closest to the third filtering pixel point as a fourth filtering pixel point, and calculating the distance between the fourth filtering pixel point and the third filtering pixel point until all pixel points in the filtering edge image are traversed;
and calculating a first distance average value of the distances corresponding to the pixel points in the filtering edge image.
Preferably, the second distance average value between each pixel point in the gray edge image is:
selecting any pixel point from the gray edge image as a first gray pixel point, acquiring a point closest to the first gray pixel point as a second gray pixel point, and calculating the distance between the first gray pixel point and the second gray pixel point; acquiring a pixel point closest to the second gray pixel point as a third gray pixel point, and calculating the distance between the second gray pixel point and the third gray pixel point; acquiring a pixel point closest to the third gray pixel point as a fourth gray pixel point, and calculating the distance between the fourth gray pixel point and the third gray pixel point until all pixel points in the gray edge image are traversed;
and calculating a second distance average value of the distances corresponding to the pixel points in the gray edge image.
Preferably, the obtaining the degree of density according to the average value of the distance between the pixels in the filtered edge image and the average value of the distance between the pixels in the gray edge image includes:
and the ratio of the first distance average value between the pixel points in the filter edge image to the second distance average value between the pixel points in the gray edge image is the density degree.
In a second aspect, an embodiment of the present invention provides an image smoothing-based noise processing system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the above-mentioned image smoothing-based noise processing method when executing the computer program.
The embodiment of the invention has at least the following beneficial effects:
according to the embodiment of the invention, a noise image is firstly obtained by utilizing an image processing technology, the noise image is grayed to obtain a gray image, and the gray image is subjected to edge detection to obtain a gray edge image. Dividing a gray level image into a plurality of areas, acquiring variances of pixel values in each area, filtering the areas with variances larger than or equal to preset area variances to obtain a filtered image, wherein the value range of the preset area variances is determined by the integral variances of the gray level filter image obtained by filtering the gray level image, and because gray level jump is generated at noise points of the noisy areas, the gray level span of the local areas of the noise points is larger, and therefore whether the areas need filtering or not can be judged by comparing the variances with the variances of the preset areas. And continuously adjusting the preset regional variance to obtain a plurality of filter images, and screening the adaptive filter images from the plurality of filter images. And obtaining the normal point retention degree and the self-adaptive denoising degree of the filtered image according to the gray level edge image before and after filtering and the number of pixel points in the filtered edge image and the distance between the pixel points, obtaining a proper preset region variance according to the signal-to-noise ratio of the filtered image, and obtaining a proper self-adaptive filtered image. The method achieves the purposes of carrying out partition filtering on the gray level image, selecting proper preset region variance to eliminate noise points in the region and keeping normal points in the normal region.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a noise processing method based on image smoothing according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for screening an adaptive filtered image from a plurality of filtered images according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purposes, the following detailed description refers to specific embodiments, structures, features and effects of a noise processing method and system based on image smoothing according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The embodiment of the invention provides a noise processing method and a system specific implementation method based on image smoothing, and the method is suitable for an image denoising scene. In order to solve the problem that the trend of the self-adaptive threshold is difficult to accurately judge, the embodiment of the invention obtains the normal point retention degree and the self-adaptive denoising degree of the filtered image according to the gray level edge image before and after filtering and the number of pixel points in the filtered edge image and the distance between the pixel points, obtains a proper preset area variance according to the signal to noise ratio of the filtered image, and obtains a proper self-adaptive filtered image. The method achieves the purposes of carrying out partition filtering on the gray level image, selecting proper preset region variance to eliminate noise points in the region and keeping normal points in the normal region.
The following specifically describes a specific scheme of the noise processing method based on image smoothing provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating a noise processing method based on image smoothing according to an embodiment of the invention is shown, the method includes the following steps:
step S100, obtaining a noise image, graying the noise image to obtain a gray image, and performing edge detection on the gray image to obtain a gray edge image.
The noise image is obtained, and the noise image is an RGB image, and it should be noted that the noise image may be a real-time image directly collected by an RGB camera, or may be an RGB image originally stored in an image database. Graying the acquired noise image to obtain a gray image, specifically: the gray level of the noise image is obtained by graying by using a weighted average method, the subsequent processing of the gray level is simple and convenient, and the image is binarized in the subsequent step, so that the image is converted into the gray level, thereby facilitating the subsequent processing.
Since the gaussian filtering may blur the image when removing noise, it can be known from the spectrogram that both the noise and the edge of the image are at the outermost periphery of the spectrogram, and smoothing noise is to shrink the spectrum inwards, so that the edges of the image may be removed together and the image may be blurred, so we use the edge detection method to screen the appropriate threshold.
In the embodiment of the invention, the Sobel operator is used for edge detection, is a discrete differential operator, combines Gaussian smoothing and differential derivation, is used for calculating the approximate gradient of an image gray function, and is affected by less noise.
Step S200, dividing the gray image into a plurality of areas, obtaining variances of pixel values in each area, filtering areas with the variances larger than or equal to preset area variances to obtain a filtered image, and determining the whole variances of the gray filter image obtained by filtering the gray image in the value range of the preset area variances; and continuously adjusting the preset regional variance to obtain a plurality of filter images, and screening the adaptive filter images from the plurality of filter images.
The gray scale image is divided into a plurality of areas, and the size of the areas is set to 51 x 51 in the embodiment of the present invention.
The variance D (i) of pixel values in the i-th region is calculated. And filtering the area with variance larger than or equal to the preset area variance, wherein the area with variance smaller than the preset area variance is kept unchanged, and a filtered image is obtained. Namely, when the variance D (i) of the pixel value corresponding to the ith region is larger than or equal to the variance of the preset region, the region can be regarded as the region with noise points, and the region is filtered to obtain a filtered image; when the variance D (i) of the pixel value corresponding to the ith region is smaller than the variance of the preset region, the region is not filtered. And repeatedly judging each area in the gray level image to obtain a filtered image.
In the embodiment of the invention, the Gaussian smoothing filter is utilized to carry out smoothing filter on the image, and the Gaussian filter is global filter, namely, the whole image is filtered.
The size of the gaussian template is (2k+1 ), and the gaussian template is used to scan the image, and in the embodiment of the present invention, the gray image is divided into a plurality of 51×51 areas, so the size of the gaussian template is also set to (51, 51), that is, the value of k is 25.
The adaptive Gaussian filter adds a threshold value selection based on Gaussian filtering, so that the noise region is expected to be smoothed, and the noise region is not smoothed, so that the influence of blurring can be minimized.
The adaptive threshold is selected by using the variance of the local area, because the noise can cause gray jump at the noise point, so that the gray span of the local area of the noise point is larger, and therefore, the variance and the variance of the preset area can be used for comparing the size of the area to judge whether the area needs filtering or not.
The preset area variance is continuously adjusted, and the embodiment of the invention wants to find the most suitable preset area variance from the preset area variance by adjusting the preset area variance. The initial preset region variance is 0, when the preset region variance is 0, each region of the gray image is smoothed, which is the same as the common Gaussian smoothing filtering, and then the preset region variance is continuously adjusted. The adjusting of the variance of the preset interval has a corresponding value range, the value range is affected by the size of the filter kernel, and when one half of the filter kernel is pure black, that is, one half of the filter kernel has a pixel value of 255, and the other half of the filter kernel is pure white, that is, one half of the filter kernel has a pixel value of 0, the upper value limit of the variance of the preset area is obtained. It should be noted that, since the variance is the maximum and the minimum of half of the data, the upper limit of the variance of the preset region is reached when half of the pixels in the filter kernel are pure black and half of the pixels are pure white. Because the number of the filter kernels is fixed to be an odd number, in the embodiment of the invention, the number of the pure black pixel points and the number of the pure white pixel points in the filter kernels are calculated through the following formulas, wherein the number of the pure black pixel points and the number of the pure white pixel points are one more than the number of the pure white pixel points, and the size of the filter kernels is (2k+1 ).
Quantity q of pure black pixel points 0 The calculation formula of (2) is as follows:
wherein 2k+1 is the side length of the filter kernel. It should be noted that the filter kernel is square.
Number q of pure white pixel points 1 The calculation formula of (2) is as follows:
wherein 2k+1 is the side length of the filter kernel.
According to the quantity q of pure black pixel points 0 And calculating the gray average value in the filter kernel area.
Gray scale mean mu 0 The calculation formula of (2) is as follows:
wherein q 0 The number of the pure black pixel points in the filter kernel; 2k+1 is the side length of the filter kernel.
And calculating the maximum regional variance corresponding to the filter kernel when the inner half of the filter kernel is pure black and the outer half of the filter kernel is pure white.
wherein mu 0 A gray average value in the filter kernel; q 0 The number of the pure black pixel points in the filter kernel; q 1 For filtering pure white in the nucleusThe number of pixels; 2k+1 is the side length of the filter kernel.
The maximum value of the value range of the preset area variance is the maximum area variance, so the value range of the preset area variance is as follows:however, the calculated amount is relatively large when all the values of the preset regional variances in the value range of the preset regional variances are traversed, so that the preset regional variances are traversed in the value range by adopting a dichotomy method in the subsequent embodiment of the invention, and the calculated amount is reduced.
The preset area variance is continuously adjusted, the value range of the preset area variance is also continuously scaled, a plurality of filtering images are obtained, and the self-adaptive filtering images are screened from the plurality of filtering images.
Referring to fig. 2, the step of screening the adaptive filtered image from the plurality of filtered images is as follows:
in step S201, edge detection is performed on each of the filtered images to obtain a filtered edge image.
The step of filtering the gray image by using different preset regional variances is described in detail in the above steps, that is, filtering is performed on the region with the variance greater than or equal to the preset regional variance corresponding to the region in the gray image, filtering is not performed on the region with the variance smaller than the preset regional variance corresponding to the region in the gray image, and the original image is directly reserved, so that the filtered image can be obtained.
And carrying out edge detection on each filtering image to obtain filtering edge images.
In step S202, the ratio of the number of pixels in the filtered edge image to the number of pixels in the gray edge image is used as the pixel retention.
The edge points and the noise points belong to high-frequency parts in the frequency domain, and when filtering is performed, the high-frequency edge information is possibly removed as noise, so that the change degree of the image before and after the smooth filtering or the retention degree of the image can be judged by comparing the number of the edge pixel points before and after the filtering.
And acquiring the first pixel number of the edge pixel points in the filtered edge image and the second pixel number of the edge pixel points in the gray-scale edge image.
The ratio of the number of the first pixel points to the number of the second pixel points is the pixel point retaining degree of the filtered edge image after filtering, and the range of the pixel point retaining degree is [0,1]. The higher the pixel point retention degree is, the better the retention degree of normal points in the edges of the filtered edge image is reflected, and the more normal points are retained.
Step S203, obtaining the density degree according to the first distance average value among the pixel points in the filtered edge image and the second distance average value among the pixel points in the gray edge image.
In both the filtered edge image and the gray-scale edge image before and after filtering, the relation between the edge points in the edge image is very tight, and very few large distances exist between one edge point and the other edge point, because the embodiment of the invention also uses the average distance between the edge pixel points to reflect whether the edge contour in the edge image before and after filtering is reserved.
Selecting any pixel point from the filtered edge image as a first filtered pixel point, acquiring the point closest to the first filtered pixel point as a second filtered pixel point, and calculating the distance between the first filtered pixel point and the second filtered pixel point; acquiring a pixel point closest to the second filtering pixel point as a third filtering pixel point, and calculating the distance between the second filtering pixel point and the third filtering pixel point; and acquiring the pixel closest to the third filtering pixel as a fourth filtering pixel, and calculating the distance between the fourth filtering pixel and the third filtering pixel until all the pixels in the filtering edge image are traversed.
And calculating a first distance average value of the distances corresponding to the pixel points in the filtered edge image.
wherein m is the number of pixel points in the filtered edge image; d, d i,i+1 Is the distance between the i-th filtering pixel point and the i+1-th filtering pixel point.
Selecting any pixel point from the gray edge image as a first gray pixel point, acquiring a point closest to the first gray pixel point as a second gray pixel point, and calculating the distance between the first gray pixel point and the second gray pixel point; acquiring a pixel point closest to the second gray pixel point as a third gray pixel point, and calculating the distance between the second gray pixel point and the third gray pixel point; acquiring the pixel closest to the third gray pixel as a fourth gray pixel, and calculating the distance between the fourth gray pixel and the third gray pixel until all the pixels in the gray edge image are traversed;
and calculating a second distance average value of the distances corresponding to the pixel points in the gray edge image.
wherein n is the number of pixel points in the gray edge image; d, d j,j+1 Is the distance between the j-th gray pixel and the j+1-th gray pixel.
The ratio of the first distance average value between the pixel points in the filter edge image to the second distance average value between the pixel points in the gray edge image is the degree of density, and the value range of the degree of density is [0,1]. The degree of density reflects the overall retention of the edge profile, and the greater the degree of density, the greater the overall retention of the edge profile.
And S204, weighting and summing the density degree and the pixel point retention degree to obtain the normal point retention degree.
It can be known that the degree of intensity obtained in step S203 and the degree of pixel point preservation obtained in step S202 can reflect the image preservation degree or the normal point preservation degree of the filtered edge image to a certain degree, so that the degree of intensity and the degree of pixel point preservation are used for weighted summation to obtain the normal point preservation degree. The higher the degree of density, the higher the corresponding degree of normal point retention, and the degree of density is in direct proportion to the degree of normal point retention. Similarly, the greater the pixel retention, the greater the corresponding normal retention, and the proportional the pixel retention and the normal retention.
The calculation formula of the normal point retention degree sigma is as follows:
wherein, alpha is the pixel point reservation degree; beta is the degree of density; θ is a pixel point retention degree adjustment coefficient;and adjusting the coefficient for the density degree. In the embodiment of the invention, the value of the pixel point retention degree adjustment coefficient is 0.2; the value of the density degree adjusting coefficient is 0.8. The greater the normal point retention degree σ, the higher the retention of normal points in the smoothed image.
The pixel point retention degree adjustment coefficient and the density degree adjustment coefficient in the calculation formula of the normal point retention degree respectively reflect the expected degrees of the pixel point retention degree and the density degree. When the number of edge points is calculated on the gray level edge map before filtering, noise points may be counted into the number of edge points, and the degree of intensity reflects edge contours, and more of the edge contours reflect the shape of edges, so that the embodiment of the invention gives a desired value with higher degree of intensity.
Step S205, calculating the signal-to-noise ratio of the filtered image, and obtaining the self-adaptive denoising degree by weighted summation of the signal-to-noise ratio and the normal point retention degree.
Along with the continuous increase of the value of the preset area variance, the areas with variances larger than the preset area variance gradually decrease until the variances of all the areas are no longer larger than the preset area variance, and the whole image is considered to have no noise at the moment, so that the image is not processed. And for the filtered image after smoothing, the noise reduction effect of the filtered image can be judged by calculating the signal to noise ratio of the filtered image.
The signal-to-noise ratio of the image should be equal to the ratio of the power spectrum of the signal to the noise, but typically the power spectrum is difficult to calculate, the signal-to-noise ratio of the image, i.e. the ratio of the signal to the noise variance, can be estimated in an approximate way.
Firstly, calculating local variances of all pixels in a filtered image, regarding the maximum value of the local variances as signal variances and the minimum value as noise variances, calculating the ratio of the local variances and converting the ratio into decibels (dB).
The calculation formula of the signal-to-noise ratio SNR is:
wherein S is the signal variance; n is the noise variance; the unit of SNR is dB.
And obtaining a signal-to-noise ratio limit according to the relation between the signal-to-noise ratio and the quality of the filtered image. At a signal-to-noise ratio of 50dB, the filtered image has a small amount of noise, but the filtered image quality is good. When the signal-to-noise ratio is greater than 50dB, the noise reduction effect of the filtered image is excellent. When the signal-to-noise ratio in the filtered image is 60dB, the filtered image may be said to be free of noise. Therefore, the range of the signal to noise ratio is [0,60] according to the embodiment of the invention, and the signal to noise ratio is normalized.
The normalized signal to noise ratio epsilon is:
where SNR is the signal-to-noise ratio before normalization. The range of the normalized signal-to-noise ratio epsilon is 0,1, and the normalized signal-to-noise ratio reflects the removal degree of noise points in the filtered image.
The self-adaptive denoising degree of an image after smoothing can be obtained through the normal point retention degree of the normal point and the signal-to-noise ratio of the filtered image, when the self-adaptive denoising degree is larger, the image effect is better, and when the self-adaptive denoising degree is smaller, the image effect is worse.
And carrying out weighted summation on the normalized signal-to-noise ratio and the normal point retention degree to obtain the self-adaptive denoising degree.
The calculation formula of the self-adaptive denoising degree omega is as follows:
ω=a*σ+b*ε
wherein σ is the normal point retention; epsilon is the normalized signal-to-noise ratio; a is a normal point retention degree adjustment coefficient; b is the signal-to-noise ratio adjustment coefficient. In the embodiment of the invention, the values of the normal point retention degree adjustment coefficient and the signal to noise ratio adjustment coefficient are both 0.5.
Step S206, selecting the filtered image corresponding to the maximum adaptive denoising degree as the adaptive filtered image.
Value range of variance of preset areaAll the values of the preset regional variances in the region are traversed, and the calculated amount is relatively large, so that the embodiment of the invention adopts a dichotomy to traverse the preset regional variances in the value range so as to reduce the calculated amount.
The range of values is scaled by a dichotomy. Specific:
firstly, taking the middle value of the value range of the variance of the preset area, and marking the middle value as t 1 :
Wherein, the liquid crystal display device comprises a liquid crystal display device,the variance of the region corresponding to the filter kernel when half of the pixels in the filter kernel are pure black and half of the pixels are pure white.
For the filtered image, the noise removal degree of the filtered image should be preferentially considered, that is, the signal-to-noise ratio SNR >50 should be ensured when the gray image is smoothed by using the preset region variance. Since the SNR is solved using a logarithmic function, the SNR is already very difficult to change when the SNR >50, at which time the adaptive denoising degree ω of the filtered image increases mainly depending on the normal point retention degree σ. Along with the increase of the preset area variance, the better the retention degree of normal points in the filtered image is, the worse the self-adaptive denoising degree of noise points is, so that the value range of the preset area variance is continuously scaled according to the signal-to-noise ratio by using a dichotomy.
When the signal-to-noise ratio is greater than or equal to the preset scaling signal-to-noise ratio, selecting the right half part of the value range of the preset region variance as the updated value range of the preset region variance.
And when the signal-to-noise ratio is smaller than the preset scaling signal-to-noise ratio, selecting the left half part of the value range of the preset region variance as the updated value range of the preset region variance. In the embodiment of the invention, the preset scaling signal to noise ratio is 50.
Boundary value t of value range after the r-th scaling r The method comprises the following steps:
wherein t is r-1 Taking the value for the boundary of the value range after the r-1 st scaling;the maximum regional variance corresponding to the filter kernel when half pixel points in the filter kernel are pure black and half pixel points in the filter kernel are pure white; SNR is the signal-to-noise ratio.
I.e. boundary value t r As the boundary of the noise self-adaptive denoising degree, the value range of the scaled preset region variance is [0, t r ]. For the value range [0, t r ]Take the value t from the boundary r Initially, the variance of the preset area is continuously changed to t r-1 ,t r-2 ,……, and calculating the adaptive denoising degree corresponding to the filtered image obtained when the variance of the preset area is changed to construct an adaptive denoising degree sequence. And until the adaptive denoising degree corresponding to the continuous 10 preset regional variances is continuously reduced, considering that the increase of the signal to noise ratio is not in line with the reduction speed of the adaptive denoising degree, selecting the maximum adaptive denoising degree from the adaptive denoising degree sequence at the moment, and taking a filtered image corresponding to the maximum adaptive denoising degree as an adaptive filtered image.
In summary, in the embodiment of the present invention, a noise image is first obtained by using an image processing technology, a gray image is obtained by graying the noise image, and a gray edge image is obtained by performing edge detection on the gray image. Dividing the gray image into a plurality of areas, obtaining variances of pixel values in each area, filtering areas with the variances larger than or equal to preset area variances to obtain a filtered image, and determining the whole variances of the gray filter image obtained by filtering the gray image in the value range of the preset area variances. And continuously adjusting the preset regional variance to obtain a plurality of filter images, and screening the adaptive filter images from the plurality of filter images. And obtaining the normal point retention degree of the filtered image according to the gray level edge image before and after filtering and the number of pixel points in the filtered edge image and the distance between the pixel points, obtaining a proper preset area variance according to the signal to noise ratio of the filtered image, and obtaining a proper self-adaptive filtered image. The aim of carrying out partition filtering on the gray level image to eliminate noise points in the region and keep normal points in the normal region is achieved.
A noise processing system based on image smoothing, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program. Since a detailed description is given above for a noise processing method based on image smoothing, a detailed description is omitted.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.
Claims (8)
1. A noise processing method based on image smoothing, the method comprising the steps of:
acquiring a noise image, graying the noise image to obtain a gray image, and performing edge detection on the gray image to obtain a gray edge image;
dividing the gray image into a plurality of areas, obtaining the variance of pixel values in each area, filtering the areas with the variance larger than or equal to the preset area variance to obtain a filtered image, wherein the value range of the preset area variance is determined by the integral variance of a gray filter image obtained by filtering the gray image; continuously adjusting the preset region variance to obtain a plurality of filter images, and screening the self-adaptive filter images from the plurality of filter images;
the method for screening the self-adaptive filtering image comprises the following steps:
performing edge detection on each filtering image to obtain a filtering edge image; the ratio of the number of pixels in the filtered edge image to the number of pixels in the gray edge image is used as the pixel retention; obtaining the density degree according to a first distance average value among all pixel points in the filter edge image and a second distance average value among all pixel points in the gray edge image; the degree of density and the degree of pixel point retention are weighted and summed to obtain the degree of normal point retention; calculating the signal-to-noise ratio of the filtered image, and obtaining the self-adaptive denoising degree by weighted summation of the signal-to-noise ratio and the normal point retention degree; selecting a filtering image corresponding to the maximum adaptive denoising degree as an adaptive filtering image;
2. The noise processing method based on image smoothing as claimed in claim 1, wherein the filtering the region with the variance larger than the preset region variance to obtain a filtered image includes:
and filtering the area with variance larger than or equal to the preset area variance, wherein the area with variance smaller than the preset area variance is kept unchanged, and a filtered image is obtained.
3. The noise processing method based on image smoothing as claimed in claim 1, wherein the value range of the preset region variance is determined by the integral variance of a gray level filter map obtained by filtering a gray level image, and further comprising:
calculating the signal-to-noise ratio of the filtered image after filtering; and scaling the value range of the preset area variance according to the signal-to-noise ratio by using a dichotomy.
4. A noise processing method based on image smoothing as defined in claim 3, wherein scaling the range of values of the preset region variance according to the signal-to-noise ratio by using a dichotomy comprises:
when the signal-to-noise ratio is greater than or equal to a preset scaling signal-to-noise ratio, selecting the right half part of the value range of the preset region variance as the updated value range of the preset region variance;
and when the signal-to-noise ratio is smaller than the preset scaling signal-to-noise ratio, selecting the left half part of the value range of the preset area variance as the updated value range of the preset area variance.
5. The noise processing method based on image smoothing as claimed in claim 1, wherein the first distance average value between each pixel point in the filtered edge image is:
selecting any pixel point from the filtering edge image as a first filtering pixel point, acquiring a point closest to the first filtering pixel point as a second filtering pixel point, and calculating the distance between the first filtering pixel point and the second filtering pixel point; acquiring a pixel point closest to the second filtering pixel point as a third filtering pixel point, and calculating the distance between the second filtering pixel point and the third filtering pixel point; acquiring a pixel point closest to the third filtering pixel point as a fourth filtering pixel point, and calculating the distance between the fourth filtering pixel point and the third filtering pixel point until all pixel points in the filtering edge image are traversed;
and calculating a first distance average value of the distances corresponding to the pixel points in the filtering edge image.
6. The noise processing method based on image smoothing as claimed in claim 1, wherein the second distance average value between each pixel point in the gray edge image is:
selecting any pixel point from the gray edge image as a first gray pixel point, acquiring a point closest to the first gray pixel point as a second gray pixel point, and calculating the distance between the first gray pixel point and the second gray pixel point; acquiring a pixel point closest to the second gray pixel point as a third gray pixel point, and calculating the distance between the second gray pixel point and the third gray pixel point; acquiring a pixel point closest to the third gray pixel point as a fourth gray pixel point, and calculating the distance between the fourth gray pixel point and the third gray pixel point until all pixel points in the gray edge image are traversed;
and calculating a second distance average value of the distances corresponding to the pixel points in the gray edge image.
7. The method for processing noise based on image smoothing as claimed in claim 1, wherein said obtaining the degree of density according to the average value of the distances between the pixels in the filtered edge image and the average value of the distances between the pixels in the gray edge image comprises:
and the ratio of the first distance average value between the pixel points in the filter edge image to the second distance average value between the pixel points in the gray edge image is the density degree.
8. A noise processing system based on image smoothing, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of a noise processing method based on image smoothing as claimed in any one of claims 1-7 when the computer program is executed by the processor.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211599503.6A CN115829874A (en) | 2022-03-31 | 2022-03-31 | Noise processing method based on image smoothing |
CN202210346740.5A CN114742727B (en) | 2022-03-31 | 2022-03-31 | Noise processing method and system based on image smoothing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210346740.5A CN114742727B (en) | 2022-03-31 | 2022-03-31 | Noise processing method and system based on image smoothing |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211599503.6A Division CN115829874A (en) | 2022-03-31 | 2022-03-31 | Noise processing method based on image smoothing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114742727A CN114742727A (en) | 2022-07-12 |
CN114742727B true CN114742727B (en) | 2023-05-05 |
Family
ID=82279805
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211599503.6A Pending CN115829874A (en) | 2022-03-31 | 2022-03-31 | Noise processing method based on image smoothing |
CN202210346740.5A Active CN114742727B (en) | 2022-03-31 | 2022-03-31 | Noise processing method and system based on image smoothing |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211599503.6A Pending CN115829874A (en) | 2022-03-31 | 2022-03-31 | Noise processing method based on image smoothing |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN115829874A (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115082507B (en) * | 2022-07-22 | 2022-11-18 | 聊城扬帆田一机械有限公司 | Intelligent regulation and control system of pavement cutting machine |
CN115049835B (en) * | 2022-08-16 | 2022-11-29 | 众烁精密模架(南通)有限公司 | Data preprocessing method based on die-casting die defect identification |
CN115249326B (en) * | 2022-09-21 | 2022-12-20 | 南通长石科技有限公司 | Logistics transfer robot running state detection method based on data processing |
CN115984148B (en) * | 2023-03-21 | 2023-06-16 | 吉林华瑞基因科技有限公司 | Denoising enhancement method for high-throughput gene sequencing data |
CN116309570B (en) * | 2023-05-18 | 2023-08-04 | 山东亮马新材料科技有限公司 | Titanium alloy bar quality detection method and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101339613A (en) * | 2008-08-12 | 2009-01-07 | 中国地质科学院矿产资源研究所 | Remote sensing image background noise reduction method |
CN105913396A (en) * | 2016-04-11 | 2016-08-31 | 湖南源信光电科技有限公司 | Noise estimation-based image edge preservation mixed de-noising method |
CN107993211A (en) * | 2017-12-04 | 2018-05-04 | 中国科学院遥感与数字地球研究所 | A kind of image de-noising method |
CN111242137A (en) * | 2020-01-13 | 2020-06-05 | 江西理工大学 | Salt and pepper noise filtering method and device based on morphological component analysis |
WO2021017809A1 (en) * | 2019-07-29 | 2021-02-04 | 深圳市中兴微电子技术有限公司 | Video denoising method and apparatus, and computer-readable storage medium |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101883280B (en) * | 2009-05-07 | 2014-08-27 | 香港科技大学 | Video encoding/decoding method and system capable of recovering noise |
CN102801928A (en) * | 2012-09-10 | 2012-11-28 | 上海国茂数字技术有限公司 | Image processing method and image processing equipment |
CN104217416B (en) * | 2013-05-31 | 2017-09-15 | 富士通株式会社 | Gray level image processing method and its device |
CN104103041B (en) * | 2013-12-24 | 2017-12-22 | 北京华科创智健康科技股份有限公司 | Ultrasonoscopy mixed noise Adaptive Suppression method |
CN103810702B (en) * | 2014-01-17 | 2016-06-29 | 浙江大学 | A kind of image accumulation signal-noise ratio computation method based on piecemeal Noise Variance Estimation |
WO2015128302A1 (en) * | 2014-02-25 | 2015-09-03 | Thomson Licensing | Method and apparatus for filtering and analyzing a noise in an image |
US9262810B1 (en) * | 2014-09-03 | 2016-02-16 | Mitsubishi Electric Research Laboratories, Inc. | Image denoising using a library of functions |
US9852353B2 (en) * | 2014-11-12 | 2017-12-26 | Adobe Systems Incorporated | Structure aware image denoising and noise variance estimation |
CN104408745A (en) * | 2014-11-18 | 2015-03-11 | 北京航空航天大学 | Real-time smog scene detection method based on video image |
CN108109123B (en) * | 2017-12-21 | 2020-05-15 | 成都微光集电科技有限公司 | Image denoising method |
CN108765312B (en) * | 2018-04-27 | 2021-11-02 | 西安科技大学 | Image denoising method based on variance information |
CN108805891A (en) * | 2018-05-23 | 2018-11-13 | 北京工业大学 | A kind of lane detection and vehicle positioning method based on carinate figure Yu improvement sequence RANSAC |
CN109410134A (en) * | 2018-09-30 | 2019-03-01 | 南京信息工程大学 | A kind of self-adaptive solution method based on image block classification |
TWI698124B (en) * | 2019-06-13 | 2020-07-01 | 瑞昱半導體股份有限公司 | Image adjustment method and associated image processing circuit |
CN111079772B (en) * | 2019-12-18 | 2024-01-26 | 深圳科瑞技术股份有限公司 | Image edge extraction processing method, device and storage medium |
CN112200742A (en) * | 2020-10-10 | 2021-01-08 | 北京享云智汇科技有限公司 | Filtering and denoising method applied to edge detection |
CN113379640B (en) * | 2021-06-25 | 2023-06-27 | 哈尔滨工业大学 | Multi-stage filtering image denoising method integrating edge information |
-
2022
- 2022-03-31 CN CN202211599503.6A patent/CN115829874A/en active Pending
- 2022-03-31 CN CN202210346740.5A patent/CN114742727B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101339613A (en) * | 2008-08-12 | 2009-01-07 | 中国地质科学院矿产资源研究所 | Remote sensing image background noise reduction method |
CN105913396A (en) * | 2016-04-11 | 2016-08-31 | 湖南源信光电科技有限公司 | Noise estimation-based image edge preservation mixed de-noising method |
CN107993211A (en) * | 2017-12-04 | 2018-05-04 | 中国科学院遥感与数字地球研究所 | A kind of image de-noising method |
WO2021017809A1 (en) * | 2019-07-29 | 2021-02-04 | 深圳市中兴微电子技术有限公司 | Video denoising method and apparatus, and computer-readable storage medium |
CN111242137A (en) * | 2020-01-13 | 2020-06-05 | 江西理工大学 | Salt and pepper noise filtering method and device based on morphological component analysis |
Also Published As
Publication number | Publication date |
---|---|
CN114742727A (en) | 2022-07-12 |
CN115829874A (en) | 2023-03-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114742727B (en) | Noise processing method and system based on image smoothing | |
US6754398B1 (en) | Method of and system for image processing and recording medium for carrying out the method | |
KR101108435B1 (en) | False contour correction method and display apparatus to be applied to the same | |
JP4460839B2 (en) | Digital image sharpening device | |
US9245323B2 (en) | Medical diagnostic device and method of improving image quality of medical diagnostic device | |
CN111681174B (en) | Joint filtering method for inhibiting salt-pepper/Gaussian noise mixing target image | |
JPH06245113A (en) | Equipment for improving picture still more by removing noise and other artifact | |
JP2001057677A (en) | Image processing method, system and recording medium | |
US20220076392A1 (en) | Method for x-ray dental image enhancement | |
CN117408890B (en) | Video image transmission quality enhancement method and system | |
CN116664457B (en) | Image processing method for enhancing denoising | |
CN116934755B (en) | Pulmonary tuberculosis CT image enhancement system based on histogram equalization | |
CN112053302A (en) | Denoising method and device for hyperspectral image and storage medium | |
van Zyl Marais et al. | Robust defocus blur identification in the context of blind image quality assessment | |
CN110136085B (en) | Image noise reduction method and device | |
CN108573478B (en) | Median filtering method and device | |
CN116612032A (en) | Sonar image denoising method and device based on self-adaptive wiener filtering and 2D-VMD | |
JP3783116B2 (en) | Radiation image enhancement processing method and apparatus | |
Ghazal et al. | Structure-oriented multidirectional wiener filter for denoising of image and video signals | |
Santhi et al. | Contrast enhancement by modified octagon histogram equalization | |
JPH0991421A (en) | Image processing method and processor | |
CN114331939A (en) | Homomorphic filtering detail enhancement multi-exposure image fusion method and storage medium | |
WO2010016263A1 (en) | Image restoring device and image restoring method | |
Paul et al. | MR image enhancement using an extended neighborhood filter | |
Elmi et al. | Iterative approach for parametric PSF estimation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 226200 group 11, Chengbei Village, Huilong Town, Qidong City, Nantong City, Jiangsu Province Patentee after: Jiangsu Dianboshi Energy Equipment Co.,Ltd. Address before: 226299 group 11, Chengbei Village, Huilong Town, Qidong City, Nantong City, Jiangsu Province Patentee before: Nantong Electric doctor automation equipment Co.,Ltd. |
|
CP03 | Change of name, title or address |