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 }
36 
37 namespace firevision {
38  class NetworkCamera;
39 }
40 
41 class Bumblebee2CalibGtkWindow : public Gtk::Window
42 {
43  public:
44  Bumblebee2CalibGtkWindow(BaseObjectType* cobject,
45  const Glib::RefPtr<Gtk::Builder> &builder);
47 
48  private:
49  void on_connection_clicked();
50  void on_connect();
51  void on_disconnect();
52  void on_exit_clicked();
53 
54  void on_pre_filter_type_changed();
55  void on_pre_filter_size_changed();
56  void on_pre_filter_cap_changed();
57  void on_sad_window_size_changed();
58  void on_min_disparity_changed();
59  void on_num_disparities_changed();
60  void on_texture_threshold_changed();
61  void on_uniqueness_ratio_changed();
62  void on_speckle_window_size_changed();
63  void on_speckle_range_changed();
64  void on_try_smaller_windows_toggled();
65 
66  void update_param_values();
67  bool update_images();
68  void dont_destroy(const guint8 *data);
69 
70  bool convert_str2float(Glib::ustring sn, float *f);
71  Glib::ustring convert_float2str(float f, unsigned int width = 2);
72 
73  void init();
74 
75 
76  private:
77  fawkes::BlackBoard *bb_;
78  fawkes::InterfaceDispatcher *ifd_params_;
80  fawkes::ConnectionDispatcher connection_dispatcher;
81 
82  firevision::NetworkCamera *cam_left_rectified_;
83  firevision::NetworkCamera *cam_disparity_;
84  unsigned char *buffer_rgb_disparity_;
85  unsigned char *buffer_rgb_rect_left_;
86  sigc::connection sconn_update_images_;
87 
88  Gtk::ComboBox *cmb_pre_filter_type;
89  Gtk::Label *lab_pre_filter_type;
90  Gtk::HScale *hsc_pre_filter_size;
91  Gtk::Label *lab_pre_filter_size;
92  Gtk::HScale *hsc_pre_filter_cap;
93  Gtk::Label *lab_pre_filter_cap;
94  Gtk::HScale *hsc_sad_window_size;
95  Gtk::Label *lab_sad_window_size;
96  Gtk::HScale *hsc_min_disparity;
97  Gtk::Label *lab_min_disparity;
98  Gtk::HScale *hsc_num_disparities;
99  Gtk::Label *lab_num_disparities;
100  Gtk::HScale *hsc_texture_threshold;
101  Gtk::Label *lab_texture_threshold;
102  Gtk::HScale *hsc_uniqueness_ratio;
103  Gtk::Label *lab_uniqueness_ratio;
104  Gtk::HScale *hsc_speckle_window_size;
105  Gtk::Label *lab_speckle_window_size;
106  Gtk::HScale *hsc_speckle_range;
107  Gtk::Label *lab_speckle_range;
108  Gtk::CheckButton *cb_try_smaller_windows;
109  Gtk::Label *lab_try_smaller_windows;
110  Gtk::ToolButton *tb_connection;
111  Gtk::ToolButton *tb_exit;
112  Gtk::Image *img_left_rectified;
113  Gtk::Image *img_disparity;
114  Gtk::Image *img_writer;
115 };
116 
117 #endif
Fawkes library namespace.
Bumblebee2 calibration GUI main window.
Definition: bb2calib.h:41
OpenCVStereoParamsInterface Fawkes BlackBoard Interface.
The BlackBoard abstract class.
Definition: blackboard.h:48
Network camera.
Definition: net.h:42
Watches network client events and dispatches them as signals.
Interface listener with dispatcher.