00001 // -*- c++ -*- 00002 // Copyright 2008 Isis Innovation Limited 00003 00004 #ifndef __CAMERACALIBRATOR_H 00005 #define __CAMERACALIBRATOR_H 00006 #include "CalibImage.h" 00007 #include <gvars3/gvars3.h> 00008 #include <vector> 00009 #include "GLWindow2.h" 00010 #include <ros/ros.h> 00011 #include <image_transport/image_transport.h> 00012 #include <sensor_msgs/image_encodings.h> 00013 00014 class CameraCalibrator 00015 { 00016 public: 00017 CameraCalibrator(); 00018 ~CameraCalibrator(); 00019 void Run(); 00020 00021 protected: 00022 void Reset(); 00023 void init(); 00024 GLWindow2 *mGLWindow; 00025 ATANCamera mCamera; 00026 bool mbDone; 00027 00028 std::vector<CalibImage> mvCalibImgs; 00029 void OptimizeOneStep(); 00030 00031 bool mbGrabNextFrame; 00032 00033 GVars3::gvar3<int> mgvnOptimizing; 00034 GVars3::gvar3<int> mgvnShowImage; 00035 GVars3::gvar3<int> mgvnDisableDistortion; 00036 00037 double mdMeanPixelError; 00038 00039 CVD::Image<CVD::byte> mCurrentImage; 00040 image_transport::Subscriber mImageSub; 00041 bool mDoOptimize; 00042 bool mNewImage; 00043 void imageCallback(const sensor_msgs::ImageConstPtr & img); 00044 00045 void GUICommandHandler(std::string sCommand, std::string sParams); 00046 static void GUICommandCallBack(void* ptr, std::string sCommand, std::string sParams); 00047 }; 00048 00049 #endif