|
||||||||||
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 Color s that represents the given
image . |
static int[][] |
getGrayLevelMatrix(java.awt.image.BufferedImage image)
Constructs a matrix of int s 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 Boolean s that indicates if each pixel of
image is marked (not transparent). |
static Pixel[][] |
getPixelsMatrix(java.awt.image.BufferedImage image)
Constructs a matrix of Pixel s 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 Pixel s 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
Pixel
s that represents the given
image
.
image
- the input image
Pixel
s that represents the given
image
ColorImageException
- if image
is not a gray level imagepublic static java.awt.Color[][] getColorMatrix(java.awt.image.BufferedImage image)
Color
s that represents the given
image
.
image
- the input image
Pixel
s that represents the given
image
public static int[][] getGrayLevelMatrix(java.awt.image.BufferedImage image) throws ColorImageException
int
s that represents the given
image
.
image
- the input image
int
s that represents the given
image
ColorImageException
- if image
is not a gray level imagepublic 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 Pixel
s 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 Pixel
s whose markers will be
refreshedmarkers
- the markers imagelabelingCriterion
- the criterion for labeling markers
connectivity
- 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)
Boolean
s that indicates if each pixel of
image
is marked (not transparent).
image
- the input image
Boolean
s 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)
Pixel
s marked as watershed with
watershedColor
.
matrix
- the input Pixel
s matrixwatershedColor
- the color used to paint the Pixel
s 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
paintedpublic 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 graph
colorSpace
- the ColorSpace
that associates a unique
Color
for each label in labels
graph
painted
according to labels
public 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 Pixel
s 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 PrimitiveCatchmentBasinsGraph
labels
- a labeling to the vertices of the graph
markers
- 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 PrimitiveCatchmentBasinsGraph
colors
- 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 |