public class GImageMiscOps extends Object
ImageMiscOps. Type checking is performed at runtime instead of at compile type.| Constructor and Description |
|---|
GImageMiscOps() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addGaussian(ImageBase input,
Random rand,
double sigma,
double lowerBound,
double upperBound)
Adds Gaussian/normal i.i.d noise to each pixel in the image.
|
static void |
addUniform(ImageBase input,
Random rand,
double min,
double max)
Adds uniform i.i.d noise to each pixel in the image.
|
static void |
copy(int srcX,
int srcY,
int dstX,
int dstY,
int width,
int height,
ImageBase input,
ImageBase output)
Copies a rectangular region from one image into another.
output[dstX:(dstX+width) , dstY:(dstY+height-1)] = input[srcX:(srcX+width) , srcY:(srcY+height-1)] |
static void |
fill(ImageBase input,
double value)
Computes the mean of the absolute value of the difference between the two images.
|
static void |
fillBorder(ImageBase input,
double value,
int radius)
Fills the outside border with the specified value
|
static void |
fillGaussian(ImageBase input,
Random rand,
double mean,
double sigma,
double lowerBound,
double upperBound)
Sets each value in the image to a value drawn from a Gaussian distribution.
|
static void |
fillRectangle(ImageBase input,
double value,
int x0,
int y0,
int width,
int height)
Draws a filled rectangle that is aligned along the image axis inside the image.
|
static void |
fillUniform(ImageBase input,
Random rand,
double min,
double max)
Sets each value in the image to a value drawn from an uniform distribution that has a range of min <= X < max.
|
static void |
flipVertical(ImageBase img)
Flips the image from top to bottom
|
public static void copy(int srcX,
int srcY,
int dstX,
int dstY,
int width,
int height,
ImageBase input,
ImageBase output)
srcX - x-coordinate of corner in input imagesrcY - y-coordinate of corner in input imagedstX - x-coordinate of corner in output imagedstY - y-coordinate of corner in output imagewidth - Width of region to be copiedheight - Height of region to be copiedinput - Input imageoutput - output imagepublic static void fill(ImageBase input, double value)
input - Input image. Not modified.value - fill valuepublic static void fillBorder(ImageBase input, double value, int radius)
input - An image.value - The value that the image is being filled with.radius - Border width.public static void fillRectangle(ImageBase input, double value, int x0, int y0, int width, int height)
input - Image the rectangle is drawn in. Modifiedvalue - Value of the rectanglex0 - Top left x-coordinatey0 - Top left y-coordinatewidth - Rectangle widthheight - Rectangle heightpublic static void fillGaussian(ImageBase input, Random rand, double mean, double sigma, double lowerBound, double upperBound)
input - Input image. Modified.rand - Random number generatormean - Distribution's mean.sigma - Distribution's standard deviation.lowerBound - Lower bound of value clipupperBound - Upper bound of value clippublic static void fillUniform(ImageBase input, Random rand, double min, double max)
input - Image which is to be filled. Modified,rand - Random number generatormin - Minimum value of the distributionmax - Maximum value of the distributionpublic static void addGaussian(ImageBase input, Random rand, double sigma, double lowerBound, double upperBound)
input - Input image. Modified.rand - Random number generator.sigma - Distributions standard deviation.lowerBound - Allowed lower boundupperBound - Allowed upper boundpublic static void addUniform(ImageBase input, Random rand, double min, double max)
public static void flipVertical(ImageBase img)
Copyright © 2013. All Rights Reserved.