DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

EuclideanSkeleton

binary skeleton operation

SYNOPSIS

#include "dip_binary.h"

dip_Error dip_EuclideanSkeleton ( in, out, endpixelCondition, edgeCondition )

DATA TYPES

binary

FUNCTION

This function calculates an accurate (euclidean)skeleton. It tests Hilditch conditions to preserve topology. The algorithms uses the following distance metrics:

2D

54-connected neighbor
78-connected neighbor
11neighbors reachable with a knight's move

3D

46-connected neighbors
618-connected neighbors
726-connected neighbors
9neighbors reachable with knight's move
10(2,1,1) neighbors
12(2,2,1) neighbors

The edge parameter specifies whether the border of the image should be treated as object (DIP_TRUE) or as background (DIP_FALSE). See section 9.6, "Morphology-based operations", in Fundamentals of Image Processing for a description of the skeleton operation.

ARGUMENTS

Data typeNameDescription
dip_ImageinBinary input image
dip_ImageoutOutput image
dip_EndpixelConditionendpixelConditionEndpixel condition
dip_BooleanedgeConditionEdge condition

The dip_EndpixelCondition enumeration consists of the following flags:

NameDescription
DIP_ENDPIXEL_CONDITION_LOOSE_ENDS_AWAYLoose ends are eaten away
DIP_ENDPIXEL_CONDITION_NATURAL"natural" endpixel condition of this algorithm
DIP_ENDPIXEL_CONDITION_KEEP_WITH_ONE_NEIGHBORKeep endpoint if it has a neighbor
DIP_ENDPIXEL_CONDITION_KEEP_WITH_TWO_NEIGHBORSKeep endpoint if it has two neighbors
DIP_ENDPIXEL_CONDITION_KEEP_WITH_THREE_NEIGHBORSKeep endpoint if it has three neighbors

KNOWN BUGS

EuclideanSkeleton is only implemented for 2 and 3 D images.

EuclideanSkeleton does not process pixels in a 2-pixel border around the edge. If this is an issue, consider adding 2 pixels on each side of your image.

The function is buggy for 3D images. DIP_ENDPIXEL_CONDITION_LOOSE_ENDS_AWAY and DIP_ENDPIXEL_CONDITION_KEEP_WITH_ONE_NEIGHBOR produce the same result as DIP_ENDPIXEL_CONDITION_KEEP_WITH_THREE_NEIGHBORS. Both DIP_ENDPIXEL_CONDITION_NATURAL and DIP_ENDPIXEL_CONDITION_KEEP_WITH_TWO_NEIGHBORS produce resonable results under most circumstances, but don't count on it!

LITERATURE

"Improved metrics in image processing applied to the Hilditch skeleton", B.J.H. Verwer, 9th ICPR, Rome, November 14-17, 1988.

AUTHOR

Ben Verwer, adapted to DIPlib by Geert van Kempen.

SEE ALSO

BinaryPropagation