2

I am currently trying to improve on-line handwriting recognition. On-line means in this case that I have the information how the symbols are written as a list of $n$ tuples of coordinates $(x(t_i), y(t_i))$ with $i \in 1, ..., n$. I can't really influence the times I get. One idea I have is that symbol recognition might get better, if I get more points / evenly spaced points (spaced by time or probably distance).

So I need an interpolation for $(x(t), y(t))$ with $t \in [t_1, t_n]$.

I know how to calculate cubic splines for functions $\mathbb{R} \rightarrow \mathbb{R}$ and I know that they are smooth and easy to calculate.

One way to interpolate the "handwriting-function" $f:\mathbb{R}\rightarrow \mathbb{R}^2$ is to calculate two cubic splines (for $x(t)$ and $y(t)$).

I have a few questions to this:

  • Is this a good idea / is there something (that might be) better? (This is the "soft" part of the question)
  • Is the function still smooth?
  • Do I loose other properties that I'm currently not aware of?
Martin Thoma
  • 10,157
  • Sure, if the components x(t), y(t) are smooth, then f is smooth. – mathematician Jun 09 '14 at 21:06
  • Depends what you mean by smooth. If the first derivative vector is ever zero, the curve might have a sharp corner, even though it's infinitely differentiable. – bubba Jun 10 '14 at 13:01
  • Yes, resampling curves using double spline interpolation is commonly done. As mentioned by @bubba, a possible parameterization is by summing the chord lengths. (Parameterization by the true arc length is possible but computationally involved.) Also be sure to segment the curves into pieces where necessary. –  Jun 10 '14 at 13:30

1 Answers1

2

One way to solve your problem is by using parametric cubic splines. As you say, this involves constructing two spline functions $x=x(t)$ and $y=y(t)$. The main problem is that, in order to do this, you have to assign a $t$ value $t=t_i$ to each of your data points $(x_i,y_i)$. How you do this will have a significant affect on the shape of your curve.

There's a bit more information in this answer, including a link that might be useful.

Some specific answers:

(1) Is it a good idea. Yes, I think so. It's not a new idea. It has been used many times before, and its problems are fairly well understood.

(2) Is the curve smooth. In a mathematical sense it is. A parametric cubic spline will have two continuous derivatives, when considered as a mapping from $\mathbb{R}$ to $\mathbb{R}^2$. But from a geometric or aesthetic point of view, it might not be "smooth". Specifically, at places where the derivative vector $(x', y')$ is zero (if any), there might be sharp corners in the curve. This doesn't happen very often in practice, though. Nasty little loops will occur if you choose the $t_i$ values badly. Again, this is a loss of aesthetic smoothness, not a loss of mathematical smoothness (differentiability).

(3) Do you lose anything. Well, in some sense, you lose your direct connection with the input data, because the $t_i$ values mentioned above are entirely fabricated.

bubba
  • 44,617