|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimagescience.random.Randomizer
public class Randomizer
Randomizes images.
Field Summary | |
---|---|
static int |
ADDITIVE
Additive insertion of random numbers. |
Messenger |
messenger
The object used for message displaying. |
static int |
MODULATORY
Modulatory insertion of random numbers. |
static int |
MULTIPLICATIVE
Multiplicative insertion of random numbers. |
Progressor |
progressor
The object used for progress displaying. |
Constructor Summary | |
---|---|
Randomizer()
Default constructor. |
Method Summary | |
---|---|
Image |
binomial(Image image,
int trials,
double probability,
int insertion,
boolean newimage)
Randomizes images using a binomial random variable. |
Image |
exponential(Image image,
double lambda,
int insertion,
boolean newimage)
Randomizes images using an exponential random variable. |
Image |
gamma(Image image,
int order,
int insertion,
boolean newimage)
Randomizes images using a gamma random variable. |
Image |
gaussian(Image image,
double mean,
double stdev,
int insertion,
boolean newimage)
Randomizes images using a Gaussian random variable. |
Image |
poisson(Image image,
double mean,
int insertion,
boolean newimage)
Randomizes images using a Poisson random variable. |
Image |
uniform(Image image,
double min,
double max,
int insertion,
boolean newimage)
Randomizes images using a uniform random variable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ADDITIVE
public static final int MULTIPLICATIVE
public static final int MODULATORY
public final Messenger messenger
public final Progressor progressor
Constructor Detail |
---|
public Randomizer()
Method Detail |
---|
public Image gaussian(Image image, double mean, double stdev, int insertion, boolean newimage)
image
- The input image to be randomized.mean
- The mean of the Gaussian distribution.stdev
- The standard deviation of the Gaussian distribution. Must be larger than or equal to 0
.insertion
- Determines how the random numbers generated from the distribution are inserted into the image. Must be one of ADDITIVE
or MULTIPLICATIVE
.newimage
- Indicates whether the randomized image should be returned as a new image. If this parameter is true
, the result is returned as a new Image
object (of the same type as the input image) and the input image is left unaltered; if it is false
, the input image itself is randomized and returned, thereby saving memory.
java.lang.IllegalArgumentException
- If stdev
is less than 0
, or if insertion
is invalid.
java.lang.NullPointerException
- If image
is null
.public Image binomial(Image image, int trials, double probability, int insertion, boolean newimage)
image
- The input image to be randomized.trials
- The number of trials of the binomial distribution. Must be larger than or equal to 0
.probability
- The probability for each trial of the binomial distribution. Must be in the range [0,1]
.insertion
- Determines how the random numbers generated from the distribution are inserted into the image. Must be one of ADDITIVE
or MULTIPLICATIVE
.newimage
- Indicates whether the randomized image should be returned as a new image. If this parameter is true
, the result is returned as a new Image
object (of the same type as the input image) and the input image is left unaltered; if it is false
, the input image itself is randomized and returned, thereby saving memory.
java.lang.IllegalArgumentException
- If trials
is less than 0
, if probability
is outside the range [0,1]
, or if insertion
is invalid.
java.lang.NullPointerException
- If image
is null
.public Image gamma(Image image, int order, int insertion, boolean newimage)
image
- The input image to be randomized.order
- The integer order of the gamma distribution. Must be larger than 0
.insertion
- Determines how the random numbers generated from the distribution are inserted into the image. Must be one of ADDITIVE
or MULTIPLICATIVE
.newimage
- Indicates whether the randomized image should be returned as a new image. If this parameter is true
, the result is returned as a new Image
object (of the same type as the input image) and the input image is left unaltered; if it is false
, the input image itself is randomized and returned, thereby saving memory.
java.lang.IllegalArgumentException
- If order
is less than or equal to 0
, or if insertion
is invalid.
java.lang.NullPointerException
- If image
is null
.public Image uniform(Image image, double min, double max, int insertion, boolean newimage)
image
- The input image to be randomized.min
- max
- The interval parameters of the uniform distribution. Random numbers are generated in the open interval (min
,max
).insertion
- Determines how the random numbers generated from the distribution are inserted into the image. Must be one of ADDITIVE
or MULTIPLICATIVE
.newimage
- Indicates whether the randomized image should be returned as a new image. If this parameter is true
, the result is returned as a new Image
object (of the same type as the input image) and the input image is left unaltered; if it is false
, the input image itself is randomized and returned, thereby saving memory.
java.lang.IllegalArgumentException
- If min
is larger than or equal to max
, or if insertion
is invalid.
java.lang.NullPointerException
- If image
is null
.public Image exponential(Image image, double lambda, int insertion, boolean newimage)
image
- The input image to be randomized.lambda
- The lambda parameter of the exponential distribution. Must be larger than 0
.insertion
- Determines how the random numbers generated from the distribution are inserted into the image. Must be one of ADDITIVE
or MULTIPLICATIVE
.newimage
- Indicates whether the randomized image should be returned as a new image. If this parameter is true
, the result is returned as a new Image
object (of the same type as the input image) and the input image is left unaltered; if it is false
, the input image itself is randomized and returned, thereby saving memory.
java.lang.IllegalArgumentException
- If lambda
is less than or equal to 0
, or if insertion
is invalid.
java.lang.NullPointerException
- If image
is null
.public Image poisson(Image image, double mean, int insertion, boolean newimage)
image
- The input image to be randomized.mean
- The mean of the Poisson distribution. Must be larger than or equal to 0
.insertion
- Determines how the random numbers generated from the distribution are inserted into the image. Must be one of ADDITIVE
, MULTIPLICATIVE
, or MODULATORY
.newimage
- Indicates whether the randomized image should be returned as a new image. If this parameter is true
, the result is returned as a new Image
object (of the same type as the input image) and the input image is left unaltered; if it is false
, the input image itself is randomized and returned, thereby saving memory.
java.lang.IllegalArgumentException
- If mean
is less than 0
, or if insertion
is invalid.
java.lang.NullPointerException
- If image
is null
.
|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.
IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.