I want to be able to take a GPX track of a twisty road and have an algorithm count the number of corners. I guess it will have to be done comparing the "bearings" of subsequent tracks. However I'm new to this and wonder if there is a simple solution out there.
问问题
281 次
1 回答
1
If you took your coordinates and were able to determine when the bearings changed, you would have the answer. To do this, we could find the best fit of straight line on the points given. This is the segmented least squares problem - given a set of points, find the minimum cost line segments that fit the points.
There is a tradeoff cost between least-sqaures error and adding a new line (otherwise, creating line segments for every two points would have zero error), you will have to play with the parameters for this yourself with your data.
See
于 2011-05-19T21:07:43.193 回答