Pink 0.9

skelsurf.c File Reference

surfacic binary skeleton guided by a priority image More...


Detailed Description

surfacic binary skeleton guided by a priority image

Usage: skelsurf in.pgm prio connex [inhibit] out.pgm

Description: Surfacic binary skeleton guided by a priority image. The lowest values of the priority image correspond to the highest priority.

The parameter prio is either an image (byte or int32_t), or a numerical code indicating that a distance map will be used as a priority image; the possible choices are:

The parameter connex indicates the connectivity of the binary object. Possible choices are 6, 26.

If the parameter inhibit is given and is a binary image name, then the points of this image will be left unchanged.

Let X be the set corresponding to the input image in.pgm. Let P be the function corresponding to the priority image. Let I be the set corresponding to the inhibit image, if given, or the empty set otherwise. The algorithm is the following:

C = {y in F | Tb(y) > 1}
Repeat until stability
  choose a point x in X, simple for X, such that C[x] == 0 
    and such that P[x] is minimal
  X = X \ {x}
  for all y in gamma(x)
    if Tb(y) > 1 then C[y] = 1
Result: X

where Tb(y) refers to the second connectivity number of y, that is, (informally) the number of connected components of gamma(y) inter complement(X).

References:
[BC07] G. Bertrand and M. Couprie: "Transformations topologiques discretes", in Géométrie discrète et images numériques, D. Coeurjolly and A. Montanvert and J.M. Chassery, pp. 187-209, Hermès, 2007.

Types supported: byte 3d

Category: topobin

Author:
Michel Couprie