cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
svlTypes.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Balazs Vagvolgyi
7  Created on: 2006
8 
9  (C) Copyright 2006-2014 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 
20 */
21 
22 #ifndef _svlTypes_h
23 #define _svlTypes_h
24 
25 #include <cisstCommon/cmnLogger.h>
34 
35 #ifdef _MSC_VER
36  // Disable warning C4996
37  #pragma warning(disable : 4996)
38 #endif // _MSC_VER
39 
40 #if (CISST_COMPILER == CISST_CLANG)
41  #pragma clang diagnostic push
42  #pragma clang diagnostic ignored "-Wunused-parameter"
43  #pragma clang diagnostic ignored "-Woverloaded-virtual"
44 #endif // (CISST_COMPILER == CISST_CLANG)
45 
46 #if CISST_SVL_HAS_OPENCV2
47  #include <opencv2/core/core_c.h>
48  #include <opencv2/core/core.hpp>
49  #include <opencv2/core/wimage.hpp>
50 // #include <opencv2/eigen.hpp>
51  #include <opencv2/core/internal.hpp>
52  #include <opencv2/imgproc/imgproc_c.h>
53  #include <opencv2/imgproc/imgproc.hpp>
54  #include <opencv2/features2d/features2d.hpp>
55  #include <opencv2/flann/flann.hpp>
56  #include <opencv2/calib3d/calib3d.hpp>
57  #include <opencv2/objdetect/objdetect.hpp>
58  #include <opencv2/legacy/compat.hpp>
59  #include <opencv2/legacy/legacy.hpp>
60  #include <opencv2/legacy/blobtrack.hpp>
61  #include <opencv2/contrib/contrib.hpp>
62  #include <opencv2/highgui/highgui_c.h>
63  #include <opencv2/highgui/highgui.hpp>
64  #include <opencv2/ml/ml.hpp>
65  #include <opencv2/video/tracking.hpp>
66  #include <opencv2/video/background_segm.hpp>
67  #include <opencv2/gpu/gpu.hpp>
68 #else // CISST_SVL_HAS_OPENCV2
69  // to compile the same API
70  typedef void IplImage;
71  namespace cv {
72  typedef std::string Mat;
73  }
74 #endif // CISST_SVL_HAS_OPENCV2
75 
76 #if (CISST_COMPILER == CISST_CLANG)
77  #pragma clang diagnostic pop
78 #endif // (CISST_COMPILER == CISST_CLANG)
79 
80 #ifdef _MSC_VER
81  // Resume C4996 warnings
82  #pragma warning(default : 4996)
83 #endif // _MSC_VER
84 
85 #pragma pack(1)
86 
88 // Image structure definitions //
90 
91 // Always include last!
93 
95 {
96  unsigned short bfType;
97  unsigned int bfSize;
98  unsigned short bfReserved1;
99  unsigned short bfReserved2;
100  unsigned int bfOffBits;
101 };
102 
104 {
105  unsigned int biSize;
106  int biWidth;
107  int biHeight;
108  unsigned short biPlanes;
109  unsigned short biBitCount;
110  unsigned int biCompression;
111  unsigned int biSizeImage;
114  unsigned int biClrUsed;
115  unsigned int biClrImportant;
116 };
117 
119 {
120  svlRGB();
121  svlRGB(unsigned char r, unsigned char g, unsigned char b);
122  void Assign(const svlRGB & color);
123  void Assign(unsigned char r, unsigned char g, unsigned char b);
124 
125  unsigned char b;
126  unsigned char g;
127  unsigned char r;
128 };
129 
131 {
132  svlRGBA();
133  svlRGBA(const svlRGB & rgb, unsigned char a);
134  svlRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
135  void Assign(const svlRGBA & color);
136  void Assign(const svlRGB & rgb, unsigned char a);
137  void Assign(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
138 
139  unsigned char b;
140  unsigned char g;
141  unsigned char r;
142  unsigned char a;
143 };
144 
146 {
147  svlBlob();
148  void Assign(const svlBlob & blob);
149 
150  unsigned int ID;
151  bool used;
152  int left;
153  int right;
154  int top;
155  int bottom;
156  int center_x;
157  int center_y;
158  unsigned int area;
159  unsigned int circumference;
160  unsigned int label;
161 };
162 
163 #pragma pack()
164 
165 
170 #if CISST_SVL_HAS_CUDA
174 #endif // CISST_SVL_HAS_CUDA
183 
184 // Always include last!
186 
187 
189 // Image typedefs //
191 
197 
198 
199 #pragma pack(1)
200 
202 // Miscellaneous structure type definitions //
204 
205 struct svlRect;
206 
208 {
209  virtual ~svlShape() {}
210  virtual svlShape* Clone() = 0;
211  virtual bool IsWithin(int x, int y) const = 0;
212  virtual void GetBoundingRect(svlRect & rect) const = 0;
213 };
214 
216 {
217  svlRect();
218  svlRect(int left, int top, int right, int bottom);
219 
220  virtual svlShape* Clone();
221  virtual bool IsWithin(int x, int y) const;
222  virtual void GetBoundingRect(svlRect & rect) const;
223 
224  void Assign(const svlRect & rect);
225  void Assign(int left, int top, int right, int bottom);
226  void Normalize();
227  void Trim(const int minx, const int maxx, const int miny, const int maxy);
228 
229  int left;
230  int top;
231  int right;
232  int bottom;
233 };
234 
236 {
237  svlTriangle();
238  svlTriangle(int x1, int y1, int x2, int y2, int x3, int y3);
239 
240  virtual svlShape* Clone();
241  virtual bool IsWithin(int x, int y) const;
242  virtual void GetBoundingRect(svlRect & rect) const;
243 
244  void Assign(const svlTriangle & triangle);
245  void Assign(int x1, int y1, int x2, int y2, int x3, int y3);
246 
247  int x1;
248  int y1;
249  int x2;
250  int y2;
251  int x3;
252  int y3;
253 };
254 
256 {
257  svlQuad();
258  svlQuad(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
259  svlQuad(const svlRect & rect);
260 
261  virtual svlShape* Clone();
262  virtual bool IsWithin(int x, int y) const;
263  virtual void GetBoundingRect(svlRect & rect) const;
264 
265  void Assign(const svlQuad & quad);
266  void Assign(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
267  void Assign(const svlRect & rect);
268 
269  int x1;
270  int y1;
271  int x2;
272  int y2;
273  int x3;
274  int y3;
275  int x4;
276  int y4;
277 };
278 
280 {
281  svlEllipse();
282  svlEllipse(int cx, int cy, int rx, int ry, double angle);
283 
284  virtual svlShape* Clone();
285  virtual bool IsWithin(int x, int y) const;
286  virtual void GetBoundingRect(svlRect & rect) const;
287 
288  void Assign(const svlEllipse & ellipse);
289  void Assign(int cx, int cy, int rx, int ry, double angle);
290 
291  int cx;
292  int cy;
293  int rx;
294  int ry;
295  double angle;
296 };
297 
299 {
300  svlPoint2D();
301  svlPoint2D(int x, int y);
302  void Assign(const svlPoint2D & point);
303  void Assign(int x, int y);
304 
305  int x;
306  int y;
307 };
308 
310 {
311  svlTarget2D();
312  svlTarget2D(bool used, bool visible, unsigned char conf, int x, int y);
313  svlTarget2D(bool used, bool visible, unsigned char conf, svlPoint2D & pos);
314  svlTarget2D(int x, int y);
315  svlTarget2D(svlPoint2D & pos);
316  void Assign(const svlTarget2D & target);
317  void Assign(bool used, bool visible, unsigned char conf, int x, int y);
318  void Assign(bool used, bool visible, unsigned char conf, svlPoint2D & pos);
319  void Assign(int x, int y);
320  void Assign(svlPoint2D & pos);
321 
322  bool used;
323  bool visible;
324  unsigned char conf;
329 };
330 
331 #pragma pack()
332 
333 #endif // _svlTypes_h
334 
unsigned int bfOffBits
Definition: svlTypes.h:100
int x3
Definition: svlTypes.h:251
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
bool used
Definition: svlTypes.h:322
int bottom
Definition: svlTypes.h:155
int x2
Definition: svlTypes.h:249
Definition: svlTypes.h:255
vctDynamicMatrix< unsigned short > svlImageMono16
Definition: svlTypes.h:193
Typedef for dynamic vectors.
int x4
Definition: svlTypes.h:275
int feature_quality
Definition: svlTypes.h:326
int x3
Definition: svlTypes.h:273
Definition: svlTypes.h:130
unsigned char r
Definition: svlTypes.h:141
int cx
Definition: svlTypes.h:291
int y4
Definition: svlTypes.h:276
unsigned int area
Definition: svlTypes.h:158
int y
Definition: svlTypes.h:306
unsigned short biBitCount
Definition: svlTypes.h:109
int x2
Definition: svlTypes.h:271
int y1
Definition: svlTypes.h:248
unsigned short bfReserved2
Definition: svlTypes.h:99
unsigned char r
Definition: svlTypes.h:127
unsigned int biClrUsed
Definition: svlTypes.h:114
unsigned int biSize
Definition: svlTypes.h:105
svlPoint2D pos
Definition: svlTypes.h:325
int top
Definition: svlTypes.h:230
Definition: svlTypes.h:298
unsigned int circumference
Definition: svlTypes.h:159
int y1
Definition: svlTypes.h:270
Definition: svlTypes.h:309
Definition: svlTypes.h:94
Typedef for fixed size vectors.
Definition: svlTypes.h:235
int x1
Definition: svlTypes.h:247
int biHeight
Definition: svlTypes.h:107
int top
Definition: svlTypes.h:154
int rx
Definition: svlTypes.h:293
unsigned int biCompression
Definition: svlTypes.h:110
int center_x
Definition: svlTypes.h:156
Definition: svlTypes.h:207
unsigned int biSizeImage
Definition: svlTypes.h:111
int cy
Definition: svlTypes.h:292
vctDynamicVector< unsigned char > feature_data
Definition: svlTypes.h:327
Typedef for different transformations.
int y2
Definition: svlTypes.h:250
unsigned short biPlanes
Definition: svlTypes.h:108
Definition: svlTypes.h:279
void IplImage
Definition: svlTypes.h:70
Declaration of cmnLogger amd macros for human readable logging.
Typedef for dynamic matrices.
int x
Definition: svlTypes.h:305
vctDynamicVector< unsigned char > image_data
Definition: svlTypes.h:328
int biWidth
Definition: svlTypes.h:106
virtual svlShape * Clone()=0
Definition: svlTypes.h:103
unsigned char b
Definition: svlTypes.h:139
double angle
Definition: svlTypes.h:295
int y3
Definition: svlTypes.h:274
unsigned int label
Definition: svlTypes.h:160
int bottom
Definition: svlTypes.h:232
virtual ~svlShape()
Definition: svlTypes.h:209
void Assign(const OtherT &other)
Definition: cisstVectorEigenAddons.h:3
Definition: svlTypes.h:145
int right
Definition: svlTypes.h:231
int y3
Definition: svlTypes.h:252
Defines mtsGenericObject.
Macros to export the symbols of cisstStereoVision (in a Dll).
int ry
Definition: svlTypes.h:294
vctDynamicMatrix< unsigned char > svlImageRGBA
Definition: svlTypes.h:196
int left
Definition: svlTypes.h:152
unsigned char g
Definition: svlTypes.h:140
Definition: svlTypes.h:215
virtual void GetBoundingRect(svlRect &rect) const =0
int x1
Definition: svlTypes.h:269
std::string Mat
Definition: svlTypes.h:72
unsigned short bfReserved1
Definition: svlTypes.h:98
bool visible
Definition: svlTypes.h:323
vctDynamicMatrix< unsigned char > svlImageMono8
Definition: svlTypes.h:192
unsigned short bfType
Definition: svlTypes.h:96
bool used
Definition: svlTypes.h:151
int right
Definition: svlTypes.h:153
virtual bool IsWithin(int x, int y) const =0
Definition: svlTypes.h:118
int left
Definition: svlTypes.h:229
int biXPelsPerMeter
Definition: svlTypes.h:112
vctDynamicMatrix< unsigned char > svlImageRGB
Definition: svlTypes.h:195
unsigned char b
Definition: svlTypes.h:125
unsigned char a
Definition: svlTypes.h:142
unsigned char conf
Definition: svlTypes.h:324
unsigned char g
Definition: svlTypes.h:126
vctDynamicMatrix< float > svlImageMonoFloat
Definition: svlTypes.h:194
int center_y
Definition: svlTypes.h:157
int biYPelsPerMeter
Definition: svlTypes.h:113
int y2
Definition: svlTypes.h:272
Typedef for fixed size matrices.
unsigned int ID
Definition: svlTypes.h:150
unsigned int bfSize
Definition: svlTypes.h:97
unsigned int biClrImportant
Definition: svlTypes.h:115