java.lang.Object
imagingbook.common.image.matching.DistanceTransform
Instances of this class calculate an approximate distance transform of a given image which is assumed to be binary (pixel value 0 = background, non-zero = foreground). For the L2 norm, the resulting distances are only an approximation. See Sec. 23.2.2 (Alg. 23.2) of [1] for additional details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Version:
- 2022/09/16
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum type for different distance norms used to calculate distance transforms. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor using the default distance norm (DistanceTransform.DistanceType.L2
).Constructor using the specified distance norm. -
Method Summary
Modifier and TypeMethodDescriptionfloat[][]
Returns the distance map as a 2D float array with the same size as the original image.
-
Constructor Details
-
DistanceTransform
Constructor using the default distance norm (DistanceTransform.DistanceType.L2
).- Parameters:
I
- the input image
-
DistanceTransform
Constructor using the specified distance norm.- Parameters:
I
- the input imagenorm
- the distance norm
-
-
Method Details
-
getDistanceMap
Returns the distance map as a 2D float array with the same size as the original image.- Returns:
- the 2D distance map.
-