00001 #ifndef vmal_refine_lines_h_ 00002 #define vmal_refine_lines_h_ 00003 //-------------------------------------------------------------------------------- 00004 //: 00005 // \file 00006 // 00007 // Refine two lines using different methods: 00008 // - with this homography between the two images 00009 // * refine at the minimum: keep only the common part of the lines (intersection) 00010 // * refine at the maximum: extend the lines (union) 00011 // - with the fundamental matrix 00012 // Problems have been encountered because when the lines are almost parallel 00013 // to the epipolar lines, big errors occurred. 00014 // 00015 // It could be useful to #include <vnl/vnl_double_3.h> to overload the methods 00016 // to make them handle vgl_point_2d and vgl_lines_segment_2d. 00017 // 00018 // \author 00019 // L. Guichard 00020 //-------------------------------------------------------------------------------- 00021 #include <vnl/vnl_double_3.h> 00022 #include <vnl/vnl_double_3x3.h> 00023 00024 class vmal_refine_lines 00025 { 00026 public: 00027 //--------------------------------------------------------------------------- 00028 //: Constructors. 00029 //--------------------------------------------------------------------------- 00030 vmal_refine_lines(); 00031 00032 //--------------------------------------------------------------------------- 00033 //: Destructor. 00034 //--------------------------------------------------------------------------- 00035 ~vmal_refine_lines(); 00036 00037 //--------------------------------------------------------------------------- 00038 //: Refine the two lines using the fundamental matrix (To improve!). 00039 //--------------------------------------------------------------------------- 00040 void refine_lines_f(vnl_double_3 &line0p, vnl_double_3 &line0q, 00041 vnl_double_3 &line1p, vnl_double_3 &line1q, 00042 const vnl_double_3x3 & F, 00043 vnl_double_3 &r_line0p, vnl_double_3 &r_line0q, 00044 vnl_double_3 &r_line1p, vnl_double_3 &r_line1q); 00045 00046 //--------------------------------------------------------------------------- 00047 //: Refine two lines using the homography matrix and keeping the intersection 00048 //--------------------------------------------------------------------------- 00049 void refine_lines_max_h(vnl_double_3 &line0p, vnl_double_3 &line0q, 00050 vnl_double_3 &line1p, vnl_double_3 &line1q, 00051 const vnl_double_3x3 & H, 00052 vnl_double_3 &r_line0p, vnl_double_3 &r_line0q, 00053 vnl_double_3 &r_line1p, vnl_double_3 &r_line1q); 00054 00055 //--------------------------------------------------------------------------- 00056 //: Refine two lines using the homography matrix and extending to the union 00057 //--------------------------------------------------------------------------- 00058 void refine_lines_min_h(vnl_double_3 &line0p, vnl_double_3 &line0q, 00059 vnl_double_3 &line1p, vnl_double_3 &line1q, 00060 const vnl_double_3x3 &H, 00061 vnl_double_3 &r_line0p, vnl_double_3 &r_line0q, 00062 vnl_double_3 &r_line1p, vnl_double_3 &r_line1q); 00063 }; 00064 00065 #endif