Package inra.ijpb.binary.distmap
Enum ChamferMasks2D
java.lang.Object
java.lang.Enum<ChamferMasks2D>
inra.ijpb.binary.distmap.ChamferMasks2D
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ChamferMasks2D>
,java.lang.constant.Constable
public enum ChamferMasks2D extends java.lang.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);
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant 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 neighborsCHESSKNIGHT
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. -
Method Summary
Modifier and Type Method Description static ChamferMasks2D
fromLabel(java.lang.String label)
Determines the operation type from its label.static java.lang.String[]
getAllLabels()
ChamferMask2D
getMask()
java.lang.String
toString()
static ChamferMasks2D
valueOf(java.lang.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.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Enum Constant Details
-
CHESSBOARD
Use weight equal to 1 for all neighbors -
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. Use 10, 14 and 17 for the 16-bits integer version. -
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). -
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). -
VERWER
Chamfer mask in the 7-by-7 neighborhood defined using the four weights 12, 17, 27, and 38.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getMask
- Returns:
- the chamfer mask associated to this enumeration entry
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Enum<ChamferMasks2D>
-
getAllLabels
public static java.lang.String[] getAllLabels()- Returns:
- the array of labels for this enumeration
-
fromLabel
Determines the operation type from its label.- Parameters:
label
- the name of a chamfer weight- Returns:
- the ChamferMasks2D enum corresponding to the given name
- Throws:
java.lang.IllegalArgumentException
- if label name is not recognized.
-