opencv extract path (centerline) from arbitrary area

ε祈祈猫儿з 提交于 2019-12-23 02:57:05

问题


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.

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.

Regards Christoph


回答1:


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

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

Skeletonization in opencv



来源:https://stackoverflow.com/questions/21039535/opencv-extract-path-centerline-from-arbitrary-area

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!