Adding noise to images

From MIPAV
Revision as of 16:05, 15 February 2012 by Angelfish100 (Talk)

(diff) <previousrevision> | Latest revision (diff) | <nextrevision> (diff)
Jump to: navigation, search

Adding noise to images

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.).
To add 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 ([MIPAV_Utilities.html#1182372 Figure 265]).
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.


Figure 265. Additive Noise dialog boxÂ

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

{| align="center"

AdditiveNoise.jpg


|- | rowspan="1" colspan="2" |

Noise Type

|- |

Gaussian

|

Adds Gaussian noise to the image.

|- |

Uniform

|

Adds Uniform noise to the image.

|- | rowspan="1" colspan="3" |

Destination

|- |

New image

| rowspan="1" colspan="2" |

Shows the cropped image in a new image window.

|- |

Replace image

| rowspan="1" colspan="2" |

Replaces the current active image with the cropped image.

|- |

OK

| rowspan="1" colspan="2" |

Applies the parameters that you specified for adding noise to this image.

|- |

Cancel

| rowspan="1" colspan="2" |

Disregards any changes you made in this dialog box, closes the dialog box, and does not add noise to this image.

|- |

Help

| rowspan="1" colspan="2" |

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.
Example

In the following example ([MIPAV_Utilities.html#1199766 Figure 266]), 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 266. Examples of adding a noise to an image, and then using it to test an algorithm's effectiveness in removing the noiseÂ


{| align="center"

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

|- |


{| align="center"

| Uniform1000.jpg

|}

B

|


{| align="center"

| MedianAfterUniform.jpg

|}

C

|- |


{| align="center" | Gaussian1000.jpg |}

E

|


{| align="center" | MedianAfterGaussianjpg.jpg |}

F

|}


.

Pad