Fawkes API  Fawkes Development Version
bb2calib.h
1 
2 /***************************************************************************
3  * bb2calib.h - Bumblebee2 calibration GUI
4  *
5  * Created: Thu Jul 18 20:36:04 2013
6  * Copyright 2008-2013 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_BUMBLEBEE2_CALIB_BB2CALIB_H_
24 #define _PLUGINS_BUMBLEBEE2_CALIB_BB2CALIB_H_
25 
26 #include <gui_utils/connection_dispatcher.h>
27 
28 #include <gtkmm.h>
29 
30 namespace fawkes {
31 class BlackBoard;
32 class Interface;
33 class InterfaceDispatcher;
34 class OpenCVStereoParamsInterface;
35 } // namespace fawkes
36 
37 namespace firevision {
38 class NetworkCamera;
39 }
40 
41 class Bumblebee2CalibGtkWindow : public Gtk::Window
42 {
43 public:
44  Bumblebee2CalibGtkWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder);
46 
47 private:
48  void on_connection_clicked();
49  void on_connect();
50  void on_disconnect();
51  void on_exit_clicked();
52 
53  void on_pre_filter_type_changed();
54  void on_pre_filter_size_changed();
55  void on_pre_filter_cap_changed();
56  void on_sad_window_size_changed();
57  void on_min_disparity_changed();
58  void on_num_disparities_changed();
59  void on_texture_threshold_changed();
60  void on_uniqueness_ratio_changed();
61  void on_speckle_window_size_changed();
62  void on_speckle_range_changed();
63  void on_try_smaller_windows_toggled();
64 
65  void update_param_values();
66  bool update_images();
67  void dont_destroy(const guint8 *data);
68 
69  bool convert_str2float(Glib::ustring sn, float *f);
70  Glib::ustring convert_float2str(float f, unsigned int width = 2);
71 
72  void init();
73 
74 private:
75  fawkes::BlackBoard * bb_;
76  fawkes::InterfaceDispatcher * ifd_params_;
78  fawkes::ConnectionDispatcher connection_dispatcher;
79 
80  firevision::NetworkCamera *cam_left_rectified_;
81  firevision::NetworkCamera *cam_disparity_;
82  unsigned char * buffer_rgb_disparity_;
83  unsigned char * buffer_rgb_rect_left_;
84  sigc::connection sconn_update_images_;
85 
86  Gtk::ComboBox * cmb_pre_filter_type;
87  Gtk::Label * lab_pre_filter_type;
88  Gtk::HScale * hsc_pre_filter_size;
89  Gtk::Label * lab_pre_filter_size;
90  Gtk::HScale * hsc_pre_filter_cap;
91  Gtk::Label * lab_pre_filter_cap;
92  Gtk::HScale * hsc_sad_window_size;
93  Gtk::Label * lab_sad_window_size;
94  Gtk::HScale * hsc_min_disparity;
95  Gtk::Label * lab_min_disparity;
96  Gtk::HScale * hsc_num_disparities;
97  Gtk::Label * lab_num_disparities;
98  Gtk::HScale * hsc_texture_threshold;
99  Gtk::Label * lab_texture_threshold;
100  Gtk::HScale * hsc_uniqueness_ratio;
101  Gtk::Label * lab_uniqueness_ratio;
102  Gtk::HScale * hsc_speckle_window_size;
103  Gtk::Label * lab_speckle_window_size;
104  Gtk::HScale * hsc_speckle_range;
105  Gtk::Label * lab_speckle_range;
106  Gtk::CheckButton *cb_try_smaller_windows;
107  Gtk::Label * lab_try_smaller_windows;
108  Gtk::ToolButton * tb_connection;
109  Gtk::ToolButton * tb_exit;
110  Gtk::Image * img_left_rectified;
111  Gtk::Image * img_disparity;
112  Gtk::Image * img_writer;
113 };
114 
115 #endif
Fawkes library namespace.
~Bumblebee2CalibGtkWindow()
Destructor.
Definition: bb2calib.cpp:129
Bumblebee2 calibration GUI main window.
Definition: bb2calib.h:41
OpenCVStereoParamsInterface Fawkes BlackBoard Interface.
Bumblebee2CalibGtkWindow(BaseObjectType *cobject, const Glib::RefPtr< Gtk::Builder > &builder)
Constructor.
Definition: bb2calib.cpp:55
The BlackBoard abstract class.
Definition: blackboard.h:45
Network camera.
Definition: net.h:40
Watches network client events and dispatches them as signals.
Interface listener with dispatcher.