2026-06-05 13:44:39 +09:00

17 lines
632 B
C#

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