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.          //
////////////////////////////////////////////////////////////////

// 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);