net.sourceforge.javaocr.filter
Class ThresholdFilter
java.lang.Object
net.sourceforge.javaocr.filter.AbstractSinglePixelFilter
net.sourceforge.javaocr.filter.ThresholdFilter
- All Implemented Interfaces:
- ImageFilter
public class ThresholdFilter
- extends AbstractSinglePixelFilter
perform threshold filtering
TODO: do we need to make this via threshold? Yep - 'if' is still faster than lookup in array
- Author:
- Konstantin Pribluda
|
Constructor Summary |
ThresholdFilter(int threshold)
construct with threshold and default values for above / below ( 255 / 0 ) |
ThresholdFilter(int threshold,
int above,
int below)
construct with specified values for above and below |
|
Method Summary |
protected void |
processPixel(Image image)
process single image pixel subclass shall retrieve current pixel value with image.next()
and store it with image.put() after processing |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
threshold
int threshold
above
private int above
below
private int below
ThresholdFilter
public ThresholdFilter(int threshold)
- construct with threshold and default values for above / below ( 255 / 0 )
- Parameters:
threshold - threshold value
ThresholdFilter
public ThresholdFilter(int threshold,
int above,
int below)
- construct with specified values for above and below
- Parameters:
threshold - threshold valueabove - value to use for values strictly over the thresholdbelow - value to substitute for values below the threshold
processPixel
protected void processPixel(Image image)
- Description copied from class:
AbstractSinglePixelFilter
- process single image pixel subclass shall retrieve current pixel value with image.next()
and store it with image.put() after processing
- Specified by:
processPixel in class AbstractSinglePixelFilter
Copyright © -2012. All Rights Reserved.