contrib/oxl/mvl/mvl_three_view_six_point_structure.h
Go to the documentation of this file.
00001 // This is oxl/mvl/mvl_three_view_six_point_structure.h
00002 #ifndef mvl_three_view_six_point_structure_h_
00003 #define mvl_three_view_six_point_structure_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 // Code for computing projective structure from 3 views of 6 points.
00011 //
00012 // The six points are assumed to be:
00013 //
00014 //  [ 1 ] [ 0 ] [ 0 ] [ 0 ] [ 1 ]     [ X ]
00015 //  [ 0 ] [ 1 ] [ 0 ] [ 0 ] [ 1 ] and [ Y ] = Q
00016 //  [ 0 ] [ 0 ] [ 1 ] [ 0 ] [ 1 ]     [ Z ]
00017 //  [ 0 ] [ 0 ] [ 0 ] [ 1 ] [ 1 ]     [ T ]
00018 //
00019 // There are up to three solutions.
00020 
00021 #include <vnl/vnl_vector.h>
00022 #include <vnl/vnl_matrix.h>
00023 
00024 struct mvl_three_view_six_point_structure
00025 {
00026   mvl_three_view_six_point_structure();
00027 
00028   // this flag is currently ignored.
00029   bool verbose;
00030 
00031   // These matrices have one row per view and 6 columns.
00032   // The ith view of the jth point is (u(i, j), v(i, j)).
00033   vnl_matrix<double> u;
00034   vnl_matrix<double> v;
00035 
00036   // Call this once you have filled in 'u' and 'v'.
00037   bool compute();
00038 
00039   // output data.
00040   struct solution_t
00041   {
00042     bool valid;
00043     vnl_matrix<double> P[3]; // camera matrices.
00044     vnl_vector<double> Q;    // last world point.
00045   } solution[3];
00046 };
00047 
00048 #endif // mvl_three_view_six_point_structure_h_