Fawkes API  Fawkes Development Version
OpenCVStereoParamsInterface.h
1 
2 /***************************************************************************
3  * OpenCVStereoParamsInterface.h - Fawkes BlackBoard Interface - OpenCVStereoParamsInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2013 Tim Niemueller
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. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __INTERFACES_OPENCVSTEREOPARAMSINTERFACE_H_
25 #define __INTERFACES_OPENCVSTEREOPARAMSINTERFACE_H_
26 
27 #include <interface/interface.h>
28 #include <interface/message.h>
29 #include <interface/field_iterator.h>
30 
31 namespace fawkes {
32 
34 {
35  /// @cond INTERNALS
36  INTERFACE_MGMT_FRIENDS(OpenCVStereoParamsInterface)
37  /// @endcond
38  public:
39  /* constants */
40 
41  /**
42  The type used for the pre-filter to come up with the features
43  for the correspondence matching.
44  */
45  typedef enum {
46  PFT_NORMALIZED_RESPONSE /**< Normalized response filter. */,
47  PFT_XSOBEL /**< Sobel filters. */
48  } PreFilterType;
49  const char * tostring_PreFilterType(PreFilterType value) const;
50 
51  private:
52  /** Internal data storage, do NOT modify! */
53  typedef struct __attribute__((packed)) {
54  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
55  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
56  int32_t pre_filter_type; /**< Pre-filtering method. */
57  uint32_t pre_filter_size; /**<
58  Averaging window size: ~5x5..21x21.
59  */
60  uint32_t pre_filter_cap; /**<
61  The output of pre-filtering is clipped by [-pre_filter_cap,pre_filter_cap].
62  */
63  uint32_t sad_window_size; /**<
64  Correspondence using Sum of Absolute Difference (SAD) window size (5x5..21x21).
65  */
66  int32_t min_disparity; /**< Minimum disparity (can be negative). */
67  uint32_t num_disparities; /**<
68  Number of disparities (maximum disparity - minimum disparity (> 0)).
69  */
70  uint32_t texture_threshold; /**<
71  The disparity is only computed for pixels with textured enough
72  neighborhood.
73  */
74  uint32_t uniqueness_ratio; /**<
75  Accept the computed disparity d* only if
76  SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.)
77  for any d != d*+/-1 within the search range.
78  */
79  uint32_t speckle_window_size; /**<
80  Disparity variation window size.
81  */
82  uint32_t speckle_range; /**<
83  Acceptable range of variation in window.
84  */
85  bool try_smaller_windows; /**<
86  If enabled, the results may be more accurate, at the expense of
87  slower processing.
88  */
89  } OpenCVStereoParamsInterface_data_t;
90 
91  OpenCVStereoParamsInterface_data_t *data;
92 
93  interface_enum_map_t enum_map_PreFilterType;
94  public:
95  /* messages */
97  {
98  private:
99  /** Internal data storage, do NOT modify! */
100  typedef struct __attribute__((packed)) {
101  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
102  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
103  int32_t pre_filter_type; /**< Pre-filtering method. */
104  } SetPreFilterTypeMessage_data_t;
105 
106  SetPreFilterTypeMessage_data_t *data;
107 
108  interface_enum_map_t enum_map_PreFilterType;
109  public:
110  SetPreFilterTypeMessage(const PreFilterType ini_pre_filter_type);
113 
115  /* Methods */
116  PreFilterType pre_filter_type() const;
117  void set_pre_filter_type(const PreFilterType new_pre_filter_type);
118  size_t maxlenof_pre_filter_type() const;
119  virtual Message * clone() const;
120  };
121 
123  {
124  private:
125  /** Internal data storage, do NOT modify! */
126  typedef struct __attribute__((packed)) {
127  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
128  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
129  uint32_t pre_filter_size; /**<
130  Averaging window size: ~5x5..21x21.
131  */
132  } SetPreFilterSizeMessage_data_t;
133 
134  SetPreFilterSizeMessage_data_t *data;
135 
136  interface_enum_map_t enum_map_PreFilterType;
137  public:
138  SetPreFilterSizeMessage(const uint32_t ini_pre_filter_size);
141 
143  /* Methods */
144  uint32_t pre_filter_size() const;
145  void set_pre_filter_size(const uint32_t new_pre_filter_size);
146  size_t maxlenof_pre_filter_size() const;
147  virtual Message * clone() const;
148  };
149 
151  {
152  private:
153  /** Internal data storage, do NOT modify! */
154  typedef struct __attribute__((packed)) {
155  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
156  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
157  uint32_t pre_filter_cap; /**<
158  The output of pre-filtering is clipped by [-pre_filter_cap,pre_filter_cap].
159  */
160  } SetPreFilterCapMessage_data_t;
161 
162  SetPreFilterCapMessage_data_t *data;
163 
164  interface_enum_map_t enum_map_PreFilterType;
165  public:
166  SetPreFilterCapMessage(const uint32_t ini_pre_filter_cap);
169 
171  /* Methods */
172  uint32_t pre_filter_cap() const;
173  void set_pre_filter_cap(const uint32_t new_pre_filter_cap);
174  size_t maxlenof_pre_filter_cap() const;
175  virtual Message * clone() const;
176  };
177 
179  {
180  private:
181  /** Internal data storage, do NOT modify! */
182  typedef struct __attribute__((packed)) {
183  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
184  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
185  uint32_t sad_window_size; /**<
186  Correspondence using Sum of Absolute Difference (SAD) window size (5x5..21x21).
187  */
188  } SetSADWindowSizeMessage_data_t;
189 
190  SetSADWindowSizeMessage_data_t *data;
191 
192  interface_enum_map_t enum_map_PreFilterType;
193  public:
194  SetSADWindowSizeMessage(const uint32_t ini_sad_window_size);
197 
199  /* Methods */
200  uint32_t sad_window_size() const;
201  void set_sad_window_size(const uint32_t new_sad_window_size);
202  size_t maxlenof_sad_window_size() const;
203  virtual Message * clone() const;
204  };
205 
207  {
208  private:
209  /** Internal data storage, do NOT modify! */
210  typedef struct __attribute__((packed)) {
211  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
212  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
213  int32_t min_disparity; /**< Minimum disparity (can be negative). */
214  } SetMinDisparityMessage_data_t;
215 
216  SetMinDisparityMessage_data_t *data;
217 
218  interface_enum_map_t enum_map_PreFilterType;
219  public:
220  SetMinDisparityMessage(const int32_t ini_min_disparity);
223 
225  /* Methods */
226  int32_t min_disparity() const;
227  void set_min_disparity(const int32_t new_min_disparity);
228  size_t maxlenof_min_disparity() const;
229  virtual Message * clone() const;
230  };
231 
233  {
234  private:
235  /** Internal data storage, do NOT modify! */
236  typedef struct __attribute__((packed)) {
237  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
238  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
239  uint32_t num_disparities; /**<
240  Number of disparities (maximum disparity - minimum disparity (> 0)).
241  */
242  } SetNumDisparitiesMessage_data_t;
243 
244  SetNumDisparitiesMessage_data_t *data;
245 
246  interface_enum_map_t enum_map_PreFilterType;
247  public:
248  SetNumDisparitiesMessage(const uint32_t ini_num_disparities);
251 
253  /* Methods */
254  uint32_t num_disparities() const;
255  void set_num_disparities(const uint32_t new_num_disparities);
256  size_t maxlenof_num_disparities() const;
257  virtual Message * clone() const;
258  };
259 
261  {
262  private:
263  /** Internal data storage, do NOT modify! */
264  typedef struct __attribute__((packed)) {
265  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
266  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
267  uint32_t texture_threshold; /**<
268  The disparity is only computed for pixels with textured enough
269  neighborhood.
270  */
271  } SetTextureThresholdMessage_data_t;
272 
273  SetTextureThresholdMessage_data_t *data;
274 
275  interface_enum_map_t enum_map_PreFilterType;
276  public:
277  SetTextureThresholdMessage(const uint32_t ini_texture_threshold);
280 
282  /* Methods */
283  uint32_t texture_threshold() const;
284  void set_texture_threshold(const uint32_t new_texture_threshold);
285  size_t maxlenof_texture_threshold() const;
286  virtual Message * clone() const;
287  };
288 
290  {
291  private:
292  /** Internal data storage, do NOT modify! */
293  typedef struct __attribute__((packed)) {
294  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
295  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
296  uint32_t uniqueness_ratio; /**<
297  Accept the computed disparity d* only if
298  SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.)
299  for any d != d*+/-1 within the search range.
300  */
301  } SetUniquenessRatioMessage_data_t;
302 
303  SetUniquenessRatioMessage_data_t *data;
304 
305  interface_enum_map_t enum_map_PreFilterType;
306  public:
307  SetUniquenessRatioMessage(const uint32_t ini_uniqueness_ratio);
310 
312  /* Methods */
313  uint32_t uniqueness_ratio() const;
314  void set_uniqueness_ratio(const uint32_t new_uniqueness_ratio);
315  size_t maxlenof_uniqueness_ratio() const;
316  virtual Message * clone() const;
317  };
318 
320  {
321  private:
322  /** Internal data storage, do NOT modify! */
323  typedef struct __attribute__((packed)) {
324  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
325  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
326  uint32_t speckle_window_size; /**<
327  Disparity variation window size.
328  */
329  } SetSpeckleWindowSizeMessage_data_t;
330 
331  SetSpeckleWindowSizeMessage_data_t *data;
332 
333  interface_enum_map_t enum_map_PreFilterType;
334  public:
335  SetSpeckleWindowSizeMessage(const uint32_t ini_speckle_window_size);
338 
340  /* Methods */
341  uint32_t speckle_window_size() const;
342  void set_speckle_window_size(const uint32_t new_speckle_window_size);
343  size_t maxlenof_speckle_window_size() const;
344  virtual Message * clone() const;
345  };
346 
348  {
349  private:
350  /** Internal data storage, do NOT modify! */
351  typedef struct __attribute__((packed)) {
352  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
353  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
354  uint32_t speckle_range; /**<
355  Acceptable range of variation in window.
356  */
357  } SetSpeckleRangeMessage_data_t;
358 
359  SetSpeckleRangeMessage_data_t *data;
360 
361  interface_enum_map_t enum_map_PreFilterType;
362  public:
363  SetSpeckleRangeMessage(const uint32_t ini_speckle_range);
366 
368  /* Methods */
369  uint32_t speckle_range() const;
370  void set_speckle_range(const uint32_t new_speckle_range);
371  size_t maxlenof_speckle_range() const;
372  virtual Message * clone() const;
373  };
374 
376  {
377  private:
378  /** Internal data storage, do NOT modify! */
379  typedef struct __attribute__((packed)) {
380  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
381  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
382  bool try_smaller_windows; /**<
383  If enabled, the results may be more accurate, at the expense of
384  slower processing.
385  */
386  } SetTrySmallerWindowsMessage_data_t;
387 
388  SetTrySmallerWindowsMessage_data_t *data;
389 
390  interface_enum_map_t enum_map_PreFilterType;
391  public:
392  SetTrySmallerWindowsMessage(const bool ini_try_smaller_windows);
395 
397  /* Methods */
398  bool is_try_smaller_windows() const;
399  void set_try_smaller_windows(const bool new_try_smaller_windows);
400  size_t maxlenof_try_smaller_windows() const;
401  virtual Message * clone() const;
402  };
403 
404  virtual bool message_valid(const Message *message) const;
405  private:
408 
409  public:
410  /* Methods */
411  PreFilterType pre_filter_type() const;
412  void set_pre_filter_type(const PreFilterType new_pre_filter_type);
413  size_t maxlenof_pre_filter_type() const;
414  uint32_t pre_filter_size() const;
415  void set_pre_filter_size(const uint32_t new_pre_filter_size);
416  size_t maxlenof_pre_filter_size() const;
417  uint32_t pre_filter_cap() const;
418  void set_pre_filter_cap(const uint32_t new_pre_filter_cap);
419  size_t maxlenof_pre_filter_cap() const;
420  uint32_t sad_window_size() const;
421  void set_sad_window_size(const uint32_t new_sad_window_size);
422  size_t maxlenof_sad_window_size() const;
423  int32_t min_disparity() const;
424  void set_min_disparity(const int32_t new_min_disparity);
425  size_t maxlenof_min_disparity() const;
426  uint32_t num_disparities() const;
427  void set_num_disparities(const uint32_t new_num_disparities);
428  size_t maxlenof_num_disparities() const;
429  uint32_t texture_threshold() const;
430  void set_texture_threshold(const uint32_t new_texture_threshold);
431  size_t maxlenof_texture_threshold() const;
432  uint32_t uniqueness_ratio() const;
433  void set_uniqueness_ratio(const uint32_t new_uniqueness_ratio);
434  size_t maxlenof_uniqueness_ratio() const;
435  uint32_t speckle_window_size() const;
436  void set_speckle_window_size(const uint32_t new_speckle_window_size);
437  size_t maxlenof_speckle_window_size() const;
438  uint32_t speckle_range() const;
439  void set_speckle_range(const uint32_t new_speckle_range);
440  size_t maxlenof_speckle_range() const;
441  bool is_try_smaller_windows() const;
442  void set_try_smaller_windows(const bool new_try_smaller_windows);
443  size_t maxlenof_try_smaller_windows() const;
444  virtual Message * create_message(const char *type) const;
445 
446  virtual void copy_values(const Interface *other);
447  virtual const char * enum_tostring(const char *enumtype, int val) const;
448 
449 };
450 
451 } // end namespace fawkes
452 
453 #endif
void set_try_smaller_windows(const bool new_try_smaller_windows)
Set try_smaller_windows value.
SetSADWindowSizeMessage Fawkes BlackBoard Interface Message.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
void set_pre_filter_type(const PreFilterType new_pre_filter_type)
Set pre_filter_type value.
void set_sad_window_size(const uint32_t new_sad_window_size)
Set sad_window_size value.
uint32_t uniqueness_ratio() const
Get uniqueness_ratio value.
Fawkes library namespace.
uint32_t speckle_window_size() const
Get speckle_window_size value.
PreFilterType pre_filter_type() const
Get pre_filter_type value.
void set_min_disparity(const int32_t new_min_disparity)
Set min_disparity value.
SetPreFilterTypeMessage Fawkes BlackBoard Interface Message.
SetPreFilterSizeMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_try_smaller_windows() const
Get maximum length of try_smaller_windows value.
int32_t min_disparity() const
Get min_disparity value.
uint32_t pre_filter_cap() const
Get pre_filter_cap value.
uint32_t texture_threshold() const
Get texture_threshold value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
SetTextureThresholdMessage Fawkes BlackBoard Interface Message.
virtual Message * create_message(const char *type) const
Create message based on type name.
SetTrySmallerWindowsMessage Fawkes BlackBoard Interface Message.
SetSpeckleRangeMessage Fawkes BlackBoard Interface Message.
uint32_t num_disparities() const
Get num_disparities value.
void set_uniqueness_ratio(const uint32_t new_uniqueness_ratio)
Set uniqueness_ratio value.
size_t maxlenof_min_disparity() const
Get maximum length of min_disparity value.
size_t maxlenof_speckle_range() const
Get maximum length of speckle_range value.
void set_pre_filter_cap(const uint32_t new_pre_filter_cap)
Set pre_filter_cap value.
uint32_t speckle_range() const
Get speckle_range value.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
SetSpeckleWindowSizeMessage Fawkes BlackBoard Interface Message.
OpenCVStereoParamsInterface Fawkes BlackBoard Interface.
size_t maxlenof_uniqueness_ratio() const
Get maximum length of uniqueness_ratio value.
const char * tostring_PreFilterType(PreFilterType value) const
Convert PreFilterType constant to string.
size_t maxlenof_sad_window_size() const
Get maximum length of sad_window_size value.
void set_pre_filter_size(const uint32_t new_pre_filter_size)
Set pre_filter_size value.
SetPreFilterCapMessage Fawkes BlackBoard Interface Message.
void set_texture_threshold(const uint32_t new_texture_threshold)
Set texture_threshold value.
void set_num_disparities(const uint32_t new_num_disparities)
Set num_disparities value.
SetUniquenessRatioMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_pre_filter_size() const
Get maximum length of pre_filter_size value.
bool is_try_smaller_windows() const
Get try_smaller_windows value.
void set_speckle_window_size(const uint32_t new_speckle_window_size)
Set speckle_window_size value.
uint32_t pre_filter_size() const
Get pre_filter_size value.
PreFilterType
The type used for the pre-filter to come up with the features for the correspondence matching...
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
SetNumDisparitiesMessage Fawkes BlackBoard Interface Message.
SetMinDisparityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_speckle_window_size() const
Get maximum length of speckle_window_size value.
size_t maxlenof_texture_threshold() const
Get maximum length of texture_threshold value.
uint32_t sad_window_size() const
Get sad_window_size value.
size_t maxlenof_pre_filter_type() const
Get maximum length of pre_filter_type value.
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
Definition: types.h:53
void set_speckle_range(const uint32_t new_speckle_range)
Set speckle_range value.
size_t maxlenof_pre_filter_cap() const
Get maximum length of pre_filter_cap value.
size_t maxlenof_num_disparities() const
Get maximum length of num_disparities value.