Package inra.ijpb.morphology.strel
Class ChamferStrel
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
inra.ijpb.morphology.strel.AbstractStrel
inra.ijpb.morphology.strel.ChamferStrel
public class ChamferStrel extends AbstractStrel
Disk-shaped structuring element based on a chamfer mask and a radius.
- Author:
- dlegland
-
Nested Class Summary
Nested classes/interfaces inherited from interface inra.ijpb.morphology.Strel
Strel.Shape
Nested classes/interfaces inherited from interface inra.ijpb.morphology.Strel3D
Strel3D.Shape
-
Field Summary
Fields inherited from interface inra.ijpb.morphology.Strel
BACKGROUND, FOREGROUND
Fields inherited from interface inra.ijpb.morphology.Strel3D
BACKGROUND, FOREGROUND
-
Constructor Summary
Constructors Constructor Description ChamferStrel(ChamferMask2D chamferMask, double radius)
Creates a new ChamferStrel from a chamfer mask (used for computing distances) and a radius (used to computing the extent of propagation). -
Method Summary
Modifier and Type Method Description int[][]
getMask()
Returns the structuring element as a mask.int[]
getOffset()
Returns the offset in the mask.int[][]
getShifts()
Returns the structuring element as a set of shifts.int[]
getSize()
Returns the size of the structuring element, as an array of size in each direction.Strel
reverse()
Returns a reversed (i.e. symmetric wrt the origin) version of this structuring element.Methods inherited from class inra.ijpb.morphology.strel.AbstractStrel
addBorder, closing, closing, cropBorder, dilation, dilation, erosion, erosion, getChannelName, getMask3D, getShifts3D, opening, opening, setChannelName
Methods inherited from class inra.ijpb.morphology.strel.AbstractStrel3D
addBorder, cropBorder, showProgress, showProgress
Methods inherited from class inra.ijpb.algo.AlgoStub
addAlgoListener, removeAlgoListener
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface inra.ijpb.algo.Algo
addAlgoListener, removeAlgoListener
Methods inherited from interface inra.ijpb.morphology.Strel3D
showProgress, showProgress
-
Constructor Details
-
ChamferStrel
Creates a new ChamferStrel from a chamfer mask (used for computing distances) and a radius (used to computing the extent of propagation).- Parameters:
chamferMask
- the chamfer maskradius
- the radius
-
-
Method Details
-
getSize
public int[] getSize()Description copied from interface:Strel
Returns the size of the structuring element, as an array of size in each direction. The first index corresponds to the number of pixels in the x direction.- Returns:
- the size of the structuring element
-
getMask
public int[][] getMask()Description copied from interface:Strel
Returns the structuring element as a mask. Each value is either 0 or 255. The first index corresponds to the y position, and the second index to the x direction.- Returns:
- the mask of the structuring element
-
getOffset
public int[] getOffset()Description copied from interface:Strel
Returns the offset in the mask. The first value corresponds to the shift in the x direction.- Returns:
- the offset in the mask
-
getShifts
public int[][] getShifts()Description copied from interface:Strel
Returns the structuring element as a set of shifts. The size of the result is N-by-2, where N is the number of elements of the structuring element. The first value corresponds to the shift in the x direction.- Returns:
- a set of shifts
-
reverse
Description copied from interface:Strel
Returns a reversed (i.e. symmetric wrt the origin) version of this structuring element. Implementations can return more specialized type depending on the implemented interfaces.- Returns:
- the reversed structuring element
-