31 #include <rtabmap/core/rtabmap_core_export.h>
36 #include <opencv2/core/core.hpp>
37 #include <opencv2/features2d/features2d.hpp>
59 const cv::Mat & image,
62 const cv::Mat & userData = cv::Mat());
66 const cv::Mat & image,
70 const cv::Mat & userData = cv::Mat());
75 const cv::Mat & depth,
79 const cv::Mat & userData = cv::Mat());
85 const cv::Mat & depth,
89 const cv::Mat & userData = cv::Mat());
94 const cv::Mat & depth,
95 const std::vector<CameraModel> & cameraModels,
98 const cv::Mat & userData = cv::Mat());
104 const cv::Mat & depth,
105 const std::vector<CameraModel> & cameraModels,
108 const cv::Mat & userData = cv::Mat());
112 const cv::Mat & left,
113 const cv::Mat & right,
117 const cv::Mat & userData = cv::Mat());
122 const cv::Mat & left,
123 const cv::Mat & right,
127 const cv::Mat & userData = cv::Mat());
132 const cv::Mat & depth,
133 const std::vector<StereoCameraModel> & cameraModels,
136 const cv::Mat & userData = cv::Mat());
142 const cv::Mat & depth,
143 const std::vector<StereoCameraModel> & cameraModels,
146 const cv::Mat & userData = cv::Mat());
160 _imageCompressed.empty() &&
161 _depthOrRightRaw.empty() &&
162 _depthOrRightCompressed.empty() &&
163 _laserScanRaw.isEmpty() &&
164 _laserScanCompressed.isEmpty() &&
165 _cameraModels.empty() &&
166 _stereoCameraModels.empty() &&
167 _userDataRaw.empty() &&
168 _userDataCompressed.empty() &&
169 _keypoints.size() == 0 &&
170 _descriptors.empty() &&
174 int id()
const {
return _id;}
176 double stamp()
const {
return _stamp;}
183 const cv::Mat &
imageRaw()
const {
return _imageRaw;}
192 void setRGBDImage(
const cv::Mat & rgb,
const cv::Mat & depth,
const CameraModel &
model,
bool clearPreviousData =
true);
193 void setRGBDImage(
const cv::Mat & rgb,
const cv::Mat & depth,
const std::vector<CameraModel> & models,
bool clearPreviousData =
true);
194 void setStereoImage(
const cv::Mat & left,
const cv::Mat & right,
const StereoCameraModel & stereoCameraModel,
bool clearPreviousData =
true);
195 void setStereoImage(
const cv::Mat & left,
const cv::Mat & right,
const std::vector<StereoCameraModel> & stereoCameraModels,
bool clearPreviousData =
true);
202 void setLaserScan(
const LaserScan & laserScan,
bool clearPreviousData =
true);
205 void setCameraModels(
const std::vector<CameraModel> & models) {_cameraModels = models;}
207 void setStereoCameraModels(
const std::vector<StereoCameraModel> & stereoCameraModels) {_stereoCameraModels = stereoCameraModels;}
210 cv::Mat
depthRaw()
const {
return _depthOrRightRaw.type()!=CV_8UC1?_depthOrRightRaw:cv::Mat();}
211 cv::Mat
rightRaw()
const {
return _depthOrRightRaw.type()==CV_8UC1?_depthOrRightRaw:cv::Mat();}
225 cv::Mat * depthOrRightRaw,
227 cv::Mat * userDataRaw = 0,
228 cv::Mat * groundCellsRaw = 0,
229 cv::Mat * obstacleCellsRaw = 0,
230 cv::Mat * emptyCellsRaw = 0);
231 void uncompressDataConst(
233 cv::Mat * depthOrRightRaw,
235 cv::Mat * userDataRaw = 0,
236 cv::Mat * groundCellsRaw = 0,
237 cv::Mat * obstacleCellsRaw = 0,
238 cv::Mat * emptyCellsRaw = 0)
const;
240 const std::vector<CameraModel> &
cameraModels()
const {
return _cameraModels;}
251 void setUserData(
const cv::Mat & userData,
bool clearPreviousData =
true);
256 void setOccupancyGrid(
257 const cv::Mat & ground,
258 const cv::Mat & obstacles,
259 const cv::Mat &
empty,
261 const cv::Point3f & viewPoint);
273 void setFeatures(
const std::vector<cv::KeyPoint> & keypoints,
const std::vector<cv::Point3f> & keypoints3D,
const cv::Mat & descriptors);
274 const std::vector<cv::KeyPoint> &
keypoints()
const {
return _keypoints;}
275 const std::vector<cv::Point3f> &
keypoints3D()
const {
return _keypoints3D;}
279 void setGlobalDescriptors(
const std::vector<GlobalDescriptor> & descriptors) {_globalDescriptors = descriptors;}
286 void setGlobalPose(
const Transform & pose,
const cv::Mat & covariance) {globalPose_ = pose; globalPoseCovariance_ = covariance;}
303 unsigned long getMemoryUsed()
const;
308 void clearCompressedData(
bool images =
true,
bool scan =
true,
bool userData =
true);
313 void clearRawData(
bool images =
true,
bool scan =
true,
bool userData =
true);
315 bool isPointVisibleFromCameras(
const cv::Point3f & pt)
const;