How to determine path from noisy X, Y data

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

    How many points you have?
    A Bezier curve, as mentioned, is a good idea if you have comparedly few points. If you have many points, buiding clusters as suggested by dmckee.

    However you also need another constraint for defining the order of points. There have been many good suggestions for how to chose the points, but unless you introduce another constraint, any gives a possible solution.

    Possible constraints I can think of:

    • shortest path
    • most straight segments
    • least total absolute rotation
    • directional preference (i.e. horizontal / vertical is more likely than crisscrossing)

    In all cases, to meet the constraint you probably need to test all permutations of the sequence. If you start with a "good guess", you cayn terminate the others quickly.

提交回复
热议问题