private void btnOtsu_Click(object sender, EventArgs e) { copy = ColorFilter.SetColorFilter((Bitmap)pictureBox1.Image, "gray"); int tresholdValue = Otsu.getThresholdValue(copy); copy = Otsu.setThresholding((Bitmap)pictureBox1.Image, tresholdValue); setPictureBox(copy); }
private void btnTresholding_Click(object sender, EventArgs e) { int tresholdValue; if (!string.IsNullOrEmpty(textboxTreshold.Text)) { tresholdValue = Convert.ToInt32(textboxTreshold.Text); } else { tresholdValue = 150; } copy = Otsu.setThresholding((Bitmap)pictureBox1.Image, tresholdValue); setPictureBox(copy); }