finding polynomials of best fit

beemc2 at aol.com beemc2 at aol.com
Tue Aug 16 16:50:09 CEST 2011


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



More information about the users mailing list