//阈值介绍 //https://blog.csdn.net/weixin_41049188/article/details/91164555 private void btnThreshod2_Click(object sender, EventArgs e) { var file = @"d:Screenshot2.png"; var file6 = @"d:Screenshot6.png"; Mat src = new Mat(file, ImreadModes.Grayscale); Mat result = src.Threshold(0, 255, ThresholdTypes.Otsu); //new Window("test", WindowMode.Normal, result); //Cv2.WaitKey(0); result.ImWrite(file6); }