WOLFRAM|DEMONSTRATIONS PROJECT

Distance Transforms

​
distance function
Manhattan
squared Euclidean
Chebyshev
4
3
2
3
4
5
6
7
8
3
2
1
2
3
4
5
6
7
2
1
0
1
2
3
4
5
6
3
2
1
2
3
3
4
5
6
4
3
2
3
3
2
3
4
5
5
4
3
3
2
1
2
3
4
5
4
3
2
1
0
1
2
3
6
5
4
3
2
1
2
3
4
7
6
5
4
3
2
3
4
5
Clicking a square on the grid turns the square "on" (yellow) or "off" (gray). The numbers on each square represent the distance from that square to the nearest "on" square. These transforms are used in digital image processing.