MATLAB Answers

How to fit a smooth curve to data in 3D?

2 views (last 30 days)
Brooke McArthur
Brooke McArthur on 30 Jul 2021
Edited: Matt J on 30 Jul 2021
Hello!
I am currently trying to recreate the path of a fiber in CT scans in MATLAB. I am doing this by finding the midpoint of several line segments of the fiber as it moves through the slices of the data and plotting them. I am trying to fit a relatively smooth line through these points that shouls create a reasonably similar path to the actual fiber.
So far, I have had the most success using the cscvn() function, but the spline is very jagged due to over fitting. Does anyone have any suggestions for how to get a smoother curve? Here is how the spline looks at the moment.
I have tried to use the curve fitting tool app as well, but I am not sure how to use it to create a single line with data in 3 dimensions as opposed to a surface. Any feedback is greatly appreciated. Thank you.

Answers (1)

Matt J
Matt J on 30 Jul 2021
Edited: Matt J on 30 Jul 2021
Perhaps with csaps(). There, you have parameters that directly control the level of smoothing.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by