Class RandomNoise

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--RandomNoise

public class RandomNoise
extends java.lang.Thread

RandomNoise is an algorithm to generate random noise in an image of either type Gaussian or Shot.

See Also:
code.iface.rnoise

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RandomNoise()
           
 
Method Summary
 int[] Gaussian(int[] src_1d, int width, int height, float par)
          Gaussian adds gaussian noise to the input image.
 int[] ShotFull(int[] src_1d, int width, int height, float par)
          ShotFull applies full shot noise to the input image.
 int[] ShotPartial(int[] src_1d, int width, int height, float par)
          ShotPartial applies partial shot noise to the input image.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomNoise

public RandomNoise()
Method Detail

ShotFull

public int[] ShotFull(int[] src_1d,
                      int width,
                      int height,
                      float par)
ShotFull applies full shot noise to the input image. This means that it changes the values in the image with probability par to either 0 or 255.
Parameters:
src_1d - The source image as a pixel array
width - width of the destination image in pixels
height - height of the destination image in pixels
par - This is used to represent the probability that a pixel will changed.
Returns:
A pixel array containing the noisy input image

ShotPartial

public int[] ShotPartial(int[] src_1d,
                         int width,
                         int height,
                         float par)
ShotPartial applies partial shot noise to the input image. This means that it changes the values in the image with probability par to a randomly chosen value between 0 and 255.
Parameters:
src_1d - The source image as a pixel array
width - width of the destination image in pixels
height - height of the destination image in pixels
par - This is used to represent the probability that a pixel will change
Returns:
A pixel array containing the noisy input image

Gaussian

public int[] Gaussian(int[] src_1d,
                      int width,
                      int height,
                      float par)
Gaussian adds gaussian noise to the input image. This means that it adds a gaussian distributed random number, with standard deviation par to the current pixel. This is repeated across the whole image.
Parameters:
src_1d - The source image as a pixel array
width - width of the destination image in pixels
height - height of the destination image in pixels
par - This represents the Standard Deviation by which the Gaussian noise is generated
Returns:
A pixel array containing the noisy input image