distance transform (external)
Usage: dist in.pgm mode out.pgm
Description: Distance to the object X defined by the binary image in.pgm . The result function DX(x) is defined by: DX(x) = min {d(x,y), y in X}.
The distance d used depends on the parameter mode:
- 0: euclidean distance (rounded to the nearest int32)
- 1: approximate quadratic euclidean distance (Danielsson)
- 2: chamfer distance ([5,7] in 2D; [4,5,6] in 3D)
- 3: exact quadratic euclidean distance (int32)
- 4: 4-distance in 2d
- 5: exact euclidean distance (float)
- 8: 8-distance in 2d
- 6: 6-distance in 3d
- 18: 18-distance in 3d
- 26: 26-distance in 3d
- 40: 4-distance in 2d (byte coded ouput)
- 80: 8-distance in 2d (byte coded ouput)
- 60: 6-distance in 3d (byte coded ouput)
- 180: 18-distance in 3d (byte coded ouput)
- 260: 26-distance in 3d (byte coded ouput)
The output out.pgm is of type int32_t for modes < 40, of type byte for other modes.
Types supported: byte 2d, byte 3d
Category: morpho
- Author:
- Michel Couprie, Xavier Daragon