00001
00002
00003
00004
00005
00006
00007
00008 #ifndef RL_CALIBRATION_HPP_
00009 #define RL_CALIBRATION_HPP_
00010
00011 #include <iostream>
00012 #include <gtkmm.h>
00013 #include <cv.h>
00014 #include <highgui.h>
00015
00016 #include "RL_ImageFrame.hpp"
00017 #include "RL_StereoProcessor.h"
00018 #include "RL_SequenceReader.hpp"
00019
00020 #define LOGO_IMAGE "resource/RL_Logo.bmp"
00022 using namespace std;
00023
00025 class RL_ViewGUI {
00026 public:
00027 RL_ViewGUI();
00028 virtual ~RL_ViewGUI();
00029
00030 protected:
00031 int filenumber;
00032
00033 char *filenameBuf;
00034 Glib::ustring folderPath;
00035
00036 RL_SequenceReader* inputStream;
00037
00038 RL_StereoProcessor* stereoProcessor;
00039 RL_StereoParams stereoParams;
00040
00041 Gtk::Window* window;
00042
00043 Glib::Thread* grabLoop;
00044 Glib::Dispatcher stopEvent;
00045 Glib::Mutex runMutex, stereoMutex, playMutex, frameMutex;
00046
00047 RL_ImageFrame* imageFrame[2], *rectified[2], *stereoFrame;
00048 Gtk::SpinButton* windowSizeSpin, *uniqueSpin, *thresholdSpin,
00049 *speckleSpin, *speckleWindowSpin, *filterSizeSpin, *filterCapSpin;
00050 Gtk::HScale *disparityScale;
00051 Gtk::Button *stopButton, *playButton, *pauseButton;
00052 Gtk::FileChooserButton *folderChooser;
00053 Gtk::ComboBox *frameSelector[2];
00054
00055 Glib::RefPtr<Gnome::Glade::Xml> refBuilder;
00056
00057 Glib::RefPtr<Gtk::ListStore> frameSelectionModel;
00058 class ModelColumns : public Gtk::TreeModel::ColumnRecord
00059 {
00060 public:
00061
00062 ModelColumns()
00063 { add(mColName); }
00064
00065 Gtk::TreeModelColumn<Glib::ustring> mColName;
00066 };
00067
00068
00069 guint8 logobuf[320*240*3];
00070 guint8 callogobuf[320*240*3];
00072 int camOnFrame[2];
00073
00074 unsigned int* serials;
00075
00076 bool threadRun;
00077 bool flipStatus;
00078 bool playing;
00079 bool stopping;
00080 bool pausing;
00081 bool fileOpened;
00082 bool frameSelectionChanged;
00083
00084 CvMat cameraMatrix;
00085 CvMat distCoeffs;
00086
00087 void SetLogo(RL_ImageFrame* Frame, guint8* log_buf);
00088
00089
00090
00091 void SetThreadStatus( bool runStatus);
00092 bool GetThreadStatus();
00093
00094 void SetFrameIndex(int i, int n);
00095 int GetFrameIndex(int i);
00096
00097 void GrabFrames();
00098 void UpdateFrames();
00099
00100 void UpdateStereoParam();
00101 void SelectFolder();
00102 void SelectFrame(int i);
00103
00104 void OnPlay();
00105 void OnPause();
00106 void OnStop();
00107
00108 int DisparityCheck();
00109 bool OnDestroy(GdkEventAny* event);
00110 bool OnIdle();
00111
00112 bool OpenFile(int);
00113
00114 };
00115
00116 #endif