Class NoiseAdders


  • public class NoiseAdders
    extends Object
    Contains Ops designed to add noise to populated images.
    Author:
    Gabriel Selzer
    • Constructor Detail

      • NoiseAdders

        public NoiseAdders()
    • Method Detail

      • addNoiseInterval

        public static <I extends RealType<I>,​O extends RealType<O>> void addNoiseInterval​(RandomAccessibleInterval<I> input,
                                                                                                Double rangeMin,
                                                                                                Double rangeMax,
                                                                                                Double rangeStdDev,
                                                                                                Long seed,
                                                                                                RandomAccessibleInterval<O> output)
        Sets the real component of an output real number to the addition of the real component of an input real number with an amount of Gaussian noise.

        Note that this Op has changed relative to the older implementations; before it operated on RealTypes, we now only provide the operation on Iterable<RealType>s. This is due to the nature of Random: The old implementation saved a Random and used it on each RealType passed to the Op. This provided no deterministic output, as the same input would yield two different outputs if called in succession. Thus in this iteration of the Op we make it a requirement that the input must be an Iterable. Since the Random is created upon every call of the Op it ensures that given the same seed and input data the output will always be the same.

        Parameters:
        input -
        rangeMin -
        rangeMax -
        rangeStdDev -
        seed -
        output -
        Implementation Note:
        op names='filter.addNoise', type=Computer
      • addNoise

        public static <I extends RealType<I>,​O extends RealType<O>> void addNoise​(I input,
                                                                                        O output,
                                                                                        double rangeMin,
                                                                                        double rangeMax,
                                                                                        double rangeStdDev,
                                                                                        Random rng)
      • addPoissonNoiseInterval

        public static <I extends RealType<I>,​O extends RealType<O>> void addPoissonNoiseInterval​(RandomAccessibleInterval<I> input,
                                                                                                       Long seed,
                                                                                                       RandomAccessibleInterval<O> output)
        Sets the real component of an output real number to a real number sampled from a Poisson distribution with lambda of the input real number.

        Implementation according to:

        D. E. Knuth. Art of Computer Programming, Volume 2: Seminumerical Algorithms (3rd Edition). Addison-Wesley Professional, November 1997

        Parameters:
        input -
        seed -
        output -
        Implementation Note:
        op names='filter.addPoissonNoise', type=Computer
      • addPoissonNoise

        public static <I extends RealType<I>,​O extends RealType<O>> void addPoissonNoise​(I input,
                                                                                               Random rng,
                                                                                               O output)
      • addUniformNoise

        public static <I extends RealType<I>> void addUniformNoise​(RandomAccessibleInterval<I> input,
                                                                   I rangeMin,
                                                                   I rangeMax,
                                                                   Long seed,
                                                                   RandomAccessibleInterval<I> output)
        Sets the real component of an output real number to the addition of the real component of an input real number with an amount of uniform noise.
        Parameters:
        input - the input RandomAccessibleInterval
        rangeMin - the "most negative" value that can be added to each element
        rangeMax - the "most positive" value that can be added to each element
        seed - the seed to the random number generator
        output - the output RandomAccessibleInterval
        Implementation Note:
        op names='filter.addUniformNoise', type=Computer