Interpolation of a discrete 3D trajectory

P

Peter Beattie

Hey guys,

I'm looking for a way to smooth out the edges of a 3D trajectory that is
really just a sequence of points in space. I've got co-ordinates just
like these:

0.072 -0.25 0.582
-0.036 -0.25 0.644
0.036 0.338 0.104

What I would like to have now is for the trajectory not to pass through
the individual points at a sharp angle, but to have an interpolated
curve instead.

Is there a reasonably easy way from, say, a 10 co-ordinate input to get
a 90 co-ordinate output with the 8 inner nodes replaced by a 10-point
quasi-curve?

(A cookbook recipe and SciPy didn't seem to contain obvious solutions.)
 
?

=?ISO-8859-1?Q?Jules_C=E9sar?=

Peter Beattie a écrit :
Hey guys,

I'm looking for a way to smooth out the edges of a 3D trajectory that is
really just a sequence of points in space. I've got co-ordinates just
like these:

0.072 -0.25 0.582
-0.036 -0.25 0.644
0.036 0.338 0.104

What I would like to have now is for the trajectory not to pass through
the individual points at a sharp angle, but to have an interpolated
curve instead.

Is there a reasonably easy way from, say, a 10 co-ordinate input to get
a 90 co-ordinate output with the 8 inner nodes replaced by a 10-point
quasi-curve?

(A cookbook recipe and SciPy didn't seem to contain obvious solutions.)
Something like
newdata= FFT.inverse_real_fft(FFT.real_fft(data),newlen)*newlen/len(data)
should be enough ?
+ maybe have to add some Hanning windowing filter to keep limits clean.
 
S

Scott David Daniels

Peter said:
I'm looking for a way to smooth out the edges of a 3D trajectory that is
really just a sequence of points in space....
What I would like to have now is for the trajectory not to pass through
the individual points at a sharp angle, but to have an interpolated
curve instead.

Is there a reasonably easy way from, say, a 10 co-ordinate input to get
a 90 co-ordinate output with the 8 inner nodes replaced by a 10-point
quasi-curve?

(A cookbook recipe and SciPy didn't seem to contain obvious solutions.)
If you know more about what the curve should be like, you can decide
among various ways to interpolate (the term for what you want to do).
I personally like the cubic B-spline because it is so easy to
"understand" it visually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top