|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.usp.ime.klava.segmentit.util.MatrixImagesUtils
public class MatrixImagesUtils
Performs operations involving images and matrices.
| Constructor Summary | |
|---|---|
MatrixImagesUtils()
|
|
| Method Summary | |
|---|---|
static java.awt.Color[][] |
getColorMatrix(java.awt.image.BufferedImage image)
Constructs a matrix of Colors that represents the given
image. |
static int[][] |
getGrayLevelMatrix(java.awt.image.BufferedImage image)
Constructs a matrix of ints that represents the given
image. |
static java.awt.image.BufferedImage |
getImage(int[][] grayLevelMatrix)
Returns an image with the gray levels given by the grayLevelMatrix. |
static java.lang.Boolean[][] |
getMarkedPixels(java.awt.image.BufferedImage image)
Returns a matrix of Booleans that indicates if each pixel of
image is marked (not transparent). |
static Pixel[][] |
getPixelsMatrix(java.awt.image.BufferedImage image)
Constructs a matrix of Pixels that represents the given
image. |
static int[] |
markBasins(PrimitiveCatchmentBasinsGraph graph,
java.awt.image.BufferedImage markers,
LabelingCriterion labelingCriterion)
Given a unique label to each connected color component of the markers image and maps this labels to the vertices of
graph. |
static java.awt.image.BufferedImage |
paintBasins(Pixel[][] matrix,
java.awt.Color watershedColor,
ColorSpace colorSpace)
Paints an image with each catchment basin of the matrix with
a unique color (according to the labeling of each pixel). |
static java.awt.image.BufferedImage |
paintBasins(PrimitiveCatchmentBasinsGraph graph,
int[] labels,
ColorSpace colorSpace)
Paints each primitive catchment basin of the given graph
according to labels. |
static java.awt.image.BufferedImage |
paintPartitionFromColors(PrimitiveCatchmentBasinsGraph graph,
java.awt.Color[] colors)
Paints each PrimitiveCatchmentBasin of the given
graph with the corresponding Color in
colors. |
static java.awt.image.BufferedImage |
paintPartitionFromMarkersColors(Pixel[][] partition,
java.awt.image.BufferedImage markers)
Paints each segment of the partition with the colors of the
corresponding marker. |
static java.awt.image.BufferedImage |
paintPartitionFromMarkersColors(PrimitiveCatchmentBasinsGraph graph,
int[] labels,
java.awt.image.BufferedImage markers)
Paints the partition given by the labels used in the
graph with the colors of the corresponding markers. |
static java.awt.image.BufferedImage |
paintWatershed(Pixel[][] matrix,
java.awt.Color watershedColor,
java.awt.Color backgroundColor)
Paints an image with the Pixels marked as watershed with
watershedColor. |
static int |
refreshMarkers(Pixel[][] matrix,
java.awt.image.BufferedImage markers,
LabelingCriterion labelingCriterion)
Refreshes the content of matrix labeling each connected
color component of the markers image with a unique label. |
static int |
refreshMarkers(Pixel[][] matrix,
java.awt.image.BufferedImage markers,
LabelingCriterion labelingCriterion,
Connectivity connectivity)
Refreshes the content of matrix labeling each connected
color component of the markers image with a unique label. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MatrixImagesUtils()
| Method Detail |
|---|
public static Pixel[][] getPixelsMatrix(java.awt.image.BufferedImage image)
throws ColorImageException
Pixels that represents the given
image.
image - the input image
Pixels that represents the given
image
ColorImageException - if image is not a gray level imagepublic static java.awt.Color[][] getColorMatrix(java.awt.image.BufferedImage image)
Colors that represents the given
image.
image - the input image
Pixels that represents the given
image
public static int[][] getGrayLevelMatrix(java.awt.image.BufferedImage image)
throws ColorImageException
ints that represents the given
image.
image - the input image
ints that represents the given
image
ColorImageException - if image is not a gray level image
public static int refreshMarkers(Pixel[][] matrix,
java.awt.image.BufferedImage markers,
LabelingCriterion labelingCriterion)
matrix labeling each connected
color component of the markers image with a unique label.
matrix - the matrix of Pixels whose markers will be
refreshedmarkers - the markers imagelabelingCriterion - the criterion for labeling markers
public static int refreshMarkers(Pixel[][] matrix,
java.awt.image.BufferedImage markers,
LabelingCriterion labelingCriterion,
Connectivity connectivity)
matrix labeling each connected
color component of the markers image with a unique label.
matrix - the matrix of Pixels whose markers will be
refreshedmarkers - the markers imagelabelingCriterion - the criterion for labeling markersconnectivity - the Connectivity for labeling markers
public static int[] markBasins(PrimitiveCatchmentBasinsGraph graph,
java.awt.image.BufferedImage markers,
LabelingCriterion labelingCriterion)
markers image and maps this labels to the vertices of
graph. If there is more than one marker that crosses a
primitive catchment basin, the label associated to this vertex is the
label of the last marker found (using the raster scan order).
graph - a graph of primitive catchment basinsmarkers - the markers imagelabelingCriterion - the criterion for labeling markers
graph according to
its intersections with each connected color component of the
markers imagepublic static java.lang.Boolean[][] getMarkedPixels(java.awt.image.BufferedImage image)
Booleans that indicates if each pixel of
image is marked (not transparent).
image - the input image
Booleans that indicates if each pixel of
image is marked (not transparent)
public static java.awt.image.BufferedImage paintWatershed(Pixel[][] matrix,
java.awt.Color watershedColor,
java.awt.Color backgroundColor)
Pixels marked as watershed with
watershedColor.
matrix - the input Pixels matrixwatershedColor - the color used to paint the Pixels belonging to
the watershed linesbackgroundColor - the color of the background of the output image,
null for a transparent background
matrix
public static java.awt.image.BufferedImage paintBasins(Pixel[][] matrix,
java.awt.Color watershedColor,
ColorSpace colorSpace)
matrix with
a unique color (according to the labeling of each pixel). It returns an
empty image if there is only one (or none) catchment basin.
matrix - the input matrixwatershedColor - the color to paint the watershed lines, null if
the watershed lines must not be paintedcolorSpace - the ColorSpace that associates a unique
Color for each catchment basin
matrix painted
public static java.awt.image.BufferedImage paintBasins(PrimitiveCatchmentBasinsGraph graph,
int[] labels,
ColorSpace colorSpace)
graph
according to labels. It returns an empty image if there is
only one label in labels.
graph - a graph of primitive catchment basinslabels - a labeling for the vertices of graphcolorSpace - the ColorSpace that associates a unique
Color for each label in labels
graph painted
according to labelspublic static java.awt.image.BufferedImage getImage(int[][] grayLevelMatrix)
grayLevelMatrix.
grayLevelMatrix - a matrix of gray levels representing an image
grayLevelMatrix
public static java.awt.image.BufferedImage paintPartitionFromMarkersColors(Pixel[][] partition,
java.awt.image.BufferedImage markers)
partition with the colors of the
corresponding marker.
partition - the input Pixels matrix, representing an image
partitionmarkers - the markers image used to obtain the partition
partition painted with the colors from the
markers
public static java.awt.image.BufferedImage paintPartitionFromMarkersColors(PrimitiveCatchmentBasinsGraph graph,
int[] labels,
java.awt.image.BufferedImage markers)
labels used in the
graph with the colors of the corresponding markers.
graph - a PrimitiveCatchmentBasinsGraphlabels - a labeling to the vertices of the graphmarkers - the markers image used to obtain the partition
markers
public static java.awt.image.BufferedImage paintPartitionFromColors(PrimitiveCatchmentBasinsGraph graph,
java.awt.Color[] colors)
PrimitiveCatchmentBasin of the given
graph with the corresponding Color in
colors.
graph - a PrimitiveCatchmentBasinsGraphcolors - a coloring for the vertices of the graph
graph painted with the colors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||