org.jscience.computing.ai.vision
Class MeanFilter

java.lang.Object
  extended by org.jscience.computing.ai.vision.Filter
      extended by org.jscience.computing.ai.vision.ConvolutionFilter
          extended by org.jscience.computing.ai.vision.MeanFilter

public class MeanFilter
extends ConvolutionFilter

A mean filter implemented as a convolution filter.

See Also:
org.generation5.vision.ConvolutionFilter

Field Summary
protected  int neighbourhoodSize
          The neighbourhood size.
 
Fields inherited from class org.jscience.computing.ai.vision.ConvolutionFilter
kernel
 
Constructor Summary
MeanFilter()
          Creates a new instance of MeanFilter.
MeanFilter(int neighbourhoodSize)
          Creates a new instance of MeanFilter of the specified neighbourhood size.
 
Method Summary
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image)
          Blur the image using the mean kernel.
 int getNeighbourhoodSize()
          Retrieve the current neighbourhood size.
static void main(java.lang.String[] args)
          Utility method for the class.
 void setNeighbourhoodSize(int ns)
          Set the neighbourhood size.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.computing.ai.vision.ConvolutionFilter
filter, getKernel, setKernel
 
Methods inherited from class org.jscience.computing.ai.vision.Filter
verifyOutput, verifyOutput, verifyOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

neighbourhoodSize

protected int neighbourhoodSize
The neighbourhood size.

Constructor Detail

MeanFilter

public MeanFilter()
Creates a new instance of MeanFilter. The default constructor sets the neighbourhood size at 3.


MeanFilter

public MeanFilter(int neighbourhoodSize)
Creates a new instance of MeanFilter of the specified neighbourhood size.

Parameters:
neighbourhoodSize - the neighbourhood size.
Method Detail

setNeighbourhoodSize

public void setNeighbourhoodSize(int ns)
Set the neighbourhood size. Note that the neighbourhood size must be an odd number. Any even number is increased to make it an odd number.

Parameters:
ns - the new neighbourhood size.

getNeighbourhoodSize

public int getNeighbourhoodSize()
Retrieve the current neighbourhood size.

Returns:
the neighbourhood size.

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image)
Blur the image using the mean kernel.

Overrides:
filter in class Filter
Parameters:
image - the input image.
Returns:
the output image.

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class ConvolutionFilter
Returns:
DOCUMENT ME!

main

public static void main(java.lang.String[] args)
Utility method for the class.

Parameters:
args - the command line arguments