Ejemplo n.º 1
0
 //灰度化
 private void button5_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(textBox1.Text))
     {
         pictureBox2.Image = ImageClass.ToGray((Bitmap)Image.FromFile(textBox1.Text));
     }
 }
Ejemplo n.º 2
0
 //获取轮廓
 private void button4_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(textBox1.Text))
     {
         Image <Gray, byte> src1 = new Image <Gray, byte>(textBox1.Text);
         Image <Bgr, byte>  src2 = new Image <Bgr, byte>(textBox1.Text);
         Bitmap             img  = ImageClass.GetOutline(src1, ref src2);
         pictureBox1.Image    = src2.ToBitmap();
         pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
         pictureBox2.Image    = img;
     }
 }