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

查看:36
本文介绍了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.

问候克里斯托夫

推荐答案

我认为您是在要求骨架化.请检查以下链接.

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

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

opencv 中的骨架化

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

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