public class GThresholdImageOps extends Object
ThresholdImageOps.| Constructor and Description |
|---|
GThresholdImageOps() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends ImageSingleBand> |
adaptiveGaussian(T input,
ImageUInt8 output,
int radius,
double bias,
boolean down,
T work1,
T work2)
Thresholds the image using an adaptive threshold that is computed using a local square region centered
on each pixel.
|
static <T extends ImageSingleBand> |
adaptiveSquare(T input,
ImageUInt8 output,
int radius,
double bias,
boolean down,
T work1,
T work2)
Thresholds the image using an adaptive threshold that is computed using a local square region centered
on each pixel.
|
static <T extends ImageSingleBand> |
threshold(T input,
ImageUInt8 output,
double threshold,
boolean down)
Applies a global threshold across the whole image.
|
public static <T extends ImageSingleBand> ImageUInt8 threshold(T input, ImageUInt8 output, double threshold, boolean down)
input - Input image. Not modified.output - Binary output image. If null a new image will be declared. Modified.threshold - threshold value.down - If true then the inequality <= is used, otherwise if false then >= is used.public static <T extends ImageSingleBand> ImageUInt8 adaptiveSquare(T input, ImageUInt8 output, int radius, double bias, boolean down, T work1, T work2)
Thresholds the image using an adaptive threshold that is computed using a local square region centered on each pixel. The threshold is equal to the average value of the surrounding pixels plus the bias. If down is true then b(x,y) = I(x,y) <= T(x,y) + bias ? 1 : 0. Otherwise b(x,y) = I(x,y) >= T(x,y) + bias ? 0 : 1
NOTE: Internally, images are declared to store intermediate results. If more control is needed over memory call the type specific function.
input - Input image.output - (optional) Output binary image. If null it will be declared internally.radius - Radius of square region.bias - Bias used to adjust thresholddown - Should it threshold up or down.work1 - (Optional) Internal workspace. Can be nullwork2 - (Optional) Internal workspace. Can be nullpublic static <T extends ImageSingleBand> ImageUInt8 adaptiveGaussian(T input, ImageUInt8 output, int radius, double bias, boolean down, T work1, T work2)
Thresholds the image using an adaptive threshold that is computed using a local square region centered on each pixel. The threshold is equal to the gaussian weighted sum of the surrounding pixels plus the bias. If down is true then b(x,y) = I(x,y) <= T(x,y) + bias ? 1 : 0. Otherwise b(x,y) = I(x,y) >= T(x,y) + bias ? 0 : 1
NOTE: Internally, images are declared to store intermediate results. If more control is needed over memory call the type specific function.
input - Input image.output - (optional) Output binary image. If null it will be declared internally.radius - Radius of square region.bias - Bias used to adjust thresholddown - Should it threshold up or down.work1 - (Optional) Internal workspace. Can be nullwork2 - (Optional) Internal workspace. Can be nullCopyright © 2013. All Rights Reserved.