×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# how to find a best fitted curve from a group of curves (points)

## how to find a best fitted curve from a group of curves (points)

(OP)
I am using a 2D laser scanner to scan a curved surface along it's longitude direction (y). This operation results in a point cloud in 3D space. At each y position, I can use least square to find a best fit curve in x,z axis, eg. a functin f(x). However, because of measurement noise, the parameters of each f(x) are slightly different to others. How can I find a best fitted curve from all those curves? and this best fitted curve will be the mathematical model of this surface.

### RE: how to find a best fitted curve from a group of curves (points)

Least squares would be one way.  You try to minimize the aggregate sum of all the deviations from the model.  A more nuanced approach would weight the more critical areas to achieve a better fit in those areas.

### RE: how to find a best fitted curve from a group of curves (points)

You have provided no criteria as to what the "best" model is... least squares is one approach, but only you can decide what method will provide you with the best solution given the data at hand.

What other models have you looked at using?  Why did you select them?  Why did you select LS over the others?

Dan - Owner
http://www.Hi-TecDesigns.com

### RE: how to find a best fitted curve from a group of curves (points)

(OP)
thanks everyone's suggestion. I didn't have data in hand yesterday, so I tried to make it simple to understand. I have got some ideas for this question, but not sure this is good or not.

The image attached show how the measurement data looks like. The object being scanned is not a smoothed, regular surface. It's a sand pile. All this data groups, eg. x1 v.s. z1 were firstly filtered using Gaussian smooth filter.

I can use least square to fit every curve, but I don't know how to use the leasr square to minimize the aggregate sum of all the deviations of these 44 data-set. At the moment, I don't have any criterias to evaulate the fitting result. Only one information I have is the repose angle of the sand. However, it is not a fixed constant, and slope angle of those curves are about the same.

My solution is:
1) K-mean clustering. This results a centroid of each (x,z) pair. Highlighted by 'X' in the image.

2) least square curve fitting.

Any suggestions?

### RE: how to find a best fitted curve from a group of curves (points)

(OP)
This is the image

### RE: how to find a best fitted curve from a group of curves (points)

If you enter every y-value for each x-value into the least squares, the resultant fit is the least squares fit over the dataset.

### RE: how to find a best fitted curve from a group of curves (points)

For an equation to fit your curve, using least square try several "Nth " degree polynomial curves and select the curve that has the highest coefficient of correlation the highest value would be "1" one.

### RE: how to find a best fitted curve from a group of curves (points)

Id probably generate akima splines from the data, since akima will hold true to its outliers (which i figure you care about). To compare one spline to the next, compare the coefficients table.

Give the ALGLIB library a shot. I've written quite a few data analysis programs which required curve fitting and interpolation for Q.C. data on manufactured parts, and have not found something that couldn't be accomplished through some clever application of ALGLIB. Brutally quick algorithms, and flexible to implement.

http://www.alglib.net/

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!