net.sourceforge.javaocr.filter
Class SauvolaBinarisationFilter

java.lang.Object
  extended by net.sourceforge.javaocr.filter.MedianFilter
      extended by net.sourceforge.javaocr.filter.SauvolaBinarisationFilter
All Implemented Interfaces:
ImageFilter

public class SauvolaBinarisationFilter
extends MedianFilter

Performs local image threshloding with Sauvola algorithm. allocates integral images to achieve O(N) performance instead ow O(N2W2). This filter allocates working images and can be reused with destination image of same size. Please note, that window/2 pixels on borders of image are invalid. It is responsibility of caller to provide suitable padding.

Based on "Efficient Implementation of Local Adaptive Thresholding Techniques Using Integral Images" by Faisal Shafait , Daniel Keysers , Thomas M. Breuel from Image Understanding and Pattern Recognition (IUPR) Research Group German Research Center for Artificial Intelligence (DFKI) GmbH D-67663 Kaiserslautern, Germany and Thomas M. Breuel from Department of Computer Science, Technical University of Kaiserslautern D-67663 Kaiserslautern, Germany

Author:
Konstantin Pribluda

Field Summary
protected  int above
           
protected  int below
           
protected  int range
           
private  SquaredIntergalImageFilter squaredIntergalImageFilter
           
private  Image squaresImage
           
protected  double weight
           
 
Fields inherited from class net.sourceforge.javaocr.filter.MedianFilter
destination, halfWindow, integralImageFilter, squareWindow
 
Constructor Summary
SauvolaBinarisationFilter(int above, int below, Image destination, int maxValue, double weight, int window)
           
 
Method Summary
protected  int computePixel(Image image, int y, int x)
          compute median pixel value
 int getAbove()
           
 int getBelow()
           
 int getRange()
           
 SquaredIntergalImageFilter getSquaredIntergalImageFilter()
           
 double getWeight()
           
 void process(Image image)
          traversal will be done by median filter, actual processing delegated to derived method
protected  int retrievePixel(Image image, int y, int x)
           
 
Methods inherited from class net.sourceforge.javaocr.filter.MedianFilter
getHalfWindow, getIntegralImageFilter, getSquareWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

above

protected final int above

below

protected final int below

range

protected final int range

weight

protected final double weight

squaredIntergalImageFilter

private SquaredIntergalImageFilter squaredIntergalImageFilter

squaresImage

private Image squaresImage
Constructor Detail

SauvolaBinarisationFilter

public SauvolaBinarisationFilter(int above,
                                 int below,
                                 Image destination,
                                 int maxValue,
                                 double weight,
                                 int window)
Parameters:
above - value to use for pixels above threshold
below - value to use for pixels below threshold
destination - destination image
maxValue - maxValue of intensity values
weight - weight of variance term (determines relation of threshold to local mean)
window - computing Window size
Method Detail

process

public void process(Image image)
traversal will be done by median filter, actual processing delegated to derived method

Specified by:
process in interface ImageFilter
Overrides:
process in class MedianFilter
Parameters:
image -

computePixel

protected int computePixel(Image image,
                           int y,
                           int x)
Description copied from class: MedianFilter
compute median pixel value

Overrides:
computePixel in class MedianFilter

retrievePixel

protected int retrievePixel(Image image,
                            int y,
                            int x)

getAbove

public int getAbove()

getBelow

public int getBelow()

getRange

public int getRange()

getWeight

public double getWeight()

getSquaredIntergalImageFilter

public SquaredIntergalImageFilter getSquaredIntergalImageFilter()


Copyright © -2012. All Rights Reserved.