MATLAB Answers

3D Fit of Centreline

7 views (last 30 days)
William
William on 10 Apr 2015
Commented: William on 12 Apr 2015
I've got a 3D data set (shown below) and I want to fit it with a line, the points of this line fit need to be equidistant apart.
Any tools able to do this? Or methods of how to achieve this?
Many thanks, Will

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 10 Apr 2015
Have you tried a Savitzky-Golay filter on the x, y, and z independently? Attached is a demo of sgolayfilt() in the Signal Processing Toolbox.

  0 Comments

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 10 Apr 2015
Do you want to smooth (regress) those points to get a smoother path? Or interpolate additional points in between those points while keeping those points where they are?
Of course we should not forget the venerable John D'Errico's interparc : http://www.mathworks.com/matlabcentral/fileexchange/34874-interparc. It sounds like just what you want to do if you want to keep those training points fixed and interpolate evenly spaced points along the curve.

  4 Comments

Show 1 older comment
William
William on 12 Apr 2015
I'll try a S-G Filter followed by interparc
William
William on 12 Apr 2015
Looking tasty. Could we calculate a standard deviation or some other error measure against the original points?
William
William on 12 Apr 2015
Simple enough - Minus filtered from original data and take statistical profile of this.
Thanks very much for your help :)

Sign in to comment.

Sign in to answer this question.


Translated by