use gray-style by Yap

This commit is contained in:
huiyadanli
2023-10-29 20:44:50 +08:00
parent d57e67c159
commit 5d87c7543b

View File

@@ -116,7 +116,7 @@ public class AutoPickTrigger : ITaskTrigger
if (_whiteList.Contains(text))
{
LogPick(content, text);
Simulation.SendInput.Keyboard.KeyPress(VirtualKeyCode.VK_F);
//Simulation.SendInput.Keyboard.KeyPress(VirtualKeyCode.VK_F);
return;
}
@@ -132,15 +132,16 @@ public class AutoPickTrigger : ITaskTrigger
}
LogPick(content, text);
Simulation.SendInput.Keyboard.KeyPress(VirtualKeyCode.VK_F);
//Simulation.SendInput.Keyboard.KeyPress(VirtualKeyCode.VK_F);
}
});
}
private Mat PreProcessForInference(Mat mat)
{
// Yap 已经改用灰度图了 https://github.com/Alex-Beng/Yap/commit/c2ad1e7b1442aaf2d80782a032e00876cd1c6c84
// 二值化
Cv2.Threshold(mat, mat, 0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary);
// Cv2.Threshold(mat, mat, 0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary);
//Cv2.AdaptiveThreshold(mat, mat, 255, AdaptiveThresholdTypes.GaussianC, ThresholdTypes.Binary, 31, 3); // 效果不错 但是和模型不搭
//mat = OpenCvCommonHelper.Threshold(mat, Scalar.FromRgb(235, 235, 235), Scalar.FromRgb(255, 255, 255)); // 识别物品不太行
// 不知道为什么要强制拉伸到 221x32