Here is what I want to do (preferably with Matlab):
Basically, I have a few tracks of cars moving along an intersection. Each of them is noisy, so I want to take the average value for all measurements in order to get a better approximation of the real route. In other words, I'm looking for a way to approximate a curve that has the smallest distance to all labeled traces (in the least square sense).
At first glance, this is very similar to what can be achieved with the spap2 CurveFitting Toolbox (a good example is in the Least Square Approximation section here ). But this algorithm has some major drawback: it takes a function (accurate to one y (x) for each x), but what I want is a curve in 2d (which may have several y (x) for one x). This causes problems when cars turn left or right with more than 90 degrees. Moreover, it accepts vertical displacements, not perpendicular displacements (as defined by wolfram ).
Does anyone know how to solve this problem? I thought about using B-Spline and changed the number of nodes and degree until I reached a certain fitting quality, but I canβt find a way to solve this problem analytically or using the functions provided by the CurveFitting Toolbox. Is there a way to solve this problem without numerical optimization?
source share