Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Gray-weighted distance transform of grayscale image

`T = graydist(I,mask)`

`T = graydist(I,C,R)`

`T = graydist(I,ind)`

`T = graydist(___,method)`

`graydist`

uses the geodesic time algorithm [1]. The basic equation for geodesic
time along a path is:

$${\tau}_{f}\left(P\right)=\frac{f\left({p}_{o}\right)}{2}+\frac{f\left({p}_{l}\right)}{2}+{\displaystyle \sum _{i=1}^{l-1}f\left({p}_{i}\right)}$$

`method`

determines the chamfer weights that are assigned to the local
neighborhood during outward propagation. Each pixel's contribution to the geodesic time is
based on the chamfer weight in a particular direction multiplied by the pixel
intensity.

[1] Soille, P. "Generalized geodesy
via geodesic time." *Pattern Recognition Letters*. Vol.15, December 1994,
pp. 1235–1240.