[panotools-cvs] SF.net SVN: panotools:[1009] branches/libpano_gsoc2009_mosaic/math.c

 [panotools-cvs] SF.net SVN: panotools:[1009] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-13 08:56:07 ```Revision: 1009 http://panotools.svn.sourceforge.net/panotools/?rev=1009&view=rev Author: dkg5 Date: 2009-07-13 08:56:02 +0000 (Mon, 13 Jul 2009) Log Message: ----------- midterm update Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-13 08:55:46 UTC (rev 1008) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-13 08:56:02 UTC (rev 1009) @@ -437,27 +437,28 @@ printf( "Entered modified vert function \n"); // params: double - double theta = 0.523599; // 30 degrees in radians - //double theta = 0.087; // small angle in radians + //double theta = 0.523599; // 30 degrees in radians + double theta = 0.087; // small angle in radians double v[3]; // 3D projective coordinate vector double m_slant[3][3]; // slant matrix + double ymax, z0, z1; - // SLANT to STRAIGHT matrix + // SLANT to STRAIGHT matrix (matrix 2 in MATLAB) // m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; // m_slant[1][0] = 0; m_slant[1][1] = 1/cos(theta); m_slant[1][2] = 0; // m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; - // STRAIGHT to SLANT matrix + // STRAIGHT to SLANT matrix (matrix 3 in MATLAB) // m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; // m_slant[1][0] = 0; m_slant[1][1] = cos(theta); m_slant[1][2] = 0; // m_slant[2][0] = 0; m_slant[2][1] = -sin(theta); m_slant[2][2] = 1; // identity matrix, for testing purposes: -// m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; -// m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; -// m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; + m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; + m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; + m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; // v[0] = x_dest; @@ -470,15 +471,35 @@ // *x_src = v[0]/v[2]; // convert back to cartesian coordinates // *y_src = v[1]/v[2]; - // Above calculations confuse destination with source. Try reverse approach + // Above calculations confuse destination with source. Try inverse approach // *x_src = x_dest * (y_dest * sin(theta))/(1 - y_dest * sin(theta)) + x_dest; // *y_src = (y_dest * cos(theta))/(1 - y_dest * sin(theta)); // Compare to STRAIGHT to SLANT matrix (should be the same!) + // + ymax = 378; // max pixel coordinate for image + //z0 = ymax/tan(50/2); // 30 is full angle FOV in degrees + // z0 is distance to image from center of projection + // replace with distance param?? + + z0 = 1667.618212; // distance param for image + z1 = z0 - y_dest *tan(theta); + //printf("z1 is %f \n", z1); + // Now you have [x_dest, y_dest, z1]'. Multiply that vector by M, the adjusted slant matrix + v[0] = x_dest; + v[1] = y_dest; + v[2] = 50; + + matrix_mult(m_slant,v); + *x_src = v[0]/v[2]; // convert back to cartesian coordinates + *y_src = v[1]/v[2]; + + + // Original vert function code: - *x_src = x_dest; - *y_src = y_dest + shift; +// *x_src = x_dest; +// *y_src = y_dest + shift; return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```

 [panotools-cvs] SF.net SVN: panotools:[1000] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-03 18:55:06 ```Revision: 1000 http://panotools.svn.sourceforge.net/panotools/?rev=1000&view=rev Author: dkg5 Date: 2009-07-03 18:55:06 +0000 (Fri, 03 Jul 2009) Log Message: ----------- More trials on smaller 10x10 and 4x4 images to see actual pixel remapping Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-02 08:24:41 UTC (rev 999) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-03 18:55:06 UTC (rev 1000) @@ -284,7 +284,7 @@ while( (stack->func) != NULL ) { if ( (stack->func) ( xd, yd, x_src, y_src, stack->param ) ) { - //printf("Execute stack %f %f %f %f\n", xd, yd, *x_src, *y_src); + printf("Execute stack %f %f %f %f\n", xd, yd, *x_src, *y_src); xd = *x_src; yd = *y_src; stack++; @@ -436,18 +436,26 @@ printf( "Entered vert function \n"); // params: double double theta = 0.523599; // 30 degrees in radians + //double theta = 0.087; // small angle in radians double v[3]; // 3D projective coordinate vector double m_slant[3][3]; // slant matrix + // SLANT to STRAIGHT matrix + m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; + m_slant[1][0] = 0; m_slant[1][1] = 1/cos(theta); m_slant[1][2] = 0; + m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; + + + // STRAIGHT to SLANT matrix // m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; -// m_slant[1][0] = 0; m_slant[1][1] = 1/cos(theta); m_slant[1][2] = 0; -// m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; +// m_slant[1][0] = 0; m_slant[1][1] = cos(theta); m_slant[1][2] = 0; +// m_slant[2][0] = 0; m_slant[2][1] = -sin(theta); m_slant[2][2] = 1; - // temporary testing matrix: - m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; - m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; - m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; + // identity matrix, for testing purposes: +// m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; +// m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; +// m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1004] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-07 10:34:39 ```Revision: 1004 http://panotools.svn.sourceforge.net/panotools/?rev=1004&view=rev Author: dkg5 Date: 2009-07-07 07:27:36 +0000 (Tue, 07 Jul 2009) Log Message: ----------- further comments and diagnostics Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-07 07:26:58 UTC (rev 1003) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-07 07:27:36 UTC (rev 1004) @@ -443,9 +443,9 @@ double m_slant[3][3]; // slant matrix // SLANT to STRAIGHT matrix - m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; - m_slant[1][0] = 0; m_slant[1][1] = 1/cos(theta); m_slant[1][2] = 0; - m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; +// m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; +// m_slant[1][0] = 0; m_slant[1][1] = 1/cos(theta); m_slant[1][2] = 0; +// m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; // STRAIGHT to SLANT matrix @@ -460,16 +460,27 @@ // m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; +// v[0] = x_dest; +// v[1] = y_dest; +// v[2] = 1; // convert to projective coordinate +// // assume z to be 1 for now +// +// +// matrix_mult( m_slant, v ); +// *x_src = v[0]/v[2]; // convert back to cartesian coordinates +// *y_src = v[1]/v[2]; + + // Above calculations confuse destination with source. Try reverse approach +// *x_src = x_dest * (y_dest * sin(theta))/(1 - y_dest * sin(theta)) + x_dest; +// *y_src = (y_dest * cos(theta))/(1 - y_dest * sin(theta)); + // Compare to STRAIGHT to SLANT matrix (should be the same!) - v[0] = x_dest; - v[1] = y_dest; - v[2] = 1; // convert to projective coordinate - // assume z to be 1 for now - - - matrix_mult( m_slant, v ); - *x_src = v[0]/v[2]; // convert back to cartesian coordinates - *y_src = v[1]/v[2]; + + // Original vert function code: + *x_src = x_dest; + *y_src = y_dest + shift; + + return 1; } @@ -1552,6 +1563,21 @@ int sphere_tp_rect( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +// Dev: When all parameters are set to 0, this is the first function that alters pixel +// coordinates in the stack. +// Here's what Tom Sharpless explains on the mailing list: +// http://groups.google.com/group/hugin-ptx/browse_thread/thread/c01fb82c91c7e502/d01bde29b3bdc333 +//For circularly symmetric lenses, panotools does this by +//converting to polar coordinates +//(A,Theta) centered on the optical axis. The raw radial angle, +//sqrt(x*x + y*y)/(FL in pixels), has to +//be converted to true angle A by inverting the actual lens projection; +//panotools uses the ideal +//function times a 4th order correction polynomial. The polar angle, +//Theta = atan2(y,x), does not depend +//on the projection in this case. [For most non-circularly symmetric +//"lenses", Panotools converts +//directly to equirectangular coordinates centered at (0,0) instead]. { // params: double distanceparam @@ -1565,6 +1591,7 @@ *y_src = *((double*)params) * theta * sin( phi ); #endif r = sqrt(x_dest*x_dest + y_dest*y_dest) / distanceparam; + printf("distanceparam = %f",distanceparam); if( r== 0.0 ) theta = 1.0; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1009] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-13 08:56:07 ```Revision: 1009 http://panotools.svn.sourceforge.net/panotools/?rev=1009&view=rev Author: dkg5 Date: 2009-07-13 08:56:02 +0000 (Mon, 13 Jul 2009) Log Message: ----------- midterm update Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-13 08:55:46 UTC (rev 1008) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-13 08:56:02 UTC (rev 1009) @@ -437,27 +437,28 @@ printf( "Entered modified vert function \n"); // params: double - double theta = 0.523599; // 30 degrees in radians - //double theta = 0.087; // small angle in radians + //double theta = 0.523599; // 30 degrees in radians + double theta = 0.087; // small angle in radians double v[3]; // 3D projective coordinate vector double m_slant[3][3]; // slant matrix + double ymax, z0, z1; - // SLANT to STRAIGHT matrix + // SLANT to STRAIGHT matrix (matrix 2 in MATLAB) // m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; // m_slant[1][0] = 0; m_slant[1][1] = 1/cos(theta); m_slant[1][2] = 0; // m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; - // STRAIGHT to SLANT matrix + // STRAIGHT to SLANT matrix (matrix 3 in MATLAB) // m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; // m_slant[1][0] = 0; m_slant[1][1] = cos(theta); m_slant[1][2] = 0; // m_slant[2][0] = 0; m_slant[2][1] = -sin(theta); m_slant[2][2] = 1; // identity matrix, for testing purposes: -// m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; -// m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; -// m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; + m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; + m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; + m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; // v[0] = x_dest; @@ -470,15 +471,35 @@ // *x_src = v[0]/v[2]; // convert back to cartesian coordinates // *y_src = v[1]/v[2]; - // Above calculations confuse destination with source. Try reverse approach + // Above calculations confuse destination with source. Try inverse approach // *x_src = x_dest * (y_dest * sin(theta))/(1 - y_dest * sin(theta)) + x_dest; // *y_src = (y_dest * cos(theta))/(1 - y_dest * sin(theta)); // Compare to STRAIGHT to SLANT matrix (should be the same!) + // + ymax = 378; // max pixel coordinate for image + //z0 = ymax/tan(50/2); // 30 is full angle FOV in degrees + // z0 is distance to image from center of projection + // replace with distance param?? + + z0 = 1667.618212; // distance param for image + z1 = z0 - y_dest *tan(theta); + //printf("z1 is %f \n", z1); + // Now you have [x_dest, y_dest, z1]'. Multiply that vector by M, the adjusted slant matrix + v[0] = x_dest; + v[1] = y_dest; + v[2] = 50; + + matrix_mult(m_slant,v); + *x_src = v[0]/v[2]; // convert back to cartesian coordinates + *y_src = v[1]/v[2]; + + + // Original vert function code: - *x_src = x_dest; - *y_src = y_dest + shift; +// *x_src = x_dest; +// *y_src = y_dest + shift; return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1010] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-13 09:06:05 ```Revision: 1010 http://panotools.svn.sourceforge.net/panotools/?rev=1010&view=rev Author: dkg5 Date: 2009-07-13 09:06:03 +0000 (Mon, 13 Jul 2009) Log Message: ----------- corrected projective distance coordinate in z Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-13 08:56:02 UTC (rev 1009) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-13 09:06:03 UTC (rev 1010) @@ -488,7 +488,7 @@ // Now you have [x_dest, y_dest, z1]'. Multiply that vector by M, the adjusted slant matrix v[0] = x_dest; v[1] = y_dest; - v[2] = 50; + v[2] = z1; matrix_mult(m_slant,v); *x_src = v[0]/v[2]; // convert back to cartesian coordinates This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1012] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-16 18:45:54 ```Revision: 1012 http://panotools.svn.sourceforge.net/panotools/?rev=1012&view=rev Author: dkg5 Date: 2009-07-16 18:45:50 +0000 (Thu, 16 Jul 2009) Log Message: ----------- identified location for forward and inverse functions Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-16 17:03:21 UTC (rev 1011) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-16 18:45:50 UTC (rev 1012) @@ -438,10 +438,11 @@ printf( "Entered modified vert function \n"); // params: double //double theta = 0.523599; // 30 degrees in radians + //double theta = 0.174532925; // 10 degrees in radians double theta = 0.087; // small angle in radians double v[3]; // 3D projective coordinate vector double m_slant[3][3]; // slant matrix - double ymax, z0, z1; + double ymax, z0, z1, FOV; // SLANT to STRAIGHT matrix (matrix 2 in MATLAB) // m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; @@ -478,11 +479,12 @@ // ymax = 378; // max pixel coordinate for image - //z0 = ymax/tan(50/2); // 30 is full angle FOV in degrees + FOV = 30; // FOV for minigrid image + z0 = ymax/tan(FOV/2); // 30 is full angle FOV in degrees // z0 is distance to image from center of projection // replace with distance param?? - z0 = 1667.618212; // distance param for image + //z0 = 1667.618212; // distance param for image z1 = z0 - y_dest *tan(theta); //printf("z1 is %f \n", z1); // Now you have [x_dest, y_dest, z1]'. Multiply that vector by M, the adjusted slant matrix @@ -697,6 +699,8 @@ return 0; } else return 1; + + // This is where forward slant function will go } // This is the cylindrical projection @@ -1742,6 +1746,8 @@ *y_src = distanceparam * atan2( y_dest, sqrt( distanceparam*distanceparam + x_dest*x_dest ) ); return 1; + + // This is where inverse slant/tilt function will go } /** convert from erect to biplane */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1013] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-22 08:39:48 ```Revision: 1013 http://panotools.svn.sourceforge.net/panotools/?rev=1013&view=rev Author: dkg5 Date: 2009-07-22 08:39:45 +0000 (Wed, 22 Jul 2009) Log Message: ----------- debugging tilting code - BROKEN as of now Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-16 18:45:50 UTC (rev 1012) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-22 08:39:45 UTC (rev 1013) @@ -431,15 +431,15 @@ // Dev: Attempt to create new stack function. Will replace existing vert function // with a new function that will multiply coordinates by slanting matrix -// ************** THIS IS THE SLANT FUNCTION ************************* +// ************** THIS IS THE TILT FUNCTION ************************* int vert( double x_dest, double y_dest, double* x_src, double* y_src, void* params) { printf( "Entered modified vert function \n"); // params: double //double theta = 0.523599; // 30 degrees in radians - //double theta = 0.174532925; // 10 degrees in radians - double theta = 0.087; // small angle in radians + double theta = 0.174532925; // 10 degrees in radians + //double theta = 0.087; // small angle in radians double v[3]; // 3D projective coordinate vector double m_slant[3][3]; // slant matrix double ymax, z0, z1, FOV; @@ -450,16 +450,16 @@ // m_slant[2][0] = 0; m_slant[2][1] = sin(theta)/cos(theta); m_slant[2][2] = 1; - // STRAIGHT to SLANT matrix (matrix 3 in MATLAB) -// m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; -// m_slant[1][0] = 0; m_slant[1][1] = cos(theta); m_slant[1][2] = 0; -// m_slant[2][0] = 0; m_slant[2][1] = -sin(theta); m_slant[2][2] = 1; + // STRAIGHT to TILT matrix (tilt2() in MATLAB) + m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; + m_slant[1][0] = 0; m_slant[1][1] = cos(theta); m_slant[1][2] = 0; + m_slant[2][0] = 0; m_slant[2][1] = -sin(theta); m_slant[2][2] = 1; // identity matrix, for testing purposes: - m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; - m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; - m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; +// m_slant[0][0] = 1; m_slant[0][1] = 0; m_slant[0][2] = 0; +// m_slant[1][0] = 0; m_slant[1][1] = 1; m_slant[1][2] = 0; +// m_slant[2][0] = 0; m_slant[2][1] = 0; m_slant[2][2] = 1; // v[0] = x_dest; @@ -478,23 +478,23 @@ // Compare to STRAIGHT to SLANT matrix (should be the same!) // - ymax = 378; // max pixel coordinate for image + ymax = 5.5; // max pixel coordinate for minigrid image FOV = 30; // FOV for minigrid image z0 = ymax/tan(FOV/2); // 30 is full angle FOV in degrees // z0 is distance to image from center of projection // replace with distance param?? //z0 = 1667.618212; // distance param for image - z1 = z0 - y_dest *tan(theta); - //printf("z1 is %f \n", z1); + //z1 = z0 - y_dest *tan(theta); + printf("z0 is %f \n", z0); // Now you have [x_dest, y_dest, z1]'. Multiply that vector by M, the adjusted slant matrix v[0] = x_dest; v[1] = y_dest; - v[2] = z1; + v[2] = z0; matrix_mult(m_slant,v); - *x_src = v[0]/v[2]; // convert back to cartesian coordinates - *y_src = v[1]/v[2]; + *x_src = z0 * v[0] / v[2]; // convert back to cartesian coordinates + *y_src = z0 * v[1] / v[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1014] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-07-23 05:49:38 ```Revision: 1014 http://panotools.svn.sourceforge.net/panotools/?rev=1014&view=rev Author: dkg5 Date: 2009-07-23 05:49:34 +0000 (Thu, 23 Jul 2009) Log Message: ----------- fixed degree to radian bug - now matches MATLAB code Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-07-22 08:39:45 UTC (rev 1013) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-07-23 05:49:34 UTC (rev 1014) @@ -479,7 +479,7 @@ // ymax = 5.5; // max pixel coordinate for minigrid image - FOV = 30; // FOV for minigrid image + FOV = DEG_TO_RAD(30); // FOV for minigrid image z0 = ymax/tan(FOV/2); // 30 is full angle FOV in degrees // z0 is distance to image from center of projection // replace with distance param?? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [panotools-cvs] SF.net SVN: panotools:[1016] branches/libpano_gsoc2009_mosaic/math.c From: - 2009-08-01 02:48:23 ```Revision: 1016 http://panotools.svn.sourceforge.net/panotools/?rev=1016&view=rev Author: dkg5 Date: 2009-08-01 02:48:16 +0000 (Sat, 01 Aug 2009) Log Message: ----------- Working code for tilting image wall.jpg image by 30 degrees Modified Paths: -------------- branches/libpano_gsoc2009_mosaic/math.c Modified: branches/libpano_gsoc2009_mosaic/math.c =================================================================== --- branches/libpano_gsoc2009_mosaic/math.c 2009-08-01 02:46:55 UTC (rev 1015) +++ branches/libpano_gsoc2009_mosaic/math.c 2009-08-01 02:48:16 UTC (rev 1016) @@ -437,8 +437,9 @@ printf( "Entered modified vert function \n"); // params: double - //double theta = 0.523599; // 30 degrees in radians - double theta = 0.174532925; // 10 degrees in radians + double theta = 0.523599; // 30 degrees in radians + //double theta = 0.174532925; // 10 degrees in radians + //double theta = 0.0523598776; // 3 degrees in radians //double theta = 0.087; // small angle in radians double v[3]; // 3D projective coordinate vector double m_slant[3][3]; // slant matrix @@ -477,12 +478,22 @@ // *y_src = (y_dest * cos(theta))/(1 - y_dest * sin(theta)); // Compare to STRAIGHT to SLANT matrix (should be the same!) - // - ymax = 5.5; // max pixel coordinate for minigrid image - FOV = DEG_TO_RAD(30); // FOV for minigrid image - z0 = ymax/tan(FOV/2); // 30 is full angle FOV in degrees + // Parameters for minigrid image +// ymax = 5.5; // max pixel coordinate for minigrid image +// FOV = DEG_TO_RAD(30); // FOV for minigrid image +// z0 = ymax/tan(FOV/2); // FOV is full angle FOV in degrees +// // z0 is distance to image from center of projection +// // replace with distance param?? + + // Parameters for wall image + ymax = 375; // max pixel coordinate for wall image + // this value is entered manually. + // where does this value come from?? + FOV = DEG_TO_RAD(25.3607669836396); // FOV for wall image + z0 = ymax/tan(FOV/2); // FOV is full angle FOV in degrees // z0 is distance to image from center of projection - // replace with distance param?? + // replace with distance param?? + //z0 = 1667.618212; // distance param for image //z1 = z0 - y_dest *tan(theta); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```