public class Binarize
Image binarization methods.
public static int OTSU_SIZE_X
Desired tile X dimension; actual size may vary
public static int OTSU_SIZE_Y
Desired tile Y dimension; actual size may vary
public static int OTSU_SMOOTH_X
Desired X smoothing value
public static int OTSU_SMOOTH_Y
Desired Y smoothing value
public static float OTSU_SCORE_FRACTION
Fraction of the max Otsu score, typically 0.1
public static int SAUVOLA_DEFAULT_WINDOW_HALFWIDTH
public static float SAUVOLA_DEFAULT_REDUCTION_FACTOR
public static int SAUVOLA_DEFAULT_NUM_TILES_X
public static int SAUVOLA_DEFAULT_NUM_TILES_Y
public static Pix otsuAdaptiveThreshold(Pix pixs)
Performs locally-adaptive Otsu threshold binarization with default parameters.
pixs - An 8 bpp PIX source image.public static Pix otsuAdaptiveThreshold(Pix pixs, int sizeX, int sizeY, int smoothX, int smoothY, @FloatRange float scoreFraction)
Performs locally-adaptive Otsu threshold binarization.
Notes:
pixs - An 8 bpp PIX source image.sizeX - Desired tile X dimension; actual size may vary.sizeY - Desired tile Y dimension; actual size may vary.smoothX - Half-width of convolution kernel applied to threshold array: use 0 for no smoothing.smoothY - Half-height of convolution kernel applied to threshold array: use 0 for no smoothing.scoreFraction - Fraction of the max Otsu score; typ. 0.1 (use 0.0 for standard Otsu).public static Pix sauvolaBinarizeTiled(Pix pixs)
Performs Sauvola binarization using default values.
pixs - An 8 bpp PIX source image.#sauvolaBinarizeTiled(Pix, int, float, int, int)public static Pix sauvolaBinarizeTiled(Pix pixs, int whsize, @FloatRange float factor, int nx, int ny)
Performs Sauvola binarization.
Notes:
pixs - An 8 bpp PIX source image.whsize - Window half-width for measuring local statisticsfactor - Factor for reducing threshold due to variance; >= 0nx - Subdivision into tiles; >= 1ny - Subdivision into tiles; >= 1