[scilab-Users] finding polynomials of best fit

Serge Steer Serge.Steer at inria.fr
Wed Aug 17 09:14:59 CEST 2011


Le 16/08/2011 16:50, beemc2 at aol.com a écrit :
> I'm a first-year engineering student working with a professor on
> stereoscopic cameras, and one of my assignments is to determine lens
> distortion in the cameras and put together an algorithm to correct
> it.  My basic plan is take photos of a known grid of dots and put
> together a list of their actual positions and their positions as they
> appear in the image, the use some form of statistical regression
> technique to give myself a good approximation of the radial distortion
> as a function of distance from the center.  (a perfect camera with no
> distortion should give a linear relation between the real position and
> the position in the image.)  Since I don't have much information on
> the geometry of the lenses themselves, i can't solve the problem
> analytically.  I want to just get the function as a fourth- or
> fifth-degree Taylor polynomial (I'm told that the fourth term is the
> highest one that will likely be significant).
> So is there a decent function in Scilab that will allow me to find a
> polynomial of best fit for a given set of data?  There's something
> similar in Excel but I'd rather not have to go through the hassle of
> exporting and then re-importing the the data, and I also might need it
> later for other applications.
> YMW
>
You can look at the lsqrsolve if there is no contraints on polynomial
coefficients or  data_fit or leastsq functions if there are bound
constraints.

Serge Steer
INRIA



More information about the users mailing list