00001 // This is oxl/mvl/mvl_five_point_camera_pencil.h 00002 #ifndef mvl_five_point_camera_pencil_h_ 00003 #define mvl_five_point_camera_pencil_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \author fsm 00010 00011 #include <vnl/vnl_double_3x4.h> 00012 #include <vnl/vnl_double_4.h> 00013 00014 //: 00015 // Given 5 image points, compute the pencil of 00016 // cameras which map the canonical projective 00017 // basis onto those points. 00018 // 00019 // The computed generators [A, B] are invariant 00020 // to similarity transformations of the image 00021 // coordinates. So there is no need to condition 00022 // the given image points. 00023 // 00024 // For full details consult 00025 // "A Six Point Solution for Structure and Motion", by 00026 // Schaffalitzky, Zisserman, Hartley and Torr in ECCV 2000. 00027 00028 bool mvl_five_point_camera_pencil(double const xs[5], 00029 double const ys[5], 00030 vnl_double_3x4 *A, 00031 vnl_double_3x4 *B); 00032 00033 //: 00034 // Return the pair (s, t) such that the reprojection of X under 00035 // P = s A + t B is closest to (u, v) in image coordinates. The 00036 // image residuals are returned in res[]. 00037 bool mvl_five_point_camera_pencil_parameters(vnl_double_3x4 const &A, 00038 vnl_double_3x4 const &B, 00039 vnl_double_4 const &X, 00040 double u, double v, 00041 double st[2], 00042 double res[2]); 00043 00044 #endif // mvl_five_point_camera_pencil_h_