private void buttonContrastSaw_Click(object sender, EventArgs e) { if (bitmap == null) { MessageBox.Show("Select an image to work with.(By clicking on it)\n " + "If there is no image, then upload it by clicking the <open image>", "Error: no image selected", MessageBoxButtons.OK ); return; } buttonContrastSaw.Enabled = false; pictureBox3.Image = FiltersForImage.СontrastScaling(bitmap, trackBar2.Value); buttonContrastSaw.Enabled = true; }
private void buttonNoise_Click(object sender, EventArgs e) { if (bitmap == null) { MessageBox.Show("Select an image to work with.(By clicking on it)\n " + "If there is no image, then upload it by clicking the <open image>", "Error: no image selected", MessageBoxButtons.OK ); return; } trackBar1.Enabled = buttonNoise.Enabled = false; pictureBox4.Image = FiltersForImage.AddSpeckleNoise(bitmap, trackBar1.Value); trackBar1.Enabled = buttonNoise.Enabled = true; }
private void buttonGray_Click(object sender, EventArgs e) { if (bitmap == null) { MessageBox.Show("Select an image to work with.(By clicking on it)\n " + "If there is no image, then upload it by clicking the <open image>", "Error: no image selected", MessageBoxButtons.OK ); return; } buttonGray.Enabled = false; pictureBox2.Image = FiltersForImage.GrayFilter(bitmap); buttonGray.Enabled = true; }
private void buttonHough_Click(object sender, EventArgs e) { if (bitmap == null) { MessageBox.Show("Select an image to work with.(By clicking on it)\n " + "If there is no image, then upload it by clicking the <open image>", "Error: no image selected", MessageBoxButtons.OK ); return; } buttonHough.Enabled = false; Bitmap bmp = FiltersForImage.bynaryImage(bitmap); pictureBox4.Image = HoughTransform.Hough(bmp, trackBar4.Value); buttonHough.Enabled = true; }
private void buttonDefiningBoundaries_Click(object sender, EventArgs e) { if (bitmap == null) { MessageBox.Show("Select an image to work with.(By clicking on it)\n " + "If there is no image, then upload it by clicking the <open image>", "Error: no image selected", MessageBoxButtons.OK ); return; } buttonDefiningBoundaries.Enabled = false; int[,] mask = new[, ] { { 0, -1, 0 }, { -1, 4, -1 }, { 0, -1, 0 } }; pictureBox3.Image = FiltersForImage.Convolution(bitmap, mask); buttonDefiningBoundaries.Enabled = true; }