br.usp.ime.klava.segmentit.watershed
Class ClassicalWatershed

java.lang.Object
  extended by br.usp.ime.klava.segmentit.watershed.ClassicalWatershed

public class ClassicalWatershed
extends java.lang.Object

Implementations of algorithms of the classical watershed (one catchment basin for each regional minimum) and intermediary steps algorithms.

Author:
Bruno Klava

Constructor Summary
ClassicalWatershed()
           
 
Method Summary
static Pixel[][] byIFT(java.awt.image.BufferedImage image, Connectivity conectivity)
          Returns the classical watershed partition of image using the regional minima given by locateRegionalMinima method as markers in the watershed by IFT algorithm.
static int byIFT(Pixel[][] pixels, Connectivity connectivity)
          Returns the classical watershed partition of pixels using the regional minima given by locateRegionalMinima method as markers in the watershed by IFT algorithm.
static Pixel[][] byVincentSoille(java.awt.image.BufferedImage image, Connectivity conectivity)
          Returns the classical watershed partition of image using the algorithm by Vincent & Soille.
static int locateRegionalMinima(Pixel[][] pixels, Connectivity connectivity)
          Gives a unique label for each regional minima of the given pixels matrix.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassicalWatershed

public ClassicalWatershed()
Method Detail

byIFT

public static Pixel[][] byIFT(java.awt.image.BufferedImage image,
                              Connectivity conectivity)
                       throws ColorImageException
Returns the classical watershed partition of image using the regional minima given by locateRegionalMinima method as markers in the watershed by IFT algorithm.

Parameters:
image - the input image
conectivity - the adjacency relation from which the graph edges are derived
Returns:
the classical watershed partition of the input image
Throws:
ColorImageException - if image is not a gray level image
See Also:
locateRegionalMinima(BufferedImage, Connectivity), WatershedFromMarkers.byIFT(Pixel[][], BufferedImage, Connectivity, LabelingCriterion)

byIFT

public static int byIFT(Pixel[][] pixels,
                        Connectivity connectivity)
Returns the classical watershed partition of pixels using the regional minima given by locateRegionalMinima method as markers in the watershed by IFT algorithm.

Parameters:
pixels - the input matrix of Pixels
connectivity - the adjacency relation from which the graph edges are derived
Returns:
the number of primitive catchment basins in the partition

locateRegionalMinima

public static int locateRegionalMinima(Pixel[][] pixels,
                                       Connectivity connectivity)
Gives a unique label for each regional minima of the given pixels matrix. It's derived from the algorithm by Vincent & Soille.

Parameters:
pixels - the input matrix of Pixels
connectivity - the adjacency relation from which the graph edges are derived
Returns:
the number of regional minima found
See Also:
byVincentSoille(BufferedImage, Connectivity)

byVincentSoille

public static Pixel[][] byVincentSoille(java.awt.image.BufferedImage image,
                                        Connectivity conectivity)
                                 throws ColorImageException
Returns the classical watershed partition of image using the algorithm by Vincent & Soille.

Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations

Parameters:
image - the input image
conectivity - the adjacency relation from which the graph edges are derived
Returns:
the classical watershed partition of the input image
Throws:
ColorImageException - if image is not a gray level image