Package inra.ijpb.binary.distmap
Class ChamferMask2DW4
java.lang.Object
inra.ijpb.binary.distmap.ChamferMask2D
inra.ijpb.binary.distmap.ChamferMask2DW4
public class ChamferMask2DW4 extends ChamferMask2D
Implementation of 2D Chamfer mask that manages four types of offsets types.
Weights correspond to the four following vectors:
- d(1,0)
- d(1,1)
- d(2,1)
- d(3,1)
- Author:
- dlegland
-
Nested Class Summary
Nested classes/interfaces inherited from class inra.ijpb.binary.distmap.ChamferMask2D
ChamferMask2D.FloatOffset, ChamferMask2D.ShortOffset
-
Field Summary
Fields inherited from class inra.ijpb.binary.distmap.ChamferMask2D
BORGEFORS, CHESSBOARD, CHESSKNIGHT, CITY_BLOCK, QUASI_EUCLIDEAN, VERWER
-
Constructor Summary
Constructors Constructor Description ChamferMask2DW4(int a, int b, int c, int d)
Creates a new ChamferWeights2DW3 object by specifying the weights associated to orthogonal and diagonal neighbors.ChamferMask2DW4(short[] weights)
Creates a new ChamferMask3D object by specifying the weights associated to orthogonal and diagonal neighbors. -
Method Summary
Modifier and Type Method Description java.util.Collection<ChamferMask2D.ShortOffset>
getBackwardOffsets()
java.util.Collection<ChamferMask2D.ShortOffset>
getForwardOffsets()
short
getShortNormalizationWeight()
Methods inherited from class inra.ijpb.binary.distmap.ChamferMask2D
fromWeights, fromWeights, fromWeights, getBackwardFloatOffsets, getFloatOffsets, getForwardFloatOffsets, getNormalizationWeight, getOffsets
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ChamferMask2DW4
public ChamferMask2DW4(int a, int b, int c, int d)Creates a new ChamferWeights2DW3 object by specifying the weights associated to orthogonal and diagonal neighbors.- Parameters:
a
- the weight associated to orthogonal neighborsb
- the weight associated to diagonal neighborsc
- the weight associated to chess-knight move neighborsd
- the weight associated to (3,1) shift and its permutations
-
ChamferMask2DW4
public ChamferMask2DW4(short[] weights)Creates a new ChamferMask3D object by specifying the weights associated to orthogonal and diagonal neighbors.- Parameters:
weights
- the weights associated to the different types of offset
-
-
Method Details
-
getForwardOffsets
- Specified by:
getForwardOffsets
in classChamferMask2D
- Returns:
- the set of offsets defined by this ChamferMask2D for forward iteration using integer weights.
-
getBackwardOffsets
- Specified by:
getBackwardOffsets
in classChamferMask2D
- Returns:
- the set of offsets defined by this ChamferMask2D for backward iteration using integer weights.
-
getShortNormalizationWeight
public short getShortNormalizationWeight()- Specified by:
getShortNormalizationWeight
in classChamferMask2D
- Returns:
- the weight associated to orthogonal offsets, that can be used to normalize the distance map.
-