public abstract class RegionLabeling extends Object
Modifier and Type | Class and Description |
---|---|
class |
RegionLabeling.BinaryRegion
This inner class of
RegionLabeling represents a connected
component or binary region. |
Modifier and Type | Field and Description |
---|---|
protected int |
currentLabel |
protected int |
height |
protected ij.process.ImageProcessor |
ip |
protected int[][] |
labelArray |
protected int |
maxLabel |
protected List<RegionLabeling.BinaryRegion> |
regions |
protected int |
width |
Modifier | Constructor and Description |
---|---|
protected |
RegionLabeling(ij.process.ByteProcessor ip) |
Modifier and Type | Method and Description |
---|---|
RegionLabeling.BinaryRegion |
findRegion(int label)
Find the region associated to the given label.
|
int |
getLabel(int u,
int v)
Get the label number for the specified image coordinate.
|
RegionLabeling.BinaryRegion |
getRegion(int u,
int v)
Finds the
RegionLabeling.BinaryRegion instance associated with
the given image position. |
Iterable<Point> |
getRegionPoints(RegionLabeling.BinaryRegion r)
Deprecated.
This method is not supported any longer.
Instead use
Iterable<Point> capability of RegionLabeling.BinaryRegion
to iterate directly over region points. |
List<RegionLabeling.BinaryRegion> |
getRegions()
Get an unsorted list of all regions associated with this region labeling.
|
List<RegionLabeling.BinaryRegion> |
getRegions(boolean sort)
Get a possibly sorted list of all regions associated with this region labeling.
|
protected int[][] |
initialize() |
ij.process.ImageProcessor |
makeLabelImage(boolean color)
Utility method that creates an image of the internal
label array.
|
protected int |
makeRandomColor() |
protected void |
resetLabel() |
protected void |
setLabel(int u,
int v,
int label) |
protected final ij.process.ImageProcessor ip
protected final int width
protected final int height
protected final int[][] labelArray
protected int currentLabel
protected int maxLabel
protected List<RegionLabeling.BinaryRegion> regions
protected RegionLabeling(ij.process.ByteProcessor ip)
protected int[][] initialize()
public List<RegionLabeling.BinaryRegion> getRegions()
public List<RegionLabeling.BinaryRegion> getRegions(boolean sort)
sort
- set true
to sort regions by decreasing size.public int getLabel(int u, int v)
u
- the horizontal coordinate.v
- the vertical coordinate.protected void setLabel(int u, int v, int label)
protected void resetLabel()
public ij.process.ImageProcessor makeLabelImage(boolean color)
color
- set false
to get a 16-bit grayscale image,
true
for an RGB (24-bit) color image.public RegionLabeling.BinaryRegion findRegion(int label)
label
- the label number.label
- the label number.null
if
is does not exist.public RegionLabeling.BinaryRegion getRegion(int u, int v)
RegionLabeling.BinaryRegion
instance associated with
the given image position.u
- the horizontal position.v
- the vertical position.RegionLabeling.BinaryRegion
object or null if
this RegionLabeling
has no region at the given position.protected int makeRandomColor()
public Iterable<Point> getRegionPoints(RegionLabeling.BinaryRegion r)
Iterable<Point>
capability of RegionLabeling.BinaryRegion
to iterate directly over region points.r
- the binary region.Iterable
to iterate over all region points.Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)