RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rtabmap::util3d Namespace Reference

3D utilities: point cloud conversion and filtering, projection, registration, surface reconstruction, mapping and transforms. More...

Functions

template<typename PointCloud2T >
LaserScan laserScanFromPointCloud (const PointCloud2T &cloud, bool filterNaNs=true, bool is2D=false, const Transform &transform=Transform())
 Convert pcl::PCLPointCloud2 to rtabmap::LaserScan with all supported fields (see rtabmap::LaserScan::Format)
 
template<typename PointT >
pcl::PointCloud< PointT >::Ptr projectCloudOnXYPlane (const typename pcl::PointCloud< PointT > &cloud)
 Projects a point cloud onto the XY plane by setting all Z coordinates to zero.
 
template<typename PointT >
void segmentObstaclesFromGround (const typename pcl::PointCloud< PointT >::Ptr &cloud, const typename pcl::IndicesPtr &indices, pcl::IndicesPtr &ground, pcl::IndicesPtr &obstacles, int normalKSearch, float groundNormalAngle, float clusterRadius, int minClusterSize, bool segmentFlatObstacles, float maxGroundHeight, pcl::IndicesPtr *flatObstacles, const Eigen::Vector4f &viewPoint, float groundNormalsUp)
 
template<typename PointT >
void segmentObstaclesFromGround (const typename pcl::PointCloud< PointT >::Ptr &cloud, pcl::IndicesPtr &ground, pcl::IndicesPtr &obstacles, int normalKSearch, float groundNormalAngle, float clusterRadius, int minClusterSize, bool segmentFlatObstacles=false, float maxGroundHeight=0.0f, pcl::IndicesPtr *flatObstacles=0, const Eigen::Vector4f &viewPoint=Eigen::Vector4f(0, 0, 100, 0), float groundNormalsUp=0)
 Segments ground and obstacle indices from a point cloud using surface normals and clustering.
 
template<typename PointT >
void occupancy2DFromGroundObstacles (const typename pcl::PointCloud< PointT >::Ptr &cloud, const pcl::IndicesPtr &groundIndices, const pcl::IndicesPtr &obstaclesIndices, cv::Mat &ground, cv::Mat &obstacles, float cellSize)
 Projects 3D ground and obstacle point clouds onto the 2D XY plane and voxelizes them into 2D occupancy data.
 
template<typename PointT >
void occupancy2DFromGroundObstacles (const typename pcl::PointCloud< PointT >::Ptr &groundCloud, const typename pcl::PointCloud< PointT >::Ptr &obstaclesCloud, cv::Mat &ground, cv::Mat &obstacles, float cellSize)
 Projects 3D ground and obstacle point clouds onto the 2D XY plane and voxelizes them into 2D occupancy data.
 
template<typename PointT >
void occupancy2DFromCloud3D (const typename pcl::PointCloud< PointT >::Ptr &cloud, const pcl::IndicesPtr &indices, cv::Mat &ground, cv::Mat &obstacles, float cellSize=0.05f, float groundNormalAngle=M_PI_4, int minClusterSize=20, bool segmentFlatObstacles=false, float maxGroundHeight=0.0f)
 Generates 2D ground and obstacle occupancy data from a 3D point cloud.
 
template<typename PointT >
void occupancy2DFromCloud3D (const typename pcl::PointCloud< PointT >::Ptr &cloud, cv::Mat &ground, cv::Mat &obstacles, float cellSize=0.05f, float groundNormalAngle=M_PI_4, int minClusterSize=20, bool segmentFlatObstacles=false, float maxGroundHeight=0.0f)
 Generates 2D ground and obstacle occupancy data from a 3D point cloud.
 
template<typename pointT >
std::vector< pcl::Vertices > normalizePolygonsSide (const typename pcl::PointCloud< pointT > &cloud, const std::vector< pcl::Vertices > &polygons, const pcl::PointXYZ &viewPoint)
 
template<typename pointRGBT >
void denseMeshPostProcessing (pcl::PolygonMeshPtr &mesh, float meshDecimationFactor, int maximumPolygons, const typename pcl::PointCloud< pointRGBT >::Ptr &cloud, float transferColorRadius, bool coloredOutput, bool cleanMesh, int minClusterSize, ProgressState *progressState)
 
template<typename PointT >
bool intersectRayMesh (const Eigen::Vector3f &origin, const Eigen::Vector3f &dir, const typename pcl::PointCloud< PointT > &cloud, const std::vector< pcl::Vertices > &polygons, bool ignoreBackFaces, float &distance, Eigen::Vector3f &normal, int &index)
 
cv::Mat RTABMAP_CORE_EXPORT rgbFromCloud (const pcl::PointCloud< pcl::PointXYZRGBA > &cloud, bool bgrOrder=true)
 Converts a PCL point cloud with RGBA information to an OpenCV RGB or BGR image.
 
cv::Mat RTABMAP_CORE_EXPORT depthFromCloud (const pcl::PointCloud< pcl::PointXYZRGBA > &cloud, bool depth16U=true)
 Generates a depth image from a PCL organized point cloud.
 
void RTABMAP_CORE_EXPORT rgbdFromCloud (const pcl::PointCloud< pcl::PointXYZRGBA > &cloud, cv::Mat &rgb, cv::Mat &depth, bool bgrOrder=true, bool depth16U=true)
 Converts a PCL point cloud (with RGBA colors) into aligned RGB and depth OpenCV images.
 
pcl::PointXYZ RTABMAP_CORE_EXPORT projectDepthTo3D (const cv::Mat &depthImage, float x, float y, float cx, float cy, float fx, float fy, bool smoothing, float depthErrorRatio=0.02f)
 Projects a single depth pixel into 3D space.
 
Eigen::Vector3f RTABMAP_CORE_EXPORT projectDepthTo3DRay (const cv::Size &imageSize, float x, float y, float cx, float cy, float fx, float fy)
 Projects pixel coordinates to a normalized 3D ray in camera coordinates.
 
RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cloudFromDepth (const cv::Mat &imageDepth, float cx, float cy, float fx, float fy, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0)
 Converts a depth image to a 3D point cloud.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cloudFromDepth (const cv::Mat &imageDepth, const CameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0)
 Converts a depth image to a 3D point cloud using a camera model.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cloudFromDepth (const cv::Mat &imageDepth, const cv::Mat &imageDepthConfidence, const CameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, unsigned char confidenceThr=0, std::vector< int > *validIndices=0)
 
RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB (const cv::Mat &imageRgb, const cv::Mat &imageDepth, float cx, float cy, float fx, float fy, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0)
 Creates a point cloud from an RGB image and a depth image.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB (const cv::Mat &imageRgb, const cv::Mat &imageDepth, const CameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0)
 Creates a point cloud from an RGB image and a depth image using a CameraModel.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudFromDepthRGB (const cv::Mat &imageRgb, const cv::Mat &imageDepth, const cv::Mat &imageDepthConfidence, const CameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, unsigned char confidenceThr=0, std::vector< int > *validIndices=0)
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cloudFromDisparity (const cv::Mat &imageDisparity, const StereoCameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0)
 Converts a disparity image to a 3D point cloud.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudFromDisparityRGB (const cv::Mat &imageRgb, const cv::Mat &imageDisparity, const StereoCameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0)
 Converts a disparity image and an RGB image to a 3D point cloud with color.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudFromStereoImages (const cv::Mat &imageLeft, const cv::Mat &imageRight, const StereoCameraModel &model, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0, const ParametersMap &parameters=ParametersMap())
 Converts a pair of stereo images (left and right) into a 3D point cloud with RGB color information.
 
std::vector< pcl::PointCloud< pcl::PointXYZ >::Ptr > RTABMAP_CORE_EXPORT cloudsFromSensorData (const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< pcl::IndicesPtr > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float > &roiRatios=std::vector< float >(), unsigned char confidenceThr=0)
 Generates a set of point clouds from sensor data.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cloudFromSensorData (const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float > &roiRatios=std::vector< float >(), unsigned char confidenceThr=0)
 Generates a point cloud from sensor data.
 
std::vector< pcl::PointCloud< pcl::PointXYZRGB >::Ptr > RTABMAP_CORE_EXPORT cloudsRGBFromSensorData (const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< pcl::IndicesPtr > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float > &roiRatios=std::vector< float >(), unsigned char confidenceThr=0)
 Generates a point cloud with RGB color data from sensor data.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudRGBFromSensorData (const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float > &roiRatios=std::vector< float >(), unsigned char confidenceThr=0)
 Generates a point cloud of type pcl::PointXYZRGB from sensor data.
 
pcl::PointCloud< pcl::PointXYZ > RTABMAP_CORE_EXPORT laserScanFromDepthImage (const cv::Mat &depthImage, float fx, float fy, float cx, float cy, float maxDepth=0, float minDepth=0, const Transform &localTransform=Transform::getIdentity())
 Converts the middle row of a depth image into a laser scan (point cloud) using camera intrinsics and a local transformation.
 
pcl::PointCloud< pcl::PointXYZ > RTABMAP_CORE_EXPORT laserScanFromDepthImages (const cv::Mat &depthImages, const std::vector< CameraModel > &cameraModels, float maxDepth, float minDepth)
 Converts multiple depth images (e.g., from a stereo or multi-camera setup) into a single laser scan (point cloud).
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZ > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZ → (x, y, z) → LaserScan::kXYZ
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZ > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZ → (x, y, z) → LaserScan::kXYZ
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointNormal > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointNormal → (x, y, z, nx, ny, nz) → LaserScan::kXYZNormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointNormal > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointNormal → (x, y, z, nx, ny, nz) → LaserScan::kXYZNormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZ > &cloud, const pcl::PointCloud< pcl::Normal > &normals, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointNormal → (x, y, z, nx, ny, nz) → LaserScan::kXYZNormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGB > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZRGB → (x, y, z, rgb) → LaserScan::kXYZRGB
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGB > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZRGB → (x, y, z, rgb) → LaserScan::kXYZRGB
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZI > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZI → (x, y, z, intensity) → LaserScan::kXYZI
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZI > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZI → (x, y, z, intensity) → LaserScan::kXYZI
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< rtabmap::PointXYZIRT > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 rtabmap::PointXYZIRT → (x, y, z, intensity, ring time) → LaserScan::kXYZIRT
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< rtabmap::PointXYZIRT > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 rtabmap::PointXYZIRT → (x, y, z, intensity, ring time) → LaserScan::kXYZIRT
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGB > &cloud, const pcl::PointCloud< pcl::Normal > &normals, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZRGBNormal → (x, y, z, rgb, nx, ny, nz) → LaserScan::kXYZRGBNormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZRGBNormal → (x, y, z, rgb, nx, ny, nz) → LaserScan::kXYZRGBNormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZRGBNormal → (x, y, z, rgb, nx, ny, nz) → LaserScan::kXYZRGBNormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZI > &cloud, const pcl::PointCloud< pcl::Normal > &normals, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZINormal → (x, y, z, intensity, nx, ny, nz) → LaserScan::kXYZINormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZINormal > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZINormal → (x, y, z, intensity, nx, ny, nz) → LaserScan::kXYZINormal
 
LaserScan RTABMAP_CORE_EXPORT laserScanFromPointCloud (const pcl::PointCloud< pcl::PointXYZINormal > &cloud, const pcl::IndicesPtr &indices, const Transform &transform=Transform(), bool filterNaNs=true)
 pcl::PointXYZINormal → (x, y, z, intensity, nx, ny, nz) → LaserScan::kXYZINormal
 
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud (const pcl::PointCloud< pcl::PointXYZ > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 PointXYZLaserScan::kXY
 
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud (const pcl::PointCloud< pcl::PointXYZI > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 PointXYZILaserScan::kXYI (x, y, intensity)
 
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud (const pcl::PointCloud< pcl::PointNormal > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 PointNormalLaserScan::kXYNormal (x, y, nx, ny, nz)
 
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud (const pcl::PointCloud< pcl::PointXYZ > &cloud, const pcl::PointCloud< pcl::Normal > &normals, const Transform &transform=Transform(), bool filterNaNs=true)
 PointXYZ + NormalLaserScan::kXYNormal (x, y, nx, ny, nz)
 
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud (const pcl::PointCloud< pcl::PointXYZINormal > &cloud, const Transform &transform=Transform(), bool filterNaNs=true)
 PointXYZINormalLaserScan::kXYINormal (x, y, inensity, nx, ny, nz)
 
LaserScan RTABMAP_CORE_EXPORT laserScan2dFromPointCloud (const pcl::PointCloud< pcl::PointXYZI > &cloud, const pcl::PointCloud< pcl::Normal > &normals, const Transform &transform=Transform(), bool filterNaNs=true)
 PointXYZI + NormalLaserScan::kXYINormal (x, y, inensity, nx, ny, nz)
 
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::Format)
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloud (const LaserScan &laserScan, const Transform &transform=Transform())
 LaserScanPointXYZ (x, y, z); any other field of the scan is dropped.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudNormal (const LaserScan &laserScan, const Transform &transform=Transform())
 LaserScanPointNormal (x, y, z, nx, ny, nz); normals are zeroed if the scan has none.
 
pcl::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)
 LaserScanPointXYZRGB (x, y, z, rgb); r, g and b are used if the scan has no color.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudI (const LaserScan &laserScan, const Transform &transform=Transform(), float intensity=0.0f)
 LaserScanPointXYZI (x, y, z, intensity); intensity is used if the scan has none.
 
pcl::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)
 LaserScanPointXYZRGBNormal (x, y, z, rgb, nx, ny, nz); missing color and normals are filled as above.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT laserScanToPointCloudINormal (const LaserScan &laserScan, const Transform &transform=Transform(), float intensity=0.0f)
 LaserScanPointXYZINormal (x, y, z, intensity, nx, ny, nz); missing intensity and normals are filled as above.
 
pcl::PointXYZ RTABMAP_CORE_EXPORT laserScanToPoint (const LaserScan &laserScan, int index)
 The point at index of the scan, as PointXYZ.
 
pcl::PointNormal RTABMAP_CORE_EXPORT laserScanToPointNormal (const LaserScan &laserScan, int index)
 The point at index of the scan, as PointNormal.
 
pcl::PointXYZRGB RTABMAP_CORE_EXPORT laserScanToPointRGB (const LaserScan &laserScan, int index, unsigned char r=100, unsigned char g=100, unsigned char b=100)
 The point at index of the scan, as PointXYZRGB.
 
pcl::PointXYZI RTABMAP_CORE_EXPORT laserScanToPointI (const LaserScan &laserScan, int index, float intensity)
 The point at index of the scan, as PointXYZI.
 
pcl::PointXYZRGBNormal RTABMAP_CORE_EXPORT laserScanToPointRGBNormal (const LaserScan &laserScan, int index, unsigned char r, unsigned char g, unsigned char b)
 The point at index of the scan, as PointXYZRGBNormal.
 
pcl::PointXYZINormal RTABMAP_CORE_EXPORT laserScanToPointINormal (const LaserScan &laserScan, int index, float intensity)
 The point at index of the scan, as PointXYZINormal.
 
void RTABMAP_CORE_EXPORT getMinMax3D (const cv::Mat &laserScan, cv::Point3f &min, cv::Point3f &max)
 Computes the minimum and maximum 3D points from a laser scan matrix.
 
void RTABMAP_CORE_EXPORT getMinMax3D (const cv::Mat &laserScan, pcl::PointXYZ &min, pcl::PointXYZ &max)
 Computes the minimum and maximum 3D points from a laser scan matrix and stores the results in pcl::PointXYZ.
 
cv::Point3f RTABMAP_CORE_EXPORT projectDisparityTo3D (const cv::Point2f &pt, float disparity, const StereoCameraModel &model)
 Projects a 2D point from the left image and its disparity into 3D space.
 
cv::Point3f RTABMAP_CORE_EXPORT projectDisparityTo3D (const cv::Point2f &pt, const cv::Mat &disparity, const StereoCameraModel &model)
 Projects a 2D point from the left image and the disparity map into 3D space.
 
cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera (const cv::Size &imageSize, const cv::Mat &cameraMatrixK, const cv::Mat &laserScan, const rtabmap::Transform &cameraTransform)
 Register a point cloud (laser scan) to the camera's frame of reference and return a registered depth image.
 
cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera (const cv::Size &imageSize, const cv::Mat &cameraMatrixK, const pcl::PointCloud< pcl::PointXYZ >::Ptr laserScan, const rtabmap::Transform &cameraTransform)
 Register a point cloud (laser scan) to the camera's frame of reference and return a registered depth image.
 
cv::Mat RTABMAP_CORE_EXPORT projectCloudToCamera (const cv::Size &imageSize, const cv::Mat &cameraMatrixK, const pcl::PCLPointCloud2::Ptr laserScan, const rtabmap::Transform &cameraTransform)
 Register a point cloud (laser scan) to the camera's frame of reference and return a registered depth image.
 
void RTABMAP_CORE_EXPORT fillProjectedCloudHoles (cv::Mat &depthRegistered, bool verticalDirection, bool fillToBorder)
 Fills holes (missing depth values) in a depth image by interpolating between non-zero values.
 
cv::Mat RTABMAP_CORE_EXPORT filterFloor (const cv::Mat &depth, const std::vector< CameraModel > &cameraModels, float threshold, cv::Mat *depthBelow=0)
 Filters out points below a certain threshold in a depth image based on camera models.
 
std::vector< std::pair< std::pair< int, int >, pcl::PointXY > > RTABMAP_CORE_EXPORT projectCloudToCameras (const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloud, const std::map< int, Transform > &cameraPoses, const std::map< int, std::vector< CameraModel > > &cameraModels, float maxDistance=0.0f, float maxAngle=0.0f, float maxDepthError=0.0f, const std::vector< float > &roiRatios=std::vector< float >(), const cv::Mat &projMask=cv::Mat(), bool distanceToCamPolicy=false, const ProgressState *state=0)
 Projects a 3D point cloud to the best camera (NodeID -> CameraIndex) for each point based on a policy.
 
std::vector< std::pair< std::pair< int, int >, pcl::PointXY > > RTABMAP_CORE_EXPORT projectCloudToCameras (const pcl::PointCloud< pcl::PointXYZINormal > &cloud, const std::map< int, Transform > &cameraPoses, const std::map< int, std::vector< CameraModel > > &cameraModels, float maxDistance=0.0f, float maxAngle=0.0f, float maxDepthError=0.0f, const std::vector< float > &roiRatios=std::vector< float >(), const cv::Mat &projMask=cv::Mat(), bool distanceToCamPolicy=false, const ProgressState *state=0)
 Projects a 3D point cloud to the best camera (NodeID -> CameraIndex) for each point based on a policy.
 
bool RTABMAP_CORE_EXPORT isFinite (const cv::Point3f &pt)
 Checks if all coordinates of a 3D point are finite.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT concatenateClouds (const std::list< pcl::PointCloud< pcl::PointXYZ >::Ptr > &clouds)
 Concatenates a list of PointXYZ point clouds into a single point cloud.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT concatenateClouds (const std::list< pcl::PointCloud< pcl::PointXYZRGB >::Ptr > &clouds)
 Concatenates a list of PointXYZRGB point clouds into a single point cloud.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT concatenate (const std::vector< pcl::IndicesPtr > &indices)
 Concatenates multiple sets of indices into a single index vector.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT concatenate (const pcl::IndicesPtr &indicesA, const pcl::IndicesPtr &indicesB)
 Concatenates two sets of indices into one.
 
void RTABMAP_CORE_EXPORT savePCDWords (const std::string &fileName, const std::multimap< int, pcl::PointXYZ > &words, const Transform &transform=Transform::getIdentity())
 Saves 3D word points to a PCD file, applying a transform to each point.
 
void RTABMAP_CORE_EXPORT savePCDWords (const std::string &fileName, const std::multimap< int, cv::Point3f > &words, const Transform &transform=Transform::getIdentity())
 Saves 3D word points (as OpenCV points) to a PCD file, applying a transform to each point.
 
cv::Mat RTABMAP_CORE_EXPORT loadBINScan (const std::string &fileName)
 Loads a KITTI-style Velodyne binary scan file into an OpenCV matrix.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT loadBINCloud (const std::string &fileName)
 Loads a KITTI-style Velodyne binary scan and converts it to a PCL point cloud.
 
RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT loadBINCloud (const std::string &fileName, int dim)
 Loads a KITTI-style Velodyne binary scan and converts it to a PCL point cloud.
 
LaserScan RTABMAP_CORE_EXPORT loadScan (const std::string &path)
 Loads a 3D scan from a file (.pcd, .ply, or .bin format).
 
RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT loadCloud (const std::string &path, const Transform &transform=Transform::getIdentity(), int downsampleStep=1, float voxelSize=0.0f)
 Loads and optionally transforms/downsamples/voxelizes a point cloud.
 
LaserScan RTABMAP_CORE_EXPORT deskew (const LaserScan &input, double inputStamp, const rtabmap::Transform &velocity)
 Lidar deskewing.
 
void RTABMAP_CORE_EXPORT extractXYZCorrespondences (const std::multimap< int, pcl::PointXYZ > &words1, const std::multimap< int, pcl::PointXYZ > &words2, pcl::PointCloud< pcl::PointXYZ > &cloud1, pcl::PointCloud< pcl::PointXYZ > &cloud2)
 Extracts 3D point correspondences between two sets of labeled 3D points.
 
void RTABMAP_CORE_EXPORT extractXYZCorrespondencesRANSAC (const std::multimap< int, pcl::PointXYZ > &words1, const std::multimap< int, pcl::PointXYZ > &words2, pcl::PointCloud< pcl::PointXYZ > &cloud1, pcl::PointCloud< pcl::PointXYZ > &cloud2)
 Extracts reliable 3D point correspondences between two sets of labeled 3D points using RANSAC filtering.
 
void RTABMAP_CORE_EXPORT extractXYZCorrespondences (const std::list< std::pair< cv::Point2f, cv::Point2f > > &correspondences, const cv::Mat &depthImage1, const cv::Mat &depthImage2, float cx, float cy, float fx, float fy, float maxDepth, pcl::PointCloud< pcl::PointXYZ > &cloud1, pcl::PointCloud< pcl::PointXYZ > &cloud2)
 Extracts 3D point correspondences from 2D pixel matches using depth images.
 
void RTABMAP_CORE_EXPORT extractXYZCorrespondences (const std::list< std::pair< cv::Point2f, cv::Point2f > > &correspondences, const pcl::PointCloud< pcl::PointXYZ > &cloud1, const pcl::PointCloud< pcl::PointXYZ > &cloud2, pcl::PointCloud< pcl::PointXYZ > &inliers1, pcl::PointCloud< pcl::PointXYZ > &inliers2)
 Extracts 3D correspondences from 2D feature matches using pcl::PointXYZ organized point clouds.
 
void RTABMAP_CORE_EXPORT extractXYZCorrespondences (const std::list< std::pair< cv::Point2f, cv::Point2f > > &correspondences, const pcl::PointCloud< pcl::PointXYZRGB > &cloud1, const pcl::PointCloud< pcl::PointXYZRGB > &cloud2, pcl::PointCloud< pcl::PointXYZ > &inliers1, pcl::PointCloud< pcl::PointXYZ > &inliers2)
 Extracts 3D correspondences from 2D feature matches using pcl::PointXYZRGB organized point clouds.
 
int RTABMAP_CORE_EXPORT countUniquePairs (const std::multimap< int, pcl::PointXYZ > &wordsA, const std::multimap< int, pcl::PointXYZ > &wordsB)
 Counts the number of unique 3D point correspondences between two sets of word-indexed features.
 
void RTABMAP_CORE_EXPORT filterMaxDepth (pcl::PointCloud< pcl::PointXYZ > &inliers1, pcl::PointCloud< pcl::PointXYZ > &inliers2, float maxDepth, char depthAxis, bool removeDuplicates)
 Filters pairs of 3D points by maximum depth along a specified axis and optionally removes duplicates.
 
void RTABMAP_CORE_EXPORT findCorrespondences (const std::multimap< int, cv::KeyPoint > &wordsA, const std::multimap< int, cv::KeyPoint > &wordsB, std::list< std::pair< cv::Point2f, cv::Point2f > > &pairs)
 Finds 2D point correspondences between two sets of keypoints based on matching word IDs.
 
void RTABMAP_CORE_EXPORT findCorrespondences (const std::multimap< int, cv::Point3f > &words1, const std::multimap< int, cv::Point3f > &words2, std::vector< cv::Point3f > &inliers1, std::vector< cv::Point3f > &inliers2, float maxDepth, std::vector< int > *uniqueCorrespondences=0)
 Finds 3D point correspondences between two sets of points based on matching word IDs.
 
void RTABMAP_CORE_EXPORT findCorrespondences (const std::map< int, cv::Point3f > &words1, const std::map< int, cv::Point3f > &words2, std::vector< cv::Point3f > &inliers1, std::vector< cv::Point3f > &inliers2, float maxDepth, std::vector< int > *correspondences=0)
 Finds 3D point correspondences between two sets of uniquely indexed 3D points.
 
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DDepth (const std::vector< cv::KeyPoint > &keypoints, const cv::Mat &depth, const std::vector< CameraModel > &cameraModels, float minDepth=0, float maxDepth=0)
 Projects 2D keypoints to 3D space using the provided depth image and camera models.
 
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DDepth (const std::vector< cv::KeyPoint > &keypoints, const cv::Mat &depth, const CameraModel &cameraModel, float minDepth=0, float maxDepth=0)
 Projects 2D keypoints to 3D space using the provided depth image and camera model.
 
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DDisparity (const std::vector< cv::KeyPoint > &keypoints, const cv::Mat &disparity, const StereoCameraModel &stereoCameraModel, float minDepth=0, float maxDepth=0)
 Projects 2D keypoints into 3D space using a disparity image and a stereo camera model.
 
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DStereo (const std::vector< cv::Point2f > &leftCorners, const std::vector< cv::Point2f > &rightCorners, const StereoCameraModel &model, const std::vector< unsigned char > &mask=std::vector< unsigned char >(), float minDepth=0, float maxDepth=0)
 Computes 3D keypoints from corresponding 2D points in a stereo image pair.
 
std::map< int, cv::Point3f > RTABMAP_CORE_EXPORT generateWords3DMono (const std::map< int, cv::KeyPoint > &kpts, const std::map< int, cv::KeyPoint > &previousKpts, const CameraModel &cameraModel, Transform &cameraTransform, float ransacReprojThreshold=3.0f, float ransacConfidence=0.99f, int varianceMedianRatio=4, const std::map< int, cv::Point3f > &refGuess3D=std::map< int, cv::Point3f >(), double *variance=0, std::vector< int > *matchesOut=0)
 
std::multimap< int, cv::KeyPoint > RTABMAP_CORE_EXPORT aggregate (const std::list< int > &wordIds, const std::vector< cv::KeyPoint > &keypoints)
 Aggregates word IDs and corresponding keypoints into a multimap.
 
LaserScan RTABMAP_CORE_EXPORT commonFiltering (const LaserScan &scan, int downsamplingStep, float rangeMin=0.0f, float rangeMax=0.0f, float voxelSize=0.0f, int normalK=0, float normalRadius=0.0f, float groundNormalsUp=0.0f)
 Applies a common set of filters to a LaserScan, including downsampling, range limits, voxel grid filtering, and normal estimation.
 
RTABMAP_DEPRECATED LaserScan RTABMAP_CORE_EXPORT commonFiltering (const LaserScan &scan, int downsamplingStep, float rangeMin, float rangeMax, float voxelSize, int normalK, float normalRadius, bool forceGroundNormalsUp)
 Applies a common set of filters to a LaserScan, including downsampling, range limits, voxel grid filtering, and normal estimation.
 
LaserScan RTABMAP_CORE_EXPORT rangeFiltering (const LaserScan &scan, float rangeMin, float rangeMax)
 Filters a LaserScan data on a minimum and maximum Euclidean range.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT rangeFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float rangeMin, float rangeMax)
 Filters a point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT rangeFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float rangeMin, float rangeMax)
 Filters a point cloud of type pcl::PointXYZRGB.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT rangeFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float rangeMin, float rangeMax)
 Filters a point cloud of type pcl::PointNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT rangeFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float rangeMin, float rangeMax)
 Filters a point cloud of type pcl::PointXYZRGBNormal.
 
void RTABMAP_CORE_EXPORT rangeSplitFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float range, pcl::IndicesPtr &closeIndices, pcl::IndicesPtr &farIndices)
 Splits a point cloud of type pcl::PointXYZ.
 
void RTABMAP_CORE_EXPORT rangeSplitFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float range, pcl::IndicesPtr &closeIndices, pcl::IndicesPtr &farIndices)
 Splits a point cloud of type pcl::PointXYZRGB.
 
void RTABMAP_CORE_EXPORT rangeSplitFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float range, pcl::IndicesPtr &closeIndices, pcl::IndicesPtr &farIndices)
 Splits a point cloud of type pcl::PointNormal.
 
void RTABMAP_CORE_EXPORT rangeSplitFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float range, pcl::IndicesPtr &closeIndices, pcl::IndicesPtr &farIndices)
 Splits a point cloud of type pcl::PointXYZRGBNormal.
 
LaserScan RTABMAP_CORE_EXPORT downsample (const LaserScan &cloud, int step)
 Downsamples a LaserScan.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT downsample (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, int step)
 Downsamples a point cloud of type pcl::PointXYZ.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT downsample (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, int step)
 Downsamples a point cloud of type pcl::PointXYZRGB.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT downsample (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, int step)
 Downsamples a point cloud of type pcl::PointXYZI.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT downsample (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, int step)
 Downsamples a point cloud of type pcl::PointNormal.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT downsample (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, int step)
 Downsamples a point cloud of type pcl::PointXYZRGBNormal.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT downsample (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, int step)
 Downsamples a point cloud of type pcl::PointXYZINormal.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZ on provided indices.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointNormal on provided indices.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZRGB on provided indices.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZRGBNormal on provided indices.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZI on provided indices.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZINormal on provided indices.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZ.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointNormal.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZRGB.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZRGBNormal.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZI.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT voxelize (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, float voxelSize)
 Performs voxel grid downsampling on a point cloud of type pcl::PointXYZINormal.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr uniformSampling (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float voxelSize)
 DEPRECATED: Use voxelize() instead.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr uniformSampling (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float voxelSize)
 DEPRECATED: Use voxelize() instead.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr uniformSampling (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, float voxelSize)
 DEPRECATED: Use voxelize() instead.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT randomSampling (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, int samples)
 Performs random sampling on a point cloud of type pcl::PointXYZ.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT randomSampling (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, int samples)
 Performs random sampling on a point cloud of type pcl::PointNormal.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT randomSampling (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, int samples)
 Performs random sampling on a point cloud of type pcl::PointXYZRGB.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT randomSampling (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, int samples)
 Performs random sampling on a point cloud of type pcl::PointXYZRGBNormal.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT randomSampling (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, int samples)
 Performs random sampling on a point cloud of type pcl::PointXYZI.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT randomSampling (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, int samples)
 Performs random sampling on a point cloud of type pcl::PointXYZINormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZ and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZRGB and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZI and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointNormal and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZRGBNormal and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZINormal and returns filtered indices.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZ and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZRGB and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZI and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointNormal and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZRGBNormal and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT passThrough (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const std::string &axis, float min, float max, bool negative=false)
 Performs pass-through filtering on a point cloud of type pcl::PointXYZINormal and returns a new point cloud of the filtered points.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PCLPointCloud2::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PCLPointCloud2 and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZ and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointNormal and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZRGB and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZRGBNormal and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZI and returns filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZINormal and returns filtered indices.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZ and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointNormal and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZRGB and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZI and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZINormal and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT cropBox (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const Eigen::Vector4f &min, const Eigen::Vector4f &max, const Transform &transform=Transform::getIdentity(), bool negative=false)
 Performs crop box filtering on a point cloud of type pcl::PointXYZRGBNormal and returns a new point cloud of the filtered points.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT frustumFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &cameraPose, float horizontalFOV, float verticalFOV, float nearClipPlaneDistance, float farClipPlaneDistance, bool negative=false)
 Performs frustum filtering on a point cloud of type pcl::PointXYZ and returns filtered indices.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT frustumFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const Transform &cameraPose, float horizontalFOV, float verticalFOV, float nearClipPlaneDistance, float farClipPlaneDistance, bool negative=false)
 Performs frustum filtering on a point cloud of type pcl::PointXYZ and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT frustumFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const Transform &cameraPose, float horizontalFOV, float verticalFOV, float nearClipPlaneDistance, float farClipPlaneDistance, bool negative=false)
 Performs frustum filtering on a point cloud of type pcl::PointXYZRGB and returns a new point cloud of the filtered points.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT removeNaNFromPointCloud (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud)
 Remove NaN points from a point cloud of type pcl::PointXYZ.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT removeNaNFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud)
 Remove NaN points from a point cloud of type pcl::PointXYZRGB.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT removeNaNFromPointCloud (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud)
 Remove NaN points from a point cloud of type pcl::PointXYZI.
 
pcl::PCLPointCloud2::Ptr RTABMAP_CORE_EXPORT removeNaNFromPointCloud (const pcl::PCLPointCloud2::Ptr &cloud)
 Remove NaN points from a point cloud of type pcl::PCLPointCloud2.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT removeNaNNormalsFromPointCloud (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud)
 Removes points with NaN normal values from a point cloud of type pcl::PointNormal.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT removeNaNNormalsFromPointCloud (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud)
 Removes points with NaN normal values from a point cloud of type pcl::PointXYZRGBNormal.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT removeNaNNormalsFromPointCloud (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud)
 Removes points with NaN normal values from a point cloud of type pcl::PointXYZINormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZRGB.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZRGBNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZI.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZINormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZ with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointNormal with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZRGB with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZRGBNormal with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZI with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT radiusFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float radiusSearch, int minNeighborsInRadius)
 Radius filtering for point cloud of type pcl::PointXYZINormal with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZRGB.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZRGBNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZI.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZINormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZ with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointNormal with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZRGB with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZRGBNormal with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZI with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT proportionalRadiusFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::vector< int > &viewpointIndices, const std::map< int, Transform > &viewpoints, float factor=0.01f, float neighborScale=2.0f)
 Proportional radius filtering for point cloud of type pcl::PointXYZINormal with indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZ >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearch, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZ, returning filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearch, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZRGB, returning filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointNormal >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearch, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointNormal, returning filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearch, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZINormal, returning filtered indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearch, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZRGBNormal, returning filtered indices.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::PointCloud< pcl::PointXYZ >::Ptr &subtractCloud, float radiusSearch, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZ, returning a new filtered point cloud.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &subtractCloud, float radiusSearch, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZRGB, returning a new filtered point cloud.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::PointCloud< pcl::PointNormal >::Ptr &subtractCloud, float radiusSearch, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointNormal, returning a new filtered point cloud.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &subtractCloud, float radiusSearch, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZINormal, returning a new filtered point cloud.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT subtractFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &subtractCloud, float radiusSearch, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1)
 Subtract filtering for point cloud of type pcl::PointXYZRGBNormal, returning a new filtered point cloud.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractAdaptiveFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearchRatio=0.01, int minNeighborsInRadius=1, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0))
 Performs adaptive radius-based subtraction filtering on a point cloud.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT subtractAdaptiveFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &subtractCloud, const pcl::IndicesPtr &subtractIndices, float radiusSearchRatio=0.01, float maxAngle=M_PI/4.0f, int minNeighborsInRadius=1, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0))
 Performs adaptive radius-based subtraction filtering on a point cloud with normals, also considering normal direction differences.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZRGB.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZRGB.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZI.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZRGBNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT normalFiltering (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
 Point normal filtering for point cloud of type pcl::PointXYZINormal.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZ.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZRGB.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZ inside provided indices.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointNormal inside provided indices.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZRGB inside provided indices.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZRGBNormal inside provided indices.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZI inside provided indices.
 
std::vector< pcl::IndicesPtr > RTABMAP_CORE_EXPORT extractClusters (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
 Extract clusters from point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
 Extract indices from point cloud of type pcl::PointXYZ.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
 Extract indices from point cloud of type pcl::PointNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
 Extract indices from point cloud of type pcl::PointXYZRGB.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
 Extract indices from point cloud of type pcl::PointXYZRGBNormal.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
 Extract indices from point cloud of type pcl::PointXYZI.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
 Extract indices from point cloud of type pcl::PointXYZINormal.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative, bool keepOrganized)
 Extract points from point cloud of type pcl::PointXYZ with corresponding indices.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative, bool keepOrganized)
 Extract points from point cloud of type pcl::PointXYZRGB with corresponding indices.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative, bool keepOrganized)
 Extract points from point cloud of type pcl::PointXYZRGBNormal with corresponding indices.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative, bool keepOrganized)
 Extract points from point cloud of type pcl::PointXYZI with corresponding indices.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT extractIndices (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative, bool keepOrganized)
 Extract points from point cloud of type pcl::PointXYZINormal with corresponding indices.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractPlane (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float distanceThreshold, int maxIterations=100, pcl::ModelCoefficients *coefficientsOut=0)
 Extracts the indices of the inliers that belong to a plane using RANSAC.
 
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractPlane (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float distanceThreshold, int maxIterations=100, pcl::ModelCoefficients *coefficientsOut=0)
 
RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT occupancy2DFromLaserScan (const cv::Mat &scan, cv::Mat &empty, cv::Mat &occupied, float cellSize, bool unknownSpaceFilled=false, float scanMaxRange=0.0f)
 
RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT occupancy2DFromLaserScan (const cv::Mat &scan, const cv::Point3f &viewpoint, cv::Mat &empty, cv::Mat &occupied, float cellSize, bool unknownSpaceFilled=false, float scanMaxRange=0.0f)
 
void RTABMAP_CORE_EXPORT occupancy2DFromLaserScan (const cv::Mat &scanHit, const cv::Mat &scanNoHit, const cv::Point3f &viewpoint, cv::Mat &empty, cv::Mat &occupied, float cellSize, bool unknownSpaceFilled=false, float scanMaxRange=0.0f)
 Generates 2D occupancy grid maps (free and occupied cells) from laser scan data.
 
cv::Mat RTABMAP_CORE_EXPORT create2DMapFromOccupancyLocalMaps (const std::map< int, Transform > &poses, const std::map< int, std::pair< cv::Mat, cv::Mat > > &occupancy, float cellSize, float &xMin, float &yMin, float minMapSize=0.0f, bool erode=false, float footprintRadius=0.0f)
 Creates a 2D occupancy grid map from local occupancy data.
 
RTABMAP_DEPRECATED cv::Mat RTABMAP_CORE_EXPORT create2DMap (const std::map< int, Transform > &poses, const std::map< int, pcl::PointCloud< pcl::PointXYZ >::Ptr > &scans, float cellSize, bool unknownSpaceFilled, float &xMin, float &yMin, float minMapSize=0.0f, float scanMaxRange=0.0f)
 
RTABMAP_DEPRECATED cv::Mat RTABMAP_CORE_EXPORT create2DMap (const std::map< int, Transform > &poses, const std::map< int, pcl::PointCloud< pcl::PointXYZ >::Ptr > &scans, const std::map< int, cv::Point3f > &viewpoints, float cellSize, bool unknownSpaceFilled, float &xMin, float &yMin, float minMapSize=0.0f, float scanMaxRange=0.0f)
 
cv::Mat RTABMAP_CORE_EXPORT create2DMap (const std::map< int, Transform > &poses, const std::map< int, std::pair< cv::Mat, cv::Mat > > &scans, const std::map< int, cv::Point3f > &viewpoints, float cellSize, bool unknownSpaceFilled, float &xMin, float &yMin, float minMapSize=0.0f, float scanMaxRange=0.0f)
 Generates a 2D occupancy grid map from a set of poses, laser scans, and viewpoints.
 
void RTABMAP_CORE_EXPORT rayTrace (const cv::Point2i &start, const cv::Point2i &end, cv::Mat &grid, bool stopOnObstacle)
 Performs a 2D ray tracing operation between two points on a grid map.
 
cv::Mat RTABMAP_CORE_EXPORT convertMap2Image8U (const cv::Mat &map8S, bool pgmFormat=false)
 Converts an occupancy grid map (CV_8S) to a grayscale image (CV_8U).
 
cv::Mat RTABMAP_CORE_EXPORT convertImage8U2Map (const cv::Mat &map8U, bool pgmFormat=false)
 Converts a grayscale occupancy image (CV_8U) to an occupancy grid map (CV_8S).
 
cv::Mat RTABMAP_CORE_EXPORT erodeMap (const cv::Mat &map)
 Performs erosion on an occupancy grid map to reduce small noisy obstacles.
 
template<typename PointT >
void segmentObstaclesFromGround (const typename pcl::PointCloud< PointT >::Ptr &cloud, const pcl::IndicesPtr &indices, pcl::IndicesPtr &ground, pcl::IndicesPtr &obstacles, int normalKSearch, float groundNormalAngle, float clusterRadius, int minClusterSize, bool segmentFlatObstacles=false, float maxGroundHeight=0.0f, pcl::IndicesPtr *flatObstacles=0, const Eigen::Vector4f &viewPoint=Eigen::Vector4f(0, 0, 100, 0), float groundNormalsUp=0)
 Segments ground and obstacle indices from a point cloud using surface normals and clustering.
 
void RTABMAP_CORE_EXPORT setRansacDeterministicSeed (bool enable)
 Toggle a deterministic seed for OpenGV's internal RANSAC RNG.
 
bool RTABMAP_CORE_EXPORT ransacDeterministicSeedEnabled ()
 
Transform RTABMAP_CORE_EXPORT estimateMotion3DTo2D (const std::map< int, cv::Point3f > &words3A, const std::map< int, cv::KeyPoint > &words2B, const CameraModel &cameraModel, int minInliers=10, int iterations=100, double reprojError=5., int flagsPnP=0, int pnpRefineIterations=1, int varianceMedianRatio=4, float maxVariance=0, const Transform &guess=Transform::getIdentity(), const std::map< int, cv::Point3f > &words3B=std::map< int, cv::Point3f >(), cv::Mat *covariance=0, std::vector< int > *matchesOut=0, std::vector< int > *inliersOut=0, bool splitLinearCovarianceComponents=false)
 Estimates a 6-DOF camera transform from 3D-2D point correspondences using PnP RANSAC.
 
Transform RTABMAP_CORE_EXPORT estimateMotion3DTo2D (const std::map< int, cv::Point3f > &words3A, const std::map< int, cv::KeyPoint > &words2B, const std::vector< CameraModel > &cameraModels, unsigned int samplingPolicy, int minInliers, int iterations, double reprojError, int flagsPnP, int refineIterations, int varianceMedianRatio, float maxVariance, const Transform &guess, const std::map< int, cv::Point3f > &words3B, cv::Mat *covariance, std::vector< std::vector< int > > *matchesOut, std::vector< std::vector< int > > *inliersOut, bool splitLinearCovarianceComponents)
 Estimates the 3D-to-2D motion (pose) transformation between a set of 3D points and their corresponding 2D keypoints using the OpenGV library.
 
Transform RTABMAP_CORE_EXPORT estimateMotion3DTo2D (const std::map< int, cv::Point3f > &words3A, const std::map< int, cv::KeyPoint > &words2B, const std::vector< CameraModel > &cameraModels, unsigned int samplingPolicy=0, int minInliers=10, int iterations=100, double reprojError=5., int flagsPnP=0, int pnpRefineIterations=1, int varianceMedianRatio=4, float maxVariance=0, const Transform &guess=Transform::getIdentity(), const std::map< int, cv::Point3f > &words3B=std::map< int, cv::Point3f >(), cv::Mat *covariance=0, std::vector< int > *matchesOut=0, std::vector< int > *inliersOut=0, bool splitLinearCovarianceComponents=false)
 Estimates the 3D-to-2D motion (pose) transformation between a set of 3D points and their corresponding 2D keypoints using the OpenGV library.
 
Transform RTABMAP_CORE_EXPORT estimateMotion3DTo3D (const std::map< int, cv::Point3f > &words3A, const std::map< int, cv::Point3f > &words3B, int minInliers=10, double inliersDistance=0.1, int iterations=100, int refineIterations=5, cv::Mat *covariance=0, std::vector< int > *matchesOut=0, std::vector< int > *inliersOut=0)
 Estimates the 3D rigid transformation between two sets of 3D points.
 
void RTABMAP_CORE_EXPORT solvePnPRansac (const std::vector< cv::Point3f > &objectPoints, const std::vector< cv::Point2f > &imagePoints, const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, cv::Mat &rvec, cv::Mat &tvec, bool useExtrinsicGuess, int iterationsCount, float reprojectionError, int minInliersCount, std::vector< int > &inliers, int flags, int refineIterations=1, float refineSigma=3.0f)
 Estimates the camera pose using the PnP RANSAC algorithm and optionally refines it.
 
int RTABMAP_CORE_EXPORT getCorrespondencesCount (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud_source, const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud_target, float maxDistance)
 
Transform RTABMAP_CORE_EXPORT transformFromXYZCorrespondencesSVD (const pcl::PointCloud< pcl::PointXYZ > &cloud1, const pcl::PointCloud< pcl::PointXYZ > &cloud2)
 Estimates the rigid 3D transformation between two point clouds using SVD.
 
Transform RTABMAP_CORE_EXPORT transformFromXYZCorrespondences (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud1, const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud2, double inlierThreshold=0.02, int iterations=100, int refineModelIterations=10, double refineModelSigma=3.0, std::vector< int > *inliers=0, cv::Mat *variance=0)
 Estimates a rigid transformation between two point clouds using RANSAC with optional refinement.
 
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences (const pcl::PointCloud< pcl::PointNormal >::ConstPtr &cloudA, const pcl::PointCloud< pcl::PointNormal >::ConstPtr &cloudB, double maxCorrespondenceDistance, double maxCorrespondenceAngle, double &variance, int &correspondencesOut, bool reciprocal)
 Compute with variance and correspondences of pcl::PointNormal point cloud type.
 
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences (const pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr &cloudA, const pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr &cloudB, double maxCorrespondenceDistance, double maxCorrespondenceAngle, double &variance, int &correspondencesOut, bool reciprocal)
 Compute with variance and correspondences of pcl::PointXYZINormal point cloud type.
 
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloudA, const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloudB, double maxCorrespondenceDistance, double &variance, int &correspondencesOut, bool reciprocal)
 Compute with variance and correspondences of pcl::PointXYZ point cloud type.
 
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences (const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &cloudA, const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &cloudB, double maxCorrespondenceDistance, double &variance, int &correspondencesOut, bool reciprocal)
 Compute with variance and correspondences of pcl::PointXYZI point cloud type.
 
Transform RTABMAP_CORE_EXPORT icp (const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud_source, const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &cloud_target, double maxCorrespondenceDistance, int maximumIterations, bool &hasConverged, pcl::PointCloud< pcl::PointXYZ > &cloud_source_registered, float epsilon=0.0f, bool icp2D=false, float ransacOutlierRatio=0.0f, int *iterationsDone=nullptr)
 Performs Iterative Closest Point (ICP) alignment between two point clouds and returns the resulting transform.
 
Transform RTABMAP_CORE_EXPORT icp (const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &cloud_source, const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &cloud_target, double maxCorrespondenceDistance, int maximumIterations, bool &hasConverged, pcl::PointCloud< pcl::PointXYZI > &cloud_source_registered, float epsilon=0.0f, bool icp2D=false, float ransacOutlierRatio=0.0f, int *iterationsDone=nullptr)
 Performs Iterative Closest Point (ICP) alignment between two point clouds and returns the resulting transform.
 
Transform RTABMAP_CORE_EXPORT icpPointToPlane (const pcl::PointCloud< pcl::PointNormal >::ConstPtr &cloud_source, const pcl::PointCloud< pcl::PointNormal >::ConstPtr &cloud_target, double maxCorrespondenceDistance, int maximumIterations, bool &hasConverged, pcl::PointCloud< pcl::PointNormal > &cloud_source_registered, float epsilon=0.0f, bool icp2D=false, float ransacOutlierRatio=0.0f, int *iterationsDone=nullptr)
 Performs Iterative Closest Point (ICP) alignment using a point-to-plane error metric.
 
Transform RTABMAP_CORE_EXPORT icpPointToPlane (const pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr &cloud_source, const pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr &cloud_target, double maxCorrespondenceDistance, int maximumIterations, bool &hasConverged, pcl::PointCloud< pcl::PointXYZINormal > &cloud_source_registered, float epsilon=0.0f, bool icp2D=false, float ransacOutlierRatio=0.0f, int *iterationsDone=nullptr)
 Performs Iterative Closest Point (ICP) alignment using a point-to-plane error metric.
 
void RTABMAP_CORE_EXPORT createPolygonIndexes (const std::vector< pcl::Vertices > &polygons, int cloudSize, std::vector< std::set< int > > &neighborPolygons, std::vector< std::set< int > > &vertexPolygons)
 Given a set of polygons, create two indexes: polygons to neighbor polygons and vertices to polygons.
 
std::list< std::list< int > > RTABMAP_CORE_EXPORT clusterPolygons (const std::vector< std::set< int > > &neighborPolygons, int minClusterSize=0)
 
std::vector< pcl::Vertices > RTABMAP_CORE_EXPORT organizedFastMesh (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, double angleTolerance, bool quad, int trianglePixelSize, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0))
 
std::vector< pcl::Vertices > RTABMAP_CORE_EXPORT organizedFastMesh (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, double angleTolerance=M_PI/16, bool quad=true, int trianglePixelSize=2, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0))
 
std::vector< pcl::Vertices > RTABMAP_CORE_EXPORT organizedFastMesh (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, double angleTolerance=M_PI/16, bool quad=true, int trianglePixelSize=2, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0))
 
void RTABMAP_CORE_EXPORT appendMesh (pcl::PointCloud< pcl::PointXYZRGBNormal > &cloudA, std::vector< pcl::Vertices > &polygonsA, const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloudB, const std::vector< pcl::Vertices > &polygonsB)
 
void RTABMAP_CORE_EXPORT appendMesh (pcl::PointCloud< pcl::PointXYZRGB > &cloudA, std::vector< pcl::Vertices > &polygonsA, const pcl::PointCloud< pcl::PointXYZRGB > &cloudB, const std::vector< pcl::Vertices > &polygonsB)
 
std::vector< int > RTABMAP_CORE_EXPORT filterNotUsedVerticesFromMesh (const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloud, const std::vector< pcl::Vertices > &polygons, pcl::PointCloud< pcl::PointXYZRGBNormal > &outputCloud, std::vector< pcl::Vertices > &outputPolygons)
 
std::vector< int > RTABMAP_CORE_EXPORT filterNotUsedVerticesFromMesh (const pcl::PointCloud< pcl::PointXYZRGB > &cloud, const std::vector< pcl::Vertices > &polygons, pcl::PointCloud< pcl::PointXYZRGB > &outputCloud, std::vector< pcl::Vertices > &outputPolygons)
 
std::vector< int > RTABMAP_CORE_EXPORT filterNaNPointsFromMesh (const pcl::PointCloud< pcl::PointXYZRGB > &cloud, const std::vector< pcl::Vertices > &polygons, pcl::PointCloud< pcl::PointXYZRGB > &outputCloud, std::vector< pcl::Vertices > &outputPolygons)
 
std::vector< pcl::Vertices > RTABMAP_CORE_EXPORT filterCloseVerticesFromMesh (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr cloud, const std::vector< pcl::Vertices > &polygons, float radius, float angle, bool keepLatestInRadius)
 
std::vector< pcl::Vertices > RTABMAP_CORE_EXPORT filterInvalidPolygons (const std::vector< pcl::Vertices > &polygons)
 
pcl::PolygonMesh::Ptr RTABMAP_CORE_EXPORT createMesh (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloudWithNormals, float gp3SearchRadius=0.025, float gp3Mu=2.5, int gp3MaximumNearestNeighbors=100, float gp3MaximumSurfaceAngle=M_PI/4, float gp3MinimumAngle=M_PI/18, float gp3MaximumAngle=2 *M_PI/3, bool gp3NormalConsistency=true)
 
pcl::TextureMesh::Ptr RTABMAP_CORE_EXPORT createTextureMesh (const pcl::PolygonMesh::Ptr &mesh, const std::map< int, Transform > &poses, const std::map< int, CameraModel > &cameraModels, const std::map< int, cv::Mat > &cameraDepths, float maxDistance=0.0f, float maxDepthError=0.0f, float maxAngle=0.0f, int minClusterSize=50, const std::vector< float > &roiRatios=std::vector< float >(), const ProgressState *state=0, std::vector< std::map< int, pcl::PointXY > > *vertexToPixels=0, bool distanceToCamPolicy=false)
 
pcl::TextureMesh::Ptr RTABMAP_CORE_EXPORT createTextureMesh (const pcl::PolygonMesh::Ptr &mesh, const std::map< int, Transform > &poses, const std::map< int, std::vector< CameraModel > > &cameraModels, const std::map< int, cv::Mat > &cameraDepths, float maxDistance=0.0f, float maxDepthError=0.0f, float maxAngle=0.0f, int minClusterSize=50, const std::vector< float > &roiRatios=std::vector< float >(), const ProgressState *state=0, std::vector< std::map< int, pcl::PointXY > > *vertexToPixels=0, bool distanceToCamPolicy=false)
 
void RTABMAP_CORE_EXPORT cleanTextureMesh (pcl::TextureMesh &textureMesh, int minClusterSize)
 
pcl::TextureMesh::Ptr RTABMAP_CORE_EXPORT concatenateTextureMeshes (const std::list< pcl::TextureMesh::Ptr > &meshes)
 
void RTABMAP_CORE_EXPORT concatenateTextureMaterials (pcl::TextureMesh &mesh, const cv::Size &imageSize, int textureSize, int maxTextures, float &scale, std::vector< bool > *materialsKept=0)
 
std::vector< std::vector< RTABMAP_PCL_INDEX > > RTABMAP_CORE_EXPORT convertPolygonsFromPCL (const std::vector< pcl::Vertices > &polygons)
 
std::vector< std::vector< std::vector< RTABMAP_PCL_INDEX > > > RTABMAP_CORE_EXPORT convertPolygonsFromPCL (const std::vector< std::vector< pcl::Vertices > > &polygons)
 
std::vector< pcl::Vertices > RTABMAP_CORE_EXPORT convertPolygonsToPCL (const std::vector< std::vector< RTABMAP_PCL_INDEX > > &polygons)
 
std::vector< std::vector< pcl::Vertices > > RTABMAP_CORE_EXPORT convertPolygonsToPCL (const std::vector< std::vector< std::vector< RTABMAP_PCL_INDEX > > > &tex_polygons)
 
pcl::TextureMesh::Ptr RTABMAP_CORE_EXPORT assembleTextureMesh (const cv::Mat &cloudMat, const std::vector< std::vector< std::vector< RTABMAP_PCL_INDEX > > > &polygons, const std::vector< std::vector< Eigen::Vector2f > > &texCoords, cv::Mat &textures, bool mergeTextures=false)
 
pcl::PolygonMesh::Ptr RTABMAP_CORE_EXPORT assemblePolygonMesh (const cv::Mat &cloudMat, const std::vector< std::vector< RTABMAP_PCL_INDEX > > &polygons)
 
cv::Mat RTABMAP_CORE_EXPORT mergeTextures (pcl::TextureMesh &mesh, const std::map< int, cv::Mat > &images, const std::map< int, CameraModel > &calibrations, const Memory *memory=0, const DBDriver *dbDriver=0, int textureSize=4096, int textureCount=1, const std::vector< std::map< int, pcl::PointXY > > &vertexToPixels=std::vector< std::map< int, pcl::PointXY > >(), bool gainCompensation=true, float gainBeta=10.0f, bool gainRGB=true, bool blending=true, int blendingDecimation=0, int brightnessContrastRatioLow=0, int brightnessContrastRatioHigh=0, bool exposureFusion=false, const ProgressState *state=0, unsigned char blankValue=255, bool clearVertexColorUnderTexture=true, std::map< int, std::map< int, cv::Vec4d > > *gains=0, std::map< int, std::map< int, cv::Mat > > *blendingGains=0, std::pair< float, float > *contrastValues=0)
 
cv::Mat RTABMAP_CORE_EXPORT mergeTextures (pcl::TextureMesh &mesh, const std::map< int, cv::Mat > &images, const std::map< int, std::vector< CameraModel > > &calibrations, const Memory *memory=0, const DBDriver *dbDriver=0, int textureSize=4096, int textureCount=1, const std::vector< std::map< int, pcl::PointXY > > &vertexToPixels=std::vector< std::map< int, pcl::PointXY > >(), bool gainCompensation=true, float gainBeta=10.0f, bool gainRGB=true, bool blending=true, int blendingDecimation=0, int brightnessContrastRatioLow=0, int brightnessContrastRatioHigh=0, bool exposureFusion=false, const ProgressState *state=0, unsigned char blankValue=255, bool clearVertexColorUnderTexture=true, std::map< int, std::map< int, cv::Vec4d > > *gains=0, std::map< int, std::map< int, cv::Mat > > *blendingGains=0, std::pair< float, float > *contrastValues=0)
 
void RTABMAP_CORE_EXPORT fixTextureMeshForVisualization (pcl::TextureMesh &textureMesh)
 
RTABMAP_DEPRECATED bool RTABMAP_CORE_EXPORT multiBandTexturing (const std::string &outputOBJPath, const pcl::PCLPointCloud2 &cloud, const std::vector< pcl::Vertices > &polygons, const std::map< int, Transform > &cameraPoses, const std::vector< std::map< int, pcl::PointXY > > &vertexToPixels, const std::map< int, cv::Mat > &images, const std::map< int, std::vector< CameraModel > > &cameraModels, const Memory *memory=0, const DBDriver *dbDriver=0, int textureSize=8192, const std::string &textureFormat="jpg", const std::map< int, std::map< int, cv::Vec4d > > &gains=std::map< int, std::map< int, cv::Vec4d > >(), const std::map< int, std::map< int, cv::Mat > > &blendingGains=std::map< int, std::map< int, cv::Mat > >(), const std::pair< float, float > &contrastValues=std::pair< float, float >(0, 0), bool gainRGB=true)
 
bool RTABMAP_CORE_EXPORT multiBandTexturing (const std::string &outputOBJPath, const pcl::PCLPointCloud2 &cloud, const std::vector< pcl::Vertices > &polygons, const std::map< int, Transform > &cameraPoses, const std::vector< std::map< int, pcl::PointXY > > &vertexToPixels, const std::map< int, cv::Mat > &images, const std::map< int, std::vector< CameraModel > > &cameraModels, const Memory *memory=0, const DBDriver *dbDriver=0, unsigned int textureSize=8192, unsigned int textureDownscale=2, const std::string &nbContrib="1 5 10 0", const std::string &textureFormat="jpg", const std::map< int, std::map< int, cv::Vec4d > > &gains=std::map< int, std::map< int, cv::Vec4d > >(), const std::map< int, std::map< int, cv::Mat > > &blendingGains=std::map< int, std::map< int, cv::Mat > >(), const std::pair< float, float > &contrastValues=std::pair< float, float >(0, 0), bool gainRGB=true, unsigned int unwrapMethod=0, bool fillHoles=false, unsigned int padding=5, double bestScoreThreshold=0.1, double angleHardThreshold=90.0, bool forceVisibleByAllVertices=false)
 
cv::Mat RTABMAP_CORE_EXPORT computeNormals (const cv::Mat &laserScan, int searchK, float searchRadius)
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, int searchK=20, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, int searchK=20, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, int searchK=20, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, int searchK=20, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, int searchK=20, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, int searchK=20, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals2D (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, int searchK=5, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeNormals2D (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, int searchK=5, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeFastOrganizedNormals2D (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, int searchK=5, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeFastOrganizedNormals2D (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, int searchK=5, float searchRadius=0.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeFastOrganizedNormals (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float maxDepthChangeFactor=0.02f, float normalSmoothingSize=10.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
pcl::PointCloud< pcl::Normal >::Ptr RTABMAP_CORE_EXPORT computeFastOrganizedNormals (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float maxDepthChangeFactor=0.02f, float normalSmoothingSize=10.0f, const Eigen::Vector3f &viewPoint=Eigen::Vector3f(0, 0, 0))
 
float RTABMAP_CORE_EXPORT computeNormalsComplexity (const LaserScan &scan, const Transform &t=Transform::getIdentity(), cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type LaserScan.
 
float RTABMAP_CORE_EXPORT computeNormalsComplexity (const pcl::PointCloud< pcl::Normal > &normals, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::Normal.
 
float RTABMAP_CORE_EXPORT computeNormalsComplexity (const pcl::PointCloud< pcl::PointNormal > &cloud, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::PointNormal.
 
float RTABMAP_CORE_EXPORT computeNormalsComplexity (const pcl::PointCloud< pcl::PointXYZINormal > &cloud, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::PointXYZINormal.
 
float RTABMAP_CORE_EXPORT computeNormalsComplexity (const pcl::PointCloud< pcl::PointXYZRGBNormal > &cloud, const Transform &t=Transform::getIdentity(), bool is2d=false, cv::Mat *pcaEigenVectors=0, cv::Mat *pcaEigenValues=0, bool centered=true)
 Computes the complexity of surface normals in a point cloud of type pcl::PointXYZRGBNormal.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT mls (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, float searchRadius=0.0f, int polygonialOrder=2, int upsamplingMethod=0, float upsamplingRadius=0.0f, float upsamplingStep=0.0f, int pointDensity=0, float dilationVoxelSize=1.0f, int dilationIterations=0)
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT mls (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, float searchRadius=0.0f, int polygonialOrder=2, int upsamplingMethod=0, float upsamplingRadius=0.0f, float upsamplingStep=0.0f, int pointDensity=0, float dilationVoxelSize=1.0f, int dilationIterations=0)
 
RTABMAP_DEPRECATED LaserScan RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (const LaserScan &scan, const Eigen::Vector3f &viewpoint, bool forceGroundNormalsUp)
 
LaserScan RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (const LaserScan &scan, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0), float groundNormalsUp=0.0f)
 
RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const Eigen::Vector3f &viewpoint, bool forceGroundNormalsUp)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0), float groundNormalsUp=0.0f)
 
RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const Eigen::Vector3f &viewpoint, bool forceGroundNormalsUp)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0), float groundNormalsUp=0.0f)
 
RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const Eigen::Vector3f &viewpoint, bool forceGroundNormalsUp)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoint (pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0), float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &poses, const std::vector< int > &cameraIndices, pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &poses, const std::vector< int > &cameraIndices, pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &poses, const std::vector< int > &cameraIndices, pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &poses, const pcl::PointCloud< pcl::PointXYZ >::Ptr &rawCloud, const std::vector< int > &rawCameraIndices, pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &poses, const pcl::PointCloud< pcl::PointXYZ >::Ptr &rawCloud, const std::vector< int > &rawCameraIndices, pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &poses, const pcl::PointCloud< pcl::PointXYZ >::Ptr &rawCloud, const std::vector< int > &rawCameraIndices, pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, float groundNormalsUp=0.0f)
 
void RTABMAP_CORE_EXPORT adjustNormalsToViewPoints (const std::map< int, Transform > &viewpoints, const LaserScan &rawScan, const std::vector< int > &viewpointIds, LaserScan &scan, float groundNormalsUp=0.0f)
 
pcl::PolygonMesh::Ptr RTABMAP_CORE_EXPORT meshDecimation (const pcl::PolygonMesh::Ptr &mesh, float factor)
 
template<typename pointT >
std::vector< pcl::Vertices > normalizePolygonsSide (const pcl::PointCloud< pointT > &cloud, const std::vector< pcl::Vertices > &polygons, const pcl::PointXYZ &viewPoint=pcl::PointXYZ(0, 0, 0))
 
bool RTABMAP_CORE_EXPORT intersectRayTriangle (const Eigen::Vector3f &p, const Eigen::Vector3f &dir, const Eigen::Vector3f &v0, const Eigen::Vector3f &v1, const Eigen::Vector3f &v2, float &distance, Eigen::Vector3f &normal)
 
int RTABMAP_CORE_EXPORT saveOBJFile (const std::string &file_name, const pcl::TextureMesh &tex_mesh, unsigned precision=5)
 
int RTABMAP_CORE_EXPORT saveOBJFile (const std::string &file_name, const pcl::PolygonMesh &mesh, unsigned precision=5)
 
LaserScan RTABMAP_CORE_EXPORT transformLaserScan (const LaserScan &laserScan, const Transform &transform)
 Applies a 3D transform to all points (and normals if present) in a LaserScan.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const Transform &transform)
 Transforms pcl::PointXYZ point cloud type.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const Transform &transform)
 Transforms pcl::PointXYZI point cloud type.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const Transform &transform)
 Transforms pcl::PointXYZRGB point cloud type.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const Transform &transform)
 Transforms pcl::PointNormal point cloud type.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const Transform &transform)
 Transforms pcl::PointXYZRGBNormal point cloud type.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const Transform &transform)
 Transforms pcl::PointXYZINormal point cloud type.
 
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &transform)
 Transforms pcl::PointXYZ point cloud type with specified indices.
 
pcl::PointCloud< pcl::PointXYZI >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZI >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &transform)
 Transforms pcl::PointXYZI point cloud type with specified indices.
 
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &transform)
 Transforms pcl::PointXYZRGB point cloud type with specified indices.
 
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &transform)
 Transforms pcl::PointNormal point cloud type with specified indices.
 
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &transform)
 Transforms pcl::PointXYZRGBNormal point cloud type with specified indices.
 
pcl::PointCloud< pcl::PointXYZINormal >::Ptr RTABMAP_CORE_EXPORT transformPointCloud (const pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloud, const pcl::IndicesPtr &indices, const Transform &transform)
 Transforms pcl::PointXYZINormal point cloud type with specified indices.
 
cv::Point3f RTABMAP_CORE_EXPORT transformPoint (const cv::Point3f &pt, const Transform &transform)
 Transforms cv::Point3f point type.
 
cv::Point3d RTABMAP_CORE_EXPORT transformPoint (const cv::Point3d &pt, const Transform &transform)
 Transforms cv::Point3d point type.
 
pcl::PointXYZ RTABMAP_CORE_EXPORT transformPoint (const pcl::PointXYZ &pt, const Transform &transform)
 Transforms pcl::PointXYZ point type.
 
pcl::PointXYZI RTABMAP_CORE_EXPORT transformPoint (const pcl::PointXYZI &pt, const Transform &transform)
 Transforms pcl::PointXYZI point type.
 
pcl::PointXYZRGB RTABMAP_CORE_EXPORT transformPoint (const pcl::PointXYZRGB &pt, const Transform &transform)
 Transforms pcl::PointXYZRGB point type.
 
pcl::PointNormal RTABMAP_CORE_EXPORT transformPoint (const pcl::PointNormal &point, const Transform &transform)
 Transforms pcl::PointNormal point type.
 
pcl::PointXYZRGBNormal RTABMAP_CORE_EXPORT transformPoint (const pcl::PointXYZRGBNormal &point, const Transform &transform)
 Transforms pcl::PointXYZRGBNormal point type.
 
pcl::PointXYZINormal RTABMAP_CORE_EXPORT transformPoint (const pcl::PointXYZINormal &point, const Transform &transform)
 Transforms pcl::PointXYZINormal point type.
 

Detailed Description

3D utilities: point cloud conversion and filtering, projection, registration, surface reconstruction, mapping and transforms.

Declared across util3d.h, util3d_filtering.h, util3d_mapping.h, util3d_registration.h, util3d_surface.h and util3d_transforms.h.

Function Documentation

◆ projectCloudOnXYPlane()

template<typename PointT >
pcl::PointCloud< PointT >::Ptr rtabmap::util3d::projectCloudOnXYPlane ( const typename pcl::PointCloud< PointT > &  cloud)

Projects a point cloud onto the XY plane by setting all Z coordinates to zero.

This function creates a copy of the input point cloud and modifies each point's Z coordinate to be zero, effectively projecting the entire cloud onto the XY plane.

Template Parameters
PointTThe type of point used in the point cloud (e.g., pcl::PointXYZ).
Parameters
cloudThe input point cloud to project.
Returns
typename pcl::PointCloud<PointT>::Ptr A pointer to the projected point cloud with Z coordinates set to zero.

Definition at line 41 of file util3d_mapping.hpp.

◆ segmentObstaclesFromGround() [1/3]

template<typename PointT >
void rtabmap::util3d::segmentObstaclesFromGround ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
const typename pcl::IndicesPtr &  indices,
pcl::IndicesPtr &  ground,
pcl::IndicesPtr &  obstacles,
int  normalKSearch,
float  groundNormalAngle,
float  clusterRadius,
int  minClusterSize,
bool  segmentFlatObstacles,
float  maxGroundHeight,
pcl::IndicesPtr *  flatObstacles,
const Eigen::Vector4f &  viewPoint,
float  groundNormalsUp 
)

Definition at line 54 of file util3d_mapping.hpp.

◆ segmentObstaclesFromGround() [2/3]

template<typename PointT >
void rtabmap::util3d::segmentObstaclesFromGround ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
pcl::IndicesPtr &  ground,
pcl::IndicesPtr &  obstacles,
int  normalKSearch,
float  groundNormalAngle,
float  clusterRadius,
int  minClusterSize,
bool  segmentFlatObstacles = false,
float  maxGroundHeight = 0.0f,
pcl::IndicesPtr *  flatObstacles = 0,
const Eigen::Vector4f &  viewPoint = Eigen::Vector4f(0, 0, 100, 0),
float  groundNormalsUp = 0 
)

Segments ground and obstacle indices from a point cloud using surface normals and clustering.

See also
segmentObstaclesFromGround() with indices

Definition at line 202 of file util3d_mapping.hpp.

◆ occupancy2DFromGroundObstacles() [1/2]

template<typename PointT >
void rtabmap::util3d::occupancy2DFromGroundObstacles ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
const pcl::IndicesPtr &  groundIndices,
const pcl::IndicesPtr &  obstaclesIndices,
cv::Mat &  ground,
cv::Mat &  obstacles,
float  cellSize 
)

Projects 3D ground and obstacle point clouds onto the 2D XY plane and voxelizes them into 2D occupancy data.

See also
occupancy2DFromGroundObstacles() without indices

Definition at line 234 of file util3d_mapping.hpp.

◆ occupancy2DFromGroundObstacles() [2/2]

template<typename PointT >
void rtabmap::util3d::occupancy2DFromGroundObstacles ( const typename pcl::PointCloud< PointT >::Ptr &  groundCloud,
const typename pcl::PointCloud< PointT >::Ptr &  obstaclesCloud,
cv::Mat &  ground,
cv::Mat &  obstacles,
float  cellSize 
)

Projects 3D ground and obstacle point clouds onto the 2D XY plane and voxelizes them into 2D occupancy data.

This function takes two 3D point clouds—representing ground and obstacles—and performs the following steps:

  • Projects them onto the XY plane (setting Z = 0).
  • Voxelizes them based on the specified cell size.
  • Converts the resulting 2D points into OpenCV matrices (1-row, N-columns, CV_32FC2) where each element is a (x, y) coordinate.
Template Parameters
PointTThe type of point in the input point clouds (e.g., pcl::PointXYZ).
Parameters
groundCloudThe input point cloud representing ground points.
obstaclesCloudThe input point cloud representing obstacle points.
groundOutput matrix containing 2D (x, y) coordinates of projected ground points (type: CV_32FC2).
obstaclesOutput matrix containing 2D (x, y) coordinates of projected obstacle points (type: CV_32FC2).
cellSizeThe size of each voxel/grid cell used for downsampling the projected cloud (in meters).

Definition at line 264 of file util3d_mapping.hpp.

◆ occupancy2DFromCloud3D() [1/2]

template<typename PointT >
void rtabmap::util3d::occupancy2DFromCloud3D ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
const pcl::IndicesPtr &  indices,
cv::Mat &  ground,
cv::Mat &  obstacles,
float  cellSize = 0.05f,
float  groundNormalAngle = M_PI_4,
int  minClusterSize = 20,
bool  segmentFlatObstacles = false,
float  maxGroundHeight = 0.0f 
)

Generates 2D ground and obstacle occupancy data from a 3D point cloud.

This function performs segmentation on a 3D point cloud to separate ground and obstacle points based on normal orientation and clustering, then projects both onto the XY plane to create 2D occupancy representations using voxelization.

The resulting occupancy data is returned as two OpenCV matrices (cv::Mat) of type CV_32FC2, where each entry contains a 2D point (x, y) in meters corresponding to a ground or obstacle voxel.

Template Parameters
PointTThe type of point used in the input point cloud (e.g., pcl::PointXYZ).
Parameters
cloudThe input 3D point cloud.
indicesOptional subset of points from the cloud to use for processing (can be full cloud indices).
groundOutput matrix containing 2D ground points projected and voxelized (CV_32FC2).
obstaclesOutput matrix containing 2D obstacle points projected and voxelized (CV_32FC2).
cellSizeThe voxel size (in meters) for projecting and grouping points in 2D.
groundNormalAngleMaximum allowable angle (in radians) between a point's normal and the vertical axis for it to be considered part of the ground.
minClusterSizeMinimum number of points required to form a valid obstacle cluster.
segmentFlatObstaclesWhether to separate flat horizontal surfaces (e.g., tables) from the ground and treat them as obstacles.
maxGroundHeightMaximum Z value (in meters) for a surface to be considered ground. If 0, height filtering is disabled.
Note
Internally, this function calls:

Definition at line 309 of file util3d_mapping.hpp.

◆ occupancy2DFromCloud3D() [2/2]

template<typename PointT >
void rtabmap::util3d::occupancy2DFromCloud3D ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
cv::Mat &  ground,
cv::Mat &  obstacles,
float  cellSize = 0.05f,
float  groundNormalAngle = M_PI_4,
int  minClusterSize = 20,
bool  segmentFlatObstacles = false,
float  maxGroundHeight = 0.0f 
)

Generates 2D ground and obstacle occupancy data from a 3D point cloud.

See also
occupancy2DFromCloud3D() with indices

Definition at line 348 of file util3d_mapping.hpp.

◆ normalizePolygonsSide()

template<typename pointT >
std::vector< pcl::Vertices > rtabmap::util3d::normalizePolygonsSide ( const typename pcl::PointCloud< pointT > &  cloud,
const std::vector< pcl::Vertices > &  polygons,
const pcl::PointXYZ &  viewPoint 
)

Definition at line 20 of file util3d_surface.hpp.

◆ denseMeshPostProcessing()

template<typename pointRGBT >
void rtabmap::util3d::denseMeshPostProcessing ( pcl::PolygonMeshPtr &  mesh,
float  meshDecimationFactor,
int  maximumPolygons,
const typename pcl::PointCloud< pointRGBT >::Ptr &  cloud,
float  transferColorRadius,
bool  coloredOutput,
bool  cleanMesh,
int  minClusterSize,
ProgressState progressState 
)

Definition at line 50 of file util3d_surface.hpp.

◆ intersectRayMesh()

template<typename PointT >
bool rtabmap::util3d::intersectRayMesh ( const Eigen::Vector3f &  origin,
const Eigen::Vector3f &  dir,
const typename pcl::PointCloud< PointT > &  cloud,
const std::vector< pcl::Vertices > &  polygons,
bool  ignoreBackFaces,
float &  distance,
Eigen::Vector3f &  normal,
int &  index 
)

Definition at line 315 of file util3d_surface.hpp.

◆ rgbFromCloud()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::rgbFromCloud ( const pcl::PointCloud< pcl::PointXYZRGBA > &  cloud,
bool  bgrOrder = true 
)

Converts a PCL point cloud with RGBA information to an OpenCV RGB or BGR image.

This function takes a structured point cloud (organized as height × width) and creates a corresponding OpenCV cv::Mat image containing the RGB (or BGR) color values from the cloud.

Parameters
cloudThe input organized point cloud of type pcl::PointCloud<pcl::PointXYZRGBA>. The cloud must be organized (i.e., cloud.width and cloud.height must be greater than 0).
bgrOrderIf true, the output image will be in BGR format (OpenCV default); if false, it will be RGB.
Returns
A cv::Mat of type CV_8UC3 with the same width and height as the input point cloud, containing RGB or BGR color values depending on the bgrOrder flag.
Note
This function assumes that the point cloud is organized. If the cloud is unorganized, the behavior is undefined.
See also
pcl::PointCloud, cv::Mat

◆ depthFromCloud()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::depthFromCloud ( const pcl::PointCloud< pcl::PointXYZRGBA > &  cloud,
bool  depth16U = true 
)

Generates a depth image from a PCL organized point cloud.

This function converts a given organized point cloud of type pcl::PointXYZRGBA into a depth image (cv::Mat) in either 32-bit float or 16-bit unsigned format. The depth image contains the Z coordinate (depth) values of each point.

Parameters
[in]cloudThe input organized point cloud (height x width), where each point contains XYZ and RGBA.
[in]depth16UIf true, output depth will be in 16-bit unsigned integer (millimeters); otherwise, 32-bit float (meters).
Returns
A depth image (cv::Mat) of the same resolution as the input cloud, with type CV_16UC1 or CV_32FC1.
Note
The function assumes that the point cloud is organized (structured as an image).

◆ rgbdFromCloud()

void RTABMAP_CORE_EXPORT rtabmap::util3d::rgbdFromCloud ( const pcl::PointCloud< pcl::PointXYZRGBA > &  cloud,
cv::Mat &  rgb,
cv::Mat &  depth,
bool  bgrOrder = true,
bool  depth16U = true 
)

Converts a PCL point cloud (with RGBA colors) into aligned RGB and depth OpenCV images.

This function extracts RGB and depth information from a structured PCL point cloud (organized point cloud with width and height) and fills the corresponding OpenCV matrices.

Parameters
[in]cloudThe input organized point cloud containing RGBA data (structured as height x width).
[out]frameBGRThe output color image (CV_8UC3). The channels are ordered as BGR if bgrOrder is true, otherwise RGB.
[out]frameDepthThe output depth image (either CV_32FC1 for meters or CV_16UC1 for millimeters depending on depth16U).
[in]bgrOrderIf true, store colors in BGR order. If false, store as RGB.
[in]depth16UIf true, store depth as 16-bit unsigned integers (in millimeters), otherwise use 32-bit floats (in meters).
Note
The function assumes that the point cloud is organized. If the point cloud is not organized, the output matrices will not be valid.

◆ projectDepthTo3D()

pcl::PointXYZ RTABMAP_CORE_EXPORT rtabmap::util3d::projectDepthTo3D ( const cv::Mat &  depthImage,
float  x,
float  y,
float  cx,
float  cy,
float  fx,
float  fy,
bool  smoothing,
float  depthErrorRatio = 0.02f 
)

Projects a single depth pixel into 3D space.

This function computes the 3D coordinates of a point given a depth image and camera intrinsic parameters. It optionally applies smoothing and depth error compensation to improve the accuracy of the result.

Parameters
depthImageThe depth image (CV_16UC1 in millimeters or CV_32FC1 in meters).
xThe x coordinate (column index) of the pixel to project.
yThe y coordinate (row index) of the pixel to project.
cxThe principal point x-coordinate. If set to 0, it will default to image center.
cyThe principal point y-coordinate. If set to 0, it will default to image center.
fxThe focal length in x direction (in pixels).
fyThe focal length in y direction (in pixels).
smoothingWhether to apply smoothing on the depth value at (x, y).
depthErrorRatioRatio used to reject outlier depths when smoothing is enabled.
Returns
A pcl::PointXYZ containing the 3D coordinates of the pixel in the depth image. If the depth value is invalid or <= 0, all coordinates are set to NaN.

◆ projectDepthTo3DRay()

Eigen::Vector3f RTABMAP_CORE_EXPORT rtabmap::util3d::projectDepthTo3DRay ( const cv::Size &  imageSize,
float  x,
float  y,
float  cx,
float  cy,
float  fx,
float  fy 
)

Projects pixel coordinates to a normalized 3D ray in camera coordinates.

This function computes the direction of a 3D ray from the camera origin through a pixel in the image plane, assuming a pinhole camera model. The returned ray is not scaled by depth; it has a fixed z component of 1.0.

Parameters
imageSizeThe size of the image (width, height).
xThe x-coordinate of the pixel in the image.
yThe y-coordinate of the pixel in the image.
cxThe x-coordinate of the principal point. If zero or negative, defaults to (image width / 2) - 0.5.
cyThe y-coordinate of the principal point. If zero or negative, defaults to (image height / 2) - 0.5.
fxThe focal length in the x direction (pixels).
fyThe focal length in the y direction (pixels).
Returns
A normalized Eigen::Vector3f representing the direction of the ray in camera coordinates.

◆ cloudFromDepth() [1/2]

RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromDepth ( const cv::Mat &  imageDepth,
float  cx,
float  cy,
float  fx,
float  fy,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0 
)

Converts a depth image to a 3D point cloud.

This function uses the camera model's intrinsic parameters to convert each pixel in the depth image to a 3D point in the camera's coordinate system. It handles the decimation of the image and ensures the resulting point cloud does not exceed the specified maximum and minimum depth values.

Parameters
[in]imageDepthThe input depth image, which should be of type CV_16UC1 or CV_32FC1.
[in]cxThe optical center of the camera in the x-axis (usually the center of the image).
[in]cyThe optical center of the camera in the y-axis (usually the center of the image).
[in]fxThe focal length of the camera in the x-axis.
[in]fyThe focal length of the camera in the y-axis.
[in]decimationDecimation factor, used to reduce the image resolution (use 0 for no decimation).
[in]maxDepthThe maximum depth value to consider when creating the point cloud.
[in]minDepthThe minimum depth value to consider when creating the point cloud.
[out]validIndicesA pointer to a vector where the indices of valid points will be stored. If null, this is ignored.
Returns
A pcl::PointCloud<pcl::PointXYZ>::Ptr containing the 3D points corresponding to the depth image.
Deprecated:
This function is deprecated and will be removed in future versions. Use the cloudFromDepth function that accepts a rtabmap::CameraModel instead.

◆ cloudFromDepth() [2/2]

pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromDepth ( const cv::Mat &  imageDepth,
const CameraModel model,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0 
)

Converts a depth image to a 3D point cloud using a camera model.

This function performs the conversion of a depth image to a point cloud using the provided CameraModel object. It handles decimation, validates the depth values, and calculates the corresponding 3D coordinates in the camera's optical coordinate system.

Parameters
[in]imageDepthInThe input depth image, which should be of type CV_16UC1 or CV_32FC1.
[in]modelThe camera model containing the intrinsic parameters (fx, fy, cx, cy).
[in]decimationThe decimation factor for image resolution reduction (use 0 for no decimation).
[in]maxDepthThe maximum depth value to consider when creating the point cloud.
[in]minDepthThe minimum depth value to consider when creating the point cloud.
[out]validIndicesA pointer to a vector to store indices of valid points in the point cloud. If null, it is ignored.
Returns
A pcl::PointCloud<pcl::PointXYZ>::Ptr containing the 3D points corresponding to the depth image.

◆ cloudFromDepthRGB() [1/2]

RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromDepthRGB ( const cv::Mat &  imageRgb,
const cv::Mat &  imageDepth,
float  cx,
float  cy,
float  fx,
float  fy,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0 
)

Creates a point cloud from an RGB image and a depth image.

This function uses the RGB and depth images, along with camera intrinsic parameters, to generate a point cloud where each point contains RGB color and 3D spatial information. It also handles decimation and depth constraints (min/max depth) for efficient processing and memory management.

Parameters
imageRgbThe RGB image (e.g., in BGR format for OpenCV).
imageDepthThe depth image (CV_16UC1 or CV_32FC1 format).
cxThe x-coordinate of the camera's principal point (optical center).
cyThe y-coordinate of the camera's principal point.
fxThe focal length in x-direction (in pixels).
fyThe focal length in y-direction (in pixels).
decimationThe decimation factor for the image (negative value for decimation from RGB size).
maxDepthThe maximum depth value to consider for valid points (set 0 to ignore).
minDepthThe minimum depth value to consider for valid points.
validIndicesA pointer to a vector that will store valid point indices (optional).
Returns
A shared pointer to a point cloud (pcl::PointCloud<pcl::PointXYZRGB>) containing RGB and 3D point data.
Deprecated:
This function is deprecated and will be removed in future versions. Use the version that accepts a rtabmap::CameraModel instead.

◆ cloudFromDepthRGB() [2/2]

pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromDepthRGB ( const cv::Mat &  imageRgb,
const cv::Mat &  imageDepth,
const CameraModel model,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0 
)

Creates a point cloud from an RGB image and a depth image using a CameraModel.

This function generates a point cloud where each point contains RGB color and 3D spatial information derived from the provided RGB and depth images, using intrinsic parameters provided in the CameraModel. It also applies decimation for efficiency, and depth constraints (min/max depth) to limit the points to a valid range.

Parameters
imageRgbThe RGB image (e.g., in BGR format for OpenCV).
imageDepthInThe depth image (CV_16UC1 or CV_32FC1 format).
modelA CameraModel object that contains intrinsic camera parameters (fx, fy, cx, cy).
decimationThe decimation factor for the image (negative value for decimation from RGB size).
maxDepthThe maximum depth value to consider for valid points (set 0 to ignore).
minDepthThe minimum depth value to consider for valid points.
validIndicesA pointer to a vector that will store valid point indices (optional).
Returns
A shared pointer to a point cloud (pcl::PointCloud<pcl::PointXYZRGB>) containing RGB and 3D point data.
Note
This version uses a CameraModel to encapsulate the camera parameters.

◆ cloudFromDisparity()

pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromDisparity ( const cv::Mat &  imageDisparity,
const StereoCameraModel model,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0 
)

Converts a disparity image to a 3D point cloud.

This function takes a disparity image and projects each disparity value to a 3D point in space using the provided stereo camera model. The points are stored in a pcl::PointCloud object. The function also supports decimating the image for faster processing.

Parameters
imageDisparityThe input disparity image, which must be of type CV_32FC1 (floating-point) or CV_16SC1 (16-bit signed short).
modelThe stereo camera model used to project disparity to 3D.
decimationThe decimation factor for downsampling the image. It must be greater than or equal to 1.
maxDepthThe maximum depth for valid points in meters. Points with a depth greater than this value will be discarded. A non-positive value means no maximum depth constraint.
minDepthThe minimum depth for valid points in meters. Points with a depth less than this value will be discarded.
validIndicesAn optional vector that will be filled with the indices of valid points in the cloud (those within the depth constraints). If nullptr, the indices are not stored.
Returns
A shared pointer to a pcl::PointCloud<pcl::PointXYZ> containing the 3D points derived from the disparity image.
Note
If the disparity image dimensions are not divisible by the decimation factor, the decimation factor will be adjusted to the highest compatible value.

◆ cloudFromDisparityRGB()

pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromDisparityRGB ( const cv::Mat &  imageRgb,
const cv::Mat &  imageDisparity,
const StereoCameraModel model,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0 
)

Converts a disparity image and an RGB image to a 3D point cloud with color.

This function takes both a disparity image and an RGB image to create a colored 3D point cloud. Each RGB pixel is associated with a 3D point generated from the disparity value. The function also supports decimating the images for faster processing.

Parameters
imageRgbThe input RGB image, which must have 3 channels (color->BGR) or 1 channel (grayscale). The image is used to assign colors to the 3D points.
imageDisparityThe input disparity image, which must be of type CV_32FC1 (floating-point) or CV_16SC1 (16-bit signed short).
modelThe stereo camera model used to project disparity to 3D.
decimationThe decimation factor for downsampling the images. It must be greater than or equal to 1.
maxDepthThe maximum depth for valid points in meters. Points with a depth greater than this value will be discarded. A non-positive value means no maximum depth constraint.
minDepthThe minimum depth for valid points in meters. Points with a depth less than this value will be discarded.
validIndicesAn optional vector that will be filled with the indices of valid points in the cloud (those within the depth constraints). If nullptr, the indices are not stored.
Returns
A shared pointer to a pcl::PointCloud<pcl::PointXYZRGB> containing the 3D points with associated RGB color values.
Note
If the disparity image dimensions are not divisible by the decimation factor, the decimation factor will be adjusted to the highest compatible value.
Warning
The RGB image must have the same size as the disparity image.

◆ cloudFromStereoImages()

pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromStereoImages ( const cv::Mat &  imageLeft,
const cv::Mat &  imageRight,
const StereoCameraModel model,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0,
const ParametersMap parameters = ParametersMap() 
)

Converts a pair of stereo images (left and right) into a 3D point cloud with RGB color information.

This function takes a pair of stereo images, computes the disparity map between the left and right images, and then converts the disparity map into a 3D point cloud where each point contains the 3D coordinates (x, y, z) and RGB color values from the corresponding pixel in the left image.

The function supports both color and monochrome images and performs stereo rectification and disparity calculation internally. The resulting 3D point cloud is returned in the PCL format with RGB color for each point, using the pcl::PointXYZRGB type. Points outside the specified depth range are discarded.

Parameters
[in]imageLeftThe left stereo image (either grayscale or color). If color, the image is converted to grayscale internally for disparity calculation.
[in]imageRightThe right stereo image (either grayscale or color). If color, the image is converted to grayscale internally for disparity calculation.
[in]modelThe stereo camera model that contains the parameters for projecting disparity values into 3D.
[in]decimationThe decimation factor used to downsample the image and reduce computation time. It must be greater than or equal to 1.
[in]maxDepthThe maximum allowable depth (z value). Points with a depth greater than this value will be discarded.
[in]minDepthThe minimum allowable depth (z value). Points with a depth smaller than this value will be discarded.
[out]validIndicesA pointer to a vector that will be filled with the indices of the valid points in the resulting point cloud. Can be set to nullptr if this information is not needed.
[in]parametersA map of additional parameters for disparity computation, used by the stereo disparity function.
Returns
A pointer to a pcl::PointCloud<pcl::PointXYZRGB> containing the 3D points with RGB colors. The cloud is dense only in regions with valid disparity values and within the specified depth range.
Note
The function assumes that the input images are rectified and aligned to the same coordinate system. The disparity map is computed from the left and right mono images using the disparityFromStereoImages utility function, which is provided by the util2d namespace.
Warning
The input images must have the same size, and the disparity computation assumes that the stereo pair is well-calibrated.

◆ cloudsFromSensorData()

std::vector< pcl::PointCloud< pcl::PointXYZ >::Ptr > RTABMAP_CORE_EXPORT rtabmap::util3d::cloudsFromSensorData ( const SensorData sensorData,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< pcl::IndicesPtr > *  validIndices = 0,
const ParametersMap stereoParameters = ParametersMap(),
const std::vector< float > &  roiRatios = std::vector< float >(),
unsigned char  confidenceThr = 0 
)

Generates a set of point clouds from sensor data.

This function processes depth and image data from the provided SensorData object to generate point clouds. It supports both depth camera data (using a camera model) and stereo camera data (using disparity computation). It handles various preprocessing operations like decimation, applying regions of interest (ROIs), and transforming point clouds.

The function creates a point cloud for each camera model (or stereo camera model) in the SensorData and returns them in a vector of point cloud pointers.

Parameters
sensorDataA reference to the SensorData object that contains raw depth or image data, along with camera models.
decimationThe decimation factor to downsample the data. A value of 0 means no decimation. The decimation factor should be a factor of the image width and height.
maxDepthThe maximum depth value to be considered in the generated point clouds.
minDepthThe minimum depth value to be considered in the generated point clouds.
validIndicesAn optional vector to store valid point indices for each point cloud. If provided, the function will populate it with indices of valid points in each corresponding cloud.
stereoParametersA map of parameters for stereo image processing, used to compute disparity.
roiRatiosA vector containing four float values representing the region of interest (ROI) in normalized coordinates (left, right, top, bottom). If not specified or set to [0 0 0 0], the entire image is used.
Returns
A vector of pcl::PointCloud<pcl::PointXYZ>::Ptr representing the generated point clouds in base coordinate frame.
Note
  • The sensorData object must contain either depth data (for depth cameras) or image data with a right image (for stereo cameras).
  • The ROI ratios must be in the range [0.0f, 1.0f] and will be applied to both depth and image data if provided.
  • If the ROI cannot be divided evenly by the decimation factor, the function will ignore the ROI and log an error.
  • If the stereo data is provided, disparity will be computed from the left and right images, and the resulting disparity image will be used to generate 3D point clouds.

◆ cloudFromSensorData()

pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudFromSensorData ( const SensorData sensorData,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0,
const ParametersMap stereoParameters = ParametersMap(),
const std::vector< float > &  roiRatios = std::vector< float >(),
unsigned char  confidenceThr = 0 
)

Generates a point cloud from sensor data.

This function processes the provided sensor data, generates point clouds for each sensor, and combines them into a single point cloud. It handles both single-camera and stereo data by calling the cloudsFromSensorData function. The resulting point cloud can be decimated according to the specified parameter and filtered based on depth constraints.

Parameters
sensorDataThe sensor data containing depth and image information. This data is used to generate the point clouds.
decimationThe factor by which the generated point cloud should be decimated. A value of 1 means no decimation. The decimation factor should be a factor of the image width and height.
maxDepthThe maximum depth allowed for valid points in the generated cloud.
minDepthThe minimum depth allowed for valid points in the generated cloud.
validIndicesOptional vector to store the indices of valid points in the generated point cloud.
stereoParametersThe stereo parameters that may be used when dealing with stereo camera data.
roiRatiosA vector containing four float values representing the region of interest (ROI) ratios (left, right, top, bottom) to crop the sensor images before processing. The values should be between 0 and 1. If not specified or set to [0 0 0 0], the entire image is used.
Returns
A pointer to a pcl::PointCloud<pcl::PointXYZ> containing the combined point cloud generated from the sensor data. The point cloud is transformed in base coordinate frame.
Note
The function will automatically handle the removal of NaN points from the cloud. If the validIndices pointer is provided, it will be filled with the indices of valid points.

◆ cloudsRGBFromSensorData()

std::vector< pcl::PointCloud< pcl::PointXYZRGB >::Ptr > RTABMAP_CORE_EXPORT rtabmap::util3d::cloudsRGBFromSensorData ( const SensorData sensorData,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< pcl::IndicesPtr > *  validIndices = 0,
const ParametersMap stereoParameters = ParametersMap(),
const std::vector< float > &  roiRatios = std::vector< float >(),
unsigned char  confidenceThr = 0 
)

Generates a point cloud with RGB color data from sensor data.

This function creates RGB point clouds from depth and color images obtained from a sensor. It supports both single camera models and stereo camera models. The RGB and depth images are processed and converted into a 3D point cloud using the provided camera models. Optionally, Region-of-Interest (ROI) ratios can be applied to the images to focus on specific areas.

Parameters
[in]sensorDataThe sensor data that contains the raw image and depth information.
[in]decimationThe decimation factor to reduce the resolution of the point cloud.
[in]maxDepthThe maximum depth to consider while generating the point cloud.
[in]minDepthThe minimum depth to consider while generating the point cloud.
[out]validIndicesA pointer to a vector of indices that indicate the valid points in the cloud. If nullptr, no indices will be returned.
[in]stereoParametersA map of parameters used for stereo vision processing (if stereo camera models are used).
[in]roiRatiosA vector of 4 floats that represent the region of interest (ROI) ratios (left, right, top, bottom) for cropping the image. Each value should be between 0.0 and 1.0, representing the normalized position of the ROI. A value of 0.0 means no cropping, and a value of 1.0 means full cropping.
Returns
A vector of point clouds containing the RGB point cloud data for each camera model. Each point cloud is represented by pcl::PointCloud<pcl::PointXYZRGB>::Ptr. The point clouds are transformed in base coordinate frame.
Note
If the sensor data does not contain both image and depth data, or if no camera models are available, an empty vector will be returned.
If stereo camera models are used, the left and right images are processed for disparity computation.
Warning
The function performs several assertions and checks, such as ensuring that the image and depth images are divisible by the number of camera models, and that the ROI ratios are compatible with the decimation factor.

◆ cloudRGBFromSensorData()

pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::cloudRGBFromSensorData ( const SensorData sensorData,
int  decimation = 1,
float  maxDepth = 0.0f,
float  minDepth = 0.0f,
std::vector< int > *  validIndices = 0,
const ParametersMap stereoParameters = ParametersMap(),
const std::vector< float > &  roiRatios = std::vector< float >(),
unsigned char  confidenceThr = 0 
)

Generates a point cloud of type pcl::PointXYZRGB from sensor data.

This function processes sensor data (such as RGB images and depth images) to generate a point cloud of type pcl::PointXYZRGB. It can handle stereo or multiple camera models, apply decimation, and filter points based on the maximum and minimum depth values. Optionally, it can also apply region-of-interest (ROI) ratios.

Parameters
[in]sensorDataThe sensor data containing raw RGB and depth images, as well as camera models.
[in]decimationThe decimation factor to reduce the point cloud size. Default is 1.
[in]maxDepthThe maximum depth value (points beyond this distance will be ignored).
[in]minDepthThe minimum depth value (points closer than this distance will be ignored).
[out]validIndicesA vector to store the indices of the valid points in the generated point cloud. It will be resized to the point cloud's size.
[in]stereoParametersA map of stereo camera parameters, used when dealing with stereo images.
[in]roiRatiosA vector of four float values representing the region-of-interest (ROI) ratios for cropping the depth and RGB images (left right top bottom). If not specified or set to [0 0 0 0], the entire image is used.
Returns
A pointer to a pcl::PointCloud<pcl::PointXYZRGB> containing the generated point cloud. If multiple clouds are generated, they are merged into a single cloud. The validIndices vector is populated if it is provided. The point cloud(s) is/are transformed in base coordinate frame.
Note
If the sensor data is stereo, the function will use stereo processing to generate the point cloud. If multiple camera models are provided, it generates and merges the point clouds from each camera.
The validIndices vector will be resized and populated if it is passed as an argument.

◆ laserScanFromDepthImage()

pcl::PointCloud< pcl::PointXYZ > RTABMAP_CORE_EXPORT rtabmap::util3d::laserScanFromDepthImage ( const cv::Mat &  depthImage,
float  fx,
float  fy,
float  cx,
float  cy,
float  maxDepth = 0,
float  minDepth = 0,
const Transform localTransform = Transform::getIdentity() 
)

Converts the middle row of a depth image into a laser scan (point cloud) using camera intrinsics and a local transformation.

This function projects each pixel from a depth image into 3D space using the camera intrinsics (focal lengths and principal point) and applies a transformation to each point in 3D space. It filters out points that are outside the specified depth range (maxDepth, minDepth) and excludes any invalid points.

Parameters
depthImageThe input depth image (single channel, 16-bit unsigned or 32-bit floating point).
fxThe focal length in the x-axis (in pixels).
fyThe focal length in the y-axis (in pixels).
cxThe optical center in the x-axis (in pixels).
cyThe optical center in the y-axis (in pixels).
maxDepthThe maximum depth value (in meters). Points with depth larger than this will be discarded. If 0, no maximum depth filtering is applied.
minDepthThe minimum depth value (in meters). Points with depth smaller than this will be discarded.
localTransformA transformation that will be applied to all points in the resulting point cloud. This can be an identity transformation if not needed.
Returns
pcl::PointCloud<pcl::PointXYZ> The resulting point cloud where each point represents a 3D coordinate projected from the depth image.
Note
Assumes the input depth image is either CV_16UC1 (16-bit unsigned integers) or CV_32FC1 (32-bit floating-point).
Assumes the camera is pointing parallel to ground (e.g., forward looking camera).

◆ laserScanFromDepthImages()

pcl::PointCloud< pcl::PointXYZ > RTABMAP_CORE_EXPORT rtabmap::util3d::laserScanFromDepthImages ( const cv::Mat &  depthImages,
const std::vector< CameraModel > &  cameraModels,
float  maxDepth,
float  minDepth 
)

Converts multiple depth images (e.g., from a stereo or multi-camera setup) into a single laser scan (point cloud).

This function processes multiple depth images, one for each camera in a stereo or multi-camera setup. It uses the camera models to project the depth values of the middle row to 3D space and combines them into a single point cloud. Each camera's depth image is projected using the associated camera intrinsics, and the points are transformed according to the camera's local transformation.

Parameters
depthImagesThe input depth images concatenated horizontally. Each camera's depth image is assumed to be of equal width and placed side by side.
cameraModelsA vector of camera models, one for each depth image in the input. Each model contains the intrinsics and the local transformation for a specific camera.
maxDepthThe maximum depth value (in meters). Points with depth larger than this will be discarded. If 0, no maximum depth filtering is applied.
minDepthThe minimum depth value (in meters). Points with depth smaller than this will be discarded.
Returns
pcl::PointCloud<pcl::PointXYZ> The resulting point cloud where each point represents a 3D coordinate projected from the depth images.
Note
This function assumes that the number of camera models corresponds to the number of sub-images in the input depth images.
Each depth image is projected using the corresponding camera model in the cameraModels array.
Assumes the cameras are pointing parallel to ground (e.g., forward and backward looking cameras).

◆ getMinMax3D() [1/2]

void RTABMAP_CORE_EXPORT rtabmap::util3d::getMinMax3D ( const cv::Mat &  laserScan,
cv::Point3f &  min,
cv::Point3f &  max 
)

Computes the minimum and maximum 3D points from a laser scan matrix.

This function computes the minimum and maximum values along each of the X, Y, and Z axes in the laser scan matrix. The laser scan is assumed to be a matrix of type CV_32FC2, CV_32FC3, CV_32FC4, CV_32FC5, CV_32FC6, or CV_32FC7, where each row represents a point in space. The matrix is expected to have 3 or more channels for 3D data, but it can have additional channels (e.g., intensity, color, etc.).

The Z-coordinate is only considered if the matrix has at least 3 channels (3D scan). If the scan has fewer than 3 channels, the Z-coordinate is set to 0.

Parameters
laserScanThe input laser scan data, which must be a matrix of type CV_32FC2, CV_32FC3, CV_32FC4, CV_32FC5, CV_32FC6, or CV_32FC7 (with at least 2 channels, and at least 3 channels for 3D).
minA reference to a cv::Point3f object where the minimum 3D point (X, Y, Z) will be stored.
maxA reference to a cv::Point3f object where the maximum 3D point (X, Y, Z) will be stored.
Exceptions
exceptionif the input matrix is empty or has an invalid type.

◆ getMinMax3D() [2/2]

void RTABMAP_CORE_EXPORT rtabmap::util3d::getMinMax3D ( const cv::Mat &  laserScan,
pcl::PointXYZ &  min,
pcl::PointXYZ &  max 
)

Computes the minimum and maximum 3D points from a laser scan matrix and stores the results in pcl::PointXYZ.

This function calls the getMinMax3D function that operates on cv::Point3f and converts the results to pcl::PointXYZ format. It is useful when working with PCL data structures for 3D processing.

Parameters
laserScanThe input laser scan data, which must be a matrix of type CV_32FC2, CV_32FC3, CV_32FC4, CV_32FC5, CV_32FC6, or CV_32FC7 (with at least 2 channels, and at least 3 channels for 3D).
minA reference to a pcl::PointXYZ object where the minimum 3D point (X, Y, Z) will be stored.
maxA reference to a pcl::PointXYZ object where the maximum 3D point (X, Y, Z) will be stored.
Exceptions
exceptionif the input matrix is empty or has an invalid type.

◆ projectDisparityTo3D() [1/2]

cv::Point3f RTABMAP_CORE_EXPORT rtabmap::util3d::projectDisparityTo3D ( const cv::Point2f &  pt,
float  disparity,
const StereoCameraModel model 
)

Projects a 2D point from the left image and its disparity into 3D space.

This function converts a 2D point from the left image and its corresponding disparity value into a 3D point in space using the provided stereo camera model.

The conversion follows the formula:

\[ Z = \frac{baseline \times f}{disparity + (cx1 - cx0)} \]

Where:

  • baseline is the distance between the left and right camera centers
  • f is the focal length of the camera
  • cx1 and cx0 are the x-coordinates of the principal points of the right and left cameras, respectively.
Parameters
ptThe 2D point in the left image (in pixels).
disparityThe disparity value for the corresponding point (in pixels).
modelThe stereo camera model containing the intrinsic parameters.
Returns
A 3D point (x, y, z) in space corresponding to the input 2D point and disparity. If the disparity is invalid or any required camera parameters are not set, it returns a point containing NaN values.
Note
This function assumes that the disparity value is positive, and that the baseline and focal lengths are also positive.

◆ projectDisparityTo3D() [2/2]

cv::Point3f RTABMAP_CORE_EXPORT rtabmap::util3d::projectDisparityTo3D ( const cv::Point2f &  pt,
const cv::Mat &  disparity,
const StereoCameraModel model 
)

Projects a 2D point from the left image and the disparity map into 3D space.

This function converts a 2D point from the left image and the disparity value from a disparity map into a 3D point in space using the provided stereo camera model.

The function first retrieves the disparity value for the given 2D point from the disparity map. It then calls the other projectDisparityTo3D function to perform the conversion to 3D.

Parameters
ptThe 2D point in the left image (in pixels).
disparityThe disparity map (CV_32FC1 or CV_16SC1) from which the disparity value for the point is retrieved.
modelThe stereo camera model containing the intrinsic parameters.
Returns
A 3D point (x, y, z) in space corresponding to the input 2D point and the disparity value. If the point is outside the disparity map bounds or if the disparity value is invalid, it returns a point containing NaN values.
Note
This function checks that the input disparity matrix is not empty and has an appropriate type (either CV_32FC1 or CV_16SC1).

◆ projectCloudToCamera() [1/3]

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::projectCloudToCamera ( const cv::Size &  imageSize,
const cv::Mat &  cameraMatrixK,
const cv::Mat &  laserScan,
const rtabmap::Transform cameraTransform 
)

Register a point cloud (laser scan) to the camera's frame of reference and return a registered depth image.

This function projects a laser scan (in /base_link coordinate system) into the camera frame of reference using the camera's intrinsic parameters and the camera's transform. The result is stored in a depth image (cv::Mat), where each pixel corresponds to the distance of the projected point in the camera frame.

Parameters
[in]imageSizeThe desired size of the output depth image (in pixels).
[in]cameraMatrixKThe camera matrix (intrinsics), containing the focal lengths and principal points.
[in]laserScanA matrix of laser scan points. The type can be CV_32FC2 (2D), CV_32FC3, CV_32FC4, etc., where the points are assumed to be in the /base_link coordinate system.
[in]cameraTransformThe transform from /base_link to /camera_link, used to adjust the point cloud to the camera's reference frame.
Returns
A cv::Mat object representing the registered depth image, with each pixel corresponding to the projected point's depth (z value) in the camera frame.
Exceptions
exceptionif the input cameraTransform is null, the laser scan is empty, or the cameraMatrixK has incorrect dimensions.

◆ projectCloudToCamera() [2/3]

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::projectCloudToCamera ( const cv::Size &  imageSize,
const cv::Mat &  cameraMatrixK,
const pcl::PointCloud< pcl::PointXYZ >::Ptr  laserScan,
const rtabmap::Transform cameraTransform 
)

Register a point cloud (laser scan) to the camera's frame of reference and return a registered depth image.

This function projects a laser scan (pcl::PointCloud) into the camera frame of reference using the camera's intrinsic parameters and the camera's transform. The result is stored in a depth image (cv::Mat), where each pixel corresponds to the distance of the projected point in the camera frame.

Parameters
[in]imageSizeThe desired size of the output depth image (in pixels).
[in]cameraMatrixKThe camera matrix (intrinsics), containing the focal lengths and principal points.
[in]laserScanA pointer to a pcl::PointCloud<pcl::PointXYZ> object containing the laser scan points. The points are assumed to be in the /base_link coordinate system.
[in]cameraTransformThe transform from /base_link to /camera_link, used to adjust the point cloud to the camera's reference frame.
Returns
A cv::Mat object representing the registered depth image, with each pixel corresponding to the projected point's depth (z value) in the camera frame.
Exceptions
exceptionif the input cameraTransform is null, the laser scan is empty, or the cameraMatrixK has incorrect dimensions.

◆ projectCloudToCamera() [3/3]

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::projectCloudToCamera ( const cv::Size &  imageSize,
const cv::Mat &  cameraMatrixK,
const pcl::PCLPointCloud2::Ptr  laserScan,
const rtabmap::Transform cameraTransform 
)

Register a point cloud (laser scan) to the camera's frame of reference and return a registered depth image.

This function projects a laser scan (pcl::PCLPointCloud2) into the camera frame of reference using the camera's intrinsic parameters and the camera's transform. The result is stored in a depth image (cv::Mat), where each pixel corresponds to the distance of the projected point in the camera frame.

Parameters
[in]imageSizeThe desired size of the output depth image (in pixels).
[in]cameraMatrixKThe camera matrix (intrinsics), containing the focal lengths and principal points.
[in]laserScanA pointer to a pcl::PCLPointCloud2 object containing the laser scan points. The points are assumed to be in the /base_link coordinate system.
[in]cameraTransformThe transform from /base_link to /camera_link, used to adjust the point cloud to the camera's reference frame.
Returns
A cv::Mat object representing the registered depth image, with each pixel corresponding to the projected point's depth (z value) in the camera frame.
Exceptions
exceptionif the input cameraTransform is null, the laser scan is empty, or the cameraMatrixK has incorrect dimensions.

◆ fillProjectedCloudHoles()

void RTABMAP_CORE_EXPORT rtabmap::util3d::fillProjectedCloudHoles ( cv::Mat &  depthRegistered,
bool  verticalDirection,
bool  fillToBorder 
)

Fills holes (missing depth values) in a depth image by interpolating between non-zero values.

This function iterates through a depth image and fills holes by interpolating between the surrounding non-zero depth values. It works either vertically or horizontally, depending on the verticalDirection parameter. The interpolation method fills the missing values based on the linear slope between two valid depth values. Optionally, the interpolation can be extended to the border of the image if fillToBorder is set to true.

Parameters
registeredDepthA matrix representing the registered depth image, where missing depth values are assumed to be zero. The matrix must be of type CV_32FC1.
verticalDirectionIf true, the holes are filled vertically (by column), otherwise the holes are filled horizontally (by row).
fillToBorderIf true, the interpolation will fill the depth holes all the way to the border of the image (i.e., it will propagate the nearest valid depth to the edges of the image).
Note
The input registeredDepth matrix must be of type CV_32FC1, where depth values are stored as single-precision floating-point numbers.
With fillToBorder enabled, the current implementation only fills up to last pixel, i.e., first/last rows or columns are not filled.
Warning
This function modifies the input registeredDepth matrix in place.

◆ filterFloor()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::filterFloor ( const cv::Mat &  depth,
const std::vector< CameraModel > &  cameraModels,
float  threshold,
cv::Mat *  depthBelow = 0 
)

Filters out points below a certain threshold in a depth image based on camera models.

This function processes a depth image and filters out points below a specified threshold, which are assumed to belong to the floor. It does this by projecting the depth pixels into 3D space (base frame) using the camera models, and if the z-coordinate of the projected point is less than the threshold, the corresponding depth value is set to 0.

Parameters
depthThe input depth image to be filtered. The matrix should contain depth values in either CV_16UC1 (unsigned short) or CV_32FC1 (float) format.
cameraModelsA vector of camera models used for reprojection. The camera models are used to convert the 2D image coordinates to 3D space.
thresholdThe z-threshold in meters, below which points are considered part of the floor and will be filtered out.
depthBelowA pointer to an optional output depth image where the filtered-out points (below the threshold) will be saved. If this is nullptr, no output is generated for filtered-out points.
Returns
A new depth image where points below the specified threshold are set to zero.
Note
  • The function assumes that the depth image has valid depth values.
  • If the input depthBelow is provided, it will contain the depth values for the points that were considered as floor points.
  • The function assumes that all camera models have the same resolution and are valid for reprojection.
Exceptions
std::invalid_argumentif the camera models are empty or invalid.

◆ projectCloudToCameras() [1/2]

std::vector< std::pair< std::pair< int, int >, pcl::PointXY > > RTABMAP_CORE_EXPORT rtabmap::util3d::projectCloudToCameras ( const pcl::PointCloud< pcl::PointXYZRGBNormal > &  cloud,
const std::map< int, Transform > &  cameraPoses,
const std::map< int, std::vector< CameraModel > > &  cameraModels,
float  maxDistance = 0.0f,
float  maxAngle = 0.0f,
float  maxDepthError = 0.0f,
const std::vector< float > &  roiRatios = std::vector< float >(),
const cv::Mat &  projMask = cv::Mat(),
bool  distanceToCamPolicy = false,
const ProgressState state = 0 
)

Projects a 3D point cloud to the best camera (NodeID -> CameraIndex) for each point based on a policy.

This function takes a point cloud of type pcl::PointXYZRGBNormal and projects each point to the best camera that sees the point. The "best" camera is selected based on the distance, angle, and other parameters like Region of Interest (ROI) ratios and projection mask.

Parameters
cloudThe input point cloud of type pcl::PointXYZRGBNormal containing 3D points.
cameraPosesA map of camera IDs to their respective poses (transformations).
cameraModelsA map of camera IDs to their camera models (internal camera parameters).
maxDistanceMaximum allowable distance from the camera for a point to be considered.
maxAngleMaximum allowable angle between the camera and the point normal for it to be considered.
roiRatiosA vector of four floats defining the region of interest ratios for the camera image. See util2d::computeRoi() for format.
projMaskA binary mask for projection, which will be checked to ensure the point lies within the mask.
distanceToCamPolicyIf true, the distance to the camera is considered in the decision of the best camera, otherwise distance to center of the camera is used.
stateA ProgressState object to provide feedback on progress or cancellation.
Returns
A vector of pairs, where each pair contains a pair of camera ID and camera index, and a 2D UV coordinate. The UV coordinate represents the projection of each point onto the best camera.

◆ projectCloudToCameras() [2/2]

std::vector< std::pair< std::pair< int, int >, pcl::PointXY > > RTABMAP_CORE_EXPORT rtabmap::util3d::projectCloudToCameras ( const pcl::PointCloud< pcl::PointXYZINormal > &  cloud,
const std::map< int, Transform > &  cameraPoses,
const std::map< int, std::vector< CameraModel > > &  cameraModels,
float  maxDistance = 0.0f,
float  maxAngle = 0.0f,
float  maxDepthError = 0.0f,
const std::vector< float > &  roiRatios = std::vector< float >(),
const cv::Mat &  projMask = cv::Mat(),
bool  distanceToCamPolicy = false,
const ProgressState state = 0 
)

Projects a 3D point cloud to the best camera (NodeID -> CameraIndex) for each point based on a policy.

This function takes a point cloud of type pcl::PointXYZINormal and projects each point to the best camera that sees the point. The "best" camera is selected based on the distance, angle, and other parameters like Region of Interest (ROI) ratios and projection mask.

Parameters
cloudThe input point cloud of type pcl::PointXYZINormal containing 3D points.
cameraPosesA map of camera IDs to their respective poses (transformations).
cameraModelsA map of camera IDs to their camera models (internal camera parameters).
maxDistanceMaximum allowable distance from the camera for a point to be considered.
maxAngleMaximum allowable angle between the camera and the point normal for it to be considered.
roiRatiosA vector of four floats defining the region of interest ratios for the camera image. See util2d::computeRoi() for format.
projMaskA binary mask for projection, which will be checked to ensure the point lies within the mask.
distanceToCamPolicyIf true, the distance to the camera is considered in the decision of the best camera, otherwise distance to center of the camera is used.
stateA ProgressState object to provide feedback on progress or cancellation.
Returns
A vector of pairs, where each pair contains a pair of camera ID and camera index, and a 2D UV coordinate. The UV coordinate represents the projection of each point onto the best camera.

◆ isFinite()

bool RTABMAP_CORE_EXPORT rtabmap::util3d::isFinite ( const cv::Point3f &  pt)

Checks if all coordinates of a 3D point are finite.

This function verifies that the x, y, and z components of the given cv::Point3f are all finite values (i.e., not NaN or infinite).

Parameters
ptThe 3D point to check.
Returns
true if all components of the point are finite, false otherwise.

◆ concatenateClouds() [1/2]

pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::concatenateClouds ( const std::list< pcl::PointCloud< pcl::PointXYZ >::Ptr > &  clouds)

Concatenates a list of PointXYZ point clouds into a single point cloud.

This function takes a list of shared pointers to pcl::PointCloud<pcl::PointXYZ> objects, and merges them into a single point cloud by appending the points of each input cloud.

Parameters
[in]cloudsA list of pointers to PointXYZ point clouds to concatenate.
Returns
A new pcl::PointCloud<pcl::PointXYZ>::Ptr containing all the points from the input clouds.

◆ concatenateClouds() [2/2]

pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::concatenateClouds ( const std::list< pcl::PointCloud< pcl::PointXYZRGB >::Ptr > &  clouds)

Concatenates a list of PointXYZRGB point clouds into a single point cloud.

This function takes a list of shared pointers to pcl::PointCloud<pcl::PointXYZRGB> objects, and merges them into a single point cloud by appending the points of each input cloud.

Parameters
[in]cloudsA list of pointers to PointXYZRGB point clouds to concatenate.
Returns
A new pcl::PointCloud<pcl::PointXYZRGB>::Ptr containing all the points from the input clouds.

◆ concatenate() [1/2]

pcl::IndicesPtr RTABMAP_CORE_EXPORT rtabmap::util3d::concatenate ( const std::vector< pcl::IndicesPtr > &  indices)

Concatenates multiple sets of indices into a single index vector.

This function takes a vector of shared pointers to PCL index vectors and combines them into a single shared pointer containing all indices in the same order as they appear in the input.

Parameters
indicesA vector of pcl::IndicesPtr (shared pointers to index vectors).
Returns
A single pcl::IndicesPtr containing the concatenated indices.
Note
The output order preserves the original order of indices from each input set.
See also
concatenate(const pcl::IndicesPtr &, const pcl::IndicesPtr &)

◆ concatenate() [2/2]

pcl::IndicesPtr RTABMAP_CORE_EXPORT rtabmap::util3d::concatenate ( const pcl::IndicesPtr &  indicesA,
const pcl::IndicesPtr &  indicesB 
)

Concatenates two sets of indices into one.

This function creates a new index vector containing all indices from indicesA followed by all indices from indicesB.

Parameters
indicesAThe first set of indices to include.
indicesBThe second set of indices to append.
Returns
A pcl::IndicesPtr containing the combined indices from both inputs.
Note
The input index vectors are not modified.
See also
concatenate(const std::vector<pcl::IndicesPtr> &)

◆ savePCDWords() [1/2]

void RTABMAP_CORE_EXPORT rtabmap::util3d::savePCDWords ( const std::string &  fileName,
const std::multimap< int, pcl::PointXYZ > &  words,
const Transform transform = Transform::getIdentity() 
)

Saves 3D word points to a PCD file, applying a transform to each point.

This function takes a multimap of word identifiers and corresponding 3D PCL points, applies the given transform to each point, and saves the resulting point cloud to the specified PCD file.

Parameters
fileNameThe path to the output PCD file.
wordsA multimap containing word IDs and their associated pcl::PointXYZ coordinates.
transformA transform to apply to each 3D point before saving.

◆ savePCDWords() [2/2]

void RTABMAP_CORE_EXPORT rtabmap::util3d::savePCDWords ( const std::string &  fileName,
const std::multimap< int, cv::Point3f > &  words,
const Transform transform = Transform::getIdentity() 
)

Saves 3D word points (as OpenCV points) to a PCD file, applying a transform to each point.

This function takes a multimap of word identifiers and corresponding 3D OpenCV points, converts them to PCL format after applying the given transform, and saves them as a point cloud to the specified PCD file.

Parameters
fileNameThe path to the output PCD file.
wordsA multimap containing word IDs and their associated cv::Point3f coordinates.
transformA transform to apply to each 3D point before saving.

◆ loadBINScan()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::loadBINScan ( const std::string &  fileName)

Loads a KITTI-style Velodyne binary scan file into an OpenCV matrix.

This function assumes the binary file contains a series of 4-float values per point representing (X, Y, Z, Intensity). It loads the entire file into a cv::Mat with type CV_32FC4.

Parameters
fileNamePath to the .bin file.
Returns
A 1-row cv::Mat with 4 channels (XYZI), one column per point.

◆ loadBINCloud() [1/2]

pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::loadBINCloud ( const std::string &  fileName)

Loads a KITTI-style Velodyne binary scan and converts it to a PCL point cloud.

Internally calls loadScan() and converts the result into a pcl::PointCloud<pcl::PointXYZ>.

Parameters
fileNamePath to the .bin file.
Returns
Pointer to the loaded point cloud.

◆ loadBINCloud() [2/2]

RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::loadBINCloud ( const std::string &  fileName,
int  dim 
)

Loads a KITTI-style Velodyne binary scan and converts it to a PCL point cloud.

Parameters
fileNamePath to the .bin file.
dimUnused parameter.
Returns
Pointer to the loaded point cloud.
Deprecated:
This overload exists for compatibility but ignores the dim parameter. Use version without dim directly.

◆ loadScan()

LaserScan RTABMAP_CORE_EXPORT rtabmap::util3d::loadScan ( const std::string &  path)

Loads a 3D scan from a file (.pcd, .ply, or .bin format).

This function detects the file type based on the extension and loads the scan accordingly. Binary .bin files are interpreted using the KITTI format (XYZI). For .pcd or .ply files, a PCL point cloud is loaded and optionally interpreted as 2D if all Z values are 0.

Parameters
pathPath to the scan file.
Returns
A LaserScan object containing the loaded scan data.

◆ loadCloud()

RTABMAP_DEPRECATED pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT rtabmap::util3d::loadCloud ( const std::string &  path,
const Transform transform = Transform::getIdentity(),
int  downsampleStep = 1,
float  voxelSize = 0.0f 
)

Loads and optionally transforms/downsamples/voxelizes a point cloud.

This function loads a point cloud from a .bin, .pcd, or .ply file. It can apply a transformation, downsample using a step size, or filter using a voxel grid.

Parameters
pathPath to the scan file.
transformTransformation to apply to the cloud (must not be null).
downsampleStepStep size to downsample (1 = no downsampling).
voxelSizeSize of the voxel grid filter in meters (0 = no filtering).
Returns
Transformed and optionally filtered pcl::PointCloud<pcl::PointXYZ>::Ptr.
Deprecated:
Use loadScan() instead.

◆ deskew()

LaserScan RTABMAP_CORE_EXPORT rtabmap::util3d::deskew ( const LaserScan input,
double  inputStamp,
const rtabmap::Transform velocity 
)

Lidar deskewing.

Parameters
inputlidar, format should have time channel
inputstamp of the lidar
velocityin base frame
velocitystamp at which it has been computed
Returns
lidar deskewed

Deskews a laser scan based on the velocity transform and timestamp information.

This function takes an input LaserScan with a time channel (kXYZIT format), and deskews the scan based on the provided velocity transform. It assumes that the scan has a time channel with time information for each point relative to inputStamp. The deskewing process involves calculating the pose of the laser at each point in time and correcting the scan data accordingly.

Parameters
[in]inputThe input LaserScan to be deskewed.
[in]inputStampThe timestamp of the input scan (e.g., epoch time).
[in]velocityThe velocity transform (linear and angular velocities), in base frame.
Returns
A new LaserScan that has been deskewed based on the provided velocity and timestamps.
Note
If the velocity is null or if the input scan does not have the correct format, an error will be logged. If the first and last timestamps are identical, deskewing cannot be performed, and an error is logged.
Warning
This function assumes that the input LaserScan is in the kXYZIT format (with time data). If not, an error will be logged and an empty LaserScan will be returned.
Exceptions
exceptionif velocity is null or the format is incorrect.

◆ extractXYZCorrespondences() [1/4]

void RTABMAP_CORE_EXPORT rtabmap::util3d::extractXYZCorrespondences ( const std::multimap< int, pcl::PointXYZ > &  words1,
const std::multimap< int, pcl::PointXYZ > &  words2,
pcl::PointCloud< pcl::PointXYZ > &  cloud1,
pcl::PointCloud< pcl::PointXYZ > &  cloud2 
)

Extracts 3D point correspondences between two sets of labeled 3D points.

This function identifies common point IDs (keys) between two multimap structures containing pcl::PointXYZ points. For each shared key that appears exactly once in both input maps, and where both corresponding points are finite, the matched points are added to two output point clouds.

The resulting cloud1 and cloud2 point clouds will contain points with a one-to-one correspondence, useful for geometric registration (e.g., ICP).

Parameters
words1Input multimap of point ID to 3D point for the first dataset.
words2Input multimap of point ID to 3D point for the second dataset.
cloud1Output point cloud (corresponding to points from words1).
cloud2Output point cloud (corresponding to points from words2).
Note
Only keys that appear exactly once in both words1 and words2, and whose associated pcl::PointXYZ entries are finite, will be included in the output clouds.

◆ extractXYZCorrespondencesRANSAC()

void RTABMAP_CORE_EXPORT rtabmap::util3d::extractXYZCorrespondencesRANSAC ( const std::multimap< int, pcl::PointXYZ > &  words1,
const std::multimap< int, pcl::PointXYZ > &  words2,
pcl::PointCloud< pcl::PointXYZ > &  cloud1,
pcl::PointCloud< pcl::PointXYZ > &  cloud2 
)

Extracts reliable 3D point correspondences between two sets of labeled 3D points using RANSAC filtering.

This function finds correspondences between words1 and words2 based on shared unique keys. For each common key that appears exactly once in both maps, and where the corresponding 3D points are finite, a candidate correspondence is formed. If more than 7 such pairs exist, RANSAC is used via OpenCV’s cv::findFundamentalMat to reject outliers based on the geometric consistency of the 2D projections.

Only the inlier correspondences determined by RANSAC are returned in the output point clouds cloud1 and cloud2.

Parameters
words1Input multimap of point ID to pcl::PointXYZ for the first set of 3D features.
words2Input multimap of point ID to pcl::PointXYZ for the second set of 3D features.
cloud1Output point cloud containing inlier points from words1.
cloud2Output point cloud containing inlier points from words2.
Note
At least 8 valid point correspondences are required for RANSAC to compute a fundamental matrix. If fewer than 8 valid matches exist, the function does not modify the output clouds.
Warning
Only 2D (x, y) components of the 3D points are used for RANSAC filtering.

◆ extractXYZCorrespondences() [2/4]

void RTABMAP_CORE_EXPORT rtabmap::util3d::extractXYZCorrespondences ( const std::list< std::pair< cv::Point2f, cv::Point2f > > &  correspondences,
const cv::Mat &  depthImage1,
const cv::Mat &  depthImage2,
float  cx,
float  cy,
float  fx,
float  fy,
float  maxDepth,
pcl::PointCloud< pcl::PointXYZ > &  cloud1,
pcl::PointCloud< pcl::PointXYZ > &  cloud2 
)

Extracts 3D point correspondences from 2D pixel matches using depth images.

This function projects matched 2D keypoints (pixel correspondences) from two RGB-D images into 3D space using the provided camera intrinsic parameters. Only valid and finite 3D points are retained. If a maxDepth threshold is provided, points farther than this threshold are excluded.

The function returns two synchronized point clouds, cloud1 and cloud2, where each point pair at the same index corresponds to a match between the two views.

Parameters
correspondencesList of 2D point correspondences between image 1 and image 2.
depthImage1Depth image corresponding to the first set of points (CV_32FC1 or CV_16UC1).
depthImage2Depth image corresponding to the second set of points (same format as depthImage1).
cxPrincipal point x-coordinate (camera intrinsic).
cyPrincipal point y-coordinate (camera intrinsic).
fxFocal length in x-direction (camera intrinsic).
fyFocal length in y-direction (camera intrinsic).
maxDepthMaximum allowed depth for a correspondence to be considered valid. If <= 0, all depths are accepted.
cloud1Output point cloud with 3D points corresponding to the first image.
cloud2Output point cloud with 3D points corresponding to the second image.
Note
  • Both output point clouds are resized to contain only the valid 3D matches after filtering.
  • Invalid, non-finite, or out-of-range depth values are automatically filtered out.

◆ extractXYZCorrespondences() [3/4]

void RTABMAP_CORE_EXPORT rtabmap::util3d::extractXYZCorrespondences ( const std::list< std::pair< cv::Point2f, cv::Point2f > > &  correspondences,
const pcl::PointCloud< pcl::PointXYZ > &  cloud1,
const pcl::PointCloud< pcl::PointXYZ > &  cloud2,
pcl::PointCloud< pcl::PointXYZ > &  inliers1,
pcl::PointCloud< pcl::PointXYZ > &  inliers2 
)

Extracts 3D correspondences from 2D feature matches using pcl::PointXYZ organized point clouds.

This function projects 2D keypoint matches into 3D using the corresponding organized point clouds (cloud1 and cloud2). Points that are not finite are discarded.

Parameters
correspondencesList of 2D point correspondences between image 1 and image 2.
cloud1Organized pcl::PointXYZ point cloud corresponding to the first image.
cloud2Organized pcl::PointXYZ point cloud corresponding to the second image.
inliers1Output 3D points from cloud1 corresponding to valid 2D matches.
inliers2Output 3D points from cloud2 corresponding to valid 2D matches.
Note
  • Only organized point clouds are supported (i.e., width × height layout must match image size from which 2D keypoints were taken).

◆ extractXYZCorrespondences() [4/4]

void RTABMAP_CORE_EXPORT rtabmap::util3d::extractXYZCorrespondences ( const std::list< std::pair< cv::Point2f, cv::Point2f > > &  correspondences,
const pcl::PointCloud< pcl::PointXYZRGB > &  cloud1,
const pcl::PointCloud< pcl::PointXYZRGB > &  cloud2,
pcl::PointCloud< pcl::PointXYZ > &  inliers1,
pcl::PointCloud< pcl::PointXYZ > &  inliers2 
)

Extracts 3D correspondences from 2D feature matches using pcl::PointXYZRGB organized point clouds.

This overload behaves identically to the pcl::PointXYZ version, but supports input point clouds that contain RGB color data. The color is not used—only the XYZ fields are extracted.

Parameters
correspondencesList of matched 2D keypoints between two images.
cloud1Organized pcl::PointXYZRGB point cloud for the first image.
cloud2Organized pcl::PointXYZRGB point cloud for the second image.
inliers1Output 3D points from cloud1 corresponding to valid 2D matches.
inliers2Output 3D points from cloud2 corresponding to valid 2D matches.

◆ countUniquePairs()

int RTABMAP_CORE_EXPORT rtabmap::util3d::countUniquePairs ( const std::multimap< int, pcl::PointXYZ > &  wordsA,
const std::multimap< int, pcl::PointXYZ > &  wordsB 
)

Counts the number of unique 3D point correspondences between two sets of word-indexed features.

This function iterates over the unique keys (word IDs) in wordsA and checks if the same key exists in wordsB. A pair is considered "unique" if both wordsA and wordsB contain exactly one 3D point (i.e., one pcl::PointXYZ) associated with the same key.

Parameters
wordsAA multimap of word IDs to 3D points (e.g., from frame A).
wordsBA multimap of word IDs to 3D points (e.g., from frame B).
Returns
The number of unique pairs where both wordsA and wordsB contain exactly one point for a given word ID.

◆ filterMaxDepth()

void RTABMAP_CORE_EXPORT rtabmap::util3d::filterMaxDepth ( pcl::PointCloud< pcl::PointXYZ > &  inliers1,
pcl::PointCloud< pcl::PointXYZ > &  inliers2,
float  maxDepth,
char  depthAxis,
bool  removeDuplicates 
)

Filters pairs of 3D points by maximum depth along a specified axis and optionally removes duplicates.

This function takes two point clouds (inliers1 and inliers2) containing corresponding 3D points, and filters out pairs where either point exceeds a specified maximum depth value along the given axis. It can also optionally remove duplicate points in the first point cloud.

Parameters
[in,out]inliers1The first point cloud of 3D points to be filtered. Points failing the filter will be removed.
[in,out]inliers2The second point cloud of 3D points corresponding to inliers1. Points failing the filter will be removed. Must be the same size as inliers1.
[in]maxDepthThe maximum allowed depth value along the specified axis. Points with coordinate values greater or equal to this value on that axis will be removed. If maxDepth is less or equal to zero, no filtering is performed.
[in]depthAxisThe axis ('x', 'y', or 'z') along which to measure depth for filtering.
[in]removeDuplicatesIf true, duplicate points in inliers1 (exact coordinate matches) will be removed. Duplicates are detected only in inliers1.
Warning
The function modifies inliers1 and inliers2 in place, replacing them with filtered versions.

◆ findCorrespondences() [1/3]

void RTABMAP_CORE_EXPORT rtabmap::util3d::findCorrespondences ( const std::multimap< int, cv::KeyPoint > &  wordsA,
const std::multimap< int, cv::KeyPoint > &  wordsB,
std::list< std::pair< cv::Point2f, cv::Point2f > > &  pairs 
)

Finds 2D point correspondences between two sets of keypoints based on matching word IDs.

This function compares two multimap structures containing word IDs associated with cv::KeyPoints. It extracts correspondences where the same word ID appears exactly once in each set.

Parameters
[in]wordsAA multimap from word ID to keypoints in set A.
[in]wordsBA multimap from word ID to keypoints in set B.
[out]pairsA list of matching 2D point correspondences (Point2f) between wordsA and wordsB.
Note
Only unique word ID matches (count == 1 in both sets) are considered valid correspondences.
Example
If wordsA = [1 2 3 4 6 6] and wordsB = [1 1 2 4 5 6 6], the output pairs will contain correspondences for IDs 2 and 4, because only those have exactly one match in both sets.

◆ findCorrespondences() [2/3]

void RTABMAP_CORE_EXPORT rtabmap::util3d::findCorrespondences ( const std::multimap< int, cv::Point3f > &  words1,
const std::multimap< int, cv::Point3f > &  words2,
std::vector< cv::Point3f > &  inliers1,
std::vector< cv::Point3f > &  inliers2,
float  maxDepth,
std::vector< int > *  uniqueCorrespondences = 0 
)

Finds 3D point correspondences between two sets of points based on matching word IDs.

This function compares two multimaps of 3D points (typically from different views or frames). It returns point pairs where the same word ID appears once in both maps, the points are finite and valid, and optionally filtered by a maximum X-depth.

Parameters
[in]words1A multimap of word IDs to 3D points in the first set.
[in]words2A multimap of word IDs to 3D points in the second set.
[out]inliers1Output vector of 3D points from words1 with valid correspondences.
[out]inliers2Output vector of corresponding 3D points from words2.
[in]maxDepthOptional filter: only points with X-values in (0, maxDepth] are kept. Use <= 0 to disable.
[out]uniqueCorrespondences(Optional) Vector of word IDs corresponding to each pair.
Note
Only pairs with exactly one occurrence in each map and non-zero, finite coordinates are kept.

◆ findCorrespondences() [3/3]

void RTABMAP_CORE_EXPORT rtabmap::util3d::findCorrespondences ( const std::map< int, cv::Point3f > &  words1,
const std::map< int, cv::Point3f > &  words2,
std::vector< cv::Point3f > &  inliers1,
std::vector< cv::Point3f > &  inliers2,
float  maxDepth,
std::vector< int > *  correspondences = 0 
)

Finds 3D point correspondences between two sets of uniquely indexed 3D points.

This overload works with std::map, where each word ID appears at most once. It finds matching IDs and returns valid point pairs based on similar criteria to the multimap version.

Parameters
[in]words1A map of word IDs to 3D points in the first set.
[in]words2A map of word IDs to 3D points in the second set.
[out]inliers1Output vector of 3D points from words1 with valid correspondences.
[out]inliers2Output vector of corresponding 3D points from words2.
[in]maxDepthOptional filter: only points with X-values in (0, maxDepth] are kept. Use <= 0 to disable.
[out]correspondences(Optional) Vector of word IDs corresponding to valid matched pairs.
Note
Finite, non-zero points are required. The function ignores word IDs not found in both sets.

◆ generateKeypoints3DDepth() [1/2]

std::vector< cv::Point3f > RTABMAP_CORE_EXPORT rtabmap::util3d::generateKeypoints3DDepth ( const std::vector< cv::KeyPoint > &  keypoints,
const cv::Mat &  depth,
const std::vector< CameraModel > &  cameraModels,
float  minDepth = 0,
float  maxDepth = 0 
)

Projects 2D keypoints to 3D space using the provided depth image and camera models.

This function takes a vector of 2D keypoints and projects them into 3D space by using depth values from a depth image and the associated camera models. It supports multi-camera setups by assuming the depth image is horizontally stacked with sub-images corresponding to each camera.

If a depth value at a keypoint location is invalid or outside the specified depth range (minDepth, maxDepth), the output 3D point will be set to NaN.

Parameters
keypointsA vector of 2D keypoints (in image coordinates).
depthThe depth image (must be either CV_32FC1 or CV_16UC1). For multiple cameras, the depth images should be horizontally concatenated.
cameraModelsA vector of camera models, one per camera. Each model must provide intrinsic parameters and optionally a local transform to apply to the resulting 3D point.
minDepthMinimum valid depth value. If negative, no minimum is enforced.
maxDepthMaximum valid depth value. If zero or negative, no maximum is enforced.
Returns
A vector of 3D points (cv::Point3f) corresponding to the input keypoints. If the depth is invalid or outside the valid range, the point will contain NaNs.
Exceptions
Assertionfailure if the depth image is empty or not of the expected type, or if the camera model vector is empty, or if camera index computation fails.

◆ generateKeypoints3DDepth() [2/2]

std::vector< cv::Point3f > RTABMAP_CORE_EXPORT rtabmap::util3d::generateKeypoints3DDepth ( const std::vector< cv::KeyPoint > &  keypoints,
const cv::Mat &  depth,
const CameraModel cameraModel,
float  minDepth = 0,
float  maxDepth = 0 
)

Projects 2D keypoints to 3D space using the provided depth image and camera model.

See also
util3d::generateKeypoints3DDepth()

◆ generateKeypoints3DDisparity()

std::vector< cv::Point3f > RTABMAP_CORE_EXPORT rtabmap::util3d::generateKeypoints3DDisparity ( const std::vector< cv::KeyPoint > &  keypoints,
const cv::Mat &  disparity,
const StereoCameraModel stereoCameraModel,
float  minDepth = 0,
float  maxDepth = 0 
)

Projects 2D keypoints into 3D space using a disparity image and a stereo camera model.

This function computes 3D coordinates for each input 2D keypoint by using the disparity image and the stereo camera model. Invalid or out-of-range depth values result in 3D points with NaN components.

The function applies the local transform of the left camera (from the stereo model) to each valid 3D point, if the transform is not null or identity.

Parameters
keypointsA vector of 2D keypoints (image coordinates) to be projected into 3D.
disparityThe disparity image (must be of type CV_16SC1 or CV_32F). Disparity values should correspond to the keypoints' locations.
stereoCameraModelA valid stereo camera model that provides projection parameters and an optional local transform.
minDepthMinimum depth threshold. If negative, no minimum constraint is applied.
maxDepthMaximum depth threshold. If zero or negative, no maximum constraint is applied.
Returns
A vector of 3D points (cv::Point3f) corresponding to the input keypoints. Points with invalid or out-of-range depth are returned as (NaN, NaN, NaN).
Exceptions
Assertionfailure if the disparity image is empty or of incorrect type, or if the stereo camera model is not valid for projection.

◆ generateKeypoints3DStereo()

std::vector< cv::Point3f > RTABMAP_CORE_EXPORT rtabmap::util3d::generateKeypoints3DStereo ( const std::vector< cv::Point2f > &  leftCorners,
const std::vector< cv::Point2f > &  rightCorners,
const StereoCameraModel model,
const std::vector< unsigned char > &  mask = std::vector< unsigned char >(),
float  minDepth = 0,
float  maxDepth = 0 
)

Computes 3D keypoints from corresponding 2D points in a stereo image pair.

This function triangulates 3D points from pairs of corresponding 2D points (leftCorners, rightCorners) using a given stereo camera model. It optionally applies a validity mask and filters 3D points by depth range.

For each point pair, the disparity is computed as the x-coordinate difference between left and right corners. Only positive disparities are considered valid. If a mask is provided, only entries with a non-zero value are processed.

The resulting 3D points are optionally transformed using the stereo camera model's local transform, if one is defined and non-identity.

Invalid or out-of-range points are set to (NaN, NaN, NaN).

Parameters
leftCornersA vector of 2D points from the left stereo image.
rightCornersA vector of corresponding 2D points from the right stereo image.
modelThe stereo camera model containing intrinsic parameters and optional local transform.
mask(Optional) A binary mask indicating which matches are valid (non-zero = valid). If empty, all matches are considered valid.
minDepthMinimum allowed depth value. If negative, no minimum is applied.
maxDepthMaximum allowed depth value. If zero or negative, no maximum is applied.
Returns
A vector of 3D points (cv::Point3f) corresponding to valid stereo matches. Invalid points or those outside the depth range are returned as (NaN, NaN, NaN).
Exceptions
Assertionfailure if the input vectors are inconsistent in size, or if the stereo camera model is invalid (e.g., non-positive focal length or baseline).

◆ aggregate()

std::multimap< int, cv::KeyPoint > RTABMAP_CORE_EXPORT rtabmap::util3d::aggregate ( const std::list< int > &  wordIds,
const std::vector< cv::KeyPoint > &  keypoints 
)

Aggregates word IDs and corresponding keypoints into a multimap.

This function pairs each word ID from the input list with the corresponding keypoint from the input vector and stores them in a std::multimap<int, cv::KeyPoint>.

It is assumed that the wordIds list and the keypoints vector are of the same length and ordered such that each word ID corresponds to the keypoint at the same index.

Parameters
wordIdsA list of integer word IDs (e.g., visual word identifiers).
keypointsA vector of keypoints associated with the word IDs.
Returns
A multimap where each key is a word ID and the value is the corresponding cv::KeyPoint. Multiple keypoints can be associated with the same word ID.
Exceptions
Assertionfailure if wordIds.size() != keypoints.size().

◆ commonFiltering() [1/2]

LaserScan RTABMAP_CORE_EXPORT rtabmap::util3d::commonFiltering ( const LaserScan scan,
int  downsamplingStep,
float  rangeMin = 0.0f,
float  rangeMax = 0.0f,
float  voxelSize = 0.0f,
int  normalK = 0,
float  normalRadius = 0.0f,
float  groundNormalsUp = 0.0f 
)

Applies a common set of filters to a LaserScan, including downsampling, range limits, voxel grid filtering, and normal estimation.

This function performs a sequence of optional preprocessing steps on the input LaserScan:

  • Downsampling: Reduces the number of points by selecting every N-th point.
  • Range filtering: Removes points outside the specified minimum and maximum range.
  • Voxel grid filtering: Reduces point density using a voxel grid.
  • Normal estimation: Computes surface normals using k-nearest neighbors or radius search.
  • Normal reorientation: normals are first flipped to face the view point, then optionally oriented upward if this condition is fulfilled: for each normal, if normal.z < -groundNormalsUp and the corresponding point is below viewpoint, it is flipped upward. The view point is the sensor origin, as the scan is kept in sensor frame (its local transform is not applied), so "below" and "upward" are along the sensor Z axis.

The function supports both 2D and 3D scans and adapts behavior based on whether the scan contains RGB or intensity data.

Depending on the filtering options used, the output point cloud may be dense if the input is organized.

Parameters
scanInInput LaserScan to be filtered.
downsamplingStepStep size for downsampling. A value >1 will reduce the scan resolution. For organized scans, only the largest dimension is downsampled and the result is dense. For example, if the input organized scan is 16x1024, the resulting scan will be 1x8192 (if all values are valid).
rangeMinMinimum range to keep points from the scan viewpoint. Points closer than this value will be discarded. Output point cloud will be dense. Set to 0 to disable.
rangeMaxMaximum range to keep points from the scan viewpoint. Points farther than this value will be discarded. Output point cloud will be dense. Set to 0 to disable.
voxelSizeSize of the voxel grid in meters. A value >0 enables voxel filtering. Output point cloud will be dense.
normalKNumber of nearest neighbors to use for normal estimation. Set to 0 to disable.
normalRadiusRadius used for normal estimation. Set to 0 to disable.
groundNormalsUpIf >0, normal vectors close to -Z axis will be oriented upward (+Z). Expected value is around 0.8.
Returns
A new LaserScan instance with the applied filters and potential normals.
See also
adjustNormalsToViewPoint()

◆ commonFiltering() [2/2]

RTABMAP_DEPRECATED LaserScan RTABMAP_CORE_EXPORT rtabmap::util3d::commonFiltering ( const LaserScan scan,
int  downsamplingStep,
float  rangeMin,
float  rangeMax,
float  voxelSize,
int  normalK,
float  normalRadius,
bool  forceGroundNormalsUp 
)

Applies a common set of filters to a LaserScan, including downsampling, range limits, voxel grid filtering, and normal estimation.

Deprecated:
Use version with groundNormalsUp as float. For forceGroundNormalsUp=true, set groundNormalsUpAngle=0.8, otherwise set groundNormalsUpAngle=0.0.

◆ rangeFiltering()

LaserScan RTABMAP_CORE_EXPORT rtabmap::util3d::rangeFiltering ( const LaserScan scan,
float  rangeMin,
float  rangeMax 
)

Filters a LaserScan data on a minimum and maximum Euclidean range.

This function removes scan points from the input LaserScan that fall outside the specified minimum and maximum range (in meters) from the LaserScan's viewpoint.

Parameters
scanThe input LaserScan object containing the scan data.
rangeMinThe minimum range threshold. Points closer than this will be excluded.
rangeMaxThe maximum range threshold. Points farther than this will be excluded.
Returns
A new LaserScan object containing only the points within the specified range. If the input scan is empty or the range limits are both zero, the original scan is returned.
Note
The function handles both 2D and 3D scans based on the scan.is2d() flag. The function doesn't keep the scan organized if the input is.
Exceptions
Assertionfailure if either rangeMin or rangeMax is negative.

◆ uniformSampling() [1/3]

pcl::PointCloud< pcl::PointXYZ >::Ptr rtabmap::util3d::uniformSampling ( const pcl::PointCloud< pcl::PointXYZ >::Ptr &  cloud,
float  voxelSize 
)
inline

DEPRECATED: Use voxelize() instead.

Performs uniform sampling of a point cloud by applying voxel grid filtering with the specified voxel size. This is a legacy wrapper for voxelize().

Parameters
cloudThe input point cloud (pcl::PointXYZ).
voxelSizeThe voxel size (resolution) used for downsampling.
Returns
A downsampled point cloud using voxel grid filtering.
Deprecated:
This function is deprecated. Use voxelize() for equivalent behavior.

Definition at line 359 of file util3d_filtering.h.

◆ uniformSampling() [2/3]

pcl::PointCloud< pcl::PointXYZRGB >::Ptr rtabmap::util3d::uniformSampling ( const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &  cloud,
float  voxelSize 
)
inline

DEPRECATED: Use voxelize() instead.

Performs uniform sampling of a point cloud by applying voxel grid filtering with the specified voxel size. This is a legacy wrapper for voxelize().

Parameters
cloudThe input point cloud (pcl::PointXYZRGB).
voxelSizeThe voxel size (resolution) used for downsampling.
Returns
A downsampled point cloud using voxel grid filtering.
Deprecated:
This function is deprecated. Use voxelize() for equivalent behavior.

Definition at line 377 of file util3d_filtering.h.

◆ uniformSampling() [3/3]

pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr rtabmap::util3d::uniformSampling ( const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &  cloud,
float  voxelSize 
)
inline

DEPRECATED: Use voxelize() instead.

Performs uniform sampling of a point cloud by applying voxel grid filtering with the specified voxel size. This is a legacy wrapper for voxelize().

Parameters
cloudThe input point cloud (pcl::PointXYZRGBNormal).
voxelSizeThe voxel size (resolution) used for downsampling.
Returns
A downsampled point cloud using voxel grid filtering.
Deprecated:
This function is deprecated. Use voxelize() for equivalent behavior.

Definition at line 395 of file util3d_filtering.h.

◆ subtractAdaptiveFiltering() [1/2]

pcl::IndicesPtr RTABMAP_CORE_EXPORT rtabmap::util3d::subtractAdaptiveFiltering ( const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &  cloud,
const pcl::IndicesPtr &  indices,
const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &  subtractCloud,
const pcl::IndicesPtr &  subtractIndices,
float  radiusSearchRatio = 0.01,
int  minNeighborsInRadius = 1,
const Eigen::Vector3f &  viewpoint = Eigen::Vector3f(0, 0, 0) 
)

Performs adaptive radius-based subtraction filtering on a point cloud.

This function removes points from the input cloud that have at least minNeighborsInRadius neighbors within an adaptive radius in the subtractCloud. The search radius is scaled proportionally to the distance of each point from the viewpoint, using the radiusSearchRatio.

Parameters
cloudThe input point cloud to filter.
indicesThe subset of points in cloud to consider. If empty, the entire cloud is used.
subtractCloudThe reference point cloud to search against.
subtractIndicesOptional indices for subtractCloud. If empty, the full cloud is used.
radiusSearchRatioThe ratio to scale the radius based on distance to viewpoint.
minNeighborsInRadiusMinimum number of neighbors required to consider a point "covered".
viewpointThe reference viewpoint used to compute adaptive search radius.
Returns
The retained point indices from cloud.
Note
Points with fewer than minNeighborsInRadius neighbors in the subtract cloud are retained.
Warning
This version does not consider surface normals; it is purely geometric.

◆ subtractAdaptiveFiltering() [2/2]

pcl::IndicesPtr RTABMAP_CORE_EXPORT rtabmap::util3d::subtractAdaptiveFiltering ( const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &  cloud,
const pcl::IndicesPtr &  indices,
const pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &  subtractCloud,
const pcl::IndicesPtr &  subtractIndices,
float  radiusSearchRatio = 0.01,
float  maxAngle = M_PI/4.0f,
int  minNeighborsInRadius = 1,
const Eigen::Vector3f &  viewpoint = Eigen::Vector3f(0, 0, 0) 
)

Performs adaptive radius-based subtraction filtering on a point cloud with normals, also considering normal direction differences.

This function removes points from the input cloud that have at least minNeighborsInRadius neighbors within an adaptive radius in the subtractCloud, unless the angular difference between normals exceeds maxAngle.

The search radius is scaled based on the distance of each point from the viewpoint, using the radiusSearchRatio. For neighbors found, the angle between their normals and the input point’s normal is evaluated. If the angle exceeds maxAngle, the neighbor is ignored.

Parameters
cloudThe input point cloud with normals to filter.
indicesThe subset of points in cloud to consider. If empty, the entire cloud is used.
subtractCloudThe reference point cloud with normals to search against.
subtractIndicesOptional indices for subtractCloud. If empty, the full cloud is used.
radiusSearchRatioThe ratio to scale the radius based on distance to viewpoint.
maxAngleMaximum angle (in radians) allowed between normals of matched neighbors.
minNeighborsInRadiusMinimum number of valid neighbors required to exclude a point.
viewpointThe reference viewpoint used to compute adaptive search radius.
Returns
The retained point indices from cloud.
Note
Neighbors with normals exceeding maxAngle from the input point's normal are discarded. Points with fewer than minNeighborsInRadius valid neighbors are retained.

◆ extractPlane()

pcl::IndicesPtr RTABMAP_CORE_EXPORT rtabmap::util3d::extractPlane ( const pcl::PointCloud< pcl::PointXYZ >::Ptr &  cloud,
const pcl::IndicesPtr &  indices,
float  distanceThreshold,
int  maxIterations = 100,
pcl::ModelCoefficients *  coefficientsOut = 0 
)

Extracts the indices of the inliers that belong to a plane using RANSAC.

This function uses the RANSAC algorithm to fit a plane model to a set of 3D points and returns the indices of the points that are considered inliers (i.e., those that lie close to the fitted plane). It also optionally outputs the coefficients of the plane (normal and offset).

Parameters
cloudThe input point cloud.
indicesAn optional set of indices in the point cloud to use for segmentation. If empty, the whole cloud is used.
distanceThresholdThe distance threshold for considering points as inliers to the plane. Points within this threshold are classified as inliers.
maxIterationsThe maximum number of iterations the RANSAC algorithm should run.
coefficientsOutAn optional output pointer to store the coefficients of the plane model. The coefficients include the plane normal and offset.
Returns
A list of indices of points that are considered inliers to the fitted plane.
Note
If the input indices is empty, the entire point cloud will be used for segmentation.
If the coefficientsOut is not null, it will be filled with the model coefficients of the plane.

◆ occupancy2DFromLaserScan() [1/3]

RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT rtabmap::util3d::occupancy2DFromLaserScan ( const cv::Mat &  scan,
cv::Mat &  empty,
cv::Mat &  occupied,
float  cellSize,
bool  unknownSpaceFilled = false,
float  scanMaxRange = 0.0f 
)
Deprecated:
Use the overload taking a viewpoint, so that ray tracing starts from the sensor and not from the base frame.

◆ occupancy2DFromLaserScan() [2/3]

RTABMAP_DEPRECATED void RTABMAP_CORE_EXPORT rtabmap::util3d::occupancy2DFromLaserScan ( const cv::Mat &  scan,
const cv::Point3f &  viewpoint,
cv::Mat &  empty,
cv::Mat &  occupied,
float  cellSize,
bool  unknownSpaceFilled = false,
float  scanMaxRange = 0.0f 
)
Deprecated:
Use the overload taking scanHit / scanNoHit; passing a null scanNoHit is equivalent to this one.

◆ occupancy2DFromLaserScan() [3/3]

void RTABMAP_CORE_EXPORT rtabmap::util3d::occupancy2DFromLaserScan ( const cv::Mat &  scanHit,
const cv::Mat &  scanNoHit,
const cv::Point3f &  viewpoint,
cv::Mat &  empty,
cv::Mat &  occupied,
float  cellSize,
bool  unknownSpaceFilled = false,
float  scanMaxRange = 0.0f 
)

Generates 2D occupancy grid maps (free and occupied cells) from laser scan data.

This function takes in a laser scan composed of hit and no-hit points and computes two 2D maps:

  • empty: 2D coordinates of free space (where the laser passed without hitting obstacles).
  • occupied: precise 2D coordinates of obstacle hits (where the laser reflected).

The internal representation uses a temporary occupancy map generated from create2DMap(), from which free cells are extracted. Obstacle points are directly passed through, potentially clipped by a maximum range filter.

Parameters
[in]scanHitInCV_32FC2 or CV_32FC(n>=2) matrix representing obstacle hits in 2D or 3D space (relative to base frame, not laser frame).
[in]scanNoHitInCV_32FC2 or CV_32FC(n>=2) matrix representing laser rays that did not hit an obstacle (relative to base frame, not laser frame).
[in]viewpointThe viewpoint (sensor origin) from which the scan was taken, in 3D space, relative to base frame. This used to determinate the origin of ray tracing.
[out]emptyOutput matrix (CV_32FC2) of free space points derived from ray tracing.
[out]occupiedOutput matrix (CV_32FC2) of occupied (hit) points, filtered by max range if required.
[in]cellSizeThe resolution of the occupancy map grid (in meters per cell).
[in]unknownSpaceFilledIf true, unknown space between hits is also filled via ray tracing.
[in]scanMaxRangeMaximum range of the scan (in meters). Values beyond this are clipped.
Note
The function assumes a single scan already converted in base frame for internal processing.
If scanMaxRange <= cellSize, no range filtering is applied to the occupied points.
See also
create2DMap(), util3d::rangeFiltering()

◆ create2DMapFromOccupancyLocalMaps()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::create2DMapFromOccupancyLocalMaps ( const std::map< int, Transform > &  poses,
const std::map< int, std::pair< cv::Mat, cv::Mat > > &  occupancy,
float  cellSize,
float &  xMin,
float &  yMin,
float  minMapSize = 0.0f,
bool  erode = false,
float  footprintRadius = 0.0f 
)

Creates a 2D occupancy grid map from local occupancy data.

Generates a 2D occupancy grid (CV_8S) where:

  • -1 indicates unknown space,
  • 0 indicates free space,
  • 100 indicates an occupied (obstacle) cell.

This function transforms and merges local empty/occupied occupancy maps from multiple robot poses into a single global 2D grid map.

Parameters
posesInMap of robot poses, indexed by node ID.
occupancyMap of local occupancy data, indexed by node ID. Each pair contains two cv::Mat elements:
  • First: empty cells (CV_32FC2) relative to base frame,
  • Second: occupied cells (CV_32FC2) relative to base frame.
cellSizeThe resolution of the map in meters per cell.
[out]xMinMinimum x-coordinate (origin offset) of the resulting map (in meters).
[out]yMinMinimum y-coordinate (origin offset) of the resulting map (in meters).
minMapSizeMinimum width/height of the output map in meters. If 0, size is computed from poses and occupancy data.
erodeWhether to post-process (erode) noisy obstacles. This helps remove isolated or thin obstacle artifacts.
footprintRadiusRadius of the robot footprint (in meters). Free space will be cleared under the robot.
Returns
cv::Mat The resulting occupancy grid map (CV_8S): -1 = unknown, 0 = free space, 100 = obstacle.
Warning
The output map can be very large if poses are far apart or cellSize is small. The function will not create a map if the estimated size exceeds reasonable limits (e.g. > 1.5 km).
Note
The function will fill small holes surrounded by known cells and optionally erode noisy borders.

◆ create2DMap() [1/3]

RTABMAP_DEPRECATED cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::create2DMap ( const std::map< int, Transform > &  poses,
const std::map< int, pcl::PointCloud< pcl::PointXYZ >::Ptr > &  scans,
float  cellSize,
bool  unknownSpaceFilled,
float &  xMin,
float &  yMin,
float  minMapSize = 0.0f,
float  scanMaxRange = 0.0f 
)
Deprecated:
Use the overload taking viewpoints, so that ray tracing starts from the sensor and not from the base frame.

◆ create2DMap() [2/3]

RTABMAP_DEPRECATED cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::create2DMap ( const std::map< int, Transform > &  poses,
const std::map< int, pcl::PointCloud< pcl::PointXYZ >::Ptr > &  scans,
const std::map< int, cv::Point3f > &  viewpoints,
float  cellSize,
bool  unknownSpaceFilled,
float &  xMin,
float &  yMin,
float  minMapSize = 0.0f,
float  scanMaxRange = 0.0f 
)
Deprecated:
Use the overload taking cv::Mat scans.

◆ create2DMap() [3/3]

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::create2DMap ( const std::map< int, Transform > &  poses,
const std::map< int, std::pair< cv::Mat, cv::Mat > > &  scans,
const std::map< int, cv::Point3f > &  viewpoints,
float  cellSize,
bool  unknownSpaceFilled,
float &  xMin,
float &  yMin,
float  minMapSize = 0.0f,
float  scanMaxRange = 0.0f 
)

Generates a 2D occupancy grid map from a set of poses, laser scans, and viewpoints.

This function aggregates laser scan data from multiple poses and creates a 2D occupancy grid (CV_8S: signed 8-bit) where:

  • -1 represents unknown space,
  • 0 represents free space,
  • 100 represents occupied space (obstacles).

The scans are first transformed into the global map frame using the corresponding pose. Obstacles and free space are inserted using ray tracing. Optionally, unknown areas between known rays can also be filled using radial sweeping.

Parameters
posesA map of node IDs to 3D poses (used to transform local scans to the global frame).
scansA map of node IDs to pairs of laser scans (<hit, no-hit>), each as a cv::Mat of type CV_32FC2.
  • first: endpoints of beams hitting obstacles (relative to base frame, not laser frame).
  • second: endpoints of beams not hitting any obstacle (relative to base frame, not laser frame).
viewpointsA map of node IDs to local sensor origin offsets relative to each pose (e.g., lidar offset /base_link -> /base_scan). This is used to determinate the starting point for each ray trace.
cellSizeThe size of each grid cell in meters.
unknownSpaceFilledIf true, fills areas between known rays (fan sweeping) up to scanMaxRange.
[out]xMinThe minimum x value (in meters) of the grid origin relative to map coordinates.
[out]yMinThe minimum y value (in meters) of the grid origin relative to map coordinates.
minMapSizeThe minimum width and height (in meters) of the map. Ensures the output map has a minimum footprint.
scanMaxRangeThe maximum range (in meters) of the sensor. Used to limit ray tracing and padding.
Returns
A 2D occupancy grid map (cv::Mat of type CV_8S) where:
  • -1 = unknown
  • 0 = free space
  • 100 = obstacle
Note
If scanMaxRange <= 0, map size is determined based on scan data bounds.
Grid coordinates are calculated with padding to ensure all points fall within the map.
This function uses ray tracing internally via the rayTrace() function.

◆ rayTrace()

void RTABMAP_CORE_EXPORT rtabmap::util3d::rayTrace ( const cv::Point2i &  start,
const cv::Point2i &  end,
cv::Mat &  grid,
bool  stopOnObstacle 
)

Performs a 2D ray tracing operation between two points on a grid map.

This function draws a line from the start point to the end point on a grid (e.g., occupancy grid), marking all traversed cells as free (value = 0) unless an obstacle (value = 100) is encountered. The line follows an integer rasterization algorithm (like Bresenham’s line), accounting for steep slopes by transposing axes when needed.

Parameters
startThe starting point of the ray (2D grid coordinates).
endThe ending point of the ray (2D grid coordinates). This point is clipped to the grid bounds.
gridA mutable 2D grid represented as a cv::Mat of signed char values. Assumes 100 denotes obstacles; 0 denotes free space.
stopOnObstacleIf true, the ray trace stops upon hitting a cell marked with 100 (an obstacle).
Note
  • If the slope of the line is steep (outside the range [-1, 1]), the algorithm swaps x and y axes for correctness.
  • The function ensures both the start and end points are within the bounds of the grid.
  • All visited cells along the path (except obstacles when stopOnObstacle is true) will be updated to 0 (free).
  • The grid must have type CV_8SC1 (signed 8-bit single-channel matrix).

◆ convertMap2Image8U()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::convertMap2Image8U ( const cv::Mat &  map8S,
bool  pgmFormat = false 
)

Converts an occupancy grid map (CV_8S) to a grayscale image (CV_8U).

This function takes a signed 8-bit occupancy grid map and produces a corresponding 8-bit unsigned grayscale image. The pixel values are mapped based on the occupancy values:

  • 0 (free space) → 178 (normal) or 254 (PGM format)
  • 100 (obstacle) → 0 (black)
  • -2 (robot footprint) → 200 (normal) or 254 (PGM format)
  • -1 (unknown) → 89 (normal) or 205 (PGM format)
  • v > 50 (partial obstacle): scaled to range [0, 89]
  • v < 50 (partial free): scaled to range [89, 178]

If pgmFormat is true, the vertical axis is flipped (for PGM format compatibility).

Parameters
map8SThe input occupancy grid map as a CV_8S single-channel matrix. Must contain values such as -1 (unknown), 0 (free), 100 (occupied).
pgmFormatIf true, output will be formatted for PGM file format (inverted Y-axis and different gray scale mapping).
Returns
A CV_8U grayscale image with pixel values representing occupancy status.
Exceptions
UASSERTif the input map is not a single-channel CV_8S matrix.

◆ convertImage8U2Map()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::convertImage8U2Map ( const cv::Mat &  map8U,
bool  pgmFormat = false 
)

Converts a grayscale occupancy image (CV_8U) to an occupancy grid map (CV_8S).

This function interprets grayscale pixel values from an input image and converts them into occupancy values used in a typical occupancy grid map:

  • 100: Occupied
  • 0: Free
  • -1: Unknown
  • -2: Free space under robot footprint (non-PGM only)

The interpretation differs slightly depending on whether the input image is in PGM format (common in ROS map_server) or in standard grayscale.

Parameters
map8UInput grayscale image (type CV_8U, single-channel).
pgmFormatIf true, assumes PGM format:
  • 0 = occupied
  • 254 = free
  • 205 = unknown If false (normal format):
  • 0 = occupied
  • 178 = free
  • 200 = footprint (free space under robot)
  • 89 = unknown
Returns
A CV_8S occupancy grid map with encoded occupancy values.
Exceptions
Assertionfailure if input image is not of type CV_8U or not single-channel.

◆ erodeMap()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::erodeMap ( const cv::Mat &  map)

Performs erosion on an occupancy grid map to reduce small noisy obstacles.

This function scans a given occupancy grid (CV_8SC1 format) and removes obstacle cells (value 100) that are surrounded by at least 3 empty cells (value 0) and no adjacent unknown cells (value -1). These obstacles are likely noise and are converted into empty space (value 0) in the resulting map.

Parameters
mapInput occupancy grid map of type CV_8SC1 where:
  • 100 represents obstacles,
  • 0 represents free space,
  • -1 represents unknown space.
Returns
A new cv::Mat of the same size and type as the input map, with eroded obstacles.

◆ segmentObstaclesFromGround() [3/3]

template<typename PointT >
void rtabmap::util3d::segmentObstaclesFromGround ( const typename pcl::PointCloud< PointT >::Ptr &  cloud,
const pcl::IndicesPtr &  indices,
pcl::IndicesPtr &  ground,
pcl::IndicesPtr &  obstacles,
int  normalKSearch,
float  groundNormalAngle,
float  clusterRadius,
int  minClusterSize,
bool  segmentFlatObstacles = false,
float  maxGroundHeight = 0.0f,
pcl::IndicesPtr *  flatObstacles = 0,
const Eigen::Vector4f &  viewPoint = Eigen::Vector4f(0, 0, 100, 0),
float  groundNormalsUp = 0 
)

Segments ground and obstacle indices from a point cloud using surface normals and clustering.

This function analyzes a point cloud to identify flat surfaces (e.g., ground) and separates them from potential obstacles based on normal orientation, height constraints, and optional clustering. Optionally, flat obstacles (e.g., tables, ramps) can be segmented separately.

Template Parameters
PointTThe type of point used in the point cloud (e.g., pcl::PointXYZ).
Parameters
cloudThe input point cloud.
indicesOptional input indices to consider from the cloud (e.g., from a prior ROI extraction).
groundOutput pointer where indices corresponding to ground points will be stored.
obstaclesOutput pointer where indices corresponding to obstacle points will be stored.
normalKSearchNumber of neighbors to use for normal estimation.
groundNormalAngleMaximum angle (in radians) between the estimated normal and the "up" direction for a surface to be considered ground.
clusterRadiusThe Euclidean distance threshold for clustering flat surfaces and obstacles.
minClusterSizeThe minimum number of points required to form a valid cluster.
segmentFlatObstaclesIf true, flat but non-ground surfaces (e.g., tables) are detected and optionally returned via flatObstacles.
maxGroundHeightMaximum Z-height for a surface to be considered ground (0 disables filtering). Note that all obstacle points under that threshold will be ignored (i.e., won't be returned in obstacles).
flatObstaclesOptional output pointer where indices corresponding to flat obstacles will be stored (only valid if segmentFlatObstacles is true).
viewPointThe viewpoint to use for normal estimation (important for consistent orientation).
groundNormalsUpThreshold (between 0 and 1) used to detect and flip ground-facing normals (set to 0.0f to disable). If the Z component of a normal is less than -groundNormalsUp and the corresponding point is below the viewpoint, the normal will be flipped.

◆ setRansacDeterministicSeed()

void RTABMAP_CORE_EXPORT rtabmap::util3d::setRansacDeterministicSeed ( bool  enable)

Toggle a deterministic seed for OpenGV's internal RANSAC RNG.

OpenGV's SampleConsensusProblem (and its multi-camera sibling) seeds its internal std::mt19937 from the system clock when default-constructed, which makes every estimateMotion3DTo2D() call non-reproducible across runs. Calling setRansacDeterministicSeed(true) reseeds OpenGV's RNG with the fixed value 12345 before each RANSAC pass so identical inputs always produce identical inlier sets, covariances and output transforms.

Intended for tests; production code should leave this off (default).

Parameters
enableIf true, force the deterministic seed; if false (default), use OpenGV's system-clock seed.

◆ ransacDeterministicSeedEnabled()

bool RTABMAP_CORE_EXPORT rtabmap::util3d::ransacDeterministicSeedEnabled ( )
Returns
Whether the deterministic-seed toggle is currently enabled.

◆ estimateMotion3DTo2D() [1/3]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::estimateMotion3DTo2D ( const std::map< int, cv::Point3f > &  words3A,
const std::map< int, cv::KeyPoint > &  words2B,
const CameraModel cameraModel,
int  minInliers = 10,
int  iterations = 100,
double  reprojError = 5.,
int  flagsPnP = 0,
int  pnpRefineIterations = 1,
int  varianceMedianRatio = 4,
float  maxVariance = 0,
const Transform guess = Transform::getIdentity(),
const std::map< int, cv::Point3f > &  words3B = std::map< int, cv::Point3f >(),
cv::Mat *  covariance = 0,
std::vector< int > *  matchesOut = 0,
std::vector< int > *  inliersOut = 0,
bool  splitLinearCovarianceComponents = false 
)

Estimates a 6-DOF camera transform from 3D-2D point correspondences using PnP RANSAC.

This function estimates the motion (transform) between two views by solving the Perspective-n-Point (PnP) problem using 3D points from one frame and their corresponding 2D keypoints in another frame. It optionally refines the result, computes covariance of the pose estimate, and handles degenerate cases.

Parameters
words3A3D points in frame A, indexed by feature ID.
words2B2D keypoints in frame B, indexed by feature ID (shared with words3A).
cameraModelIntrinsic and extrinsic parameters of the camera (must be valid).
minInliersMinimum number of inliers required to accept the estimated transform. If the value is <4, it is set internally to 4.
iterationsNumber of RANSAC iterations for PnP.
reprojErrorMaximum allowed reprojection error (in pixels) to consider a point an inlier.
flagsPnPFlags to control the cv::solvePnPRansac behavior (e.g., cv::SOLVEPNP_ITERATIVE).
refineIterationsNumber of iterations for non-linear optimization (set to 0 to disable refinement).
varianceMedianRatioIndex divisor used to select the robust variance threshold from sorted error residuals (e.g., 4 → use the 25% percentile).
maxVarianceMaximum allowed median variance (linear error). Estimates with higher variance are rejected.
guessInitial guess for the camera pose (must not be null). Typically from odometry or motion model.
words3BOptional 3D points in frame B (if available). Used to better estimate 3D errors and variances.
covarianceOptional output pointer for the estimated 6x6 pose covariance matrix. The matrix contains linear variance in the top-left 3x3 and angular variance in the bottom-right 3x3.
matchesOutOptional output vector of all matched IDs used (regardless of inlier status).
inliersOutOptional output vector of matched IDs that were determined to be inliers.
splitLinearCovarianceComponentsWhether to split and compute variance for X, Y, Z components separately.
Returns
The estimated transformation from frame B to frame A. If estimation fails or is rejected due to variance, a null transform is returned (i.e., transform.isNull() will be true).
Note
  • If words3B is provided, 3D variance is computed by comparing reprojected points to actual transformed points.
  • If words3B is empty, variance is estimated using reprojection error only.
  • The function assumes the camera model's local transform is known and factored into the pose estimation.
See also
cv::solvePnPRansac

◆ estimateMotion3DTo2D() [2/3]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::estimateMotion3DTo2D ( const std::map< int, cv::Point3f > &  words3A,
const std::map< int, cv::KeyPoint > &  words2B,
const std::vector< CameraModel > &  cameraModels,
unsigned int  samplingPolicy,
int  minInliers,
int  iterations,
double  reprojError,
int  flagsPnP,
int  refineIterations,
int  varianceMedianRatio,
float  maxVariance,
const Transform guess,
const std::map< int, cv::Point3f > &  words3B,
cv::Mat *  covariance,
std::vector< std::vector< int > > *  matchesOut,
std::vector< std::vector< int > > *  inliersOut,
bool  splitLinearCovarianceComponents 
)

Estimates the 3D-to-2D motion (pose) transformation between a set of 3D points and their corresponding 2D keypoints using the OpenGV library.

This function uses a robust multi-camera Perspective-n-Point (PnP) algorithm to estimate the transformation from a 3D point cloud (scene A) to a set of 2D keypoints (scene B) given the corresponding camera models and initial pose guess. The method supports multiple camera models and uses RANSAC with OpenGV for outlier rejection.

Parameters
words3A3D points in the source frame (scene A), indexed by feature ID.
words2B2D keypoints in the destination frame (scene B), indexed by feature ID.
cameraModelsList of camera models (multi-camera rig setup) for the destination frame.
samplingPolicySampling strategy (0 = auto, 1 = any, 2 = homogeneous multi-camera).
minInliersMinimum number of inliers required to consider the estimated transform as valid.
iterationsMaximum number of RANSAC iterations.
reprojErrorReprojection error threshold used by RANSAC.
flagsPnPPnP flags (not used internally).
refineIterationsNumber of pose refinement iterations after RANSAC (not used internally).
varianceMedianRatioDivider used to compute median-based variance from the error distribution.
maxVarianceMaximum allowed variance to accept the transform. Higher values permit more noisy estimates.
guessInitial guess of the transformation.
words3BOptional 3D points in destination frame (scene B) to evaluate the covariance using 3D correspondences, otherwise covariance is estimated from reprojection errors.
covarianceOptional output 6x6 covariance matrix of the estimated transform.
matchesOutOptional output: matches grouped per camera.
inliersOutOptional output: inliers grouped per camera.
splitLinearCovarianceComponentsIf true, linear covariance is split into separate x/y/z components.
Returns
The estimated Transform from scene A to scene B. Returns a null Transform if estimation fails or variance exceeds threshold.
Note
This function requires RTAB-Map to be built with OpenGV support.
Warning
The function assumes all camera models have the same image width and valid intrinsic parameters.
See also
https://github.com/laurentkneip/opengv

◆ estimateMotion3DTo2D() [3/3]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::estimateMotion3DTo2D ( const std::map< int, cv::Point3f > &  words3A,
const std::map< int, cv::KeyPoint > &  words2B,
const std::vector< CameraModel > &  cameraModels,
unsigned int  samplingPolicy = 0,
int  minInliers = 10,
int  iterations = 100,
double  reprojError = 5.,
int  flagsPnP = 0,
int  pnpRefineIterations = 1,
int  varianceMedianRatio = 4,
float  maxVariance = 0,
const Transform guess = Transform::getIdentity(),
const std::map< int, cv::Point3f > &  words3B = std::map< int, cv::Point3f >(),
cv::Mat *  covariance = 0,
std::vector< int > *  matchesOut = 0,
std::vector< int > *  inliersOut = 0,
bool  splitLinearCovarianceComponents = false 
)

Estimates the 3D-to-2D motion (pose) transformation between a set of 3D points and their corresponding 2D keypoints using the OpenGV library.

See also
estimateMotion3DTo2D(), the only difference is that output matches and inliers are combined in same vector instead of per camera

◆ estimateMotion3DTo3D()

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::estimateMotion3DTo3D ( const std::map< int, cv::Point3f > &  words3A,
const std::map< int, cv::Point3f > &  words3B,
int  minInliers = 10,
double  inliersDistance = 0.1,
int  iterations = 100,
int  refineIterations = 5,
cv::Mat *  covariance = 0,
std::vector< int > *  matchesOut = 0,
std::vector< int > *  inliersOut = 0 
)

Estimates the 3D rigid transformation between two sets of 3D points.

This function matches 3D points from two frames (A and B) using their unique IDs, filters correspondences based on a minimum number of inliers and distance threshold, and estimates the 6DoF transformation using PCL's RANSAC-based method.

Parameters
words3AA map of 3D points from the previous frame (id -> point).
words3BA map of 3D points from the current frame (id -> point).
minInliersMinimum number of inliers required to accept the transformation.
inliersDistanceMaximum distance between correspondences to be considered inliers.
iterationsMaximum number of RANSAC iterations.
refineIterationsNumber of iterations for refining the transformation after RANSAC.
covariance(Optional) Output 6x6 covariance matrix of the estimated transform.
matchesOut(Optional) Output vector of all matched point IDs (from words3A).
inliersOut(Optional) Output vector of inlier point IDs (subset of matchesOut).
Returns
A Transform object representing the estimated rigid body motion from frame B to A. If not enough inliers are found or the estimation fails, a null Transform is returned.

◆ solvePnPRansac()

void RTABMAP_CORE_EXPORT rtabmap::util3d::solvePnPRansac ( const std::vector< cv::Point3f > &  objectPoints,
const std::vector< cv::Point2f > &  imagePoints,
const cv::Mat &  cameraMatrix,
const cv::Mat &  distCoeffs,
cv::Mat &  rvec,
cv::Mat &  tvec,
bool  useExtrinsicGuess,
int  iterationsCount,
float  reprojectionError,
int  minInliersCount,
std::vector< int > &  inliers,
int  flags,
int  refineIterations = 1,
float  refineSigma = 3.0f 
)

Estimates the camera pose using the PnP RANSAC algorithm and optionally refines it.

This function computes the rotation and translation vectors (rvec, tvec) that transform 3D object points into the camera frame, using the Perspective-n-Point (PnP) method with RANSAC for robust outlier rejection. After an initial estimation using OpenCV's solvePnPRansac, it optionally refines the model iteratively based on reprojection error thresholds.

Parameters
objectPointsA vector of 3D points in the object coordinate space.
imagePointsA vector of corresponding 2D points in the image plane.
cameraMatrixThe camera intrinsic matrix (3x3).
distCoeffsVector of distortion coefficients (k1, k2, p1, p2, k3, ...).
rvecOutput rotation vector (Rodrigues form).
tvecOutput translation vector.
useExtrinsicGuessIf true, uses the provided rvec and tvec as an initial guess.
iterationsCountThe number of RANSAC iterations.
reprojectionErrorMaximum allowed reprojection error to classify an inlier.
minInliersCountMinimum number of inliers required to accept a model.
inliersOutput vector of indices of inlier points.
flagsMethod for solving PnP (cv::SOLVEPNP_* flags).
refineIterationsNumber of refinement iterations after RANSAC.
refineSigmaMultiplier for the reprojection error standard deviation to define adaptive inlier threshold.
Note
This function uses OpenCV 3's implementation of solvePnPRansac for robustness. After RANSAC, the pose is optionally refined by minimizing reprojection error on inliers.
Warning
Refinement may oscillate or terminate early if convergence is poor or the inlier set becomes unstable.
See also
cv::solvePnP, cv::solvePnPRansac

◆ transformFromXYZCorrespondencesSVD()

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::transformFromXYZCorrespondencesSVD ( const pcl::PointCloud< pcl::PointXYZ > &  cloud1,
const pcl::PointCloud< pcl::PointXYZ > &  cloud2 
)

Estimates the rigid 3D transformation between two point clouds using SVD.

This function computes the transformation (rotation and translation) that best aligns cloud2 to cloud1 using Singular Value Decomposition (SVD) based on point correspondences. It assumes a one-to-one correspondence between points in the two clouds.

Internally, it uses PCL's TransformationEstimationSVD to compute the 4x4 transformation matrix, which is then converted to a Transform object.

Parameters
cloud1Target point cloud (reference frame).
cloud2Source point cloud to be aligned with cloud1. It must have the same number of points as cloud1, and the points should correspond to each other by index.
Returns
A Transform representing the rigid-body transformation from cloud1 to cloud2.
Note
This function does not perform any outlier rejection or correspondence estimation— it assumes that the input clouds are already matched appropriately.

◆ transformFromXYZCorrespondences()

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::transformFromXYZCorrespondences ( const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &  cloud1,
const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &  cloud2,
double  inlierThreshold = 0.02,
int  iterations = 100,
int  refineModelIterations = 10,
double  refineModelSigma = 3.0,
std::vector< int > *  inliers = 0,
cv::Mat *  variance = 0 
)

Estimates a rigid transformation between two point clouds using RANSAC with optional refinement.

This function finds a 3D rigid-body transform from cloud1 to cloud2 using one-to-one point correspondences. It applies a RANSAC-based outlier rejection and optionally refines the transformation with iterative model optimization.

It also optionally returns the inlier indices used to compute the final model and an approximate 6x6 covariance matrix of the transform.

Parameters
cloud1Target point cloud (reference frame). Must contain at least 3 points and match cloud2 in size.
cloud2Source point cloud to align to cloud1. Must be the same size as cloud1.
inlierThresholdMaximum Euclidean distance (in meters) between corresponding points for them to be considered inliers.
iterationsNumber of RANSAC iterations to perform.
refineIterationsNumber of refinement steps to perform after the initial RANSAC. If set to 0, no refinement is done.
refineSigmaMultiplier for standard deviation used to adjust the inlier threshold during refinement.
inliersOutOptional pointer to a vector that will receive the indices of the inlier correspondences.
covarianceOptional pointer to a 6x6 covariance matrix of the estimated transform (as CV_64FC1). Will be identity if set and no inliers are found.
Returns
A Transform representing the estimated pose from cloud1 to cloud2. If no valid model is found, the returned transform will be identity.
Note
This function assumes a one-to-one correspondence between points in the two clouds (e.g., index i in cloud1 corresponds to index i in cloud2).
If fewer than 3 points are provided or point counts do not match, the identity transform is returned.
Warning
Inlier refinement is sensitive to oscillation and may stop early if alternating inlier counts are detected.

◆ icp() [1/2]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::icp ( const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &  cloud_source,
const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &  cloud_target,
double  maxCorrespondenceDistance,
int  maximumIterations,
bool &  hasConverged,
pcl::PointCloud< pcl::PointXYZ > &  cloud_source_registered,
float  epsilon = 0.0f,
bool  icp2D = false,
float  ransacOutlierRatio = 0.0f,
int *  iterationsDone = nullptr 
)

Performs Iterative Closest Point (ICP) alignment between two point clouds and returns the resulting transform.

This function aligns the cloud_source to the cloud_target using PCL's ICP algorithm. It optionally supports 2D ICP, which constrains the estimated transformation to the XY-plane with rotation about the Z-axis.

The result is returned as a Transform representing the transformation from source to target. The aligned version of the source cloud is written into cloud_source_registered.

Parameters
cloud_sourceThe input source point cloud to align.
cloud_targetThe input target point cloud to align to.
maxCorrespondenceDistanceMaximum distance threshold for point correspondences.
maximumIterationsMaximum number of ICP iterations to perform.
[out]hasConvergedSet to true if ICP converged to a solution; false otherwise.
[out]cloud_source_registeredOutput point cloud containing the source aligned to the target.
epsilonConvergence threshold for transformation changes between iterations (applied as squared value).
icp2DIf true, enforces 2D ICP using only XY translation and Z rotation (ignores Z and X/Y rotation).
Returns
Transform The estimated transformation from cloud_source to cloud_target.
Note
All input points in both clouds must be finite (i.e., no NaNs or infinite values).
See also
pcl::IterativeClosestPoint
pcl::registration::TransformationEstimation2D

◆ icp() [2/2]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::icp ( const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &  cloud_source,
const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &  cloud_target,
double  maxCorrespondenceDistance,
int  maximumIterations,
bool &  hasConverged,
pcl::PointCloud< pcl::PointXYZI > &  cloud_source_registered,
float  epsilon = 0.0f,
bool  icp2D = false,
float  ransacOutlierRatio = 0.0f,
int *  iterationsDone = nullptr 
)

Performs Iterative Closest Point (ICP) alignment between two point clouds and returns the resulting transform.

See also
util3d::icp()
Parameters
ransacOutlierRatioIf > 0 and < 1, install a PCL RANSAC correspondence rejector with inlier threshold = ransacOutlierRatio * maxCorrespondenceDistance. 0 disables the rejector (default).

◆ icpPointToPlane() [1/2]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::icpPointToPlane ( const pcl::PointCloud< pcl::PointNormal >::ConstPtr &  cloud_source,
const pcl::PointCloud< pcl::PointNormal >::ConstPtr &  cloud_target,
double  maxCorrespondenceDistance,
int  maximumIterations,
bool &  hasConverged,
pcl::PointCloud< pcl::PointNormal > &  cloud_source_registered,
float  epsilon = 0.0f,
bool  icp2D = false,
float  ransacOutlierRatio = 0.0f,
int *  iterationsDone = nullptr 
)

Performs Iterative Closest Point (ICP) alignment using a point-to-plane error metric.

This function aligns a source point cloud to a target point cloud using PCL's point-to-plane ICP implementation with a linear least squares estimator. It returns the estimated transformation from the source to the target.

Optionally, if icp2D is true, the resulting transformation is projected to 3DoF (XY translation and rotation about Z).

Parameters
cloud_sourceInput source point cloud with normals.
cloud_targetInput target point cloud with normals.
maxCorrespondenceDistanceMaximum distance for considering point correspondences.
maximumIterationsMaximum number of ICP iterations to perform.
[out]hasConvergedSet to true if the ICP algorithm successfully converged.
[out]cloud_source_registeredOutput cloud representing the aligned source.
epsilonConvergence threshold for the transformation change (used as squared value).
icp2DIf true, the result is projected to 2D (XY + Yaw only).
Returns
The transformation from the source to the target cloud.
Note
All points and normals in both input clouds must be finite (no NaNs or infinities).
See also
pcl::IterativeClosestPoint
pcl::registration::TransformationEstimationPointToPlaneLLS

◆ icpPointToPlane() [2/2]

Transform RTABMAP_CORE_EXPORT rtabmap::util3d::icpPointToPlane ( const pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr &  cloud_source,
const pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr &  cloud_target,
double  maxCorrespondenceDistance,
int  maximumIterations,
bool &  hasConverged,
pcl::PointCloud< pcl::PointXYZINormal > &  cloud_source_registered,
float  epsilon = 0.0f,
bool  icp2D = false,
float  ransacOutlierRatio = 0.0f,
int *  iterationsDone = nullptr 
)

Performs Iterative Closest Point (ICP) alignment using a point-to-plane error metric.

See also
util3d::icpPointToPlane()
Parameters
ransacOutlierRatioIf > 0 and < 1, install a PCL RANSAC correspondence rejector with inlier threshold = ransacOutlierRatio * maxCorrespondenceDistance. 0 disables the rejector (default).

◆ createPolygonIndexes()

void RTABMAP_CORE_EXPORT rtabmap::util3d::createPolygonIndexes ( const std::vector< pcl::Vertices > &  polygons,
int  cloudSize,
std::vector< std::set< int > > &  neighborPolygons,
std::vector< std::set< int > > &  vertexPolygons 
)

Given a set of polygons, create two indexes: polygons to neighbor polygons and vertices to polygons.

Parameters
polygonsthe polygons to be indexed.
cloudSizethe size of the cloud of the corresponding mesh to polygons (must be at least as high as the highest vertex value contained in the polygons).
neighborPolygonsreturned index from polygons to neighbor polygons (index size = polygons size).
vertexPolygonsreturned index from vertices to polygons (index size = cloudSize).

◆ cleanTextureMesh()

void RTABMAP_CORE_EXPORT rtabmap::util3d::cleanTextureMesh ( pcl::TextureMesh &  textureMesh,
int  minClusterSize 
)

Remove not textured polygon clusters. If minClusterSize<0, only the largest cluster is kept.

◆ mergeTextures()

cv::Mat RTABMAP_CORE_EXPORT rtabmap::util3d::mergeTextures ( pcl::TextureMesh &  mesh,
const std::map< int, cv::Mat > &  images,
const std::map< int, CameraModel > &  calibrations,
const Memory memory = 0,
const DBDriver dbDriver = 0,
int  textureSize = 4096,
int  textureCount = 1,
const std::vector< std::map< int, pcl::PointXY > > &  vertexToPixels = std::vector< std::map< int, pcl::PointXY > >(),
bool  gainCompensation = true,
float  gainBeta = 10.0f,
bool  gainRGB = true,
bool  blending = true,
int  blendingDecimation = 0,
int  brightnessContrastRatioLow = 0,
int  brightnessContrastRatioHigh = 0,
bool  exposureFusion = false,
const ProgressState state = 0,
unsigned char  blankValue = 255,
bool  clearVertexColorUnderTexture = true,
std::map< int, std::map< int, cv::Vec4d > > *  gains = 0,
std::map< int, std::map< int, cv::Mat > > *  blendingGains = 0,
std::pair< float, float > *  contrastValues = 0 
)

Merge all textures in the mesh into "textureCount" textures of size "textureSize".

Returns
merged textures corresponding to new materials set in TextureMesh (height=textureSize, width=textureSize*materials)

◆ multiBandTexturing()

bool RTABMAP_CORE_EXPORT rtabmap::util3d::multiBandTexturing ( const std::string &  outputOBJPath,
const pcl::PCLPointCloud2 &  cloud,
const std::vector< pcl::Vertices > &  polygons,
const std::map< int, Transform > &  cameraPoses,
const std::vector< std::map< int, pcl::PointXY > > &  vertexToPixels,
const std::map< int, cv::Mat > &  images,
const std::map< int, std::vector< CameraModel > > &  cameraModels,
const Memory memory = 0,
const DBDriver dbDriver = 0,
unsigned int  textureSize = 8192,
unsigned int  textureDownscale = 2,
const std::string &  nbContrib = "1 5 10 0",
const std::string &  textureFormat = "jpg",
const std::map< int, std::map< int, cv::Vec4d > > &  gains = std::map< int, std::map< int, cv::Vec4d > >(),
const std::map< int, std::map< int, cv::Mat > > &  blendingGains = std::map< int, std::map< int, cv::Mat > >(),
const std::pair< float, float > &  contrastValues = std::pair< float, float >(0, 0),
bool  gainRGB = true,
unsigned int  unwrapMethod = 0,
bool  fillHoles = false,
unsigned int  padding = 5,
double  bestScoreThreshold = 0.1,
double  angleHardThreshold = 90.0,
bool  forceVisibleByAllVertices = false 
)

Texture mesh with AliceVision's multiband texturing approach. See also https://meshroom-manual.readthedocs.io/en/bibtex1/node-reference/nodes/Texturing.html.

Parameters
outputOBJPathOutput OBJ path
cloudinput Cloud of the mesh.
polygonsInput polygons of the mesh.
cameraPosesPoses of the cameras.
vertexToPixelsOutput from createTextureMesh().
imagesImages corresponding to cameraPoses, raw or compressed, can be empty if memory or dbDriver should be used.
cameraModelsCamera calibrations corresponding to cameraPoses.
memoryShould be set if images and dbDriver are not set.
dbDriverShould be set if images and memory are not set.
textureSizeOutput texture size 1024, 2048, 4096, 8192, 16384.
textureDownscaleDownscaling to 4 or 8 will reduce the texture quality but speed up the computation time. Set Texture Downscale to 1 instead of 2 to get the maximum possible resolution with the resolution of your images. The output texture size will be divided by this value, e.g., with texture size of 8192 and downscale value of 2, the output will be 4096.
nbContribnumber of contributions per frequency band for the multi-band blending (should be 4 values)
textureFormatOutput texture format: "png" or "jpg".
gainsOptional output of mergeTextures().
blendingGainsOptional output of mergeTextures().
contrastValuesOptional output of mergeTextures().
gainRGBApply gain compensation on each RGB channels separately, otherwise it is apply equally to all channels.
unwrapMethodMethod to unwrap input mesh if it does not have UV coordinates 0=Basic (> 600k faces) fast and simple. Can generate multiple atlases 2=LSCM (<= 600k faces): optimize space. Generates one atlas 1=ABF (<= 300k faces): optimize space and stretch. Generates one atlas.
fillHolesFill Texture holes with plausible values True/False.
paddingTexture edge padding size in pixel (0-100).
bestScoreThreshold0.0 to disable filtering based on threshold to relative best score (0.0-1.0).
angleHardThreshold0.0 to disable angle hard threshold filtering (0.0, 180.0).
forceVisibleByAllVerticesTriangle visibility is based on the union of vertices visibility.

◆ intersectRayTriangle()

bool RTABMAP_CORE_EXPORT rtabmap::util3d::intersectRayTriangle ( const Eigen::Vector3f &  p,
const Eigen::Vector3f &  dir,
const Eigen::Vector3f &  v0,
const Eigen::Vector3f &  v1,
const Eigen::Vector3f &  v2,
float &  distance,
Eigen::Vector3f &  normal 
)

intersectRayTriangle(): find the 3D intersection of a ray with a triangle Input: p = origin of the ray dir = direction of the ray v0 = point 0 of the triangle v1 = point 1 of the triangle v2 = point 2 of the triangle Output: distance = distance from origin along ray direction normal = normal of the triangle (not normalized) Return: true = intersect in unique point inside the triangle

Intersection point can be computed with "I = p + dir*distance"

Copyright 2001 softSurfer, 2012 Dan Sunday This code may be freely used and modified for any purpose providing that this copyright notice is included with it. SoftSurfer makes no warranty for this code, and cannot be held liable for any real or imagined damage resulting from its use. Users of this code must verify correctness for their application.

Mathieu: Adapted for PCL format

◆ transformLaserScan()

LaserScan RTABMAP_CORE_EXPORT rtabmap::util3d::transformLaserScan ( const LaserScan laserScan,
const Transform transform 
)

Applies a 3D transform to all points (and normals if present) in a LaserScan.

This function transforms each point in the input LaserScan using the specified Transform. The transformation is applied on a cloned copy of the scan data, preserving the original. It supports both 2D and 3D scans, and if normals are present, they are also properly transformed.

The transformation is only applied if it is neither null nor the identity transform.

Parameters
laserScanThe input LaserScan object containing scan data to be transformed.
transformA Transform representing the spatial transformation to apply (translation + rotation). Can be 3DoF or 6DoF depending on the scan dimensionality.
Returns
A new LaserScan object with transformed points (and optionally normals), and the same metadata such as range limits, angle information, format, and local transform as the input scan.

Behavior:

  • If the transform is null or identity, the scan is returned unchanged.
  • If the scan has normals (e.g., format is kXYZNormal, kXYZINormal, etc.), both positions and normals are transformed.
  • If the scan has no normals, only point positions are transformed.
  • Angle-based scans (2D with valid angle increment) retain angular properties in the returned object.
  • The localTransform of the original scan is preserved in the returned scan.

Supported Formats:

This function works with all valid formats defined by LaserScan::Format, including:

  • 2D: kXY, kXYI, kXYNormal, kXYINormal
  • 3D: kXYZ, kXYZI, kXYZNormal, kXYZINormal, kXYZRGB, kXYZRGBNormal, kXYZIT
See also
LaserScan, Transform, util3d::transformPoint()