net.sourceforge.javaocr.plugin.fir
Class MedianFilter
java.lang.Object
net.sourceforge.javaocr.plugin.fir.AbstractNeighborhoodFilter
net.sourceforge.javaocr.plugin.fir.MedianFilter
- All Implemented Interfaces:
- ImageFilter
public class MedianFilter
- extends AbstractNeighborhoodFilter
Apply median filter to image, useful to clean up after thresholding.
TODO Works for binarized images only, could be extended to grayscale.
- Author:
- Andrea De Pasquale
|
Constructor Summary |
MedianFilter(int width,
int height,
Image dest)
Create a MedianFilter, which selects median value from
pixels inside a given neighborhood. |
|
Method Summary |
protected int |
processNeighborhood(Image nImage)
compute pixel value by looking up values in the neighborhood image |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pixels
private int[] pixels
counter
private int counter
MedianFilter
public MedianFilter(int width,
int height,
Image dest)
- Create a
MedianFilter, which selects median value from
pixels inside a given neighborhood.
- Parameters:
width - Neighborhood width; if even, filter expands to the right only.height - Neighborhood height; if even, filter expands to the bottom only.dest - The image to be filled up during processing.
processNeighborhood
protected int processNeighborhood(Image nImage)
- Description copied from class:
AbstractNeighborhoodFilter
- compute pixel value by looking up values in the neighborhood image
- Specified by:
processNeighborhood in class AbstractNeighborhoodFilter
Copyright © -2012. All Rights Reserved.