在形状中查找线 [英] Find lines in shape

查看:209
本文介绍了在形状中查找线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个二进制映像,我正在寻找一个鲁棒的方法来找到形状和拓扑(如何连接)。线的连接。



已经在matlab中进行了实验(尽管我要求的是使用哪些方法)。



我试过在二进制图像上使用骨架化,然后使用hough- ,有时工作,但不是一个鲁棒的解决方案。



任何人都可以指示我在这里使用的方法(以什么顺序)。








更多步骤可以更精确地识别交叉点:





我得出结论,使用初始图像提供的所有信息非常重要。所有简化等都会删除有价值的事实,增加任务的整体复杂性。



更新



如果该图没有大多数垂直和水平线,这种方法是否有效?



这些步骤是相当独立的,所以没有严格的要求有垂直或水平线。自然地,识别交叉点并进行一些额外的调整以提高准确性是更复杂的任务。



很容易看到,在形状的开始和结尾有垂直线引入的一些重要错误。非常简单的优化给了我们更好的结果:




I have a binary image and I'm looking for a robust way to find the lines in the shape and the topology (how the lines connect).

I have experimented in matlab (although what I'm asking for is which methods to use).

I've tried using skeletonization on the binary image and then used hough-transform, works sometimes but not a robust solution. I struggled with boundary disturbance.

Could anyone point me in a direction of which methods to use here (and in what order).

Binary file for testing

解决方案

Frankly speaking, I've been monitoring this question for some time in the hope to see useful answer. The task itself does not seem to be really complex (and I'll try to prove that), but elegant solution is still a bit far from me.

Some time ago I solved similar task and it does look like with my very basic home-grown solution your initial example is easily traceable:

It is just a simple scan (1), vertical and horizontal lines identification(2) along with further analysis of the more complex areas (3). Having all areas analysed (3) it is not that hard to find intersection points and optimise them as well (4).

The result is pretty rough, but it confirms the feasibility if this approach.

I do understand this is a bit far from Matlab, but I just want to highlight several important moments:

  • skeletonization will potentially break the initial geometry
  • further analysis of the skeleton seems to be a bit tricky and unreliable
  • with a bit of enhanced quality your images can be traced with way more simple approach

BTW, in my approach different operations can be performed in parallel. Scan step is adjustable and even with reduced number of scans result is pretty good:

With more steps intersection points can be identified more precisely:

I came to conclusion it is really important to use all information provided by an initial image. All simplifications, etc will remove valuable facts increasing overall complexity of the task.

Update

Would this approach work if the figure did not have a majority of vertical and horizontal lines?

Those steps are pretty independent, so there is no strict requirement to have vertical or horizontal lines. Naturally, it is more complex task to identify intersections and do some additional tweaking in order to enhance accuracy.

Easy to see there are some significant errors introduced by vertical lines at the beginning and at the end of the shape. Very straightforward optimisation gives us better results:

这篇关于在形状中查找线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆