net.sourceforge.javaocr.filter
Class MedianFilter

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

public class MedianFilter
extends Object
implements ImageFilter

applies median filter to image (pixel is Mx from his surrounding window) result is collected in destination image. Pixels outside source image are treated as non existing. Border pixels are considered invalid, and their treatment is upon user


Field Summary
protected  Image destination
           
protected  int halfWindow
           
protected  IntegralImageFilter integralImageFilter
           
private  PixelImage meanImage
           
protected  int squareWindow
           
 
Constructor Summary
MedianFilter(Image destination, int window)
          create median filter
 
Method Summary
protected  int computePixel(Image image, int y, int x)
          compute median pixel value
 int getHalfWindow()
           
 IntegralImageFilter getIntegralImageFilter()
           
 int getSquareWindow()
           
 void process(Image image)
          perform image processing possibly overwriting the image with the result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

destination

protected final Image destination

halfWindow

protected final int halfWindow

squareWindow

protected final int squareWindow

meanImage

private final PixelImage meanImage

integralImageFilter

protected final IntegralImageFilter integralImageFilter
Constructor Detail

MedianFilter

public MedianFilter(Image destination,
                    int window)
create median filter

Parameters:
destination - overscan image where result is collected.
window - window size, in case of even value will be treated as one less
Method Detail

process

public void process(Image image)
Description copied from interface: ImageFilter
perform image processing possibly overwriting the image with the result

Specified by:
process in interface ImageFilter

computePixel

protected int computePixel(Image image,
                           int y,
                           int x)
compute median pixel value


getHalfWindow

public int getHalfWindow()

getSquareWindow

public int getSquareWindow()

getIntegralImageFilter

public IntegralImageFilter getIntegralImageFilter()


Copyright © -2012. All Rights Reserved.