Locating the end points of a bridge-like structure in an image

后端 未结 6 1967
隐瞒了意图╮
隐瞒了意图╮ 2021-02-08 02:14

How do I locate the end points of a bridge-like structure in an image?

Below is a generalized representation.

6条回答
  •  忘了有多久
    2021-02-08 03:14

    A generic approach comes to mind:

    1) trace the outline and turn it into a path. So there is one path that goes all around the shape, it being made out of line segments

    2) look for the stem - the place on the path where the line segments are approximately parallel for some distance (a spatial index e.g. octree or kdtree will help keep the search localised)

    3) follow the path in some direction until the two sides suddenly diverge. That's an endpoint to the stem

    4) follow the path in the other direction to find the other endpoint

提交回复
热议问题