4

here is what I want to do (preferably with Matlab):

Basically I have several traces of cars driving on an intersection. Each one is noisy, so I want to take the mean over all measurements to get a better approximation of the real route. In other words, I am looking for a way to approximate the Curve, which has the smallest distence to all of the meassured traces (in a least-square sense).

At the first glance, this is quite similar what can be achieved with spap2 of the CurveFitting Toolbox (good example in section Least-Squares Approximation here). But this algorithm has some major drawback: It assumes a function (with exactly one y(x) for every x), but what I want is a curve in 2d (which may have several y(x) for one x). This leads to problems when cars turn right or left with more then 90 degrees. Futhermore it takes the vertical offsets and not the perpendicular offsets (according to the definition on wolfram).

Has anybody an idea how to solve this problem? I thought of using a B-Spline and change the number of knots and the degree until I reached a certain fitting quality, but I can't find a way to solve this problem analytically or with the functions provided by the CurveFitting Toolbox. Is there a way to solve this without numerical optimization?

4

1 に答える 1

0

mbeckishは正しいです。曲線の形状に十分な柔軟性を持たせるには、明示的な表現y(x)の代わりに、パラメトリック曲線表現(x(t)、y(t))を使用する必要があります。パラメトリック方程式を参照してください。

曲線上のn個の連続するポイントが与えられた場合、それを知っている場合はそれらに真の時間を割り当て、知らない場合は整数0..n-1を割り当てます。次に、X、Yの代わりにベクトルT、XおよびT、Yを使用してspap2を2回呼び出します。ここで、任意のtに対して、曲線上の点(x、y)を取得します。

これは真の最小二乗解を与えるものではありませんが、ニーズには十分なはずです。

于 2012-02-18T14:12:09.693 に答える