多边形斑点的中心线(二进制图像) [英] centerline of a polygonal blob (binary image)

查看:173
本文介绍了多边形斑点的中心线(二进制图像)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个蠕虫的二进制映像(提取效果很好). 我有兴趣在吹虫(蠕虫)上安装一条中心线.

I have a binary image of a worm (blob extraction which works well). I am interested in fitting a centerline on the blowb (worm).

到目前为止,我想到了这一点:从一个多边形开始(在图像中斑点的轮廓提取之后),我进行了voronoi计算并丢弃了多边形(蓝色)之外的所有顶点,这给了我黑色的中心线我可以进一步使用它来拟合平滑的中心线.

So far I came up with this: starting from a polygon (after outline extraction of blob in the image) I applied a voronoi computation and discarded all vertices which are outside of the polygon (blue) which gave me the black center line which I can further use to fit a smooth centerline.

但是,此计算一点都不鲁棒(由于删除了不在多边形内部的voronoi顶点?)有人知道一种算法工作流程来获取多边形的中心线或斑点对象的中心线(二进制图像). (骨架化?,使用内部边缘的中点对多边形进行三角剖分)

However, this computation is not at all robust (due removing voronoi vertices not inside the polygon?) Does somebody know an algorithmic workflow to get the centerline of a polygon or the center line of a blob object (binary image). (skeletonization?, triangulation of polygon an using midpoints of inside edges)

这是一个示范:

推荐答案

我找到了更好的解决方案:

I have found a better solution:

  • 骨架化二进制二进制对象
  • 通过跟踪像素线和分支点
  • 构建骨架的(无循环) >
  • 获取从每个端节点到所有其他端节点的所有最短路径,并采用最长的路径(大约是blob的起点和终点)
  • 从一个末端节点(度= 1)到另一个末端节点的最终路径是蠕虫中间线的近似值.
  • skeltonize the binary blob
  • build the graph (without cycles) of the skeleton by tracing pixel lines and branch points
  • get all shortest paths from each end node to all other end nodes and take the longest one (approximately the start and end of the blob)
  • the resulting path from one end node (degree=1) to another end node is an approximation of the worm middle line.

如果有人对解决方案感兴趣,我可以共享一个python笔记本. 最终结果:绿色=最终中线图,深绿色=最终中线

If someone is interested in the solution, I may share a python notebook. end result: green= final midline graph, dark green=final midline

骨架的图

源代码:
可以在以下位置找到该问题的代码: https://github.com/gabyx/WormAnalysis (如果您使用它,请给它加注星标)

Source Code:
The code to this question can be found here: https://github.com/gabyx/WormAnalysis (if you use it please star it)

这篇关于多边形斑点的中心线(二进制图像)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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