Adding noise to images

From MIPAV
Jump to: navigation, search

Background

Adding noise to images allows you to test the robustness and performance of an algorithm in the presence of known amounts of noise. When you select Utilities > Noise, the program clamps either Gaussian or Uniform noise to the lowest or highest value in the source image type.
For example, for a byte image, if the intensity of the source pixel is 120 and noise is 15, then intensity noise = 135. This value (135) would be clamped to the maximum pixel value for a byte image (127).
This class relies heavily on the Java Random class and is used to generate a stream of pseudorandom numbers. The class uses a 48-bit seed, which is modified using a linear congruency formula (refer to Donald Knuth, The Art of Computer Programming, Volume 2, Section 3.2.1.).

Adding noise to images

1 Open an image on which you want to test the effectiveness of an algorithm.
2 Select Utilities > Noise in the MIPAV window. The program displays the Additive Noise dialog box (Figure 45).
3 Type the level of noise that you want to add to the image in the Noise level box. You can specify a value from 10 to 32,768.

Additive Noise dialog box

Figure 45. Additive Noise dialog box
Noise level (0-32768)
Specifies the level of noise to add to the image.
The default value is 10.

AdditiveNoise.jpg

Noise Type
Gaussian
Adds Gaussian noise to the image.
Uniform
Adds Uniform noise to the image.
Destination
New image
Shows the cropped image in a new image window.
Replace image
Replaces the current active image with the cropped image.
OK
Applies the parameters that you specified for adding noise to this image.
Cancel
Disregards any changes you made in this dialog box, closes the dialog box, and does not add noise to this image.
Help
Displays online help for this dialog box.

4 Type the level of noise that you want to add to the image in the Noise level box. You can specify a value from 10 to 32,768.
5 Select either of the following:
Gaussian -To add Gaussian noise to the image
Uniform< -To add Uniform noise to the image
6 Select either of the following:
New image -To generate the resulting image in a new image window
Replace image -To replace the current image with the resulting image
7 Click OK. The program adds the Gaussian or Uniform noise to the image and displays either a new image or replaces the current image with the one to which noise was added.
8 Now, select the algorithm in the Algorithms menu to test its effectiveness on the image.

Examples

In the following example (Figure 46), the original image appears at the top of the figure. The next row shows the image on the left that results from adding Uniform noise of 1000. To its right is the image after running the Median algorithm. The image on the left on the last row results from adding Gaussian noise of 1000 to the original image. Running the Median algorithm on that image produces the image on its right. In this example, the Median algorithm performs better on an image containing Gaussian noise.

Figure 46. Examples of adding a noise to an image, and then using it to test an algorithm's effectiveness in removing the noise

AddingNoiseOriginal.jpg


A
A is an original image
B is the image after applying Uniform noise (1000)
C is the image B after applying the Median filter
D is the image after adding Gaussian noise (1000)
F is the image D after running the Median filter on it

Uniform1000.jpg


B

MedianAfterUniform.jpg


C

Gaussian1000.jpg


E

MedianAfterGaussianjpg.jpg


F

See also

Changing Image Datasets Using MIPAV Utilities

Pad