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.

Geodesic distance transform of binary image

`D = bwdistgeodesic(BW,mask)`

`D = bwdistgeodesic(BW,C,R)`

`D = bwdistgeodesic(BW,idx)`

`D = bwdistgeodesic(___,method)`

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.