00001 // This is brl/bmvl/bcal/bcal_zhang_linear_calibrate.h 00002 #ifndef AFX_ZHANGLINEARCALIBRATE_H__A6F24F23_8E39_494F_83FB_3ABF8093481D__INCLUDED_ 00003 #define AFX_ZHANGLINEARCALIBRATE_H__A6F24F23_8E39_494F_83FB_3ABF8093481D__INCLUDED_ 00004 //: 00005 // \file 00006 // \author Kongbin Kang (kk@lems.brown.edu) 00007 // Brown University 00008 // \brief zhang linear camera calibration from planary pattern 00009 // \date 3/23/2003 00010 //------------------------------------------------------------------------------ 00011 00012 #if defined(_MSC_VER) && ( _MSC_VER > 1000 ) 00013 #pragma once 00014 #endif // _MSC_VER > 1000 00015 00016 #include <vnl/vnl_vector_fixed.h> 00017 #include <vnl/vnl_double_3x3.h> 00018 #include <vgl/algo/vgl_h_matrix_2d.h> 00019 #include <vgl/algo/vgl_h_matrix_3d.h> 00020 #include "bcal_camera_graph.h" 00021 #include "bcal_calibrate_plane.h" 00022 #include "bcal_zhang_camera_node.h" 00023 #include "bcal_euclidean_transformation.h" 00024 00025 class bcal_zhang_linear_calibrate 00026 { 00027 public: 00028 // compute extrinsic parameters of camera 00029 vgl_h_matrix_3d<double> compute_extrinsic(vgl_h_matrix_2d<double> const &H, 00030 vnl_double_3x3 const &A); 00031 00032 // calibrate the camera array 00033 int calibrate(); 00034 00035 // set camera graph 00036 void setCameraGraph(bcal_camera_graph<bcal_calibrate_plane, bcal_zhang_camera_node, bcal_euclidean_transformation>* pG); 00037 bcal_zhang_linear_calibrate(); 00038 virtual ~bcal_zhang_linear_calibrate(); 00039 00040 protected: 00041 int calibrate_extrinsic(); 00042 void calibrate_intrinsic(); 00043 int compute_homography(); 00044 vnl_vector_fixed<double, 6> homg_constrain(vgl_h_matrix_2d<double> const& hm, int i, int j); 00045 // homographies list hm_list[0...n-1] 00046 vnl_double_3x3 compute_intrinsic(vgl_h_matrix_2d<double> *hm_list, int n); 00047 00048 // get closet rotation matrix from a none rotation matrix Q 00049 vnl_double_3x3 get_closest_rotation(vnl_double_3x3 const & Q); 00050 00051 // allocate memory to store homography according to camera graph 00052 int initialize(); 00053 // clear allocated memory. 00054 int clear(); 00055 00056 private: 00057 bcal_camera_graph<bcal_calibrate_plane, bcal_zhang_camera_node, bcal_euclidean_transformation>* cam_graph_ptr_; 00058 vcl_vector<vgl_h_matrix_2d<double> *> h_matrice_; 00059 vcl_vector<int> num_views_; 00060 }; 00061 00062 #endif // AFX_ZHANGLINEARCALIBRATE_H__A6F24F23_8E39_494F_83FB_3ABF8093481D__INCLUDED_
1.5.1