コード例 #1
0
        //Drawing Histogram
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            if (p1 == null)
            {
                return;
            }
            var  ImgIn       = new ImgModule(p1);
            var  PixelArray  = ImgIn.Histogram(p1);
            var  PixelLength = ImgIn.rgbValues.Length / 3;
            Pen  pen         = new Pen(Color.FromArgb(255, 0, 0, 0));
            long MaxPixelNum = 0;

            for (int i = 0; i < 256; i++)
            {
                if (PixelArray[i] > MaxPixelNum)
                {
                    MaxPixelNum = PixelArray[i];
                }
            }
            for (int i = 0; i < 256; i++)
            {
                int LineHight = (int)(((double)PixelArray[i] / MaxPixelNum) * 255);
                e.Graphics.DrawLine(pen, i, panel1.Size.Height, i, panel1.Size.Height - (int)LineHight);
            }
        }
コード例 #2
0
        //HoughTransform
        private void button9_Click(object sender, EventArgs e)
        {
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.HoughTransform(p1, 200);
            this.pictureBox1.Image = p1;
        }
コード例 #3
0
        //Binary
        private void button8_Click(object sender, EventArgs e)
        {
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.Binary(p1, 200);
            this.pictureBox1.Image = p1;
        }
コード例 #4
0
        //Sobel
        private void button7_Click(object sender, EventArgs e)
        {
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.Sobel(p1);
            this.pictureBox1.Image = p1;
        }
コード例 #5
0
        //Gray
        private void button2_Click(object sender, EventArgs e)
        {
            if (p1 == null)
            {
                return;
            }
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.gary(p1);
            this.pictureBox1.Image = p1;
        }
コード例 #6
0
        //HistogramEqulization
        private void button4_Click(object sender, EventArgs e)
        {
            if (p1 == null)
            {
                return;
            }
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.HistogramProcessing(p1, 200, 50, Constants.HE);
            this.pictureBox1.Image = p1;
            panel1.Invalidate();
        }
コード例 #7
0
        //PepperSalt
        private void button3_Click(object sender, EventArgs e)
        {
            if (p1 == null)
            {
                return;
            }
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.PepperSalt(p1, 5);
            this.pictureBox1.Image = p1;
            panel1.Invalidate();
        }
コード例 #8
0
        //UnSharpMasking
        private void button6_Click(object sender, EventArgs e)
        {
            if (p1 == null)
            {
                return;
            }
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.UnSharpMasking(p1, 0, 1);
            this.pictureBox1.Image = p1;
            panel1.Invalidate();
        }
コード例 #9
0
        //LowPassFilter
        private void button5_Click(object sender, EventArgs e)
        {
            if (p1 == null)
            {
                return;
            }
            var ImgIn = new ImgModule(p1);

            p1 = ImgIn.LowPassFilter(p1, 3);
            this.pictureBox1.Image = p1;
            panel1.Invalidate();
        }