**1 Answer**

written 20 months ago by | • modified 20 months ago |

**Solution:**

**Distance Transforms:-**

Distance transforms are required in image processing projects where measurements have to be made.

The distance transform provides a measure of the separation of points in an image.

**(1) Eadidian Distance:-**

It is the straight line distance between two pixels. If p and q are the two pieces with coordinates $\left(x, y_1\right)$ and $\left(x_2, y_2\right)$ then,

$ D_E=\left[\left(x_1-x_2\right)^2+\left(y_1-y_2\right)^2\right]^{1 / 2} $

**(2) City Block Distance:-**

For the same points $p\left(x_1, y_1\right)$ and $q\left(x_2, y_2\right)$ the city block distance is defined as,

$ D_{\text {CIT } Y}(p, q)=D_4(p, q)=\left|x_1-x_2\right|+\left|y_1-y_2\right| $

The city block distance measures the path between the pixels based on a 4 connected

pixels whose edges touch are I unit apart and pixels touching diagonally are 2 units apart.

**(3) Chess Board Distance (Do Distance):**

For the pixels $P\left(x, y_1\right)$ and $q\left(x_2 y_2\right)$ the chess board distance is defined as,

$ \text { DCHESS }(p, q)=D_8(p, q)=\max \left(\left|x_1-x_2\right|,\left|y_1-y_2\right|\right)\\ $

The chessboard distance measures the path between the pixels based on an 8-connected neighborhood. Pixels whose edges or corners touch are I unit apart.

**(4) Dm Distance (m- adagency Distance ) :-**

This distance measure is based on m-adjacency. pixels p and q are m-adjacent if.

a) q is in $N_4(p)$ or

b) q is in $N_0(p)$ and $N_4(p) \cap N_4(q)$ is empty.