First, the principle
The addition of images can be used to average multiple images in the same scene to reduce additive (additive) random noises.
Second, the experiment
i= imread (' E:\matlab\work\lenna.bmp '); % read Picture
[L h]=size (i) % get size
K=zeros (l,h)
for i=1:100
j=imnoise (i, ' Gaussian ', 0,0.02); % Random additive noise
j1=im2double (J); % turns into double type to add
k=k+j1;
End
k=k/100;
Subplot (2,2,1), Imshow (I), title (' original image ');
Subplot (2,2,2), Imshow (J), title (' Add noise after image '), subplot (2,2,3), Imshow (K), title (' Processed image ');
Effect:
The description of some key points of the code 1.im2double because the image defaults to the uint8 or bool type (binary graph). The results of the uint8 type are saved by default to the Uint8 type, which is cast out of range, so it is first converted to double.
2.imnoise Reference Baidu Encyclopedia:
matlab function imnoise is to add noise pollution an image, called noise pollution image function.
G=imnoise (F, ' Gaussian ', M,var) adds the Gaussian noise of mean M and variance var to image F, and the default value is the noise of mean M 0 and variance var 0.01. G=imnoise (F, ' Localvar ', v) adds a Gaussian noise with a mean of 0 and a local variance of V to the image F, where V is an array of the same size as F, which contains the ideal variance value for each point. G=imnoise (F, ' Localvar ', Image_intensity,var) adds a Gaussian noise with a mean value of 0 to the image F, where the noise local variance var is the function of the brightness value of the image F. Parametric image_intensity and Var are the same size vectors, plot (Image_intensity,var) draw a functional relationship between noise variance and image brightness. The vector image_intensity must contain a normalized brightness value within [0,1]. G=imnoise (F, ' Salt&pepper ', d) pollute the image f with salt and pepper noise, where d is the noise density (that is, the percentage of the image region that includes the noise value). As a result, approximately d*numel (f) pixels are affected. The default noise density is 0.05. G=imnoise (F, ' speckle ', var) with the equation g=f+n*f) adds multiplicative noise to the image F, where n is a uniformly distributed random noise with a mean value of 0 and the variance is Var, and the default value of Var is 0.04. G=imnoise (F, ' Poisson ') generates Poisson noises from the data rather than adding artificial noises to the data, and in order to comply with Poisson statistics, the brightness of the UNIT8 and unit16 images must match the number of photons. When the number of photons per pixel is greater than 65535, a double image is used. The brightness value varies between 0 and 1 and corresponds to the number of photons divided by 10e12.