简体   繁体   English

如何从凌乱的背景中提取线条

[英]How extract lines from a messy background

Given the next canny edge result image: 给定下一个Canny Edge结果图像:

在此处输入图片说明

I'm trying to extract the selected lines: 我正在尝试提取选定的行:

在此处输入图片说明

I did try several methods without success. 我确实尝试了几种方法,但均未成功。 For ex. 对于前。 I tried morphological operations but didn't work well because some times the lines are in angle or they are not completely vertical or horizontal... 我尝试了形态学运算,但是效果不佳,因为有时线条成角度或者它们不是完全垂直或水平...

I wonder if there's a method or if it is possible to extract them properly. 我想知道是否有一种方法或是否有可能正确地提取它们。

Thanks. 谢谢。

If you want to identify the longest lines try with finding contou r and filter by its length. 如果要确定最长的线,请尝试查找线并按其长度进行过滤。

You will get only the long connected lines irrespective of angle. 无论角度如何,您都只会得到长连接的线。

if you want that to match with line then try houghlines Hope it helps. 如果您希望该线与线匹配,请尝试使用houghlines希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM