public class StructuringElement extends Object
| Modifier and Type | Field and Description |
|---|---|
static StructuringElement |
BOX
Standard 3x3 box structuring element
|
static StructuringElement |
CROSS
Standard 3x3 cross structuring element
|
static StructuringElement |
HPIT
Standard horizontal pit structuring element [x .
|
Set<Pixel> |
negative
Set of negative pixels in the structuring element
|
Set<Pixel> |
positive
Set of positive pixels in the structuring element
|
| Constructor and Description |
|---|
StructuringElement()
Construct an empty structuring element
|
StructuringElement(Pixel[] positive,
Pixel[] negative)
Construct a structuring element with the given positive and negative
pixels
|
StructuringElement(Set<Pixel> positive,
Set<Pixel> negative)
Construct a structuring element with the given positive and negative
pixels
|
| Modifier and Type | Method and Description |
|---|---|
int |
countActive()
Count the total (positive and negative) number of pixels in this
structuring element
|
static StructuringElement |
disk(int radius)
Build a disk shaped structuring element with the given radius.
|
boolean |
matches(Pixel p,
Set<Pixel> pixels)
Determine if this structuring element is completely contained in the
pixels centered at p.
|
static StructuringElement |
parseElement(String ele,
int cx,
int cy)
Construct a structuring element from a @link{String} of the form produced
by @link{#toString()}.
|
int[] |
size()
Get the size of the structuring element in the form [width, height, x, y]
|
String |
toString() |
public static final StructuringElement BOX
public static final StructuringElement CROSS
public static final StructuringElement HPIT
public StructuringElement()
public StructuringElement(Set<Pixel> positive, Set<Pixel> negative)
positive - the positive pixelsnegative - the negative pixelspublic StructuringElement(Pixel[] positive, Pixel[] negative)
positive - the positive pixelsnegative - the negative pixelspublic int[] size()
public static StructuringElement parseElement(String ele, int cx, int cy)
ele - the string defining the elementcx - the top-left x-coordinatecy - the top-left y-coordinatetoString()public boolean matches(Pixel p, Set<Pixel> pixels)
p - the centrepixels - the pixelspublic int countActive()
public static StructuringElement disk(int radius)
radius - the disk radius