边缘检测算法实现还未看,先贴代码
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
Image< Bgr, Byte> img1 = new Image< Bgr, byte>(ofd.FileName);
pictureBox1.Image = img1.ToBitmap();
//convert the img1 to grayscale and the filter out the noise
Image< Gray, Byte> gray1 = img1.Convert< Gray, Byte>().PyrDown().PyrUp();
Image< Gray, Byte> cannyGray = gray1.Canny(120, 180);
pictureBox2.Image = cannyGray.ToBitmap();
}