## [Hugin-cvs] SF.net SVN: hugin:[4126] hugin/branches/gsoc2009_lenscalibration/src/ lens_calibrate

 [Hugin-cvs] SF.net SVN: hugin:[4126] hugin/branches/gsoc2009_lenscalibration/src/ lens_calibrate From: - 2009-07-29 23:05:19 ```Revision: 4126 http://hugin.svn.sourceforge.net/hugin/?rev=4126&view=rev Author: blimbo Date: 2009-07-29 23:05:12 +0000 (Wed, 29 Jul 2009) Log Message: ----------- Minor changes, inv_radial function Modified Paths: -------------- hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/MapPoints.cpp hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp Modified: hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/MapPoints.cpp =================================================================== --- hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/MapPoints.cpp 2009-07-29 18:19:16 UTC (rev 4125) +++ hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/MapPoints.cpp 2009-07-29 23:05:12 UTC (rev 4126) @@ -110,7 +110,44 @@ y_src = y_dest * scale; return 1; } +/* +int inv_radial( double& x_dest, double& y_dest, double& x_src, double& y_src, double *p){ + // params: double coefficients[4] + // param values + //i: 0 => 1.000000 = 1-(a+b+c) + //i: 1 => 0.000000 = c === p[2] + //i: 2 => 0.000000 = b === p[1] + //i: 3 => 0.000000 = a === p[0] + //i: 4 => 250.000000 scale??? + //i: 5 => 1000.000000 ??? + + register double rs, rd, f, scale; + int iter = 0; + + rd = (sqrt( x_dest*x_dest + y_dest*y_dest )) / ((double*)params)[4]; // Normalized + + rs = rd; + f = (((((double*)params)[3] * rs + ((double*)params)[2]) * rs + + ((double*)params)[1]) * rs + ((double*)params)[0]) * rs; + + while( abs(f - rd) > R_EPS && iter++ < MAXITER ) + { + rs = rs - (f - rd) / ((( 4 * ((double*)params)[3] * rs + 3 * ((double*)params)[2]) * rs + + 2 * ((double*)params)[1]) * rs + ((double*)params)[0]); + + f = (((((double*)params)[3] * rs + ((double*)params)[2]) * rs + + ((double*)params)[1]) * rs + ((double*)params)[0]) * rs; + } + + scale = rs / rd; +// printf("scale = %lg iter = %d\n", scale,iter); + + x_src = x_dest * scale ; + y_src = y_dest * scale ; + return 1; +} +*/ int rect_sphere_tp(double& x_dest,double& y_dest, double& x_src, double& y_src){ // params: double distanceparam Modified: hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp =================================================================== --- hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp 2009-07-29 18:19:16 UTC (rev 4125) +++ hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp 2009-07-29 23:05:12 UTC (rev 4126) @@ -997,7 +997,7 @@ if (good_lines == 0){ - cout << "No lines found!" << endl; + cout << "No lines found!" << endl << endl; }else{ // Create image for each line for (int i = plotted; i < lines.size(); i++){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```