public class ThresholdNick extends java.lang.Object implements InputToBinary<GrayF32>
Based off the NICK algorithm described in [1] this is a thresholding algorithm intended for use on low quality ancient documents. A sliding windows approach is employed and is inspired by Niblack. It's designed to better handled "white" and ligh page images by shifting the threshold down.
[1] Khurshid, Khurram, et al. "Comparison of Niblack inspired Binarization methods for ancient documents." Document Recognition and Retrieval XVI. Vol. 7247. International Society for Optics and Photonics, 2009.
| Constructor and Description |
|---|
ThresholdNick(ConfigLength width,
float k,
boolean down)
Configures the algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
ImageType<GrayF32> |
getInputType() |
float |
getK() |
ConfigLength |
getWidth() |
boolean |
isDown() |
void |
process(GrayF32 input,
GrayU8 output)
Converts the input image into a binary image.
|
void |
setDown(boolean down) |
void |
setK(float k) |
void |
setWidth(ConfigLength width) |
public ThresholdNick(ConfigLength width, float k, boolean down)
width - size of local region. Try 31k - User specified threshold adjustment factor. Must be positive. Try 0.3down - Threshold down or uppublic void process(GrayF32 input, GrayU8 output)
process in interface InputToBinary<GrayF32>input - Input image. Not modified.output - Output binary image. Modified.public ImageType<GrayF32> getInputType()
getInputType in interface InputToBinary<GrayF32>public float getK()
public void setK(float k)
public ConfigLength getWidth()
public void setWidth(ConfigLength width)
public boolean isDown()
public void setDown(boolean down)