vdistance(1)

PROGRAM
vdistance - Computes the distance from the boundary in a two_valued byte image.

SYNTAX

vdistance

-i  input image

-o  output image

[-V]
    Gives the version for vdistance

[-U]
    Gives the usage for vdistance

[-P]
    Prompts for command line options

[-A [file1]]
    Creates the answer file called vdistance.ans or file1

[-a [file1]]
    Uses vdistance.ans or file1 as the answer file

DESCRIPTION
vdistance Computes the distance from the nearest boundary point.

The distance transform uses the following iterative algorithm :

U(m,n) : original image. This image contains only two gray levels, 0 for the background, and any other value 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 between (m,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.

ADVICE: 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.

REQUIRED ARGUMENTS

-i  type: infile
    desc: input image

-o  type: outfile
    desc: output image

OPTIONAL ARGUMENTS
none

EXAMPLES

vdistance -i image1 -o image2
Computes the distance from the nearest boundary point.
For this routine, the image has to be a byte binary image, with the gray-level value 0 for the background. So it is strongly advisable to use vthresh previously to vdistance.

SEE ALSO
intro(1), verror(3), vgparms(3), vutils(3), lvdistance(3) lvthresh(3), vthresh(1).

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

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.