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

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

public class WatershedFromMarkers
extends java.lang.Object

Implements the watershed from markers by IFT algorithm.

The Image Foresting Transform: Theory, Algorithms, and Applications

Author:
Bruno Klava

Constructor Summary
WatershedFromMarkers()
           
 
Method Summary
static Pixel[][] byIFT(java.awt.image.BufferedImage image, java.awt.image.BufferedImage markers, Connectivity connectivity, LabelingCriterion labelingCriterion)
          Returns a partition of image using the given markers in the watershed by the IFT algorithm.
static int byIFT(Pixel[][] pixels, java.awt.image.BufferedImage markers, Connectivity connectivity, LabelingCriterion labelingCriterion)
          Refreshes the partition contained in pixels using the given markers in the watershed by the IFT algorithm.
static int[] byIFT(PrimitiveCatchmentBasinsGraph graph, java.awt.image.BufferedImage markers, LabelingCriterion labelingCriterion)
          Returns a labeling of the vertices of the given graph using the given markers in the watershed by the IFT algorithm.
static void propagateMarkersLabels(Pixel[][] pixels, Connectivity connectivity)
          Propagates the labels of the markers Pixels in pixels by the IFT algorithm.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatershedFromMarkers

public WatershedFromMarkers()
Method Detail

byIFT

public static Pixel[][] byIFT(java.awt.image.BufferedImage image,
                              java.awt.image.BufferedImage markers,
                              Connectivity connectivity,
                              LabelingCriterion labelingCriterion)
                       throws ColorImageException
Returns a partition of image using the given markers in the watershed by the IFT algorithm.

Parameters:
image - the input image
markers - the markers image
connectivity - the adjacency relation from which the graph edges are derived
labelingCriterion - the criterion for labeling markers
Returns:
a partition of the input image
Throws:
ColorImageException - if image is not a gray level image

byIFT

public static int byIFT(Pixel[][] pixels,
                        java.awt.image.BufferedImage markers,
                        Connectivity connectivity,
                        LabelingCriterion labelingCriterion)
Refreshes the partition contained in pixels using the given markers in the watershed by the IFT algorithm.

Parameters:
pixels - the Pixels matrix
markers - the markers image
connectivity - the adjacency relation from which the graph edges are derived
labelingCriterion - the criterion for labeling markers
Returns:
the number of basins of the partition

propagateMarkersLabels

public static void propagateMarkersLabels(Pixel[][] pixels,
                                          Connectivity connectivity)
Propagates the labels of the markers Pixels in pixels by the IFT algorithm.

Parameters:
pixels - the Pixels matrix
connectivity - the adjacency relation from which the graph edges are derived

byIFT

public static int[] byIFT(PrimitiveCatchmentBasinsGraph graph,
                          java.awt.image.BufferedImage markers,
                          LabelingCriterion labelingCriterion)
Returns a labeling of the vertices of the given graph using the given markers in the watershed by the IFT algorithm.

Parameters:
graph - a graph of primitive catchment basins
markers - the markers image
labelingCriterion - the criterion for labeling markers
Returns:
a labeling of the vertices of the given graph using the given markers in the watershed by IFT algorithm