Grayweighted distance transform of grayscale image
T = graydist(A,mask)
T = graydist(A,C,R)
T = graydist(A,ind)
T = graydist(...,method)
computes
the grayweighted distance transform of the grayscale image T
= graydist(A
,mask
)A
.
Locations where mask
is true
are
seed locations.
uses
vectors T
= graydist(A
,C,R
)C
and R
to specify the
row and column coordinates of seed locations.
specifies
the linear indices of seed locations using the vector T
= graydist(A
,ind
)ind
.
specifies
an alternate distance metric. T
= graydist(...,method
)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.

Grayscale image.  

Logical image the same size as  

Numeric vectors that contain the positive integer row and column
coordinates of the seed locations. Coordinate values are valid  

Numeric vector of positive integer, linear indices of seed locations.  

Type of distance metric.
Default: 

Array the same size as 
A
can be numeric or logical, and it must
be nonsparse. mask
is a logical array of the same
size as A
. C
, R
,
and ind
are numeric vectors that contain positive
integer values.
The output T
is an array of the same size
as A
. If the input numeric type of A
is double
,
the output T
is double
. If the
input is any other numeric type, the output T
is single
.
graydist
uses the geodesic time algorithm
described in Soille, P., Generalized geodesy via geodesic
time,, Pattern Recognition Letters, vol.15, December 1994;
pp. 1235–1240
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}^{l1}f\left({p}_{i}\right)}$$