Canny边缘检测:
用法和opencv中的一致,
Image<Gray,Byte> Image<Gray,Byte>.Canny(double thresh,double threshLinging)
thresh、threshLinging为第一滞后阈值和第二滞后阈值。
private void button1_Click(object sender, EventArgs e)
{
Image<Bgr, Byte> image1 = new Image<Bgr, Byte>(Properties.Resources._2);
Image<Gray, Byte> grayImage = image1.Convert<Gray, Byte>();
Image<Gray, Byte> cannyGray = grayImage.Canny(100, 200);
pictureBox1.Image = cannyGray.ToBitmap();
}
线检测:
1.先调用HoughLinesBinary检测直线,返回一个LineSegment2D[]的数组
LineSegment2D[][]