EasyImage::Threshold

Binarize an image by setting pixels to two different possible values in a destination image, according to their value in a source image.

Namespace: Euresys::Open_eVision

[C++]

void Threshold(
   EROIBW8* sourceImage,
   EROIBW8* destinationImage,
   OEV_UINT32 threshold,
   OEV_UINT8 lowValue,
   OEV_UINT8 highValue,
   float relativeThreshold
)

void Threshold(
   const EROIBW8* sourceImage,
   const ERegion& region,
   EROIBW8* destinationImage,
   OEV_UINT32 threshold,
   OEV_UINT8 lowValue,
   OEV_UINT8 highValue,
   float relativeThreshold
)

void Threshold(
   EROIBW16* sourceImage,
   EROIBW16* destinationImage
)

void Threshold(
   const EROIBW16* sourceImage,
   const ERegion& region,
   EROIBW16* destinationImage
)

void Threshold(
   EROIBW16* sourceImage,
   EROIBW16* destinationImage,
   OEV_UINT32 threshold
)

void Threshold(
   const EROIBW16* sourceImage,
   const ERegion& region,
   EROIBW16* destinationImage,
   OEV_UINT32 threshold
)

void Threshold(
   EROIBW16* sourceImage,
   EROIBW16* destinationImage,
   OEV_UINT32 threshold,
   EBW16 lowValue,
   EBW16 highValue
)

void Threshold(
   const EROIBW16* sourceImage,
   const ERegion& region,
   EROIBW16* destinationImage,
   OEV_UINT32 threshold,
   EBW16 lowValue,
   EBW16 highValue
)

void Threshold(
   EROIBW16* sourceImage,
   EROIBW16* destinationImage,
   float relativeThreshold
)

void Threshold(
   const EROIBW16* sourceImage,
   const ERegion& region,
   EROIBW16* destinationImage,
   float relativeThreshold
)

void Threshold(
   EROIBW16* sourceImage,
   EROIBW16* destinationImage,
   float relativeThreshold,
   EBW16 lowValue,
   EBW16 highValue
)

void Threshold(
   const EROIBW16* sourceImage,
   const ERegion& region,
   EROIBW16* destinationImage,
   float relativeThreshold,
   EBW16 lowValue,
   EBW16 highValue
)

void Threshold(
   EROIC24* sourceImage,
   EROIBW8* destinationImage,
   EC24 minimum,
   EC24 maximum
)

void Threshold(
   const EROIC24* sourceImage,
   const ERegion& region,
   EROIBW8* destinationImage,
   EC24 minimum,
   EC24 maximum
)

void Threshold(
   EROIC24* sourceImage,
   EROIBW8* destinationImage,
   EC24 minimum,
   EC24 maximum,
   EColorLookup* colorLookupTable,
   EBW8 rejectValue,
   EBW8 acceptValue
)

void Threshold(
   const EROIC24* sourceImage,
   const ERegion& region,
   EROIBW8* destinationImage,
   EC24 minimum,
   EC24 maximum,
   EColorLookup* colorLookupTable,
   EBW8 rejectValue,
   EBW8 acceptValue
)

void Threshold(
   EROIC24* sourceImage,
   EROIBW8* destinationImage,
   EC24 minimum,
   EC24 maximum,
   EColorLookup* colorLookupTable
)

void Threshold(
   const EROIC24* sourceImage,
   const ERegion& region,
   EROIBW8* destinationImage,
   EC24 minimum,
   EC24 maximum,
   EColorLookup* colorLookupTable
)

void Threshold(
   EROIBW8* sourceImage,
   EROIBW1* destinationImage,
   OEV_UINT32 threshold,
   float relativeThreshold
)

void Threshold(
   EROIBW16* sourceImage,
   EROIBW1* destinationImage,
   OEV_UINT32 threshold,
   float relativeThreshold
)

Parameters

sourceImage

Pointer to the source image/ROI.

destinationImage

Pointer to the destination image/ROI.

threshold

The value to compare each pixel to

lowValue

Value for pixels below the threshold (by default, 0).

highValue

Value for pixels above the threshold (by default, it is set to 255 for BW8 destination images and 65535 for BW16 destination images).

relativeThreshold

Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is EThresholdMode_Relative (by default, 0.5). This value must be greater than (or equal to) 0 and strictly less than 1.

region

Pointer to a region to apply the function only on a particular region in the image.

minimum

Three lower thresholds combined in a single color value.

maximum

Three upper thresholds combined in a single color value.

colorLookupTable

Pointer to the color lookup table to be applied before thresholding, if any.

rejectValue

Value for pixels falling outside the range (by default, 0).

acceptValue

Value for pixels falling inside the range (by default, 255).

Remarks

When the source image is gray-level, the pixel values are measured against a threshold. All pixels below this threshold will yield a low value in the destination image, and all pixels above or on the threshold will yield a high value.
When the destination image is binary (BW1 pixel type), then the values are set to 0 or 1, according to the criterion.
When the destination image is gray-level (BW8 or BW16), then the values are set to 0 or to the maximum pixel value for the image type (255 for BW8 and 65535 for BW16). In some overloads, these minimum and maximum destination values can be specified.
When the source image is gray-level, several modes are available: absolute (the threshold value is given), relative (the threshold value is computed to obtain a desired fraction of the image pixels), or automatic (using three different criteria). In the function overloads where this mode cannot be specified, it is assumed to be absolute.
If the source image is color, all pixels whose components are comprised in a range of values (minimum to maximum) will be set to a constant value (white by default), while other pixels will be set to another constant value (black by default). In this case, if a color lookup is specified, it is applied on the fly to the color image before thresholding.
The simpler color image overload does not support the use of an on-the-fly color lookup table nor rejectValue/acceptValue arguments. On the other hand, it has been MMX optimized, and will run significantly faster when the acceptance region is large.

EasyImage.Threshold

Binarize an image by setting pixels to two different possible values in a destination image, according to their value in a source image.

Namespace: Euresys.Open_eVision

[C#]

void Threshold(
   Euresys.Open_eVision.EROIBW8 sourceImage,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   uint threshold,
   byte lowValue,
   byte highValue,
   float relativeThreshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW8 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   uint threshold,
   byte lowValue,
   byte highValue,
   float relativeThreshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW16 destinationImage
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW16 destinationImage
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   uint threshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   uint threshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   uint threshold,
   Euresys.Open_eVision.EBW16 lowValue,
   Euresys.Open_eVision.EBW16 highValue
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   uint threshold,
   Euresys.Open_eVision.EBW16 lowValue,
   Euresys.Open_eVision.EBW16 highValue
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   float relativeThreshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   float relativeThreshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   float relativeThreshold,
   Euresys.Open_eVision.EBW16 lowValue,
   Euresys.Open_eVision.EBW16 highValue
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW16 destinationImage,
   float relativeThreshold,
   Euresys.Open_eVision.EBW16 lowValue,
   Euresys.Open_eVision.EBW16 highValue
)

void Threshold(
   Euresys.Open_eVision.EROIC24 sourceImage,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   Euresys.Open_eVision.EC24 minimum,
   Euresys.Open_eVision.EC24 maximum
)

void Threshold(
   Euresys.Open_eVision.EROIC24 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   Euresys.Open_eVision.EC24 minimum,
   Euresys.Open_eVision.EC24 maximum
)

void Threshold(
   Euresys.Open_eVision.EROIC24 sourceImage,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   Euresys.Open_eVision.EC24 minimum,
   Euresys.Open_eVision.EC24 maximum,
   Euresys.Open_eVision.EColorLookup colorLookupTable,
   Euresys.Open_eVision.EBW8 rejectValue,
   Euresys.Open_eVision.EBW8 acceptValue
)

void Threshold(
   Euresys.Open_eVision.EROIC24 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   Euresys.Open_eVision.EC24 minimum,
   Euresys.Open_eVision.EC24 maximum,
   Euresys.Open_eVision.EColorLookup colorLookupTable,
   Euresys.Open_eVision.EBW8 rejectValue,
   Euresys.Open_eVision.EBW8 acceptValue
)

void Threshold(
   Euresys.Open_eVision.EROIC24 sourceImage,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   Euresys.Open_eVision.EC24 minimum,
   Euresys.Open_eVision.EC24 maximum,
   Euresys.Open_eVision.EColorLookup colorLookupTable
)

void Threshold(
   Euresys.Open_eVision.EROIC24 sourceImage,
   Euresys.Open_eVision.ERegion region,
   Euresys.Open_eVision.EROIBW8 destinationImage,
   Euresys.Open_eVision.EC24 minimum,
   Euresys.Open_eVision.EC24 maximum,
   Euresys.Open_eVision.EColorLookup colorLookupTable
)

void Threshold(
   Euresys.Open_eVision.EROIBW8 sourceImage,
   Euresys.Open_eVision.EROIBW1 destinationImage,
   uint threshold,
   float relativeThreshold
)

void Threshold(
   Euresys.Open_eVision.EROIBW16 sourceImage,
   Euresys.Open_eVision.EROIBW1 destinationImage,
   uint threshold,
   float relativeThreshold
)

Parameters

sourceImage

Pointer to the source image/ROI.

destinationImage

Pointer to the destination image/ROI.

threshold

The value to compare each pixel to

lowValue

Value for pixels below the threshold (by default, 0).

highValue

Value for pixels above the threshold (by default, it is set to 255 for BW8 destination images and 65535 for BW16 destination images).

relativeThreshold

Fraction of the image pixels that will be set below the threshold. Only used when the threshold value is Relative (by default, 0.5). This value must be greater than (or equal to) 0 and strictly less than 1.

region

Pointer to a region to apply the function only on a particular region in the image.

minimum

Three lower thresholds combined in a single color value.

maximum

Three upper thresholds combined in a single color value.

colorLookupTable

Pointer to the color lookup table to be applied before thresholding, if any.

rejectValue

Value for pixels falling outside the range (by default, 0).

acceptValue

Value for pixels falling inside the range (by default, 255).

Remarks

When the source image is gray-level, the pixel values are measured against a threshold. All pixels below this threshold will yield a low value in the destination image, and all pixels above or on the threshold will yield a high value.
When the destination image is binary (BW1 pixel type), then the values are set to 0 or 1, according to the criterion.
When the destination image is gray-level (BW8 or BW16), then the values are set to 0 or to the maximum pixel value for the image type (255 for BW8 and 65535 for BW16). In some overloads, these minimum and maximum destination values can be specified.
When the source image is gray-level, several modes are available: absolute (the threshold value is given), relative (the threshold value is computed to obtain a desired fraction of the image pixels), or automatic (using three different criteria). In the function overloads where this mode cannot be specified, it is assumed to be absolute.
If the source image is color, all pixels whose components are comprised in a range of values (minimum to maximum) will be set to a constant value (white by default), while other pixels will be set to another constant value (black by default). In this case, if a color lookup is specified, it is applied on the fly to the color image before thresholding.
The simpler color image overload does not support the use of an on-the-fly color lookup table nor rejectValue/acceptValue arguments. On the other hand, it has been MMX optimized, and will run significantly faster when the acceptance region is large.