org.jscience.computing.ai.vision
Class ConvolutionFilter

java.lang.Object
  extended by org.jscience.computing.ai.vision.Filter
      extended by org.jscience.computing.ai.vision.ConvolutionFilter
Direct Known Subclasses:
GaussianFilter, MeanFilter

public class ConvolutionFilter
extends Filter

This class implements a convolution filter. This class is merely a wrapper for the Java 2D ConvolveOp, but implements the Generation5 JDK's Filter.


Field Summary
protected  java.awt.image.Kernel kernel
          The kernel to be used.
 
Constructor Summary
ConvolutionFilter()
          Creates a new instance of ConvolutionFilter
ConvolutionFilter(java.awt.image.Kernel kernel)
          Creates a new instance of a convolution filter with the given kernel.
 
Method Summary
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image, java.awt.image.BufferedImage output)
          Convolve the image using the kernel.
 java.awt.image.Kernel getKernel()
          Return the kernel currently set.
 void setKernel(java.awt.image.Kernel kernel)
          Set the kernel to be used.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.computing.ai.vision.Filter
filter, verifyOutput, verifyOutput, verifyOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kernel

protected java.awt.image.Kernel kernel
The kernel to be used.

Constructor Detail

ConvolutionFilter

public ConvolutionFilter()
Creates a new instance of ConvolutionFilter


ConvolutionFilter

public ConvolutionFilter(java.awt.image.Kernel kernel)
Creates a new instance of a convolution filter with the given kernel.

Parameters:
kernel - the kernel to use.
Method Detail

setKernel

public void setKernel(java.awt.image.Kernel kernel)
Set the kernel to be used.

Parameters:
kernel - the kernel.

getKernel

public java.awt.image.Kernel getKernel()
Return the kernel currently set.

Returns:
the kernel.

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image,
                                           java.awt.image.BufferedImage output)
Convolve the image using the kernel.

Specified by:
filter in class Filter
Parameters:
image - the input image.
output - the pre-allocated output image (optional).
Returns:
the output image.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!
See Also:
Filter.verifyOutput(BufferedImage,BufferedImage)

toString

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

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!