net.sourceforge.javaocr.filter
Class ThresholdFilter

java.lang.Object
  extended by net.sourceforge.javaocr.filter.AbstractSinglePixelFilter
      extended by 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

Field Summary
private  int above
           
private  int below
           
(package private)  int threshold
           
 
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 net.sourceforge.javaocr.filter.AbstractSinglePixelFilter
process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threshold

int threshold

above

private int above

below

private int below
Constructor Detail

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 value
above - value to use for values strictly over the threshold
below - value to substitute for values below the threshold
Method Detail

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.