How to determine path from noisy X, Y data

后端 未结 10 1960
星月不相逢
星月不相逢 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:21

    With an unsorted list, you won't really know which points to include in each segment, so I guess you could just go with the closest point.

    One way could be to pick a start point at random, and pick the closest point as the next point in each step. Add the first two points to a set S.

    Fit a line to the points in S until the RMS exceeds some value, then clear S and start a new line.

    The intersection of consecutive lines would be the end-points of the segments.

提交回复
热议问题