opencv从任意区域提取路径(中心线) [英] opencv extract path (centerline) from arbitrary area

查看:1385
本文介绍了opencv从任意区域提取路径(中心线)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任意区域,想要提取路径(像素系列)。路径应该开始和结束,这样你走的路最长,但总是留在中间,在你的边界之间。

I have an arbitray area and want to extract a path (series of pixels). The path should start and end so that you walk the longest way but always stay in the center, between your borders.

有没有明智的方法在opencv中实现这个?
基本上像侵蚀这样的形态滤波器(找到边界之间的中间)听起来不错。但是我不想缩短路径的长度。

Is there any sensible way to implement this in opencv? Basically a morphologic filter like erosion (to find the middle between the borders) sounds good. However I do not want to shorten the the length of the path.

它不需要是一个全自动的解决方案。用户输入,例如标记路径的起点和终点也是一种选择。

It does not need to be a fully automatic solution. User input, e.g. marking the start and end point of an path, is also an option.

这是一个用油漆绘制的(相当差的)示例。我想你明白了。

Here is a (rather poor) example drawn with paint. I guess you get the point.

关于
Christoph

Regards Christoph

推荐答案

我想你在问用于骨架化。请检查以下链接。

I think you are asking for skeletonization. Check the following links please.

http://opencvpython.blogspot.com/2012/05/skeletonization-using-opencv-python.html

< a href =https://stackoverflow.com/questions/12488894/skeletonization-in-opencv> opencv中的骨架化

这篇关于opencv从任意区域提取路径(中心线)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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