Class ChamferMask2DW3

java.lang.Object
inra.ijpb.binary.distmap.ChamferMask2D
inra.ijpb.binary.distmap.ChamferMask2DW3

public class ChamferMask2DW3
extends ChamferMask2D
Implementation of Chamfer Weights that manages three types of offsets types: orthogonal, diagonal neighbors and "chess-knight move" neighbors. By default, computation is performed using integers.
Author:
dlegland
  • Constructor Details

    • ChamferMask2DW3

      public ChamferMask2DW3​(int a, int b, int c)
      Creates a new ChamferWeights2DW3 object by specifying the weights associated to orthogonal and diagonal neighbors.
      Parameters:
      a - the weight associated to orthogonal neighbors
      b - the weight associated to diagonal neighbors
      c - the weight associated to chess-knight move neighbors
    • ChamferMask2DW3

      public ChamferMask2DW3​(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

      public java.util.Collection<ChamferMask2D.ShortOffset> getForwardOffsets()
      Specified by:
      getForwardOffsets in class ChamferMask2D
      Returns:
      the set of offsets defined by this ChamferMask2D for forward iteration using integer weights.
    • getBackwardOffsets

      public java.util.Collection<ChamferMask2D.ShortOffset> getBackwardOffsets()
      Specified by:
      getBackwardOffsets in class ChamferMask2D
      Returns:
      the set of offsets defined by this ChamferMask2D for backward iteration using integer weights.
    • getShortNormalizationWeight

      public short getShortNormalizationWeight()
      Specified by:
      getShortNormalizationWeight in class ChamferMask2D
      Returns:
      the weight associated to orthogonal offsets, that can be used to normalize the distance map.