当前位置:网站首页>[image denoising] image denoising based on MATLAB Gaussian + mean + median + bilateral filtering [including Matlab source code 1872]

[image denoising] image denoising based on MATLAB Gaussian + mean + median + bilateral filtering [including Matlab source code 1872]

2022-06-13 10:00:00 Poseidon light

One 、 gaussian + mean value + The median + Introduction of bilateral filtering image denoising

1 A brief introduction of digital image denoising technology
1.1 Research background and purpose

Image is the first perspective for human beings to understand the world , We can get more real information and intuitive results through images . But actually , In the process of generation and transmission, the signal will inevitably mix with some noise . therefore , When receiving an image signal , Eliminating or reducing noise has become an important method to obtain high-definition images . Before denoising the image , We need to model noisy images , Get the original information of noise . Because noise generation is inevitable , therefore , You can only choose to eliminate by corresponding methods , This is also the research significance of image noise elimination .

With the rapid development of computer application technology , The information that human contact is no longer a simple voice signal . More image signals , The more digital information , There will be more interference and noise . With the development of society , People's requirements for image quality of receiving external information sources are increasing , This also puts forward higher requirements for noise removal technology . With the deepening of people's research , A lot about image processing technology is improving , Image denoising technology is becoming more and more perfect .

Nowadays, image denoising has been a relatively visual research topic , Its scope is very wide , It is of great help to the military and medical fields . therefore , Further research on image denoising from the computer level has important practical significance .

1.2 Research status of digital image denoising technology
In reality, image signals inevitably have noise signals . therefore , The only way to eliminate noise is to filter the noise signal . According to the nature of image and noise , Scientists have proposed a variety of methods to remove noise . With the development of modern science and Technology , These methods are gradually applied to practice , There are commonly used adaptive median filtering methods based on the concept of fuzzy index 、 Average filtering method based on fuzzy weighting method, etc . Although these two methods are widely used , But there are also some disadvantages . for example , When multiple noises interfere with the image signal at the same time , The results of the above two methods are not ideal , Because it smoothes the details of the image while removing the noise , The details of the image become blurred , The quality of the image also declines .

Image and vision , It is the most direct means and method for human beings to obtain information , Although other human organs have the ability to receive information , however , In general , Vision always comes first . It is often intuitive for people to understand the world with the help of vision , We need to deal with the events we see . During the event processing , It mainly includes the basic stored procedure of image 、 The smoothing and noise filtering process of the original image , In this way, the image information we get can be more intuitive and efficient . because , The existence of image noise , It mainly affects the image recognition .

The process of image processing is a collection of integrated disciplines , Including signaling 、 mathematics 、 Computer science 、 Statistics and other disciplines , The comprehensive treatment of subjects is the process of algorithm complexity . We are in a complicated situation , They often summarize the corresponding laws of the noise studied . therefore , Analyze from a numerical point of view , Image noise generally includes Gaussian noise 、 White noise 、 Poisson noise and other noises with strong regularity , For some noise that does not conform to the law of change , It can be smoothed by filtering , Common filtering methods include median filtering 、 Gaussian filtering and so on . According to different noise types and image types , Before image analysis , The noise needs to be analyzed , And for different analysis requirements, different methods are used for noise reduction .

The noise signal distribution of Gaussian noise is mainly Gaussian distribution , This type of noise is a common system noise . For images , It is mainly the noise interference caused by the image medium propagation in the process of image formation , Such noise can be defined as a relatively strong quantization noise , It is the inevitable noise interference in the process of image formation .

The noise processing is completed in the frequency domain [11]. Fourier transform is commonly used to transform images from space to transform domain 、 Wavelet transform, etc . For noise treatment , Image information can be converted into numbers , In the process of signal processing , We need to convert the image digital signal into the frequency domain , Gaussian noise can be stripped out in the frequency domain , And through the corresponding filter , Deal with the noise , Then the processed signal is transformed by inverse transformation , Applied to the image domain , You get the output image .

2 Gaussian filtering algorithm and its implementation
On the whole , Gaussian filter is a kind of linear smoothing filter , It is very effective in dealing with systematic Gaussian noise , It mainly deals with the weighted average of the digital signal corresponding to the image . such as , The position result of any noise , Use the weighted average of the surrounding areas , The noise points can disappear in the surrounding weighted average results , In the process of concrete implementation , It mainly uses the weighted average function to weight the results , after , Overwrite the special value with the average value .

Noise removal process , In fact, it is the implementation process of the filter . Gaussian filter is to filter Gaussian noise , So we can get an image with good signal-to-noise ratio , The higher the SNR is , The more distortion free the result is . For an image , If the noise persists , It may cause poor noise transmission . The process of Gaussian filtering is to smooth the signal first . And then , Remove the noise accordingly . The purpose of Gaussian filter is to construct a filter , Carry out second-order filtration , And carry out the corresponding energy conversion process , In the frequency domain , Energy is a relatively direct manifestation . We often can not directly use the ideal filter to process the signal , Because it is very likely that the signal will ring . The advantage of Gaussian filter is that its system function is relatively reliable , It can effectively smooth the system noise , Avoid undesirable ringing .

A filter is a model , Through the model, the image data is transformed into energy , The noise belongs to the high frequency part , After smoothing by Gaussian filter, the influence of noise on image can be reduced .

3 Mean filtering
Mean filtering is also called linear filtering , The main method is neighborhood average method . The basic principle of linear filtering is to replace each pixel value in the original image with the mean value , The current pixel to be processed (x, y) , Select a template , The template is composed of several neighboring pixels , Find the mean value of all pixels in the template , Then assign the mean value to the current pixel (x, y) , As the gray level of the processed image at this point g (x, y) , namely g(x,y)=1M∑f∈sf(x,y), among , s As a template , M Is the total number of pixels in the template including the current pixel .

4 median filtering
Median filter is a kind of nonlinear signal processing technology which can effectively suppress noise based on sorting statistics theory . The basic principle of median filter is to replace the value of a point in a digital image or digital sequence with the median value of each point in a neighborhood of the point , Let the pixel with a large difference in the gray value of the surrounding pixels change to a value close to the surrounding pixel value , Thus, isolated noise points can be eliminated . The method is to take a two-dimensional sliding template of a certain structure , Sort the pixels in the template according to the size of the pixel value , Generate monotonous rise ( Or down ) Two-dimensional data sequence . The output of two-dimensional median filter is g (x, y) =Med{f (x-k, y-l) , (k, l) ∈W}, among , f (x, y) , g (x, y) They are the original image and the processed image .W It's a two-dimensional template , Usually it is 3×3, 5×5 Area , It can also be in different shapes , Like a thread , circular , cross , Torus, etc .

5 Bilateral filtering
Through the analysis and research of bilateral filtering , The author thinks , The algorithms of bilateral filtering and Gaussian filtering are different . Different from Gaussian filtering , Bilateral filtering is a nonlinear digital processing method for image signals , Bilateral filtering can cover Gaussian filtering algorithm , It also takes into account the dual effects of gray point value and burr removal . But for images , It is better to choose the combination of Gaussian filter and bilateral filter for denoising . Specifically speaking from the algorithm , Bilateral filtering is transformed from Gaussian filtering , Double convolution processing for Gaussian filtering function , Optimize the filter weight coefficient , The coefficients of the filter weights are multiplied by the convolution results in the frequency domain of the image , Thus, the effect of removing burr on the basis of removing gray is obtained , It gives full play to the advantages of Gaussian filtering noise , At the same time, the bilateral smoothing optimization effect is also obtained .

In theory , The result of bilateral filtering is better , The smoothness of the image is good , Practical . Let's explain the weight enhancement in the bilateral filtering process , Generally speaking, the weighting coefficients of bilateral filtering are a nonlinear combination of Gaussian filtering and convoluted result coefficients , It mainly uses the coefficient memory convolution calculation of spatial image approximation function and brightness approximation function . For the former , As the calculation step changes , The mathematical distance between the pixel point obtained from the image and the back center point will become smaller , If you increase the clarity of the image , Then the distance becomes smaller . in other words , The higher the pixel, the higher the image , During processing , The bilateral filter will be transformed into the corresponding low-pass filter , The edge of the image can be better protected . Generally speaking , The results of bilateral filtering are affected by 3 The influence of two parameters , They are the half width of the filter N、 Parameters δs and δr. For general bilateral filtering analysis , In the filtering process, the proximity factor and the brightness change factor are both violent . We are in the process of image processing , You can't just keep high-frequency or low-frequency signals , therefore , Use of bilateral filtering , It can protect the image processing with wide frequency domain , The realization of its effect is mainly accomplished by the function of bilateral filtering . In a bilateral filter , The output result of pixels will be generated . According to previous studies , Bilateral filtering has strong nonlinear processing ability 、 The local processing effect is good and the calculation process does not have the characteristics of iteration . However, the disadvantage of bilateral filtering is that it is easy to process the signal of its own image , This requires the cooperation of Gaussian filtering . In other words , If gray processing or other processing methods are not used in the early stage , Cover the rough edges , Then the effect of bilateral filtering may not be ideal , The mathematical model of bilateral filtering is given below .

Bilateral filter , The value of the output pixel depends on the weighted combination of the values of the neighboring pixels , The formula says :
 Insert picture description here
Weight factor w(i,j,k,l) It depends on the domain
 Insert picture description here
utilize Matlab Software bilateral filtering method on the graph 1 To deal with , Get the picture 3、 chart 4 Sum graph 5 The effect of , stay Matlab Build :function B = bfilter2(A,w,sigma) and function B =bfltGray(A,w,sigma_d,sigma_r) Function of .

Two 、 Partial source code

function B = bfilter2(A,w,sigma)
% Confirm that the input graphic exists and is valid 
% Verify that the input image exists and is valid.
if ~exist('A','var') || isempty(A)
   error('Input image A is undefined or invalid.');
end
if ~isfloat(A) || ~sum([1,3] == size(A,3)) || ...
      min(A(:)) < 0 || max(A(:)) > 1
   error(['Input image A must be a double precision ',...
          'matrix of size NxMx1 or NxMx3 on the closed ',...
          'interval [0,1].']);      
end

% Verify bilateral filter window size 
% Verify bilateral filter window size.
if ~exist('w','var') || isempty(w) || ...
      numel(w) ~= 1 || w < 1
   w = 5;
end
w = ceil(w);

% Verify the standard deviation of the bilateral filter 
% Verify bilateral filter standard deviations.
if ~exist('sigma','var') || isempty(sigma) || ...
      numel(sigma) ~= 2 || sigma(1) <= 0 || sigma(2) <= 0
   sigma = [3 0.1];
end

% Apply color or grayscale bilateral filtering 
% Apply either grayscale or color bilateral filtering.
if size(A,3) == 1
   B = bfltGray(A,w,sigma(1),sigma(2));
else
   B = bfltColor(A,w,sigma(1),sigma(2));
end

3、 ... and 、 Running results

 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here

Four 、matlab Edition and references

1 matlab edition
2014a

2 reference
[1] Cai Limei .MATLAB The image processing —— theory 、 Algorithm and example analysis [M]. tsinghua university press ,2020.
[2] Yang Dan , Zhao Haibin , Long Zhe .MATLAB Detailed explanation of image processing examples [M]. tsinghua university press ,2013.
[3] Zhou pin .MATLAB Image processing and graphical user interface design [M]. tsinghua university press ,2013.
[4] Liu Chenglong . Master MATLAB The image processing [M]. tsinghua university press ,2015.
[5] Hu Lei , Zhang Wei , Qin Qingyan . Application analysis of several image denoising algorithms [J]. information technology . 2007,(07)
[6] Pan Liangjing . Digital image denoising algorithm based on Gaussian filter and bilateral filter [J]. Journal of Shangqiu Vocational and technical college . 2020,19(01)

3 remarks
This part of the introduction is taken from the Internet , For reference only , If infringement , Contact deletion

原网站

版权声明
本文为[Poseidon light]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130952159836.html