public Form1() { InitializeComponent(); ConvFilter = new ConvolutionBasedFilter(); imageThreshold = new Thresholding(); morphImage = new Morphology(); }
private void erossionToolStripMenuItem1_Click(object sender, EventArgs e) { Structural_Element_Options seOptions = new Structural_Element_Options(this); if (seOptions.ShowDialog() == DialogResult.OK) { morphImage = new Morphology(windowHeight, windowWidth,structureElementVal); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); picBox_NewBtmp.Image = morphImage.calculateErosion(oldImage); stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; ProcessingTimeLabel.Text = "Processing Time : " + String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); ProcessingTimeLabel.Visible = true; } }