Exemple #1
0
        private void adaptiveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WindowSizeDialog windowDialog = new WindowSizeDialog(this);
            if (windowDialog.ShowDialog() == DialogResult.OK)
            {
                imageThreshold = new Thresholding(windowHeight,windowWidth);
                Stopwatch stopWatch = new Stopwatch();
                stopWatch.Start();

                picBox_NewBtmp.Image = imageThreshold.applyAdaptiveThresholding(BasicFilters.ToGrayScale(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;
            }
        }
Exemple #2
0
        private void slowToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WindowSizeDialog windowDialog = new WindowSizeDialog(this);
            if (windowDialog.ShowDialog() == DialogResult.OK)
            {
                ConvFilter = new ConvolutionBasedFilter(windowHeight,windowWidth);
                Stopwatch stopWatch = new Stopwatch();
                stopWatch.Start();

                picBox_NewBtmp.Image = ConvFilter.OriginalSmooting(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;
            }
        }