how many control points are needed if n+1 data points are interpolated by p degree(or p+1 order) B-Spline?
Exactly, I suppose that both the number of control points and knot points are decided by the number of data points to be interpolated and the degree of B-Spline basis. However, I found two different answers to the question.
B-spline Curves: Definition
Curve Global Interpolation
it says the
Given a set of n+1 data points, $D_0$, $D_2$, ..., $D_n$ and a degree $p$, find a B-spline curve of degree $p$ defined by $n+1$ control points that passes all data points in the given order.
In summary, it means the number of control points is the number of the data points
Trajectory Planning for Automatic Machines and Robots
this book page 198
it means that the number of control points is the number of data points $n+1$ plus the degree $p$ then minus $1$.
thus, these two answers are conflicted, after all the first is not related to the degree and the second is related to the degree. Anyone could explain this, please I need help.
For the first description where "the number of control points is the number of the data points", this is the basic B-spline interpolation problem. The resulting B-spline will have $(n+1)$ control points and will have $(n+1-p)$ Bezier segments. This means that the knot points (i.e., the points on the curve corresponding to the knots) will in general not be coincident with the data points.
For the second description, the construction of the knot vector (i.e., eq 4.42) means that it is forcing the knot points to be coincident with the data points. This means that the resulting B-spline curve needs to have $n$ Bezier segments and therefore the B-spline curve will have $(n+1)+p-1$ control points. Since we only have $(n+1)$ data points, we still need $(p-1)$ additional constraints in order to find the unique solution. When $p=3$ (i.e., cubic B-spline), we need 2 additional constraints and a very common choice is to force the 2nd derivative to be 0.0 at $t=0$ and $t=1$, which will produce a result commonly known as "natural cubic spline".
In summary, both descriptions are correct and both are B-spline interpolation. But the resulting B-spline from the 2nd description will have knot points coincident with the data points while the result from the 1st description will not.