How to determine path from noisy X, Y data

后端 未结 10 1965
星月不相逢
星月不相逢 2021-02-08 21:54

I have an unsorted list of noisy X, Y points. They do, however, form a path through the world. I would like an algorithm to draw an approximation of this data using line segment

10条回答
  •  说谎
    说谎 (楼主)
    2021-02-08 22:10

    My approach would be to first sort your list of points, then use a bezier curve.

    The trick is of course the sorting. Start with one random point and find the nearest point. Assume these two are connected. With those two endpoints, find the nearest points to them. Assume that the one with the smaller distance to it's endpoint is connected to that point. Repeat until all points are connected.

    I assume that there are still some problems with this approach, but maybe you can use it as a starting point (pun intended).

    Edit: You can do it several times with different starting points, and then see where the results differ. That at least gives you some confidence, which points are connected to each other.

提交回复
热议问题