Main Content

Geodesic distance transform of binary image

computes the geodesic distance transform, given the binary image
`D`

= bwdistgeodesic(`BW`

,`mask`

)`BW`

and the seed locations specified by
`mask`

. Regions where `BW`

is
`true`

represent valid regions that can be traversed in the
computation of the distance transform. Regions where `BW`

is
`false`

represent constrained regions that cannot be traversed
in the distance computation. For each `true`

pixel in
`BW`

, the geodesic distance transform assigns a number that
is the constrained distance between that pixel and the nearest
`true`

pixel in `mask`

. Output matrix
`D`

contains geodesic distances.

`bwdistgeodesic`

uses the geodesic distance algorithm described in
Soille, P., *Morphological Image Analysis: Principles and Applications, 2nd
Edition*, Secaucus, NJ, Springer-Verlag, 2003, pp. 219–221.