【发布时间】:2019-05-26 02:09:41
【问题描述】:
我想删除所有水平和垂直线,但一些小的垂直线没有被删除。 添加输入和输出图像以及下面的代码。
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);
我想删除所有水平和垂直线,但一些小的垂直线没有被删除。 添加上述代码的输入输出。
输入图像:
输出图片:
如果您注意到一些垂直线没有被删除。我在 Visual Studio 中使用 emgu.cv 库,代码是 C# 。任何不使用 emgu 的解决方案也将不胜感激
【问题讨论】:
-
不要为此使用 Hough。使用带有水平和垂直线结构元素的形态闭合。
标签: c# opencv image-processing emgucv