EasyImage::AutoThreshold

Returns a suitable threshold value for a gray-level image binarization.

Namespace: Euresys::Open_eVision

[C++]

EBW8 AutoThreshold(
   const EROIBW8* sourceImage,
   Euresys::Open_eVision::EThresholdMode thresholdMode,
   float relativeThresholdMode
)

EBW16 AutoThreshold(
   const EROIBW16* sourceImage,
   Euresys::Open_eVision::EThresholdMode thresholdMode,
   float relativeThresholdMode
)

EBW8 AutoThreshold(
   const EROIBW8* sourceImage,
   const EROIBW8* mask,
   Euresys::Open_eVision::EThresholdMode thresholdMode,
   float relativeThresholdMode
)

EBW16 AutoThreshold(
   const EROIBW16* sourceImage,
   const EROIBW8* mask,
   Euresys::Open_eVision::EThresholdMode thresholdMode,
   float relativeThresholdMode
)

EBW8 AutoThreshold(
   const EROIBW8* sourceImage,
   const ERegion& region,
   Euresys::Open_eVision::EThresholdMode thresholdMode,
   float relativeThresholdMode
)

EBW16 AutoThreshold(
   const EROIBW16* sourceImage,
   const ERegion& region,
   Euresys::Open_eVision::EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Parameters

sourceImage

Pointer to the source image/ROI.

thresholdMode

The thresholding mode, as defined by the enumeration EThresholdMode. To use absolute thresholding, use directly the threshold value instead.

relativeThresholdMode

Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is EThresholdMode_Relative (by default, relativeThresholdMode = 0.5).

mask

Pointer to a mask to apply the function only on a particular region in the image. Note: the mask must have the same size as the source image.

region

An Eregion object to apply the function only on a particular region in the image.

Remarks

Several modes are available: absolute (the threshold value is given readily in the thresholdMode parameter), relative (the threshold value is computed to obtain a desired fraction of the image pixels) or automatic (using three different criteria).

It is possible that, in the automatic or relative thresholding modes, the computed threshold exceeds the dynamic range of the return type. In this case, the value is clipped to the maximum value that is representable in the return type.

EasyImage.AutoThreshold

Returns a suitable threshold value for a gray-level image binarization.

Namespace: Euresys.Open_eVision

[C#]

Euresys.Open_eVision.EBW8 AutoThreshold(
   Euresys.Open_eVision.EROIBW8 sourceImage,
   Euresys.Open_eVision.EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Euresys.Open_eVision.EBW16 AutoThreshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Euresys.Open_eVision.EBW8 AutoThreshold(
   Euresys.Open_eVision.EROIBW8 sourceImage,
   Euresys.Open_eVision.EROIBW8 mask,
   Euresys.Open_eVision.EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Euresys.Open_eVision.EBW16 AutoThreshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW8 mask,
   Euresys.Open_eVision.EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Euresys.Open_eVision.EBW8 AutoThreshold(
   Euresys.Open_eVision.EROIBW8 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Euresys.Open_eVision.EBW16 AutoThreshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EThresholdMode thresholdMode,
   float relativeThresholdMode
)

Parameters

sourceImage

Pointer to the source image/ROI.

thresholdMode

The thresholding mode, as defined by the enumeration EThresholdMode. To use absolute thresholding, use directly the threshold value instead.

relativeThresholdMode

Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is Relative (by default, relativeThresholdMode = 0.5).

mask

Pointer to a mask to apply the function only on a particular region in the image. Note: the mask must have the same size as the source image.

region

An Eregion object to apply the function only on a particular region in the image.

Remarks

Several modes are available: absolute (the threshold value is given readily in the thresholdMode parameter), relative (the threshold value is computed to obtain a desired fraction of the image pixels) or automatic (using three different criteria).

It is possible that, in the automatic or relative thresholding modes, the computed threshold exceeds the dynamic range of the return type. In this case, the value is clipped to the maximum value that is representable in the return type.