using Matrox.MatroxImagingLibrary; using VisionCommon; namespace MilPattern { internal class MilBinarization { public static void Binarize( MIL_ID srcImage, MIL_ID dstImage, double thresholdLow, double thresholdHigh, eForegroundColor foregroundColor) { if (foregroundColor == eForegroundColor.White) { MIL.MimBinarize(srcImage, dstImage, MIL.M_FIXED + MIL.M_IN_RANGE, thresholdLow, thresholdHigh); } else { MIL.MimBinarize(srcImage, dstImage, MIL.M_FIXED + MIL.M_OUT_RANGE, thresholdLow, thresholdHigh); } } } }