Documentation Portal      

What are you looking for?

Double Thresholding

Functional Guide | Reference: DoubleThreshold

////////////////////////////////////////////////////////////////
// This code snippet shows how to perform a thresholding //
// operation based on low and high threshold values. //
////////////////////////////////////////////////////////////////
// Images constructor
EImageBW8 srcImage;
EImageBW8 dstImage;
// ...
// Source and destination images must have the same size
dstImage.SetSize(&srcImage);
// Double thresholding, low threshold = 50, high threshold = 150,
// pixels below 50 become black, pixels above 150 become white,
// pixels between thresholds become gray
EasyImage::DoubleThreshold(&srcImage, &dstImage, 50, 150, 0, 128, 255);
'////////////////////////////////////////////////////////////////
'// This code snippet shows how to perform a thresholding //
'// operation based on low and high threshold values. //
'////////////////////////////////////////////////////////////////
' EasyImage context constructor
Dim EasyImage As New EasyImage
' Images constructor
Dim srcImage As New EImageBW8
Dim dstImage As New EImageBW8
' ...
' Source and destination images must have the same size
dstImage.SetSize srcImage.Width, srcImage.Height
' Double thresholding, low threshold = 50, high threshold = 150,
' pixels below 50 become black, pixels above 150 become white,
' pixels between thresholds become gray
EasyImage.DoubleThresholdBW8 srcImage, dstImage, 50, 150, 0, 128, 255
////////////////////////////////////////////////////////////////
// This code snippet shows how to perform a thresholding //
// operation based on low and high threshold values. //
////////////////////////////////////////////////////////////////
// Images constructor
EImageBW8 srcImage= new EImageBW8();
EImageBW8 dstImage= new EImageBW8();
// ...
// Source and destination images must have the same size
dstImage.SetSize(srcImage);
// Double thresholding, low threshold = 50, high threshold = 150,
// pixels below 50 become black, pixels above 150 become white,
// pixels between thresholds become gray
EasyImage.DoubleThreshold(srcImage, dstImage, 50, 150, 0, 128, 255);

See also in the Reference

DoubleThreshold

Which API shall we display?

© 2019 EURESYS s.a.  -  About Documentation  -  Open Source Licenses  -  Open eVision 2.10.0.1121