Beispiel #1
0
        private void 傅里叶平均值ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }

            Bitmap bit = new Bitmap(pictureBox1.Image);

            bit = scale2SquareSize(bit);
            pictureBox2.Refresh();

            Bitmap graybit = GraphicClass.convertRGB2Gray(bit);
            int    width   = graybit.Width;
            int    height  = graybit.Height;

            label5.Text = width.ToString() + " × " + height.ToString();
            label6.Text = GraphicClass.aveValue(bit, GraphicClass.fft2d(bit, false)).ToString();

            pictureBox2.Image = GraphicClass.complex2Gray(GraphicClass.fft2d(bit, true), width, height);

            // 跳到对应信息显示区域
            tabControl1.SelectedIndex = 1;
        }
Beispiel #2
0
        private void halftoningToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            checkPictureBox1();
            if (!valid)
            {
                return;
            }
            Bitmap bit = new Bitmap(pictureBox1.Image);

            pictureBox2.Refresh();
            pictureBox2.Image = GraphicClass.halftoning(GraphicClass.convertRGB2Gray(bit));
        }
Beispiel #3
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 #4
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);
        }
Beispiel #5
0
        private void kirsch算子ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (pictureBox1.Image == null)
            {
                return;
            }

            Bitmap bit     = new Bitmap(pictureBox1.Image);
            Bitmap graybit = GraphicClass.convertRGB2Gray(bit);

            PassValueForm form = new PassValueForm();

            form.Owner       = this;
            form.Description = "输入阙值";
            DialogResult result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                pictureBox2.Refresh();
                double value1 = Convert.ToDouble(form.Value);

                pictureBox2.Image = GraphicClass.kirsch(graybit, value1);
            }
        }