问题
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