Package inra.ijpb.binary.distmap
Interface DistanceTransform
- All Superinterfaces:
Algo
- All Known Subinterfaces:
ChamferDistanceTransform2D
- All Known Implementing Classes:
ChamferDistanceTransform2DFloat
,ChamferDistanceTransform2DShort
,DistanceTransform3x3Float
,DistanceTransform3x3Short
,DistanceTransform5x5Float
,DistanceTransform5x5Short
public interface DistanceTransform extends Algo
Interface for computing distance maps from binary images.
Example of use:
short[] shortWeights = ChamferWeights.CHESSKNIGHT.getShortWeights();
boolean normalize = true;
DistanceTransform dt = new DistanceTransform5x5Short(shortWeights, normalize);
ImageProcessor result = dt.distanceMap(inputImage);
// or:
ImagePlus resultPlus = BinaryImages.distanceMap(imagePlus, shortWeights, normalize);
-
Method Summary
Modifier and Type Method Description ij.process.ImageProcessor
distanceMap(ij.process.ImageProcessor image)
Computes the distance map from a binary image processor.Methods inherited from interface inra.ijpb.algo.Algo
addAlgoListener, removeAlgoListener
-
Method Details
-
distanceMap
ij.process.ImageProcessor distanceMap(ij.process.ImageProcessor image)Computes the distance map from a binary image processor. Distance is computed for each foreground (white) pixel, as the chamfer distance to the nearest background (black) pixel.- Parameters:
image
- a binary image with white pixels (255) as foreground- Returns:
- a new image containing:
- 0 for each background pixel
- the distance to the nearest background pixel otherwise
-