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();}
213 RTABMAP_DEPRECATED(
void setImageRaw(
const cv::Mat & image),
"Use setRGBDImage() or setStereoImage() with clearNotUpdated=false or removeRawData() instead. To be backward compatible, this function doesn't clear compressed data.");
214 RTABMAP_DEPRECATED(
void setDepthOrRightRaw(
const cv::Mat & image),
"Use setRGBDImage() or setStereoImage() with clearNotUpdated=false or removeRawData() instead. To be backward compatible, this function doesn't clear compressed data.");
215 RTABMAP_DEPRECATED(
void setLaserScanRaw(
const LaserScan & scan),
"Use setLaserScan() with clearNotUpdated=false or removeRawData() instead. To be backward compatible, this function doesn't clear compressed data.");
216 RTABMAP_DEPRECATED(
void setUserDataRaw(
const cv::Mat &
data),
"Use setUserData() or removeRawData() instead.");
221 cv::Mat * depthOrRightRaw,
223 cv::Mat * userDataRaw = 0,
224 cv::Mat * groundCellsRaw = 0,
225 cv::Mat * obstacleCellsRaw = 0,
226 cv::Mat * emptyCellsRaw = 0);
227 void uncompressDataConst(
229 cv::Mat * depthOrRightRaw,
231 cv::Mat * userDataRaw = 0,
232 cv::Mat * groundCellsRaw = 0,
233 cv::Mat * obstacleCellsRaw = 0,
234 cv::Mat * emptyCellsRaw = 0)
const;
236 const std::vector<CameraModel> &
cameraModels()
const {
return _cameraModels;}
247 void setUserData(
const cv::Mat & userData,
bool clearPreviousData =
true);
252 void setOccupancyGrid(
253 const cv::Mat & ground,
254 const cv::Mat & obstacles,
255 const cv::Mat & empty,
257 const cv::Point3f & viewPoint);
269 void setFeatures(
const std::vector<cv::KeyPoint> & keypoints,
const std::vector<cv::Point3f> & keypoints3D,
const cv::Mat & descriptors);
270 const std::vector<cv::KeyPoint> &
keypoints()
const {
return _keypoints;}
271 const std::vector<cv::Point3f> &
keypoints3D()
const {
return _keypoints3D;}
275 void setGlobalDescriptors(
const std::vector<GlobalDescriptor> & descriptors) {_globalDescriptors = descriptors;}
282 void setGlobalPose(
const Transform & pose,
const cv::Mat & covariance) {globalPose_ = pose; globalPoseCovariance_ = covariance;}
299 unsigned long getMemoryUsed()
const;
304 void clearCompressedData(
bool images =
true,
bool scan =
true,
bool userData =
true);
309 void clearRawData(
bool images =
true,
bool scan =
true,
bool userData =
true);
311 bool isPointVisibleFromCameras(
const cv::Point3f & pt)
const;
const Type & type() const
cv::Mat RTABMAP_EXP uncompressData(const cv::Mat &bytes)
const cv::Mat & gridObstacleCellsCompressed() const
std::vector< GlobalDescriptor > _globalDescriptors
cv::Mat _userDataCompressed
const std::vector< cv::Point3f > & keypoints3D() const
const Transform & globalPose() const
std::vector< cv::Point3f > _keypoints3D
LaserScan _laserScanCompressed
const LaserScan & laserScanCompressed() const
std::vector< StereoCameraModel > _stereoCameraModels
cv::Mat _obstacleCellsRaw
const cv::Mat & gridGroundCellsCompressed() const
void setStereoCameraModels(const std::vector< StereoCameraModel > &stereoCameraModels)
void setGlobalPose(const Transform &pose, const cv::Mat &covariance)
void clearGlobalDescriptors()
const cv::Mat & depthOrRightRaw() const
std::map< int, Landmark > Landmarks
const std::vector< StereoCameraModel > & stereoCameraModels() const
const std::vector< cv::KeyPoint > & keypoints() const
cv::Mat _groundCellsCompressed
void setCameraModels(const std::vector< CameraModel > &models)
void setGPS(const GPS &gps)
cv::Mat _emptyCellsCompressed
const std::vector< GlobalDescriptor > & globalDescriptors() const
RTABMAP_DEPRECATED(typedef SensorData Image, "rtabmap::Image class is renamed to rtabmap::SensorData, use the last one instead.")
const cv::Mat & globalPoseCovariance() const
float gridCellSize() const
std::vector< cv::KeyPoint > _keypoints
void setCameraModel(const CameraModel &model)
void addEnvSensor(const EnvSensor &sensor)
void clearOccupancyGridRaw()
const std::vector< CameraModel > & cameraModels() const
void addGlobalDescriptor(const GlobalDescriptor &descriptor)
cv::Mat globalPoseCovariance_
cv::Mat _obstacleCellsCompressed
const cv::Mat & imageRaw() const
const EnvSensors & envSensors() const
const cv::Mat & descriptors() const
void setEnvSensors(const EnvSensors &sensors)
const cv::Mat & depthOrRightCompressed() const
const Transform & groundTruth() const
cv::Mat _depthOrRightCompressed
const cv::Point3f & gridViewPoint() const
const LaserScan & laserScanRaw() const
const cv::Mat & userDataRaw() const
void setGlobalDescriptors(const std::vector< GlobalDescriptor > &descriptors)
const cv::Mat & gridEmptyCellsRaw() const
const cv::Mat & userDataCompressed() const
const cv::Mat & gridGroundCellsRaw() const
std::vector< CameraModel > _cameraModels
void setStamp(double stamp)
void setLandmarks(const Landmarks &landmarks)
void setIMU(const IMU &imu)
void setGroundTruth(const Transform &pose)
const cv::Mat & gridObstacleCellsRaw() const
const Landmarks & landmarks() const
std::map< EnvSensor::Type, EnvSensor > EnvSensors
const cv::Mat & gridEmptyCellsCompressed() const
void setStereoCameraModel(const StereoCameraModel &stereoCameraModel)
const cv::Mat & imageCompressed() const