Documentation Portal      

What are you looking for?

Single Thresholding

Functional Guide | Reference: SetSize, Threshold

////////////////////////////////////////////////////////////////
// This code snippet shows how to perform minimum residue //
// thresholding, absolute thresholding and relative //
// thresholding operations. //
////////////////////////////////////////////////////////////////
// Images constructor
EImageBW8 srcImage;
EImageBW8 dstImage;
// ...
// Source and destination images must have the same size
dstImage.SetSize(&srcImage);
// Minimum residue thresholding (default method)
EasyImage::Threshold(&srcImage, &dstImage);
// Absolute thresholding (threshold = 110)
EasyImage::Threshold(&srcImage, &dstImage, 110);
// Relative thresholding (70% black, 30% white)
EasyImage::Threshold(&srcImage, &dstImage, EThresholdMode_Relative, 0, 255, 0.7f);
'////////////////////////////////////////////////////////////////
'// This code snippet shows how to perform minimum residue //
'// thresholding, absolute thresholding and relative //
'// thresholding operations. //
'////////////////////////////////////////////////////////////////
' 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
' Minimum residue thresholding (default method)
EasyImage.ThresholdBW8LowHigh srcImage, dstImage
' Absolute thresholding (threshold = 110)
EasyImage.ThresholdBW8LowHigh srcImage, dstImage, 110
' Relative thresholding (70% black, 30% white)
EasyImage.ThresholdBW8LowHigh srcImage, dstImage, EThresholdMode_Relative, 0, 255, 0.7
////////////////////////////////////////////////////////////////
// This code snippet shows how to perform minimum residue //
// thresholding, absolute thresholding and relative //
// thresholding operations. //
////////////////////////////////////////////////////////////////
// Images constructor
EImageBW8 srcImage= new EImageBW8();
EImageBW8 dstImage= new EImageBW8();
// ...
// Source and destination images must have the same size
dstImage.SetSize(srcImage);
// Minimum residue thresholding (default method)
EasyImage.Threshold(srcImage, dstImage);
// Absolute thresholding (threshold = 110)
EasyImage.Threshold(srcImage, dstImage, 110);
// Relative thresholding (70% black, 30% white)
EasyImage.Threshold(srcImage, dstImage, (int)EThresholdMode.Relative, 0, 255, 0.7f);

See also in the Reference

SetSize

Threshold

Which API shall we display?

© 2018 EURESYS s.a.  -  About Documentation  -  Open Source Licenses  -  Open eVision 2.6.1.1110