org.jscience.computing.ai.vision
Class GaussianFilter

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.GaussianFilter

public class GaussianFilter
extends ConvolutionFilter

Implements simple Gaussian smoothing. This extends ConvolutionFilter and calculates the kernel automatically from the standard deviation passed.


Field Summary
protected  double standardDeviation
          The standard deviation used in the gaussian spread (defaults to 1.0).
 
Fields inherited from class org.jscience.computing.ai.vision.ConvolutionFilter
kernel
 
Constructor Summary
GaussianFilter()
          Creates a new instance of GaussianFilter
GaussianFilter(double standardDeviation)
          Creates a new instance of GaussianFilter, with the standard deviation.
 
Method Summary
static float[] createKernel(double stddev)
          This creates a gaussian filter with a given standard deviation.
protected static int getSize(double stddev)
          Calculate the size of the kernel required for the standard deviation passed.
 double getStandardDeviation()
          Get the standard deviation.
static void main(java.lang.String[] args)
          Utility method.
 void setStandardDeviation(double standardDeviation)
          Set the standard deviation used.
 
Methods inherited from class org.jscience.computing.ai.vision.ConvolutionFilter
filter, getKernel, setKernel, toString
 
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

standardDeviation

protected double standardDeviation
The standard deviation used in the gaussian spread (defaults to 1.0).

Constructor Detail

GaussianFilter

public GaussianFilter()
Creates a new instance of GaussianFilter


GaussianFilter

public GaussianFilter(double standardDeviation)
Creates a new instance of GaussianFilter, with the standard deviation.

Parameters:
standardDeviation - the standard deviation.
Method Detail

main

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

Parameters:
args - the command line arguments

createKernel

public static float[] createKernel(double stddev)
This creates a gaussian filter with a given standard deviation. This method is exposed as public and static as a utility method.

Parameters:
stddev - the standard deviation.
Returns:
the kernel.

getSize

protected static int getSize(double stddev)
Calculate the size of the kernel required for the standard deviation passed.

Parameters:
stddev - the standard deviation.
Returns:
the kernel size.

getStandardDeviation

public double getStandardDeviation()
Get the standard deviation.

Returns:
the current standard deviation.

setStandardDeviation

public void setStandardDeviation(double standardDeviation)
Set the standard deviation used. The kernel is automatically regenerated when this method is called.

Parameters:
standardDeviation - the new standard deviation to use.