21 lines
738 B
C#
21 lines
738 B
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
} |