} //****************************** end BreadthFirst **************************************** private void button5_Click(object sender, EventArgs e) // Root method { if (ORIG == false) { MessageBox.Show("Please open an image and click 'Segment' and 'Impulse noise'"); return; } if (SEGMENT == false) { MessageBox.Show("Please click 'Segment' and 'Impulse noise'"); return; } if (IMPULSE == false) { MessageBox.Show("Please click 'Impulse noise'"); return; } RootIm.Copy(ImpulseIm, true); progressBar1.Value = 0; progressBar1.Visible = true; int nComp = RootIm.ComponentsE(this); int nPal = 0; RootIm.MakePalette(ref nPal); progressBar1.Visible = false; RootBmp = new Bitmap(width, height, PixelFormat.Format24bppRgb); LabToBitmap(RootBmp, RootIm); progressBar1.Visible = false; pictureBox2.Image = RootBmp; ROOT = true; label2.Text = nComp + " root components "; label6.Text = "Saving 'Root' is possible"; } //****************************** end Root method ****************************************
} //****************************** end Impulse noise **************************************** private void button3_Click(object sender, EventArgs e) // BreadthFirst { if (ORIG == false) { MessageBox.Show("Please open an image and click 'Segment' and 'Impulse noise'"); return; } if (SEGMENT == false) { MessageBox.Show("Please click 'Segment' and 'Impulse noise'"); return; } if (IMPULSE == false) { MessageBox.Show("Please click 'Impulse noise'"); return; } progressBar1.Value = 0; progressBar1.Visible = true; progressBar1.Step = 1; BreadthFirIm.Copy(ImpulseIm, true); int nComp = BreadthFirIm.LabelC(this); int nPal = 0; BreadthFirIm.MakePalette(ref nPal); BreadthBmp = new Bitmap(width, height, PixelFormat.Format24bppRgb); LabToBitmap(BreadthBmp, BreadthFirIm); pictureBox2.Image = BreadthBmp; progressBar1.Visible = false; BREAD = true; label2.Text = nComp + " breadth components "; label6.Text = "Saving 'Breadth' is possible"; } //****************************** end BreadthFirst ****************************************