## 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)

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

Chinese prisoner wins Nobel Peace Prize

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

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)

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)

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

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

Chinese prisoner wins Nobel Peace Prize

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

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

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/