Foundation (CVFoundation.dll) 14.0
Image Segmentation Functions

Functions

cvbres_t LabelMarker (IMG ImgMarker, cvbval_t MinLabel, cvbval_t MaxLabel, TSegmentationNorm Norm, cvbdim_t &NumLabels, IMG &ImgLabelled)
 This method labels markers in the source image ImgMarker with different integer values. More...
 
cvbres_t SegmentGradient (IMG ImgIn, TSegmentationNorm Norm, TSegmentationBorder Border, IMG ImgMarker, cvbdim_t Threshold, IMG &ImgOut)
 This method performs segmentation by region growing to the least gradient direction. More...
 
cvbres_t SegmentWatershed (IMG ImgIn, TWatershedNorm Norm, TWatershedSegmentation Segmentation, TSegmentationBorder Border, IMG ImgMarker, cvbdim_t Threshold, IMG &ImgOut)
 This method performs watershed segmentation with markers. More...
 

Detailed Description

Function Documentation

◆ LabelMarker()

cvbres_t LabelMarker ( IMG  ImgMarker,
cvbval_t  MinLabel,
cvbval_t  MaxLabel,
TSegmentationNorm  Norm,
cvbdim_t &  NumLabels,
IMG ImgLabelled 
)

This method labels markers in the source image ImgMarker with different integer values.

Each connected set of non-zero image pixels is treated as a separate marker. All pixels belonging to the same marker are set to the same value from the interval [MinLabel, MaxLabel]. Two markers can be labelled with the same value if the number of connected components exceeds MinLabel - MaxLabel + 1.

Note
This functions works with 8-bit and 16-bit images.
Attention
Images with more than 1 plane will be split for computation in single plane images. All image planes are treated independently to each other.
Parameters
[in]ImgMarkerHandle of input image to be labelled.
[in]MinLabelMinimum value of the marker label (0 < MinLabel <= MaxLabel).
[in]MaxLabelMaximum value of the marker label (MinLabel <= MaxLabel < 255 for 8-bit markers, and MinLabel <= MaxLabel < 65535 for 16-bit markers). values see #TWatershedSegmentation.
[in]NormNorm to form the mask for marker propagation. Either 4- or 8-connectivity can be used depending on the norm type. See #TSegmentationNorm for possible values.
[out]NumLabelsNumber of labelled regions.
[out]ImgLabelledImage handle of labelled image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
#TSegmentationNorm, SegmentWatershed

◆ SegmentGradient()

cvbres_t SegmentGradient ( IMG  ImgIn,
TSegmentationNorm  Norm,
TSegmentationBorder  Border,
IMG  ImgMarker,
cvbdim_t  Threshold,
IMG ImgOut 
)

This method performs segmentation by region growing to the least gradient direction.

This function performs image segmentation by region growing with markers. Non-zero pixels of ImgMarker belong to initial image regions. Marker values propagate through the whole image in the direction of the least value of the absolute value of the image gradient.

Image segments are formed by groups of connected ImgMarker pixels with the same value.

Note
This function works only with 8-bit images.
Attention
For 3-channel image the gradient is calculated as the maximum of channel gradients.
Parameters
[in]ImgInHandle of input image to be segmented.
[in]NormControls the marker propagation connectivity. See #TSegmentationNorm for possible values.
[in]BorderBorder to be applied to the segments. See #TSegmentationBorder for possible values.
Note: The pixels between image segments are marked with the value 254. The maximum possible value (255) is used internally and can not used to mark segments.
[in]ImgMarkerMarker image which is needed to perform gradient segmentation. If NULL is specified, the marker image is created automatically using morphological reconstruction.
[in]ThresholdThreshold which is applied for marker creation. This value is only used if ImgMarker is NULL.
[out]ImgOutImage handle of segmented image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
#TSegmentationNorm, #TSegmentationBorder, SegmentWatershed

◆ SegmentWatershed()

cvbres_t SegmentWatershed ( IMG  ImgIn,
TWatershedNorm  Norm,
TWatershedSegmentation  Segmentation,
TSegmentationBorder  Border,
IMG  ImgMarker,
cvbdim_t  Threshold,
IMG ImgOut 
)

This method performs watershed segmentation with markers.

The watershed segmentation is preferable for images with local minimums, for example, gradient images. Image markers generally correspond to the local minimums and can be created, for example, manually or using morphological reconstruction.

Non-zero pixels of ImgMarker image belong to water source markers. Marker values propagate through the whole image according to the watershed algorithm. Image segments are formed by groups of connected ImgMarker pixels with the same value.

Note
This function works only with 8-bit images.
Attention
Images with more than 1 plane will be split for computation in single plane images. All image planes are treated independently to each other.
Parameters
[in]ImgInHandle of input image to be segmented.
[in]NormControls the marker propagation connectivity. See #TWatershedNorm for more information.
[in]SegmentationSpecifies the algorithm of segmentation. For possible values see #TWatershedSegmentation.
[in]BorderBorder to be applied to the segments. See #TSegmentationBorder for possible values.
[in]ImgMarkerMarker image which is needed to perform watershed segmentation. If NULL is specified, the marker image is created automatically using morphological reconstruction.
[in]ThresholdThreshold which is applied for marker creation. This value is only used if ImgMarker is NULL.
[out]ImgOutImage handle of segmented image.
Returns
0 : OK
< 0: an error occurred.
Supported platforms:
Win32
Win64
Related Topics:
#TWatershedNorm, #TWatershedSegmentation, #TSegmentationBorder, SegmentGradient