GCOP
1.0
|
00001 #ifndef UAV_CAMERA_H 00002 #define UAV_CAMERA_H 00003 00004 #include "opencv/cv.h" 00005 #include "opencv/highgui.h" 00006 #include <iostream> 00007 //#include <pthread.h> 00008 #include "utils.h" 00009 #include <stdint.h> 00010 #include <Eigen/Dense> 00011 #include <fstream> 00012 #define np 5 00013 00014 00015 namespace gcop { 00016 00017 using namespace Eigen; 00018 typedef Matrix<double, 6, 1> Vector6d; 00019 typedef Matrix<double, 4, 4> Matrix4d; 00020 00026 class Camera { 00027 public: 00028 00029 Camera(double bl = 1.75, double irows=480, double imcols=640, const double *K=0, const double *D=0); 00030 virtual ~Camera(); 00031 00032 bool Pose(Vector6d &q, const cv::Mat &raw, cv::Mat &cont); 00033 bool Pose(Vector6d &q, const cv::Mat &raw); 00034 00035 float tolerance; 00036 int kernel_size; 00037 00038 protected: 00039 00040 //unsigned int width, height; 00041 00042 cv::Mat filt; 00043 00044 cv::Mat rvec; 00045 cv::Mat tvec; 00046 00047 double bl; 00048 00049 //static double _cm[9];//<The camera matrix 00050 //static double _dc[5];//<Distortion coefficients 00051 cv::Mat camMatrix; 00052 cv::Mat dccoeffs; 00053 cv::Point2f iprs[np]; 00054 std::ofstream pointfile; 00055 bool find_contours; 00056 //bool init_obj; 00057 }; 00058 00059 } 00060 00061 #endif