Beispiel #1
0
        private void 指数噪声ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }

            Bitmap bit = new Bitmap(pictureBox1.Image);

            PassValueForm form = new PassValueForm();

            form.setTextBox2_unvisible();
            form.Owner       = this;
            form.Description = "输入指数噪声参数(0.01~0.2之间最佳)";
            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                pictureBox2.Refresh();
                double value1 = Convert.ToDouble(form.Value);
                double value2 = Convert.ToDouble(form.Value1);
                //noise generator
                pictureBox2.Image = GraphicClass.noiseGenerator(bit, value1, value2, 3);
                pictureBox3.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox1.Image));
                pictureBox4.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox2.Image));
            }
        }
Beispiel #2
0
        private void 逆谐波均值滤波器ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }

            PassValueForm form = new PassValueForm();

            form.setTextBox2_unvisible();
            form.Owner       = this;
            form.Description = "输入逆谐波参数Q";
            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                int parameter = Convert.ToInt32(form.Value);

                Bitmap bit = new Bitmap(pictureBox1.Image);
                pictureBox2.Refresh();
                pictureBox2.Image = GraphicClass.AvgFilter(bit, 3, parameter);

                pictureBox3.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox1.Image));
                pictureBox4.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox2.Image));
            }
        }
Beispiel #3
0
        private void 中点滤波器ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }
            Bitmap bit = new Bitmap(pictureBox1.Image);

            pictureBox2.Image = GraphicClass.greatValueFiltering(bit, 2);
            pictureBox3.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox1.Image));
            pictureBox4.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox2.Image));
        }
Beispiel #4
0
        private void 直方图ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }
            Bitmap bit = new Bitmap(pictureBox1.Image);

            pictureBox3.Image = GraphicClass.drawHistogram(bit);
            pictureBox1.Refresh();
            pictureBox1.Image = GraphicClass.convertRGB2Gray(bit);
        }
Beispiel #5
0
        private void 几何均值滤波器ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }
            Bitmap bit = new Bitmap(pictureBox1.Image);

            pictureBox2.Refresh();
            pictureBox2.Image = GraphicClass.AvgFilter(bit, 1);
            pictureBox3.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox1.Image));
            pictureBox4.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox2.Image));
        }
Beispiel #6
0
        private void 算术均值滤波器ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }
            float temp = (float)(1.0 / 9.0);

            float[] a   = { temp, temp, temp, temp, temp, temp, temp, temp, temp };
            Bitmap  bit = new Bitmap(pictureBox1.Image);

            pictureBox2.Refresh();
            pictureBox2.Image = GraphicClass.AvgFilter(bit, 0);
            pictureBox3.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox1.Image));
            pictureBox4.Image = GraphicClass.drawHistogram(new Bitmap(pictureBox2.Image));
        }
Beispiel #7
0
        private void 直方图均衡化ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }

            Bitmap original = new Bitmap(pictureBox1.Image);

            pictureBox3.Image = GraphicClass.drawHistogram(original);

            Bitmap result = GraphicClass.histogramEqualization(original);

            pictureBox1.Image = GraphicClass.convertRGB2Gray(original);

            pictureBox2.Image = result;
            pictureBox4.Image = GraphicClass.drawHistogram(result);
        }