- java.lang.Object
-
- org.scijava.ops.image.filter.addNoise.NoiseAdders
-
public class NoiseAdders extends Object
Contains Ops designed to add noise to populated images.- Author:
- Gabriel Selzer
-
-
Constructor Summary
Constructors Constructor Description NoiseAdders()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <I extends RealType<I>,O extends RealType<O>>
voidaddNoise(I input, O output, double rangeMin, double rangeMax, double rangeStdDev, Random rng)static <I extends RealType<I>,O extends RealType<O>>
voidaddNoiseInterval(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.static <I extends RealType<I>,O extends RealType<O>>
voidaddPoissonNoise(I input, Random rng, O output)static <I extends RealType<I>,O extends RealType<O>>
voidaddPoissonNoiseInterval(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.static <I extends RealType<I>>
voidaddUniformNoise(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.
-
-
-
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 ofRandom: The old implementation saved aRandomand used it on eachRealTypepassed 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 anIterable. Since theRandomis 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 inputRandomAccessibleIntervalrangeMin- the "most negative" value that can be added to each elementrangeMax- the "most positive" value that can be added to each elementseed- the seed to the random number generatoroutput- the outputRandomAccessibleInterval- Implementation Note:
- op names='filter.addUniformNoise', type=Computer
-
-