# [Digital Image Processing] classification of common noise and Matlab implementation

Source: Internet
Author: User
1. Study the necessity of Noise Characteristics

This article mainly introduces the classification and features of common noises. Model the noise, and then use the model to implement all kinds of noise.

The aging of various photos in real life can be attributed to the following aging models.

This model is very simple and can be expressed directly using the following formula.

In the frequency domain, it is expressed in the following formula.

According to the above formula, we can see that the restoration of old photos is mainly divided into two tasks: Noise Reduction and convolution, or inverse filtering, that is, the aging filter is reversed.

This article first models the noise type. The following blog will introduce several basic denoising methods and basic inverse filtering methods.

2. Noise implementation 2.1 evaluation images and their histograms 2.2 Gaussian noise, also known as normal noise, has a normal distribution of statistical characteristics. A general noise model. The implementation of MATLAB is relatively simple. MATLAB already has a randn (m, n) function, A Gaussian noise image with the mean value 0, variance 1, and size m x n pixels can be generated. Use the following program to produce Gaussian noise of any mean and variance.

`a = 0;b = 0.08;n_gaussian = a + b .* randn(M,N);`

2.3 Ruili Noise

In contrast to Gaussian noise, the pattern is skewed to the right, which is useful for fitting some skewed histogram noise.

The implementation of Ruili noise can be achieved by the mean noise. As shown below.

The mean value is 0, and the variance is 1. In Matlab, the Rand (m, n) function can generate a uniform noise with an mean of 0 and a variance of 1.

`a = -0.2;b = 0.03;n_rayleigh = a + (-b .* log(1 - rand(M,N))).^0.5;`

2.4 gamma noise

The gamma noise distribution follows the gamma curve distribution. The implementation of gamma noise requires the superposition of B noises that are subject to exponential distribution. Exponential Distribution noise can be achieved using uniform distribution.

The gamma noise can be obtained by using multiple uniform distributions (represented by B.

Of course, when B = 1, we can get exponential noise.

`a = 25;b = 3;n_Erlang = zeros(M,N); for j=1:b    n_Erlang = n_Erlang + (-1/a)*log(1 - rand(M,N));end`

2.5 uniform noise

As shown above, uniform noise can be directly produced by the RAND (m, n) function.

`a = 0;b = 0.3;n_Unifrom = a + (b-a)*rand(M,N);`

2.6 salt and pepper noise is also a dual-pulse noise. In the early stages of printed film, due to the unstable chemical properties of the film and damage during playback, the photosensitive material on the film surface and the substrate of the film will be lost, some white or black damages are caused. In fact, this can also be attributed to special pretzels.

The implementation of salt and pepper noise requires some logic judgment. Here our idea is to generate even noise, and then set the vertices that exceed the threshold value as black spots or white spots. Of course, if you need to fit the film damage, you can choose another type of noise to fit.

`a = 0.05;b = 0.05;x = rand(M,N);g_sp = zeros(M,N);g_sp = f;g_sp(find(x<=a)) = 0;g_sp(find(x > a & x<(a+b))) = 1;`

3. Summarize the several basic types of noise implemented in this article. The implementation method is provided. The Code is as follows. In the next blog, We will compare several common denoising filters.

Published in blog: http://blog.csdn.net/thnh169/

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.