public class ChamferDistanceTransform2DShort extends AlgoStub implements ChamferDistanceTransform2D
Example of use:
ChamferMask2D mask = ChamferMask2D.BORGEFORS();
boolean normalize = true;
DistanceTransform dt = new ChamferDistanceTransform2DShort(mask, normalize);
ImageProcessor result = dt.distanceMap(inputImage);
ChamferDistanceTransform2DFloat
,
ChamferDistanceTransform2DShort
Constructor and Description |
---|
ChamferDistanceTransform2DShort(ChamferMask2D mask)
Creates a new algorithm for computing distance maps based on a chamfer
mask.
|
ChamferDistanceTransform2DShort(ChamferMask2D mask,
boolean normalize)
Creates a new algorithm for computing distance maps based on a chamfer
mask.
|
Modifier and Type | Method and Description |
---|---|
ij.process.ShortProcessor |
distanceMap(ij.process.ImageProcessor binaryImage)
Computes the distance map of the distance to the nearest background
pixel.
|
ChamferMask2D |
mask()
Return the chamfer mask used by this distance transform algorithm.
|
addAlgoListener, fireProgressChanged, fireProgressChanged, fireStatusChanged, fireStatusChanged, removeAlgoListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAlgoListener, removeAlgoListener
public ChamferDistanceTransform2DShort(ChamferMask2D mask)
mask
- the chamfer mask to use for propagating distancespublic ChamferDistanceTransform2DShort(ChamferMask2D mask, boolean normalize)
mask
- the chamfer mask to use for propagating distancesnormalize
- whether distance map should be normalized by the weight
associated to orthogonal shiftspublic ChamferMask2D mask()
ChamferDistanceTransform2D
mask
in interface ChamferDistanceTransform2D
public ij.process.ShortProcessor distanceMap(ij.process.ImageProcessor binaryImage)
ShortProcessor
the same size as the input, with values greater or equal to zero.distanceMap
in interface DistanceTransform
binaryImage
- a binary image with black pixels (0) as backgroundCopyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.