public enum ChamferMasks2D extends Enum<ChamferMasks2D>
A pre-defined set of weights that can be used to compute distance transform using chamfer approximations of euclidean metric.
Provides methods to access weight values either as float array or as short array.
Example of use:
ChamferMask2D chamferMask = ChamferMasks2D.BORGEFORS.getMask();
boolean normalize = true;
DistanceTransform dt = new ChamferDistanceTransform2DFloat(chamferMask, normalize);
ImageProcessor result = dt.distanceMap(inputImage);
Enum Constant and Description |
---|
BORGEFORS
Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors,
and 5 for cube-diagonals (best approximation for 3-by-3-by-3 masks).
|
CHESSBOARD
Use weight equal to 1 for all neighbors
|
CHESSKNIGHT
Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors, and
11 for chess-knight moves (best approximation for 5-by-5 masks).
|
CITY_BLOCK
Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors,
and 3 for cube-diagonals.
|
QUASI_EUCLIDEAN
Use floating-point weights 1.0 for orthogonal neighbors and sqrt(2) for
diagonal neighbors, and sqrt(3) for cube-diagonals.
|
VERWER
Chamfer mask in the 7-by-7 neighborhood defined using the four weights
12, 17, 27, and 38.
|
Modifier and Type | Method and Description |
---|---|
static ChamferMasks2D |
fromLabel(String label)
Determines the operation type from its label.
|
static String[] |
getAllLabels() |
ChamferMask2D |
getMask() |
String |
toString() |
static ChamferMasks2D |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ChamferMasks2D[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ChamferMasks2D CHESSBOARD
public static final ChamferMasks2D CITY_BLOCK
public static final ChamferMasks2D QUASI_EUCLIDEAN
public static final ChamferMasks2D BORGEFORS
public static final ChamferMasks2D CHESSKNIGHT
public static final ChamferMasks2D VERWER
public static ChamferMasks2D[] values()
for (ChamferMasks2D c : ChamferMasks2D.values()) System.out.println(c);
public static ChamferMasks2D valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic ChamferMask2D getMask()
public String toString()
toString
in class Enum<ChamferMasks2D>
public static String[] getAllLabels()
public static ChamferMasks2D fromLabel(String label)
label
- the name of a chamfer weightIllegalArgumentException
- if label name is not recognized.Copyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.