CameraStereo.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #pragma once
29 
30 #include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
31 
33 #include "rtabmap/core/Camera.h"
34 #include "rtabmap/core/CameraRGB.h"
35 #include "rtabmap/core/Version.h"
36 #include <list>
37 
38 namespace FlyCapture2
39 {
40 class Camera;
41 }
42 
43 namespace sl
44 {
45 class Camera;
46 }
47 
48 namespace rtabmap
49 {
50 
52 // CameraStereoDC1394
54 class DC1394Device;
55 
57  public Camera
58 {
59 public:
60  static bool available();
61 
62 public:
63  CameraStereoDC1394( float imageRate=0.0f, const Transform & localTransform = Transform::getIdentity());
64  virtual ~CameraStereoDC1394();
65 
66  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
67  virtual bool isCalibrated() const;
68  virtual std::string getSerial() const;
69 
70 protected:
71  virtual SensorData captureImage(CameraInfo * info = 0);
72 
73 private:
74 #ifdef RTABMAP_DC1394
75  DC1394Device *device_;
76  StereoCameraModel stereoModel_;
77 #endif
78 };
79 
81 // CameraStereoFlyCapture2
84  public Camera
85 {
86 public:
87  static bool available();
88 
89 public:
90  CameraStereoFlyCapture2( float imageRate=0.0f, const Transform & localTransform = Transform::getIdentity());
91  virtual ~CameraStereoFlyCapture2();
92 
93  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
94  virtual bool isCalibrated() const;
95  virtual std::string getSerial() const;
96 
97 protected:
98  virtual SensorData captureImage(CameraInfo * info = 0);
99 
100 private:
101 #ifdef RTABMAP_FLYCAPTURE2
102  FlyCapture2::Camera * camera_;
103  void * triclopsCtx_; // TriclopsContext
104 #endif
105 };
106 
108 // CameraStereoZED
111  public Camera
112 {
113 public:
114  static bool available();
115 
116 public:
118  int deviceId,
119  int resolution = 2, // 0=HD2K, 1=HD1080, 2=HD720, 3=VGA
120  int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
121  int sensingMode = 0,// 0=STANDARD, 1=FILL
122  int confidenceThr = 100,
123  bool computeOdometry = false,
124  float imageRate=0.0f,
125  const Transform & localTransform = Transform::getIdentity(),
126  bool selfCalibration = true);
128  const std::string & svoFilePath,
129  int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
130  int sensingMode = 0,// 0=STANDARD, 1=FILL
131  int confidenceThr = 100,
132  bool computeOdometry = false,
133  float imageRate=0.0f,
134  const Transform & localTransform = Transform::getIdentity(),
135  bool selfCalibration = true);
136  virtual ~CameraStereoZed();
137 
138  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
139  virtual bool isCalibrated() const;
140  virtual std::string getSerial() const;
141  virtual bool odomProvided() const;
142 
143 protected:
144  virtual SensorData captureImage(CameraInfo * info = 0);
145 
146 private:
147 #ifdef RTABMAP_ZED
148  sl::Camera * zed_;
149  StereoCameraModel stereoModel_;
150  CameraVideo::Source src_;
151  int usbDevice_;
152  std::string svoFilePath_;
153  int resolution_;
154  int quality_;
155  bool selfCalibration_;
156  int sensingMode_;
157  int confidenceThr_;
158  bool computeOdometry_;
159  bool lost_;
160 #endif
161 };
162 
164 // CameraStereoImages
166 class CameraImages;
168  public CameraImages
169 {
170 public:
171  static bool available();
172 
173 public:
175  const std::string & pathLeftImages,
176  const std::string & pathRightImages,
177  bool rectifyImages = false,
178  float imageRate=0.0f,
179  const Transform & localTransform = Transform::getIdentity());
181  const std::string & pathLeftRightImages,
182  bool rectifyImages = false,
183  float imageRate=0.0f,
184  const Transform & localTransform = Transform::getIdentity());
185  virtual ~CameraStereoImages();
186 
187  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
188  virtual bool isCalibrated() const;
189  virtual std::string getSerial() const;
190 
191  virtual void setStartIndex(int index) {CameraImages::setStartIndex(index);camera2_->setStartIndex(index);} // negative means last
192 
193 protected:
194  virtual SensorData captureImage(CameraInfo * info = 0);
195 
196 private:
199 };
200 
201 
203 // CameraStereoVideo
205 class CameraImages;
207  public Camera
208 {
209 public:
210  static bool available();
211 
212 public:
214  const std::string & pathSideBySide,
215  bool rectifyImages = false,
216  float imageRate=0.0f,
217  const Transform & localTransform = Transform::getIdentity());
219  const std::string & pathLeft,
220  const std::string & pathRight,
221  bool rectifyImages = false,
222  float imageRate=0.0f,
223  const Transform & localTransform = Transform::getIdentity());
225  int device,
226  bool rectifyImages = false,
227  float imageRate = 0.0f,
228  const Transform & localTransform = Transform::getIdentity());
230  int deviceLeft,
231  int deviceRight,
232  bool rectifyImages = false,
233  float imageRate = 0.0f,
234  const Transform & localTransform = Transform::getIdentity());
235  virtual ~CameraStereoVideo();
236 
237  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
238  virtual bool isCalibrated() const;
239  virtual std::string getSerial() const;
240 
241 protected:
242  virtual SensorData captureImage(CameraInfo * info = 0);
243 
244 private:
245  cv::VideoCapture capture_;
246  cv::VideoCapture capture2_;
247  std::string path_;
248  std::string path2_;
251  std::string cameraName_;
255 };
256 
257 } // namespace rtabmap
StereoCameraModel stereoModel_
Definition: CameraStereo.h:198
cv::VideoCapture capture_
Definition: CameraStereo.h:245
f
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
CameraVideo::Source src_
Definition: CameraStereo.h:252
StereoCameraModel stereoModel_
Definition: CameraStereo.h:250
virtual void setStartIndex(int index)
Definition: CameraStereo.h:191
cv::VideoCapture capture2_
Definition: CameraStereo.h:246


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:41:30