Find tunnel 'center line'?

前端 未结 3 1179
轻奢々
轻奢々 2020-12-23 23:40

I have some map files consisting of \'polylines\' (each line is just a list of vertices) representing tunnels, and I want to try and find the tunnel \'center line\' (shown,

3条回答
  •  忘掉有多难
    2020-12-24 00:11

    This is a pretty classic skeletonization problem; there are lots of algorithms available. Some algorithms work in principle on outline contours, but since almost everyone uses them on images, I'm not sure how available such things will be. Anyway, if you can just plot and fill the sewer outlines and then use a skeletonization algorithm, you could get something close to the midline (within pixel resolution).

    Then you could walk along those lines and do a binary search with circles until you hit at least two separate line segments (three if you're at a branch point). The midpoint of the two spots you first hit, or the center of a circle touching the three points you first hit, is a good estimate of the center.

提交回复
热议问题