RETRO (vipl) functions


LIBRARY ROUTINE

lvdistance - Compute the distance from the nearest boundary point.

LIBRARY CALL

int lvdistance(
    xvimage *image)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) on failure

DESCRIPTION

lvdistance Computes the distance from the nearest boundary point. The distance transform respects the following iterative algorithm : U(m,n) : original image. This image contains only two gray levels, 0 for the background, and any value but 0 for the objects. Uk(i,j) : image after k iterations. U0(m,n) = U(m,n), and for k= 1, 2, 3, ... Uk(m,n)=U0(m,n)+min{Uk-1(i,j);((i,j):dist(m,n;i,j)<=1)},

dist(m,n;i,j) is the distance kbetween ((double)m,(double)n) and (i,j).

dist(i,j-1;i,j) = dist(i,j+1;i,j) =dist(i-1,j;i,j) =dist(i+1,j;i,j) = 1.

dist(i-1,j-1;i,j) = dist(i+1,j-1;i,j) =dist(i-1,j+1;i,j) =dist(i+1,j+1;i,j) = 2.

The transform is completed when k equals the maximum thickness of the region. That is, when Uk+1 equals Uk.

The distance image can be used to extract edges or the medial axis (form of skeleton).

Set of functions that can be used with vdistance: vmedian - Customizes the medial axis from the distance image. vthresh - Generates a binary image.

For this routine, the image must be a byte binary image, with the gray-level value 0 for the background.

It is advisable to use vthresh prior to using vdistance.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

lvdistance works only on BYTE binary images which background value is zero.

MODIFICATION

none

FILES

$RETRO/objects/library/vipl/src/lvdistance.c

SEE ALSO

vipl(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.