Package boofcv.alg.misc
Class GPixelMath
java.lang.Object
boofcv.alg.misc.GPixelMath
Generalized version of
PixelMath
. Type checking is performed at runtime instead of at compile type.
DO NOT MODIFY. Automatically generated code created by GenerateGPixelMath
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ImageBase<T>>
voidabs
(T input, T output) Sets each pixel in the output image to be the absolute value of the input image.add
(T inputA, T inputB, O output) Performs pixel-wise addition
d(x,y) = inputA(x,y) + inputB(x,y)static <T extends ImageBase<T>>
voidboundImage
(T input, double min, double max) Bounds image pixels to be between these two values.static <T extends ImageBase<T>>
voiddiffAbs
(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)|divide
(N imgA, D imgB, N output) Performs pixel-wise division
output(x,y) = imgA(x,y) / imgB(x,y)divide
(T input, double denominator, double lower, double upper, O output) Divide each element by a scalar value.divide
(T input, double denominator, O output) Divide each element by a scalar value.log
(T input, double value, O output) Sets each pixel in the output image to log( val + input(x,y)) of the input image.logSign
(T input, double value, O output) Sets each pixel in the output image to sgn*log( val + sgn*input(x,y)) of the input image.static <T extends ImageBase<T>>
voidminus
(double value, T input, double lower, double upper, T output) Subtracts the value of each element from a scalar value.static <T extends ImageBase<T>>
voidminus
(double value, T input, T output) Subtracts the value of each element from a scalar value.minus
(T input, double value, double lower, double upper, O output) Subtracts a scalar value from each element.minus
(T input, double value, O output) Subtracts a scalar value from each element.multiply
(N imgA, D imgB, N output) Performs pixel-wise multiplication
output(x,y) = imgA(x,y) * imgB(x,y)multiply
(T input, double value, double lower, double upper, O output) Multiply each element by a scalar value.multiply
(T input, double value, O output) Multiply each element by a scalar value.static <T extends ImageBase<T>>
voidnegative
(T input, T output) Changes the sign of every pixel in the image: output[x,y] = -input[x,y]static <T extends ImageBase<T>>
voidoperator1
(T input, PixelMathLambdas.Function1 function, T output) Applies the lambda operation to each element in the input image.static <T extends ImageBase<T>>
voidoperator2
(T imgA, PixelMathLambdas.Function2 function, T imgB, T output) Applies the lambda operation to each element in the two input images.plus
(T input, double value, double lower, double upper, O output) Each element has the specified number added to it.plus
(T input, double value, O output) Each element has the specified number added to it.pow2
(A input, B output) Raises each pixel in the input image to the power of two.static <T extends ImageBase<T>>
voidsqrt
(T input, T output) Computes the square root of each pixel in the input image.stdev
(T mean, B pow2, T stdev) Computes the standard deviation of each pixel in a local region.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)
-
Constructor Details
-
GPixelMath
public GPixelMath()
-
-
Method Details
-
operator1
public static <T extends ImageBase<T>> void operator1(T input, PixelMathLambdas.Function1 function, T output) Applies the lambda operation to each element in the input image. output[i] = function(input[i]) Both the input and output image can be the same instance. -
operator2
public static <T extends ImageBase<T>> void operator2(T imgA, PixelMathLambdas.Function2 function, T imgB, T output) Applies the lambda operation to each element in the two input images. output[i] = function(imA[i],imgB[i]) Both the imgA, imgB, and output images can be the same instance. -
abs
Sets each pixel in the output image to be the absolute value of the input image. Both the input and output image can be the same instance.- Parameters:
input
- The input image. Not modified.output
- Where the inverted image is written to. Modified.
-
negative
Changes the sign of every pixel in the image: output[x,y] = -input[x,y]- Parameters:
input
- The input image. Not modified.output
- Where the inverted image is written to. Modified.
-
divide
public static <T extends ImageBase<T>,O extends ImageBase<O>> void divide(T input, double denominator, O output) Divide each element by a scalar value. Both input and output images can be the same instance.- Parameters:
input
- The input image. Not modified.denominator
- What each element is divided by.output
- The output image. Modified.
-
divide
public static <T extends ImageBase<T>,O extends ImageBase<O>> void divide(T input, double denominator, double lower, double upper, O output) Divide each element by a scalar value. Both input and output images can be the same instance.- Parameters:
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.
-
multiply
public static <T extends ImageBase<T>,O extends ImageBase<O>> void multiply(T input, double value, O output) Multiply each element by a scalar value. Both input and output images can be the same instance.- Parameters:
input
- The input image. Not modified.value
- What each element is multiplied by.output
- The output image. Modified.
-
multiply
public static <T extends ImageBase<T>,O extends ImageBase<O>> void multiply(T input, double value, double lower, double upper, O output) Multiply each element by a scalar value. Both input and output images can be the same instance.- Parameters:
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.
-
plus
public static <T extends ImageBase<T>,O extends ImageBase<O>> void plus(T input, double value, O output) Each element has the specified number added to it. Both input and output images can be the same.- Parameters:
input
- The input image. Not modified.value
- What is added to each element.output
- The output image. Modified.
-
plus
public static <T extends ImageBase<T>,O extends ImageBase<O>> void plus(T input, double value, double lower, double upper, O output) Each element has the specified number added to it. Both input and output images can be the same.- Parameters:
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.
-
minus
public static <T extends ImageBase<T>,O extends ImageBase<O>> void minus(T input, double value, O output) Subtracts a scalar value from each element. Both input and output images can be the same instance.- Parameters:
input
- The input image. Not modified.value
- What is subtracted from each element in input.output
- The output image. Modified.
-
minus
public static <T extends ImageBase<T>,O extends ImageBase<O>> void minus(T input, double value, double lower, double upper, O output) Subtracts a scalar value from each element. Both input and output images can be the same instance.- Parameters:
input
- The input image. Not modified.value
- What is subtracted from each element in input.lower
- Lower bound on output. Inclusive.upper
- Upper bound on output. Inclusive.output
- The output image. Modified.
-
minus
Subtracts the value of each element from a scalar value. Both input and output images can be the same instance. output = value - input- Parameters:
value
- Left side of equation.input
- The input image. Not modified.output
- The output image. Modified.
-
minus
public static <T extends ImageBase<T>> 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- Parameters:
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.
-
log
public static <T extends ImageBase<T>,O extends ImageBase<O>> void log(T input, double value, O output) Sets each pixel in the output image to log( val + input(x,y)) of the input image. Both the input and output image can be the same instance.- Parameters:
input
- The input image. Not modified.value
- log( value + input[x,y])output
- The output image. Modified.
-
logSign
public static <T extends ImageBase<T>,O extends ImageBase<O>> void logSign(T input, double value, O output) Sets each pixel in the output image to sgn*log( val + sgn*input(x,y)) of the input image. where sng is the sign of input(x,y).- Parameters:
input
- The input image. Not modified.value
- sgn*log( value + sgn*input[x,y])output
- The output image. Modified.
-
sqrt
Computes the square root of each pixel in the input image. Both the input and output image can be the same instance.- Parameters:
input
- The input image. Not modified.output
- Where the inverted image is written to. Modified.
-
divide
Performs pixel-wise division
Only floating point images are supported. If the numerator has multiple bands and the denominator is a single band then the denominator will divide each band.
output(x,y) = imgA(x,y) / imgB(x,y)- Parameters:
imgA
- Input image. Not modified.imgB
- Input image. Not modified.output
- Output image. Modified.
-
multiply
Performs pixel-wise multiplication
Only floating point images are supported. If one image has multiple bands and the other is gray then the gray image will be multiplied by each band in the multiple band image.
output(x,y) = imgA(x,y) * imgB(x,y)- Parameters:
imgA
- Input image. Not modified.imgB
- Input image. Not modified.output
- Output image. Modified.
-
pow2
Raises each pixel in the input image to the power of two. Both the input and output image can be the same instance.- Parameters:
input
- The input image. Not modified.output
- Where the pow2 image is written to. Modified.
-
add
Performs pixel-wise addition
d(x,y) = inputA(x,y) + inputB(x,y)- Parameters:
inputA
- Input image. Not modified.inputB
- Input image. Not modified.output
- Output image. Modified.
-
boundImage
Bounds image pixels to be between these two values.- Parameters:
input
- Input image.min
- minimum value. Inclusive.max
- maximum value. Inclusive.
-
diffAbs
Computes the absolute value of the difference between each pixel in the two images.
d(x,y) = |img1(x,y) - img2(x,y)|- Parameters:
inputA
- Input image. Not modified.inputB
- Input image. Not modified.output
- Absolute value of difference image. Modified.
-
stdev
Computes the standard deviation of each pixel in a local region.- Parameters:
mean
- (Input) Image with local meanpow2
- (Input) Image with local mean pixel-wise power of 2stdev
- (Output) standard deviation of each pixel. Can be same instance as either input.
-
subtract
public static <T extends ImageBase<T>,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)- Parameters:
inputA
- Input image. Not modified.inputB
- Input image. Not modified.output
- Output image. Modified.
-