Exemple #1
0
        private void createMatrix(int mHeight, int mWidth)
        {
            int height = 50;
            int width  = 50;

            int x = 30, y = 70;

            if (mHeight > 0 && mWidth > 0)
            {
                localMask = Morphology.createMaskList(mHeight, mWidth);
            }

            for (int i = 0; i < localMask.Count; i++)
            {
                for (int j = 0; j < localMask[i].Count; j++)
                {
                    NumericUpDown numUD = new NumericUpDown();
                    numUD.Height   = height;
                    numUD.Width    = width;
                    numUD.Name     = "numUD" + i + j;
                    numUD.Maximum  = 1;
                    numUD.Minimum  = 0;
                    numUD.Location = new Point(x, y);
                    numUD.Value    = Convert.ToDecimal(localMask[i][j]);
                    this.Controls.Add(numUD);

                    x += 80;
                }

                x  = 30;
                y += 30;
            }
        }
Exemple #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            stopwatch = new Stopwatch();
            stopwatch.Start();

            ownerForm.resultImage = Morphology.applyErosion("RGB", 0, ownerForm.originalImage,
                                                            new Point(ownerForm.originalImage.Width, ownerForm.originalImage.Height),
                                                            mask, new Point(mask.Count, mask[0].Count));
            ownerForm.updateResultBox();

            stopwatch.Stop();
            ownerForm.erosionLabel.Text = "Erosion time: " + stopwatch.ElapsedMilliseconds;
        }
Exemple #3
0
 private void LocalMethods_Load(object sender, EventArgs e)
 {
     mask = Morphology.createMaskList(3, 3);
     redrawMask();
 }