SMIL
1.0.4
|
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.
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... | |
size_t smil::label | ( | const Image< T1 > & | imIn, |
Image< T2 > & | imOut, | ||
const StrElt & | se = DEFAULT_SE |
||
) |
[in] | imIn | : input image |
[out] | imOut | : output image |
[in] | se | : structuring element |
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
[in] | imIn | : input image |
[in] | lambdaVal | : lambda value |
[out] | imOut | : output image |
[in] | se | : structuring element |
size_t smil::fastLabel | ( | const Image< T1 > & | imIn, |
Image< T2 > & | imOut, | ||
const StrElt & | se = DEFAULT_SE |
||
) |
fastLabel() - Image labelization (faster, use OpenMP)
[in] | imIn | : input image |
[out] | imOut | : output image |
[in] | se | : structuring element |
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)
[in] | imIn | : input image |
[in] | lambdaVal | : lambda expression |
[out] | imOut | : output image |
[in] | se | : structuring element |
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.
[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 |
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.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.imIn
and imRegions
are the same. 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
[in] | imIn | : input image |
[out] | imOut | : output image |
[in] | se | : structuring element |
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
[in] | imIn | : input image |
[in] | imLabelIn | : an image with regions defined in imIn |
[out] | imLabelOut | : output image |
[in] | se | : structuring element |
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
[in] | imIn | : input image |
[in] | imLabelIn | : an image with regions defined in imIn |
[out] | imLabelOut | : output image |
[in] | se | : structuring element |
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
[in] | imIn | : input image |
[in] | imLabelIn | : an image with regions defined in imIn |
[out] | imLabelOut | : output image |
[in] | se | : structuring element |
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())
[in] | imIn | : input image |
[out] | imOut | : output image |
[in] | se | : structuring element |