[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
Connected Components Labeling | ![]() |
Functions | |
template<... > | |
unsigned int | labelImage (...) |
Find the connected components of a segmented image. More... | |
template<... > | |
unsigned int | labelImageWithBackground (...) |
Find the connected components of a segmented image, excluding the background from labeling. More... | |
template<... > | |
unsigned int | labelMultiArray (...) |
Find the connected components of a MultiArray with arbitrary many dimensions. More... | |
template<... > | |
unsigned int | labelMultiArrayBlockwise (...) |
Connected components labeling for ChunkedArrays. More... | |
template<... > | |
unsigned int | labelMultiArrayWithBackground (...) |
Find the connected components of a MultiArray with arbitrary many dimensions, excluding the background from labeling. More... | |
template<... > | |
unsigned int | labelVolume (...) |
Find the connected components of a segmented volume. More... | |
template<class SrcIterator , class SrcAccessor , class SrcShape , class DestIterator , class DestAccessor > | |
unsigned int | labelVolumeSix (triple< SrcIterator, SrcShape, SrcAccessor > src, pair< DestIterator, DestAccessor > dest) |
Find the connected components of a segmented volume using the 6-neighborhood. More... | |
template<... > | |
unsigned int | labelVolumeWithBackground (...) |
Find the connected components of a segmented volume, excluding the background from labeling. More... | |
template<... > | |
void | regionImageToCrackEdgeImage (...) |
Transform a labeled image into a crack edge (interpixel edge) image. More... | |
template<... > | |
void | regionImageToEdgeImage (...) |
Transform a labeled image into an edge image. More... | |
The 2-dimensional connected components algorithms may use either 4 or 8 connectivity. By means of a functor the merge criterion can be defined arbitrarily.
The 3-dimensional connected components algorithms may use either 6 or 26 connectivity. By means of a functor the merge criterion can be defined arbitrarily.
unsigned int vigra::labelMultiArrayBlockwise | ( | ...) |
Connected components labeling for ChunkedArrays.
Declarations:
The resulting labeling is equivalent to a labeling by labelMultiArray, that is, the connected components are the same but may have different ids. NeighborhoodType and background value (if any) can be specified with the LabelOptions object. If the mapping parameter is provided, each chunk is labeled seperately and contiguously (starting at one, zero for background), with mapping containing a mapping of local labels to global labels for each chunk. Thus, the shape of 'mapping' has to be large enough to hold each chunk coordinate.
Return: the number of regions found (=largest global region label)
Usage:
#include <vigra/blockwise_labeling.hxx>
Namespace: vigra
unsigned int vigra::labelImage | ( | ...) |
Find the connected components of a segmented image.
Connected components are defined as regions with uniform pixel values. Thus, T1
either must be equality comparable, or a suitable EqualityFunctor must be provided that realizes the desired predicate. The destination's value type T2
should be large enough to hold the labels without overflow. Region numbers will be a consecutive sequence starting with one and ending with the region number returned by the function (inclusive). The parameter 'eight_neighbors
' determines whether the regions should be 4-connected (false) or 8-connected (true).
Return: the number of regions found (= largest region label)
See labelMultiArray() for a dimension-independent implementation of connected components labelling.
Declarations:
pass 2D array views:
Usage:
#include <vigra/labelimage.hxx>
Namespace: vigra
unsigned int vigra::labelImageWithBackground | ( | ...) |
Find the connected components of a segmented image, excluding the background from labeling.
This function works like labelImage(), but considers all background pixels (i.e. pixels having the given 'background_value
') as a single region that is ignored when determining connected components and remains untouched in the destination image. Usually, you will zero-initialize the output image, so that the background gets label 0 (remember that actual region labels start at one).
Return: the number of non-background regions found (= largest region label)
See labelMultiArrayWithBackground() for a dimension-independent implementation if this algorithm.
Declarations:
pass 2D array views:
Usage:
#include <vigra/labelimage.hxx>
Namespace: vigra
void vigra::regionImageToCrackEdgeImage | ( | ...) |
Transform a labeled image into a crack edge (interpixel edge) image.
Declarations:
pass 2D array views:
This algorithm inserts border pixels (so called "crack edges" or "interpixel edges") between regions in a labeled image like this (a
and c
are the original labels, and 0
is the value of edge_marker
and denotes the inserted edges):
The algorithm assumes that the original labeled image contains no background. Therefore, it is suitable as a post-processing operation of labelImage() or seededRegionGrowing().
The destination image must be twice the size of the original (precisely, (2*w-1)
by (2*h-1)
pixels). The source value type (SrcAccessor::value-type
) must be equality-comparable.
Usage:
#include <vigra/labelimage.hxx>
Namespace: vigra
Preconditions:
The destination image must have twice the size of the source:
void vigra::regionImageToEdgeImage | ( | ...) |
Transform a labeled image into an edge image.
Declarations:
pass 2D array views:
This algorithm marks all pixels with the given edge_marker
which belong to a different region (label) than their right or lower neighbors:
The non-edge pixels of the destination image will not be touched. The source value type T1
must be equality-comparable.
Usage:
#include <vigra/labelimage.hxx>
Namespace: vigra
unsigned int vigra::labelVolume | ( | ...) |
Find the connected components of a segmented volume.
Connected components are defined as regions with uniform voxel values. Thus, T1
either must be equality comparable, or an EqualityFunctor must be provided explicitly that realizes the desired equivalence predicate. The destination's value type T2
should be large enough to hold the labels without overflow. Region numbers will be a consecutive sequence starting with one and ending with the region number returned by the function (inclusive).
Return: the number of regions found (= largest region label)
See labelMultiArray() for a dimension-independent implementation of connected components labelling.
Declarations:
pass 3D array views:
Usage:
#include <vigra/labelvolume.hxx>
Namespace: vigra
unsigned int vigra::labelVolumeSix | ( | triple< SrcIterator, SrcShape, SrcAccessor > | src, |
pair< DestIterator, DestAccessor > | dest | ||
) |
Find the connected components of a segmented volume using the 6-neighborhood.
See labelVolume() for detailed documentation.
unsigned int vigra::labelVolumeWithBackground | ( | ...) |
Find the connected components of a segmented volume, excluding the background from labeling.
This function works like labelVolume(), but considers all background voxels (i.e. voxels having the given 'background_value
') as a single region that is ignored when determining connected components and remains untouched in the destination array. Usually, you will zero-initialize the output array, so that the background gets label 0 (remember that actual region labels start at one).
Return: the number of regions found (= largest region label)
See labelMultiArrayWithBackground() for a dimension-independent implementation if this algorithm.
Declarations:
pass 3D array views:
Usage:
#include <vigra/labelvolume.hxx>
Namespace: vigra
unsigned int vigra::labelMultiArray | ( | ...) |
Find the connected components of a MultiArray with arbitrary many dimensions.
Declaration:
Connected components are defined as regions with uniform values. Thus, the value type T
of the input array data either must be equality comparable, or an EqualityFunctor must be provided that realizes the desired predicate. The destination array's value type Label
should be large enough to hold the labels without overflow. Region numbers will form a consecutive sequence starting at one and ending with the region number returned by the function (inclusive).
Argument neighborhood specifies the type of connectivity used. It can take the values DirectNeighborhood
(which corresponds to 4-neighborhood in 2D and 6-neighborhood in 3D, default) or IndirectNeighborhood
(which corresponds to 8-neighborhood in 2D and 26-neighborhood in 3D).
Return: the number of regions found (= highest region label, because labeling starts at 1)
Usage:
#include <vigra/multi_labeling.hxx>
Namespace: vigra
Required Interface:
unsigned int vigra::labelMultiArrayWithBackground | ( | ...) |
Find the connected components of a MultiArray with arbitrary many dimensions, excluding the background from labeling.
Declaration:
This function is the same as labelMultiArray(), except for the additional parameter backgroundValue. Points in the input array data with this value (which default to zero) are ignored during labeling, and their output label is automatically set to zero. Region numbers will be a consecutive sequence starting at zero (when background was present) or at one (when no background was present) and ending with the region number returned by the function (inclusive).
Return: the number of non-background regions found (= highest region label, because background has label 0)
Usage:
#include <vigra/multi_labeling.hxx>
Namespace: vigra
Required Interface:
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|