31#include "rtabmap/core/rtabmap_core_export.h"
33#include <pcl/point_cloud.h>
34#include <pcl/point_types.h>
35#include <pcl/pcl_base.h>
36#include <pcl/TextureMesh.h>
37#include <rtabmap/core/Transform.h>
38#include <rtabmap/core/SensorData.h>
39#include <rtabmap/core/Parameters.h>
40#include <opencv2/core/core.hpp>
41#include <rtabmap/core/ProgressState.h>
63 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
85cv::Mat RTABMAP_CORE_EXPORT rgbFromCloud(
86 const pcl::PointCloud<pcl::PointXYZRGBA> & cloud,
87 bool bgrOrder =
true);
103cv::Mat RTABMAP_CORE_EXPORT depthFromCloud(
104 const pcl::PointCloud<pcl::PointXYZRGBA> & cloud,
105 bool depth16U =
true);
122void RTABMAP_CORE_EXPORT rgbdFromCloud(
123 const pcl::PointCloud<pcl::PointXYZRGBA> & cloud,
126 bool bgrOrder =
true,
127 bool depth16U =
true);
147pcl::PointXYZ RTABMAP_CORE_EXPORT projectDepthTo3D(
148 const cv::Mat & depthImage,
153 float depthErrorRatio = 0.02f);
171Eigen::Vector3f RTABMAP_CORE_EXPORT projectDepthTo3DRay(
172 const cv::Size & imageSize,
199RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDepth(
200 const cv::Mat & imageDepth,
204 float maxDepth = 0.0f,
205 float minDepth = 0.0f,
206 std::vector<int> * validIndices = 0);
222pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDepth(
223 const cv::Mat & imageDepth,
226 float maxDepth = 0.0f,
227 float minDepth = 0.0f,
228 std::vector<int> * validIndices = 0);
229pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDepth(
230 const cv::Mat & imageDepth,
231 const cv::Mat & imageDepthConfidence,
234 float maxDepth = 0.0f,
235 float minDepth = 0.0f,
236 unsigned char confidenceThr = 0,
237 std::vector<int> * validIndices = 0);
264RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB(
265 const cv::Mat & imageRgb,
266 const cv::Mat & imageDepth,
270 float maxDepth = 0.0f,
271 float minDepth = 0.0f,
272 std::vector<int> * validIndices = 0);
295pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB(
296 const cv::Mat & imageRgb,
297 const cv::Mat & imageDepth,
300 float maxDepth = 0.0f,
301 float minDepth = 0.0f,
302 std::vector<int> * validIndices = 0);
303pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB(
304 const cv::Mat & imageRgb,
305 const cv::Mat & imageDepth,
306 const cv::Mat & imageDepthConfidence,
309 float maxDepth = 0.0f,
310 float minDepth = 0.0f,
311 unsigned char confidenceThr = 0,
312 std::vector<int> * validIndices = 0);
343pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromDisparity(
344 const cv::Mat & imageDisparity,
347 float maxDepth = 0.0f,
348 float minDepth = 0.0f,
349 std::vector<int> * validIndices = 0);
384pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromDisparityRGB(
385 const cv::Mat & imageRgb,
386 const cv::Mat & imageDisparity,
389 float maxDepth = 0.0f,
390 float minDepth = 0.0f,
391 std::vector<int> * validIndices = 0);
429pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudFromStereoImages(
430 const cv::Mat & imageLeft,
431 const cv::Mat & imageRight,
434 float maxDepth = 0.0f,
435 float minDepth = 0.0f,
436 std::vector<int> * validIndices = 0,
437 const ParametersMap & parameters = ParametersMap());
477std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> RTABMAP_CORE_EXPORT cloudsFromSensorData(
480 float maxDepth = 0.0f,
481 float minDepth = 0.0f,
482 std::vector<pcl::IndicesPtr> * validIndices = 0,
483 const ParametersMap & stereoParameters = ParametersMap(),
484 const std::vector<float> & roiRatios = std::vector<float>(),
485 unsigned char confidenceThr = 0);
515pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT cloudFromSensorData(
518 float maxDepth = 0.0f,
519 float minDepth = 0.0f,
520 std::vector<int> * validIndices = 0,
521 const ParametersMap & stereoParameters = ParametersMap(),
522 const std::vector<float> & roiRatios = std::vector<float>(),
523 unsigned char confidenceThr = 0);
557std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> RTABMAP_CORE_EXPORT cloudsRGBFromSensorData(
560 float maxDepth = 0.0f,
561 float minDepth = 0.0f,
562 std::vector<pcl::IndicesPtr > * validIndices = 0,
563 const ParametersMap & stereoParameters = ParametersMap(),
564 const std::vector<float> & roiRatios = std::vector<float>(),
565 unsigned char confidenceThr = 0);
593pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT cloudRGBFromSensorData(
596 float maxDepth = 0.0f,
597 float minDepth = 0.0f,
598 std::vector<int> * validIndices = 0,
599 const ParametersMap & stereoParameters = ParametersMap(),
600 const std::vector<float> & roiRatios = std::vector<float>(),
601 unsigned char confidenceThr = 0);
625pcl::PointCloud<pcl::PointXYZ> RTABMAP_CORE_EXPORT laserScanFromDepthImage(
626 const cv::Mat & depthImage,
653pcl::PointCloud<pcl::PointXYZ> RTABMAP_CORE_EXPORT laserScanFromDepthImages(
654 const cv::Mat & depthImages,
655 const std::vector<CameraModel> & cameraModels,
775template<
typename Po
intCloud2T>
846pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud(
const LaserScan & laserScan,
const Transform & transform =
Transform());
847pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudNormal(
const LaserScan & laserScan,
const Transform & transform =
Transform());
848pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudRGB(
const LaserScan & laserScan,
const Transform & transform =
Transform(),
unsigned char r = 100,
unsigned char g = 100,
unsigned char b = 100);
849pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudI(
const LaserScan & laserScan,
const Transform & transform =
Transform(),
float intensity = 0.0f);
850pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudRGBNormal(
const LaserScan & laserScan,
const Transform & transform =
Transform(),
unsigned char r = 100,
unsigned char g = 100,
unsigned char b = 100);
851pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudINormal(
const LaserScan & laserScan,
const Transform & transform =
Transform(),
float intensity = 0.0f);
854pcl::PointXYZ RTABMAP_CORE_EXPORT laserScanToPoint(
const LaserScan & laserScan,
int index);
855pcl::PointNormal RTABMAP_CORE_EXPORT laserScanToPointNormal(
const LaserScan & laserScan,
int index);
856pcl::PointXYZRGB RTABMAP_CORE_EXPORT laserScanToPointRGB(
const LaserScan & laserScan,
int index,
unsigned char r = 100,
unsigned char g = 100,
unsigned char b = 100);
857pcl::PointXYZI RTABMAP_CORE_EXPORT laserScanToPointI(
const LaserScan & laserScan,
int index,
float intensity);
858pcl::PointXYZRGBNormal RTABMAP_CORE_EXPORT laserScanToPointRGBNormal(
const LaserScan & laserScan,
int index,
unsigned char r,
unsigned char g,
unsigned char b);
859pcl::PointXYZINormal RTABMAP_CORE_EXPORT laserScanToPointINormal(
const LaserScan & laserScan,
int index,
float intensity);
882void RTABMAP_CORE_EXPORT getMinMax3D(
const cv::Mat & laserScan, cv::Point3f & min, cv::Point3f & max);
897void RTABMAP_CORE_EXPORT getMinMax3D(
const cv::Mat & laserScan, pcl::PointXYZ & min, pcl::PointXYZ & max);
921cv::Point3f RTABMAP_CORE_EXPORT projectDisparityTo3D(
922 const cv::Point2f & pt,
944cv::Point3f RTABMAP_CORE_EXPORT projectDisparityTo3D(
945 const cv::Point2f & pt,
946 const cv::Mat & disparity,
969cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera(
970 const cv::Size & imageSize,
971 const cv::Mat & cameraMatrixK,
972 const cv::Mat & laserScan,
995cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera(
996 const cv::Size & imageSize,
997 const cv::Mat & cameraMatrixK,
998 const pcl::PointCloud<pcl::PointXYZ>::Ptr laserScan,
1021cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera(
1022 const cv::Size & imageSize,
1023 const cv::Mat & cameraMatrixK,
1024 const pcl::PCLPointCloud2::Ptr laserScan,
1046void RTABMAP_CORE_EXPORT fillProjectedCloudHoles(
1047 cv::Mat & depthRegistered,
1048 bool verticalDirection,
1079cv::Mat RTABMAP_CORE_EXPORT filterFloor(
1080 const cv::Mat & depth,
1081 const std::vector<CameraModel> & cameraModels,
1083 cv::Mat * depthBelow = 0);
1105std::vector<std::pair< std::pair<int, int>, pcl::PointXY> > RTABMAP_CORE_EXPORT projectCloudToCameras (
1106 const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud,
1107 const std::map<int, Transform> & cameraPoses,
1108 const std::map<
int, std::vector<CameraModel> > & cameraModels,
1109 float maxDistance = 0.0f,
1110 float maxAngle = 0.0f,
1111 float maxDepthError = 0.0f,
1112 const std::vector<float> & roiRatios = std::vector<float>(),
1113 const cv::Mat & projMask = cv::Mat(),
1114 bool distanceToCamPolicy =
false,
1136std::vector<std::pair< std::pair<int, int>, pcl::PointXY> > RTABMAP_CORE_EXPORT projectCloudToCameras (
1137 const pcl::PointCloud<pcl::PointXYZINormal> & cloud,
1138 const std::map<int, Transform> & cameraPoses,
1139 const std::map<
int, std::vector<CameraModel> > & cameraModels,
1140 float maxDistance = 0.0f,
1141 float maxAngle = 0.0f,
1142 float maxDepthError = 0.0f,
1143 const std::vector<float> & roiRatios = std::vector<float>(),
1144 const cv::Mat & projMask = cv::Mat(),
1145 bool distanceToCamPolicy =
false,
1157bool RTABMAP_CORE_EXPORT isFinite(
const cv::Point3f & pt);
1168pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT concatenateClouds(
1169 const std::list<pcl::PointCloud<pcl::PointXYZ>::Ptr> & clouds);
1179pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT concatenateClouds(
1180 const std::list<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds);
1196pcl::IndicesPtr RTABMAP_CORE_EXPORT concatenate(
1197 const std::vector<pcl::IndicesPtr> & indices);
1213pcl::IndicesPtr RTABMAP_CORE_EXPORT concatenate(
1214 const pcl::IndicesPtr & indicesA,
1215 const pcl::IndicesPtr & indicesB);
1228void RTABMAP_CORE_EXPORT savePCDWords(
1229 const std::string & fileName,
1230 const std::multimap<int, pcl::PointXYZ> & words,
1244void RTABMAP_CORE_EXPORT savePCDWords(
1245 const std::string & fileName,
1246 const std::multimap<int, cv::Point3f> & words,
1259cv::Mat RTABMAP_CORE_EXPORT loadBINScan(
const std::string & fileName);
1268pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT loadBINCloud(
const std::string & fileName);
1277RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT loadBINCloud(
const std::string & fileName,
int dim);
1289LaserScan RTABMAP_CORE_EXPORT loadScan(
const std::string & path);
1304RTABMAP_DEPRECATED pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT loadCloud(
1305 const std::string & path,
1307 int downsampleStep = 1,
1308 float voxelSize = 0.0f);
1353 (
float, intensity, intensity)
1354 (std::uint16_t, ring, ring)
1358#include "rtabmap/core/impl/util3d.hpp"
Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...
Represents 2D or 3D laser scan data with support for multiple point data formats.
Container class for all sensor data captured at a specific time.
A class representing a calibrated stereo camera system.
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud(const pcl::PointCloud< pcl::PointXYZ > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
PointXYZ → LaserScan::kXY
LaserScan laserScanFromPointCloud(const PointCloud2T &cloud, bool filterNaNs, bool is2D, const Transform &transform)
Convert pcl::PCLPointCloud2 to rtabmap::LaserScan with all supported fields (see rtabmap::LaserScan::...
pcl::PCLPointCloud2::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud2(const LaserScan &laserScan, const Transform &transform=Transform())
Convert rtabmap::LaserScan to pcl::PCLPointCloud2 with all supported fields (see rtabmap::LaserScan::...
This namespace contains 3D point cloud processing utilities.