B-spline curve fitting

1.9k Views Asked by At

I am trying to do curve fitting with b-splines. Searching on the internet, i found that a simply could use least square fit,

$$E = \frac{1}{2} \sum_{k=0}^m |C(t_k) - X_k|^2$$

where $C$ is the b-spline curve and $X_k$ is the k:th that point. What I dont understand is how I should choose the knot values $t_k$. I feel like i should use a $t_k$ that is close to the k:th data point.

I found this link in another stackexchange post, that says every data point has a sample time $s_k$ and i should map these sample times to the parmeter domain $t_k = \frac{s_k - s_0}{s_m - s_0} $ . But I dont have sample times for my data points, just x y - coordinates.

What am i missing/not understanding?

1

There are 1 best solutions below

2
On

There is no single "correct" way to choose the parameter values $t_k$. The usual technique is to choose them so that $t_k - t_{k-1} = \|\mathbf{X}_k - \mathbf{X}_{k-1}\|$, but this is really little more than a heuristic.

There is some discussion of the options starting on this web page.

If you're willing to do a lot more work, you can regard the $t_k$ as unknowns in the optimization problem. But then the problem becomes non-linear and therefore much more difficult. You will need to find a suitable non-linear optimization package. Typically the hard part of non-linear optimization is finding a place to start the iterations. I suggest you calculate $t_k$ values as I described in the first paragraph above. Then solve the linear problem with these $t_k$ values fixed. Then use the $t_k$ values and the calculated control points as a starting location for an optimization.