lvmediaxis(3)

LIBRARY ROUTINE
lvmediaxis - Computes the medial axis transform

LIBRARY CALL
#include "vinclude.h"
int
lvmediaxis(image,wflag)
struct xvimage *image;
int wflag;

INPUT

    image _ an xvimage structure.
    wflag _ logical integer. if TRUE the median axis pixel values is 255, if FALSE the value is the shortest distance to the region outline itself. will

OUTPUT

    image _ holds the result median axis image.

MODIFICATIONS
Ghosted by Pascal ADAM - Mon Jun 4 09:22:26 MDT 1990 Modification of description in lvmediaxis(3) and vmediaxis(1)

DESCRIPTION
lvmediaxis computes the medial axis transform on a byte binary image.

The median axis of a region in a binary image is the set of pixels whose minimum distance from the edge is a local maximum. It is a thinning algorithm that is comparable to the morphological skeletonization. The median axis is generally not connected.

An optional flag allows the user to obtain the medial axis pixel values set either to their distance from the border, or to 255. If the flag is set to one, it leads to a better visualization of the median axis but the information that permits the user to reconstruct the original binary image is lost.
If the flag is not set to 1, it is possible to reconstruct the original image from the medial axis.

Presentation of the MEDIAL AXIS TRANSFORM algorithm :

U(m,n) : original image. This image must be a two-valued byte image, 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)=U(m,n)+min{U0(i,j);((i,j):dist(m,n;i,j)<= 1)},
where:

    dist(m,n;i,j) is the mediaxis 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 last part consists of using this image and of keeping only the pixels that are locally maximum in the 4 neighborhod.
The MEDIAL AXIS IMAGE is a form of SKELETONIZATION.

    SET OF FUNCTIONS that can be useful when using vmediaxis:

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, so it is advisable to use vthresh on the image before using vmediaxis.

SEE ALSO
vmediaxis(1), intro(3), vipl(3), verror(3), vutils(3) vthresh(1), lvthresh(1).

RESTRICTIONS
vmediaxis works only on Byte binary images where the background is set to zero.

AUTHOR
Pascal ADAM

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