calculate turning points / pivot points in trajectory (path)

前端 未结 5 1320
花落未央
花落未央 2020-12-23 01:41

I\'m trying to come up with an algorithm that will determine turning points in a trajectory of x/y coordinates. The following figures illustrates what I mean: green indicate

5条回答
  •  失恋的感觉
    2020-12-23 02:38

    Another idea is to examine the left and the right surroundings at every point. This may be done by creating a linear regression of N points before and after each point. If the intersecting angle between the points is below some threshold, then you have an corner.

    This may be done efficiently by keeping a queue of the points currently in the linear regression and replacing old points with new points, similar to a running average.

    You finally have to merge adjacent corners to a single corner. E.g. choosing the point with the strongest corner property.

提交回复
热议问题