public class GPixelMath
extends java.lang.Object
PixelMath. Type checking is performed at runtime instead of at compile type.| Constructor and Description |
|---|
GPixelMath() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends ImageSingleBand> |
abs(T input,
T output)
Sets each pixel in the output image to be the absolute value of the input image.
|
static <T extends ImageSingleBand,O extends ImageSingleBand> |
add(T inputA,
T inputB,
O output)
Performs pixel-wise addition
d(x,y) = inputA(x,y) + inputB(x,y) |
static <T extends ImageSingleBand> |
averageBand(MultiSpectral<T> input,
T output)
Computes the average for each pixel across all bands in the
MultiSpectral image. |
static <T extends ImageSingleBand> |
boundImage(T input,
double min,
double max)
Bounds image pixels to be between these two values.
|
static <T extends ImageSingleBand> |
diffAbs(T inputA,
T inputB,
T output)
Computes the absolute value of the difference between each pixel in the two images.
d(x,y) = |img1(x,y) - img2(x,y)| |
static <T extends ImageSingleBand> |
divide(T input,
double denominator,
double lower,
double upper,
T output)
Divide each element by a scalar value and bounds the result.
|
static <T extends ImageSingleBand> |
divide(T input,
double denominator,
T output)
Divide each element by a scalar value.
|
static <T extends ImageSingleBand> |
divide(T imgA,
T imgB,
T output)
Performs pixel-wise division
output(x,y) = imgA(x,y) / imgB(x,y) |
static <T extends ImageSingleBand> |
invert(T input,
T output)
Changes the sign of every pixel in the image: output[x,y] = -input[x,y]
Can only be used on signed images.
|
static <T extends ImageSingleBand> |
log(T input,
T output)
Sets each pixel in the output image to log( 1 + input(x,y)) of the input image.
|
static <T extends ImageSingleBand> |
minus(double value,
T input,
double lower,
double upper,
T output)
Subtracts the value of each element from a scalar value.
|
static <T extends ImageSingleBand> |
minus(double value,
T input,
T output)
Subtracts the value of each element from a scalar value.
|
static <T extends ImageSingleBand> |
minus(T input,
double value,
double lower,
double upper,
T output)
Subtracts a scalar value from each element.
|
static <T extends ImageSingleBand> |
minus(T input,
double value,
T output)
Subtracts a scalar value from each element.
|
static <T extends ImageSingleBand> |
multiply(T input,
double value,
double lower,
double upper,
T output)
Multiply each element by a scalar value and bounds the result.
|
static <T extends ImageSingleBand> |
multiply(T input,
double value,
T output)
Multiply each element by a scalar value.
|
static <T extends ImageSingleBand> |
multiply(T imgA,
T imgB,
T output)
Performs pixel-wise multiplication
output(x,y) = imgA(x,y) * imgB(x,y) |
static <T extends ImageSingleBand> |
plus(T input,
double value,
double lower,
double upper,
T output)
Add a scalar value to each element and bounds the result.
|
static <T extends ImageSingleBand> |
plus(T input,
double value,
T output)
Each element has the specified number added to it.
|
static <T extends ImageSingleBand> |
pow2(T input,
T output)
Raises each pixel in the input image to the power of two.
|
static <T extends ImageSingleBand> |
sqrt(T input,
T output)
Computes the square root of each pixel in the input image.
|
static <T extends ImageBase,O extends ImageBase> |
subtract(T inputA,
T inputB,
O output)
Performs pixel-wise subtraction, but ensures the result is between two bounds.
d(x,y) = imgA(x,y) - imgB(x,y) |
public static <T extends ImageSingleBand> void abs(T input, T output)
input - The input image. Not modified.output - Where the absolute value image is written to. Modified.public static <T extends ImageSingleBand> void invert(T input, T output)
input - The input image. Not modified.output - Where the inverted image is written to. Modified.public static <T extends ImageSingleBand> void divide(T input, double denominator, T output)
input - The input image. Not modified.denominator - What each element is divided by.output - The output image. Modified.public static <T extends ImageSingleBand> void divide(T input, double denominator, double lower, double upper, T output)
input - The input image. Not modified.denominator - What each element is divided by.lower - Lower bound on output. Inclusive.upper - Upper bound on output. Inclusive.output - The output image. Modified.public static <T extends ImageSingleBand> void divide(T imgA, T imgB, T output)
Performs pixel-wise division
output(x,y) = imgA(x,y) / imgB(x,y)
imgA - Input image. Not modified.imgB - Input image. Not modified.output - Output image. Modified.public static <T extends ImageSingleBand> void multiply(T input, double value, T output)
input - The input image. Not modified.value - What each element is multiplied by.output - The output image. Modified.public static <T extends ImageSingleBand> void multiply(T input, double value, double lower, double upper, T output)
input - The input image. Not modified.value - What each element is multiplied by.lower - Lower bound on output. Inclusive.upper - Upper bound on output. Inclusive.output - The output image. Modified.public static <T extends ImageSingleBand> void multiply(T imgA, T imgB, T output)
Performs pixel-wise multiplication
output(x,y) = imgA(x,y) * imgB(x,y)
imgA - Input image. Not modified.imgB - Input image. Not modified.output - Output image. Modified.public static <T extends ImageSingleBand> void log(T input, T output)
input - The input image. Not modified.output - Where the log image is written to. Modified.public static <T extends ImageSingleBand> void pow2(T input, T output)
input - The input image. Not modified.output - Where the pow2 image is written to. Modified.public static <T extends ImageSingleBand> void sqrt(T input, T output)
input - The input image. Not modified.output - Where the sqrt() image is written to. Modified.public static <T extends ImageSingleBand> void plus(T input, double value, T output)
input - The input image. Not modified.value - What is added to each element.output - The output image. Modified.public static <T extends ImageSingleBand> void plus(T input, double value, double lower, double upper, T output)
input - The input image. Not modified.value - What is added to each element.lower - Lower bound on output. Inclusive.upper - Upper bound on output. Inclusive.output - The output image. Modified.public static <T extends ImageSingleBand> void minus(T input, double value, T output)
Subtracts a scalar value from each element. Both input and output images can be the same instance.
output = input - value
input - The input image. Not modified.value - What is subtracted from each element in input.output - The output image. Modified.public static <T extends ImageSingleBand> void minus(double value, T input, T output)
Subtracts the value of each element from a scalar value. Both input and output images can be the same instance.
output = value - input
value - Value on left side of equation.input - The input image, elements subtracted from value. Not modified.output - The output image. Modified.public static <T extends ImageSingleBand> void minus(T input, double value, double lower, double upper, T output)
Subtracts a scalar value from each element. Both input and output images can be the same instance.
output = input - value
input - The input image. Not modified.value - What is subtracted from each element.lower - Lower bound on output. Inclusive.upper - Upper bound on output. Inclusive.output - The output image. Modified.public static <T extends ImageSingleBand> void minus(double value, T input, double lower, double upper, T output)
Subtracts the value of each element from a scalar value. Both input and output images can be the same instance.
output = value - input
value - Left side of equation.input - The input image. Not modified.lower - Lower bound on output. Inclusive.upper - Upper bound on output. Inclusive.output - The output image. Modified.public static <T extends ImageSingleBand,O extends ImageSingleBand> void add(T inputA, T inputB, O output)
Performs pixel-wise addition
d(x,y) = inputA(x,y) + inputB(x,y)
inputA - Input image. Not modified.inputB - Input image. Not modified.output - Output image. Modified.public static <T extends ImageBase,O extends ImageBase> void subtract(T inputA, T inputB, O output)
Performs pixel-wise subtraction, but ensures the result is between two bounds.
d(x,y) = imgA(x,y) - imgB(x,y)
inputA - Input image. Not modified.inputB - Input image. Not modified.output - Output image. Modified.public static <T extends ImageSingleBand> void boundImage(T input, double min, double max)
input - Input image.min - minimum value. Inclusive.max - maximum value. Inclusive.public static <T extends ImageSingleBand> void diffAbs(T inputA, T inputB, T output)
Computes the absolute value of the difference between each pixel in the two images.
d(x,y) = |img1(x,y) - img2(x,y)|
inputA - Input image. Not modified.inputB - Input image. Not modified.output - Absolute value of difference image. Modified.public static <T extends ImageSingleBand> void averageBand(MultiSpectral<T> input, T output)
MultiSpectral image.input - MultiSpectral imageoutput - Gray scale image containing average pixel values