br.usp.ime.klava.segmentit.filters
Class Dilation

java.lang.Object
  extended by br.usp.ime.klava.segmentit.filters.Dilation
All Implemented Interfaces:
Filter, GrayLevelFilter, ParameterizedFilter

public class Dilation
extends java.lang.Object
implements GrayLevelFilter, ParameterizedFilter

Filter that returns the dilation of the input image, using a square structuring element.

Author:
Bruno Klava

Constructor Summary
Dilation()
           
 
Method Summary
 void chooseParameters(java.awt.image.BufferedImage image)
          Method called when the parameterized filter is selected on the filters menu.
static int[][] dilation(int[][] matrix, int n)
          Returns the gray level dilation of the image represented by matrix.
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image)
          Returns the dilation of the input image.
 java.lang.String getName()
          Returns the name of the filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dilation

public Dilation()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Filter
Returns the name of the filter.

Specified by:
getName in interface Filter
Returns:
the name of the filter

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image)
                                    throws ColorImageException
Returns the dilation of the input image.

Specified by:
filter in interface Filter
Specified by:
filter in interface GrayLevelFilter
Parameters:
image - the image to be filtered
Returns:
the dilation of the input image image by the 3x3 square structuring element
Throws:
ColorImageException

chooseParameters

public void chooseParameters(java.awt.image.BufferedImage image)
Description copied from interface: ParameterizedFilter
Method called when the parameterized filter is selected on the filters menu. In order to set the derived filtered image, one can use the method setFilteredImage on SegmentationContainer.

Specified by:
chooseParameters in interface ParameterizedFilter
Parameters:
image - the original image to be filtered
See Also:
SegmentationContainer.setFilteredImage(BufferedImage, Filter)

dilation

public static int[][] dilation(int[][] matrix,
                               int n)
Returns the gray level dilation of the image represented by matrix.

Parameters:
matrix - a matrix of gray levels
n - the number used to calculate the size of the structuring element
Returns:
the dilation of matrix by the (2n+1)x(2 n+1) structuring element