//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); } }
//HoughTransform private void button9_Click(object sender, EventArgs e) { var ImgIn = new ImgModule(p1); p1 = ImgIn.HoughTransform(p1, 200); this.pictureBox1.Image = p1; }
//Binary private void button8_Click(object sender, EventArgs e) { var ImgIn = new ImgModule(p1); p1 = ImgIn.Binary(p1, 200); this.pictureBox1.Image = p1; }
//Sobel private void button7_Click(object sender, EventArgs e) { var ImgIn = new ImgModule(p1); p1 = ImgIn.Sobel(p1); this.pictureBox1.Image = p1; }
//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; }
//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(); }
//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(); }
//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(); }
//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(); }