Routines (alphabetical) > Routines: N > NOISE_SLUR

# NOISE_SLUR

The NOISE_SLUR function introduces noise into an image by selecting random pixels to be replaced by a neighboring pixel from a random location in the row above. This simulates a downward melting effect.

With NOISE_SLUR, there is an 80% chance of using the pixel directly above for replacement and a 10% chance of using either of the pixels to the above left and above right. The probability of replacing a pixel is controlled by a parameter which controls the amount of noise introduced into the image.

## Example

This example introduces noise to a test image:

; Read an image:
file = FILEPATH('rose.jpg', SUBDIR=['examples','data'])
IOPEN, file, image
; Introduce noise to the image:
image_noisy= NOISE_SLUR(image, 0.5, ITER=10)
; Display the images side by side:
IIMAGE, image, VIEW_GRID=[2,1], VIEW_TITLE='Original', $
DIMENSIONS=[600, 300], WINDOW_TITLE='NOISE_SLUR Example', $
/NO_SAVEPROMPT
IIMAGE, image_noisy, /VIEW_NEXT, VIEW_TITLE='Noisy'

The resulting images appear as follows:

## Syntax

Result = NOISE_SLUR(Image [, Randomization][, ITERATIONS=value] [, SEED=value])

## Return Value

Result is an array of the same type and dimensions as Image.

## Arguments

### Image

A two dimensional or three dimensional array containing the input image. Two dimensional arrays are treated as single channel images and for three dimensional arrays the first dimension contains the color channels forming a pixel (Pixel Interleave).

### Randomization

A floating-point scalar in the range 0.0-1.0 that specifies the probability of picking each pixel for replacement. 0.0 means no chance of replacement and 1.0 means the pixel is always replaced. The default value is 0.5.

Note: This value specifies the probability of replacement for each pixel. It does not necessarily mean that a particular percentage of the pixels are replaced.

## Keywords

### ITERATIONS

Set this keyword to the number of times to apply the noise generator. Increasing the number of iterations increases the distance pixels can move.

### SEED

Set this keyword to the seed value for the random number generator. This keyword is used in the same way as the SEED argument for RANDOMU.

## Version History

6.4 | Introduced