پاسخ داده شده: تشخیص خط در سی شارپ
تابع HoughLinesBinary خطوط را در تصویر شناسایی می کنه.به صورت زیر:
//Load the image that has been pre-processed Image<Gray, Byte> cannyGray = new Image<Gray, byte>(new Bitmap(pictureBox2.Image)); //Call HoughLinesBinary method LineSegment2D[] lines = cannyGray.HoughLinesBinary(1, Math.PI / 45.0, 20, 30, 10)[0]; //Draw lines Image<Bgr, Byte> imageLines = new Image<Bgr, byte>(cannyGray.Width, cannyGray.Height); foreach (LineSegment2D line in lines) { imageLines.Draw(line, new Bgr(Color.DeepSkyBlue), 5); } //Show result pictureBox2.Image = imageLines.ToBitmap();