我想删除所有水平和垂直线,但一些小的垂直线没有被删除。添加输入和输出图像以及下面的代码。
string ImageUrl = @"C:\Users\Jayant\Desktop\test images\rtaImage.tiff";
Image<Bgr, Byte> image = new Image<Bgr, byte>(ImageUrl);
Image<Bgr, byte> res = image.Copy();
LineSegment2D[] lines =
image
.Convert<Gray, byte>()
.Canny(16, 16)
.HoughLinesBinary(1, Math.PI / 16, 10, 50, 1)[0];
foreach (LineSegment2D line in lines)
{
res.Draw(line, new Bgr(System.Drawing.Color.White), 2);
}
res.Save(ImageUrl);
Run Code Online (Sandbox Code Playgroud)
我想删除所有水平和垂直线,但一些小的垂直线没有被删除。添加上述代码的输入和输出。
输入图像:
输出图像:
如果您发现一些垂直线没有被删除。我在 Visual Studio 中使用 emgu.cv 库,代码是 C# 。任何不使用 emgu 的解决方案也将受到赞赏