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());
141 _imageCompressed.empty() &&
142 _depthOrRightRaw.empty() &&
143 _depthOrRightCompressed.empty() &&
144 _laserScanRaw.isEmpty() &&
145 _laserScanCompressed.isEmpty() &&
146 _cameraModels.size() == 0 &&
147 !_stereoCameraModel.isValidForProjection() &&
148 _userDataRaw.empty() &&
149 _userDataCompressed.empty() &&
150 _keypoints.size() == 0 &&
151 _descriptors.empty() &&
155 int id()
const {
return _id;}
157 double stamp()
const {
return _stamp;}
164 const cv::Mat &
imageRaw()
const {
return _imageRaw;}
173 void setRGBDImage(
const cv::Mat & rgb,
const cv::Mat & depth,
const CameraModel & model,
bool clearPreviousData =
true);
174 void setRGBDImage(
const cv::Mat & rgb,
const cv::Mat & depth,
const std::vector<CameraModel> & models,
bool clearPreviousData =
true);
175 void setStereoImage(
const cv::Mat & left,
const cv::Mat & right,
const StereoCameraModel & stereoCameraModel,
bool clearPreviousData =
true);
182 void setLaserScan(
const LaserScan & laserScan,
bool clearPreviousData =
true);
185 void setCameraModels(
const std::vector<CameraModel> & models) {_cameraModels = models;}
189 cv::Mat
depthRaw()
const {
return _depthOrRightRaw.type()!=CV_8UC1?_depthOrRightRaw:cv::Mat();}
190 cv::Mat
rightRaw()
const {
return _depthOrRightRaw.type()==CV_8UC1?_depthOrRightRaw:cv::Mat();}
192 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.");
193 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.");
194 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.");
195 RTABMAP_DEPRECATED(
void setUserDataRaw(
const cv::Mat & data),
"Use setUserData() or removeRawData() instead.");
200 cv::Mat * depthOrRightRaw,
202 cv::Mat * userDataRaw = 0,
203 cv::Mat * groundCellsRaw = 0,
204 cv::Mat * obstacleCellsRaw = 0,
205 cv::Mat * emptyCellsRaw = 0);
206 void uncompressDataConst(
208 cv::Mat * depthOrRightRaw,
210 cv::Mat * userDataRaw = 0,
211 cv::Mat * groundCellsRaw = 0,
212 cv::Mat * obstacleCellsRaw = 0,
213 cv::Mat * emptyCellsRaw = 0)
const;
215 const std::vector<CameraModel> &
cameraModels()
const {
return _cameraModels;}
226 void setUserData(
const cv::Mat & userData,
bool clearPreviousData =
true);
231 void setOccupancyGrid(
232 const cv::Mat & ground,
233 const cv::Mat & obstacles,
234 const cv::Mat & empty,
236 const cv::Point3f & viewPoint);
248 void setFeatures(
const std::vector<cv::KeyPoint> & keypoints,
const std::vector<cv::Point3f> & keypoints3D,
const cv::Mat & descriptors);
249 const std::vector<cv::KeyPoint> &
keypoints()
const {
return _keypoints;}
250 const std::vector<cv::Point3f> &
keypoints3D()
const {
return _keypoints3D;}
254 void setGlobalDescriptors(
const std::vector<GlobalDescriptor> & descriptors) {_globalDescriptors = descriptors;}
261 void setGlobalPose(
const Transform & pose,
const cv::Mat & covariance) {globalPose_ = pose; globalPoseCovariance_ = covariance;}
278 unsigned long getMemoryUsed()
const;
283 void clearCompressedData(
bool images =
true,
bool scan =
true,
bool userData =
true);
288 void clearRawData(
bool images =
true,
bool scan =
true,
bool userData =
true);
290 bool isPointVisibleFromCameras(
const cv::Point3f & pt)
const;
cv::Mat RTABMAP_EXP uncompressData(const cv::Mat &bytes)
std::vector< GlobalDescriptor > _globalDescriptors
cv::Mat _userDataCompressed
std::vector< cv::Point3f > _keypoints3D
const LaserScan & laserScanCompressed() const
LaserScan _laserScanCompressed
cv::Mat _obstacleCellsRaw
void setGlobalPose(const Transform &pose, const cv::Mat &covariance)
void clearGlobalDescriptors()
std::map< int, Landmark > Landmarks
const cv::Mat & descriptors() const
cv::Mat _groundCellsCompressed
float gridCellSize() const
const std::vector< cv::KeyPoint > & keypoints() const
void setCameraModels(const std::vector< CameraModel > &models)
void setGPS(const GPS &gps)
const cv::Mat & gridObstacleCellsCompressed() const
const cv::Mat & gridGroundCellsRaw() const
const cv::Mat & gridGroundCellsCompressed() const
const LaserScan & laserScanRaw() const
const Transform & groundTruth() const
const cv::Mat & gridEmptyCellsCompressed() const
cv::Mat _emptyCellsCompressed
const EnvSensors & envSensors() const
const cv::Mat & imageRaw() const
const cv::Mat & globalPoseCovariance() const
std::vector< cv::KeyPoint > _keypoints
void setCameraModel(const CameraModel &model)
void addEnvSensor(const EnvSensor &sensor)
void clearOccupancyGridRaw()
void addGlobalDescriptor(const GlobalDescriptor &descriptor)
const cv::Mat & depthOrRightCompressed() const
cv::Mat globalPoseCovariance_
const Transform & globalPose() const
cv::Mat _obstacleCellsCompressed
const Type & type() const
const cv::Mat & depthOrRightRaw() const
const cv::Mat & userDataRaw() const
void setEnvSensors(const EnvSensors &sensors)
const std::vector< GlobalDescriptor > & globalDescriptors() const
const cv::Mat & userDataCompressed() const
const cv::Mat & gridEmptyCellsRaw() const
cv::Mat _depthOrRightCompressed
const Landmarks & landmarks() const
const std::vector< CameraModel > & cameraModels() const
void setGlobalDescriptors(const std::vector< GlobalDescriptor > &descriptors)
StereoCameraModel _stereoCameraModel
const StereoCameraModel & stereoCameraModel() const
std::vector< CameraModel > _cameraModels
void setStamp(double stamp)
const cv::Mat & imageCompressed() const
void setLandmarks(const Landmarks &landmarks)
void setIMU(const IMU &imu)
void setGroundTruth(const Transform &pose)
std::map< EnvSensor::Type, EnvSensor > EnvSensors
RTABMAP_DEPRECATED(typedef SensorData Image,"rtabmap::Image class is renamed to rtabmap::SensorData, use the last one instead.")
void setStereoCameraModel(const StereoCameraModel &stereoCameraModel)
const cv::Point3f & gridViewPoint() const
const std::vector< cv::Point3f > & keypoints3D() const
const cv::Mat & gridObstacleCellsRaw() const