br.usp.ime.klava.segmentit.util
Class GranularitiesUtils

java.lang.Object
  extended by br.usp.ime.klava.segmentit.util.GranularitiesUtils

public class GranularitiesUtils
extends java.lang.Object

Performs operations involving partitions at Pixel and PrimitiveCatchmentBasin granularities.

Author:
Bruno Klava

Constructor Summary
GranularitiesUtils()
           
 
Method Summary
static int[] fixLabels(PrimitiveCatchmentBasinsGraph graph, int[] originalLabels)
           
static int[] getUnifiedLabels(PrimitiveCatchmentBasinsGraph graph, java.awt.image.BufferedImage desiredPartition)
          Returns a labeling to graph unifying the labels in desiredPartitions within each PrimitiveCatchmentBasin.
static int[] getUnifiedLabels(PrimitiveCatchmentBasinsGraph graph, Pixel[][] pixels)
          Returns a labeling to graph unifying the labels in pixels within each PrimitiveCatchmentBasin.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GranularitiesUtils

public GranularitiesUtils()
Method Detail

getUnifiedLabels

public static int[] getUnifiedLabels(PrimitiveCatchmentBasinsGraph graph,
                                     Pixel[][] pixels)
Returns a labeling to graph unifying the labels in pixels within each PrimitiveCatchmentBasin.

Parameters:
graph - a PrimitiveCatchmentBasinsGraph to be labeled
pixels - the desired partition in Pixels granularity
Returns:
a labeling for the given graph that most approximates the partition in pixels

getUnifiedLabels

public static int[] getUnifiedLabels(PrimitiveCatchmentBasinsGraph graph,
                                     java.awt.image.BufferedImage desiredPartition)
Returns a labeling to graph unifying the labels in desiredPartitions within each PrimitiveCatchmentBasin.

Parameters:
graph - a PrimitiveCatchmentBasinsGraph to be labeled
desiredPartition - the desired partition in Pixels granularity
Returns:
a labeling for the given graph that most approximates the partition in desiredPartition

fixLabels

public static int[] fixLabels(PrimitiveCatchmentBasinsGraph graph,
                              int[] originalLabels)
Parameters:
originalLabels -
Returns:
a unique label for each ROI (originalLabels may contain same label for distinct ROIs, if a ROI was split by labels unification within PrimitiveCatchmentBasins)