public class EuclideanDistanceTransform extends Object implements ImageAnalyser<FImage>
Constructor and Description |
---|
EuclideanDistanceTransform() |
Modifier and Type | Method and Description |
---|---|
void |
analyseImage(FImage image)
Analyse an image.
|
protected static void |
DT1D(float[] f,
float[] d,
int[] v,
int[] l,
float[] z) |
FImage |
getDistances() |
int[][] |
getIndices() |
static void |
main(String[] args)
Test the distance transform
|
static void |
squaredEuclideanDistance(FImage image,
FImage distances,
int[][] indices)
The static function which underlies EuclideanDistanceTransform.
|
static void |
squaredEuclideanDistanceBinary(FImage image,
FImage distances,
int[][] indices)
Calculate the squared euclidean distance transform of a binary image with
foreground pixels set to 1 and background set to 0.
|
public EuclideanDistanceTransform()
public void analyseImage(FImage image)
ImageAnalyser
analyseImage
in interface ImageAnalyser<FImage>
image
- The image to process in place.public FImage getDistances()
public int[][] getIndices()
protected static void DT1D(float[] f, float[] d, int[] v, int[] l, float[] z)
public static void squaredEuclideanDistanceBinary(FImage image, FImage distances, int[][] indices)
image
- the image to be transformed.distances
- the distance of each pixel to the closest 1-pixelindices
- the index of the closes valid pixelpublic static void squaredEuclideanDistance(FImage image, FImage distances, int[][] indices)
image
- the image to be transformed. Each pixel is considered valid except those of value Float.MAX_VALUEdistances
- the distance of each pixel to the closest non-Float.MAX_VALUE pixelindices
- the index of the closes valid pixelpublic static void main(String[] args) throws IOException
args
- IOException