SMIL  1.0.4

Detailed Description

The connected component labelling of a binary image is a transformation directly associated with the notion of connectivity. It consists in setting each pixel belonging to a connected component of the input binary image to a specific grey level value, different values being considered for each connected component (the background components are usually not processed and they keep their original value, i.e., zero). The resulting image is called a label image.

The notion of labelling extends directly to grey scale image. In this latter case, a distinct label is given to each grey scale connected component (flat zone) of the image.

See also
  • [17] P. Soille, Morphological Image Analysis, 2003, p. 35-38
+ Collaboration diagram for Labelling:

Functions

template<class T1 , class T2 >
size_t label (const Image< T1 > &imIn, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
 label() - Image labelization More...
 
template<class T1 , class T2 >
size_t lambdaLabel (const Image< T1 > &imIn, const T1 &lambdaVal, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
 lambdaLabel() - Lambda-flat zones labelization More...
 
template<class T1 , class T2 >
size_t fastLabel (const Image< T1 > &imIn, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
 fastLabel() - Image labelization (faster, use OpenMP) More...
 
template<class T1 , class T2 >
size_t lambdaFastLabel (const Image< T1 > &imIn, const T1 &lambdaVal, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
 lambdaFastLabel() - Lambda-flat zones labelization (faster, use OpenMP) More...
 
template<typename T1 , typename T2 , typename T3 >
size_t labelWithProperty (const Image< T1 > &imRegions, const Image< T2 > &imIn, Image< T3 > &imLabelOut, const string property="area", bool doRescale=false, double scale=1., const StrElt &se=DEFAULT_SE)
 labelWithProperty() - Image labelization with the value of the property of each connected components in the imRegions image. More...
 
template<class T1 , class T2 >
size_t labelWithArea (const Image< T1 > &imIn, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
 labelWithArea() - Image labelization with the size (area) of each connected components More...
 
template<class T1 , class T2 >
size_t labelWithVolume (const Image< T1 > &imIn, const Image< T2 > &imLabelIn, Image< T2 > &imLabelOut, const StrElt &se=DEFAULT_SE)
 labelWithVolume() - Image labelization with the volume (sum of values) of each connected components in the imLabelIn image More...
 
template<class T1 , class T2 >
size_t labelWithMax (const Image< T1 > &imIn, const Image< T2 > &imLabelIn, Image< T2 > &imLabelOut, const StrElt &se=DEFAULT_SE)
 labelwithMax() - Image labelization with the maximum values of each connected components in the imLabelIn image More...
 
template<class T1 , class T2 >
size_t labelWithMean (const Image< T1 > &imIn, const Image< T2 > &imLabelIn, Image< T1 > &imLabelOut, const StrElt &se=DEFAULT_SE)
 labelWithMean() - Image labelization with the mean values of each connected components in the imLabelIn image More...
 
template<class T1 , class T2 >
RES_T neighbors (const Image< T1 > &imIn, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
 neighbors() - Neighbors count More...
 

Function Documentation

◆ label()

size_t smil::label ( const Image< T1 > &  imIn,
Image< T2 > &  imOut,
const StrElt se = DEFAULT_SE 
)

label() - Image labelization

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Note
The range of type T2 of the output image shall be big enough to accomodate all label values (the number of disjoint regions in the input image.

◆ lambdaLabel()

size_t smil::lambdaLabel ( const Image< T1 > &  imIn,
const T1 &  lambdaVal,
Image< T2 > &  imOut,
const StrElt se = DEFAULT_SE 
)

lambdaLabel() - Lambda-flat zones labelization

In this mode of labeling, two neighbour pixels have the same label if there are a path between them at which the value difference from pixel to pixel doesn't exceed lambdaVal

Parameters
[in]imIn: input image
[in]lambdaVal: lambda value
[out]imOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Note
shall include an example of how to use this...

◆ fastLabel()

size_t smil::fastLabel ( const Image< T1 > &  imIn,
Image< T2 > &  imOut,
const StrElt se = DEFAULT_SE 
)

fastLabel() - Image labelization (faster, use OpenMP)

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)

◆ lambdaFastLabel()

size_t smil::lambdaFastLabel ( const Image< T1 > &  imIn,
const T1 &  lambdaVal,
Image< T2 > &  imOut,
const StrElt se = DEFAULT_SE 
)

lambdaFastLabel() - Lambda-flat zones labelization (faster, use OpenMP)

Parameters
[in]imIn: input image
[in]lambdaVal: lambda expression
[out]imOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Note
shall include an example of how to use this...

◆ labelWithProperty()

size_t smil::labelWithProperty ( const Image< T1 > &  imRegions,
const Image< T2 > &  imIn,
Image< T3 > &  imLabelOut,
const string  property = "area",
bool  doRescale = false,
double  scale = 1.,
const StrElt se = DEFAULT_SE 
)

labelWithProperty() - Image labelization with the value of the property of each connected components in the imRegions image.

The intensity of each pixel will correspond to the value of the property.

Parameters
[in]imRegions: an image with regions to be labeled
[in]imIn: image where to take values to evaluate properties
[out]imLabelOut: output image
[in]property: the property to use as label. One of : "area", "volume", "max", "min", "mean", "stddev", "median", "mode", "nbvalues", "entropy"
[in]doRescale: values are rescaled to fullfit the range of the output image (T3) : ([min, max] => [1, max(T3)])
[in]scale: coefficient to multiply property result of each region
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Note
  • The image imRegions is labeled and blobs are assigned to it before evaluating the property of each region. The structuring element is needed just to the labeling operation.
  • The same label can be assigned to different regions not connected regions in the image if they have the same property value.
  • the number of regions in imRegions shall be smaller than the maximum value of the type T3
  • The range of values of the output image (T3) shall be big enough to accomodate all property values. If not, use parametersTT} or doRescale
  • scale and doRescale parameters are useful for visualisation purposes or when the goal isn't the real value of the property but their relative values (order of values). These parameters allows to use image with smaller data types. scale is ignored when doRescale is set.
  • if the property is area then imIn and imRegions are the same.

◆ labelWithArea()

size_t smil::labelWithArea ( const Image< T1 > &  imIn,
Image< T2 > &  imOut,
const StrElt se = DEFAULT_SE 
)

labelWithArea() - Image labelization with the size (area) of each connected components

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Warning
This function is obsolete. Use labelWithProperty() :
labelWithProperty(imIn, imIn, imOut, "area", false, 1., se);
size_t labelWithProperty(const Image< T1 > &imRegions, const Image< T2 > &imIn, Image< T3 > &imLabelOut, const string property="area", bool doRescale=false, double scale=1., const StrElt &se=DEFAULT_SE)
labelWithProperty() - Image labelization with the value of the property of each connected components ...
Definition: DMorphoLabel.hpp:737
Note
  • The range of values of the output image (T2) shall be big enough to accomodate all label values.
  • The same value can be assigned to different disconnected regions in the image if they have the same area.

◆ labelWithVolume()

size_t smil::labelWithVolume ( const Image< T1 > &  imIn,
const Image< T2 > &  imLabelIn,
Image< T2 > &  imLabelOut,
const StrElt se = DEFAULT_SE 
)

labelWithVolume() - Image labelization with the volume (sum of values) of each connected components in the imLabelIn image

Parameters
[in]imIn: input image
[in]imLabelIn: an image with regions defined in imIn
[out]imLabelOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Warning
This function is obsolete. Use labelWithProperty()
labelWithProperty(imLabelIn, imIn, imLabelOut, "volume", false, 1., se);
Note
  • The range of values of the output image (T2) shall be big enough to accomodate all label values.
  • The same value can be assigned to different disconnected regions in the image if they have the same volume.

◆ labelWithMax()

size_t smil::labelWithMax ( const Image< T1 > &  imIn,
const Image< T2 > &  imLabelIn,
Image< T2 > &  imLabelOut,
const StrElt se = DEFAULT_SE 
)

labelwithMax() - Image labelization with the maximum values of each connected components in the imLabelIn image

Parameters
[in]imIn: input image
[in]imLabelIn: an image with regions defined in imIn
[out]imLabelOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Warning
This function is obsolete. Use labelWithProperty()
labelWithProperty(imLabelIn, imIn, imLabelOut, "max", false, 1., se);
Note
  • The range of values of the output image (T2) shall be big enough to accomodate all label values.
  • The same value can be assigned to different disconnected regions in the image if they have the maximum value.

◆ labelWithMean()

size_t smil::labelWithMean ( const Image< T1 > &  imIn,
const Image< T2 > &  imLabelIn,
Image< T1 > &  imLabelOut,
const StrElt se = DEFAULT_SE 
)

labelWithMean() - Image labelization with the mean values of each connected components in the imLabelIn image

Parameters
[in]imIn: input image
[in]imLabelIn: an image with regions defined in imIn
[out]imLabelOut: output image
[in]se: structuring element
Returns
the number of labels (or 0 if error)
Warning
This function is obsolete. Use labelWithProperty()
labelWithProperty(imLabelIn, imIn, imLabelOut, "mean", false, 1., se);
Note
  • The range of values of the output image (T2) shall be big enough to accomodate all label values.
  • The same label can be assigned to different regions not connected regions in the image if they have the same mean value.

◆ neighbors()

RES_T smil::neighbors ( const Image< T1 > &  imIn,
Image< T2 > &  imOut,
const StrElt se = DEFAULT_SE 
)

neighbors() - Neighbors count

Return for each pixel the number of different values in the neighborhood.

Usefull in order to find interfaces or multiple points between basins (see basins())

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element