28#ifndef UTIL3D_FILTERING_H_
29#define UTIL3D_FILTERING_H_
31#include <rtabmap/core/rtabmap_core_export.h>
32#include <rtabmap/core/Transform.h>
33#include <pcl/point_cloud.h>
34#include <pcl/point_types.h>
35#include <pcl/pcl_base.h>
36#include <pcl/ModelCoefficients.h>
37#include <rtabmap/core/LaserScan.h>
82 float rangeMin = 0.0f,
83 float rangeMax = 0.0f,
84 float voxelSize = 0.0f,
86 float normalRadius = 0.0f,
87 float groundNormalsUp = 0.0f);
100 bool forceGroundNormalsUp);
144 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
145 const pcl::IndicesPtr & indices,
150 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
151 const pcl::IndicesPtr & indices,
156 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
157 const pcl::IndicesPtr & indices,
162 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
163 const pcl::IndicesPtr & indices,
189 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
190 const pcl::IndicesPtr & indices,
192 pcl::IndicesPtr & closeIndices,
193 pcl::IndicesPtr & farIndices);
196 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
197 const pcl::IndicesPtr & indices,
199 pcl::IndicesPtr & closeIndices,
200 pcl::IndicesPtr & farIndices);
203 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
204 const pcl::IndicesPtr & indices,
206 pcl::IndicesPtr & closeIndices,
207 pcl::IndicesPtr & farIndices);
210 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
211 const pcl::IndicesPtr & indices,
213 pcl::IndicesPtr & closeIndices,
214 pcl::IndicesPtr & farIndices);
243pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
downsample(
244 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
247pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
downsample(
248 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
251pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
downsample(
252 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
255pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
downsample(
256 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
259pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
downsample(
260 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
263pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
downsample(
264 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
292pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
voxelize(
293 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
294 const pcl::IndicesPtr & indices,
297pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
298 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
299 const pcl::IndicesPtr & indices,
302pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
voxelize(
303 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
304 const pcl::IndicesPtr & indices,
307pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
308 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
309 const pcl::IndicesPtr & indices,
312pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
voxelize(
313 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
314 const pcl::IndicesPtr & indices,
317pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
318 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
319 const pcl::IndicesPtr & indices,
322pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
voxelize(
323 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
326pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
327 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
330pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
voxelize(
331 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
334pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
335 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
338pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
voxelize(
339 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
342pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
343 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
360 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
378 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
396 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
420 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
424 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
428 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
432 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
436 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
440 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
469 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
470 const pcl::IndicesPtr & indices,
471 const std::string & axis,
474 bool negative =
false);
477 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
478 const pcl::IndicesPtr & indices,
479 const std::string & axis,
482 bool negative =
false);
485 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
486 const pcl::IndicesPtr & indices,
487 const std::string & axis,
490 bool negative =
false);
493 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
494 const pcl::IndicesPtr & indices,
495 const std::string & axis,
498 bool negative =
false);
501 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
502 const pcl::IndicesPtr & indices,
503 const std::string & axis,
506 bool negative =
false);
509 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
510 const pcl::IndicesPtr & indices,
511 const std::string & axis,
514 bool negative =
false);
516pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
passThrough(
517 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
518 const std::string & axis,
521 bool negative =
false);
523pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
passThrough(
524 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
525 const std::string & axis,
528 bool negative =
false);
530pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
passThrough(
531 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
532 const std::string & axis,
535 bool negative =
false);
537pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
passThrough(
538 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
539 const std::string & axis,
542 bool negative =
false);
544pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
passThrough(
545 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
546 const std::string & axis,
549 bool negative =
false);
551pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
passThrough(
552 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
553 const std::string & axis,
556 bool negative =
false);
583 const pcl::PCLPointCloud2::Ptr & cloud,
584 const pcl::IndicesPtr & indices,
585 const Eigen::Vector4f & min,
586 const Eigen::Vector4f & max,
588 bool negative =
false);
591 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
592 const pcl::IndicesPtr & indices,
593 const Eigen::Vector4f & min,
594 const Eigen::Vector4f & max,
596 bool negative =
false);
599 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
600 const pcl::IndicesPtr & indices,
601 const Eigen::Vector4f & min,
602 const Eigen::Vector4f & max,
604 bool negative =
false);
607 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
608 const pcl::IndicesPtr & indices,
609 const Eigen::Vector4f & min,
610 const Eigen::Vector4f & max,
612 bool negative =
false);
615 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
616 const pcl::IndicesPtr & indices,
617 const Eigen::Vector4f & min,
618 const Eigen::Vector4f & max,
620 bool negative =
false);
623 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
624 const pcl::IndicesPtr & indices,
625 const Eigen::Vector4f & min,
626 const Eigen::Vector4f & max,
628 bool negative =
false);
631 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
632 const pcl::IndicesPtr & indices,
633 const Eigen::Vector4f & min,
634 const Eigen::Vector4f & max,
636 bool negative =
false);
638pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
cropBox(
639 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
640 const Eigen::Vector4f & min,
641 const Eigen::Vector4f & max,
643 bool negative =
false);
645pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
cropBox(
646 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
647 const Eigen::Vector4f & min,
648 const Eigen::Vector4f & max,
650 bool negative =
false);
652pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
cropBox(
653 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
654 const Eigen::Vector4f & min,
655 const Eigen::Vector4f & max,
657 bool negative =
false);
659pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
cropBox(
660 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
661 const Eigen::Vector4f & min,
662 const Eigen::Vector4f & max,
664 bool negative =
false);
666pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
cropBox(
667 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
668 const Eigen::Vector4f & min,
669 const Eigen::Vector4f & max,
671 bool negative =
false);
673pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
cropBox(
674 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
675 const Eigen::Vector4f & min,
676 const Eigen::Vector4f & max,
678 bool negative =
false);
714 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
715 const pcl::IndicesPtr & indices,
719 float nearClipPlaneDistance,
720 float farClipPlaneDistance,
721 bool negative =
false);
724 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
728 float nearClipPlaneDistance,
729 float farClipPlaneDistance,
730 bool negative =
false);
733 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
737 float nearClipPlaneDistance,
738 float farClipPlaneDistance,
739 bool negative =
false);
760 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud);
763 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud);
766 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud);
769 const pcl::PCLPointCloud2::Ptr & cloud);
788 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud);
791 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud);
794 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud);
822 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
824 int minNeighborsInRadius);
827 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
829 int minNeighborsInRadius);
832 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
834 int minNeighborsInRadius);
837 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
839 int minNeighborsInRadius);
842 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
844 int minNeighborsInRadius);
847 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
849 int minNeighborsInRadius);
852 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
853 const pcl::IndicesPtr & indices,
855 int minNeighborsInRadius);
858 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
859 const pcl::IndicesPtr & indices,
861 int minNeighborsInRadius);
864 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
865 const pcl::IndicesPtr & indices,
867 int minNeighborsInRadius);
870 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
871 const pcl::IndicesPtr & indices,
873 int minNeighborsInRadius);
876 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
877 const pcl::IndicesPtr & indices,
879 int minNeighborsInRadius);
882 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
883 const pcl::IndicesPtr & indices,
885 int minNeighborsInRadius);
927 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
928 const std::vector<int> & viewpointIndices,
929 const std::map<int, Transform> & viewpoints,
931 float neighborScale=2.0f);
934 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
935 const std::vector<int> & viewpointIndices,
936 const std::map<int, Transform> & viewpoints,
938 float neighborScale=2.0f);
941 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
942 const std::vector<int> & viewpointIndices,
943 const std::map<int, Transform> & viewpoints,
945 float neighborScale=2.0f);
948 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
949 const std::vector<int> & viewpointIndices,
950 const std::map<int, Transform> & viewpoints,
952 float neighborScale=2.0f);
955 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
956 const std::vector<int> & viewpointIndices,
957 const std::map<int, Transform> & viewpoints,
959 float neighborScale=2.0f);
962 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
963 const std::vector<int> & viewpointIndices,
964 const std::map<int, Transform> & viewpoints,
966 float neighborScale=2.0f);
970 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
971 const pcl::IndicesPtr & indices,
972 const std::vector<int> & viewpointIndices,
973 const std::map<int, Transform> & viewpoints,
975 float neighborScale=2.0f);
978 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
979 const pcl::IndicesPtr & indices,
980 const std::vector<int> & viewpointIndices,
981 const std::map<int, Transform> & viewpoints,
983 float neighborScale=2.0f);
986 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
987 const pcl::IndicesPtr & indices,
988 const std::vector<int> & viewpointIndices,
989 const std::map<int, Transform> & viewpoints,
991 float neighborScale=2.0f);
994 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
995 const pcl::IndicesPtr & indices,
996 const std::vector<int> & viewpointIndices,
997 const std::map<int, Transform> & viewpoints,
999 float neighborScale=2.0f);
1002 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1003 const pcl::IndicesPtr & indices,
1004 const std::vector<int> & viewpointIndices,
1005 const std::map<int, Transform> & viewpoints,
1007 float neighborScale=2.0f);
1010 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1011 const pcl::IndicesPtr & indices,
1012 const std::vector<int> & viewpointIndices,
1013 const std::map<int, Transform> & viewpoints,
1015 float neighborScale=2.0f);
1041 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1042 const pcl::IndicesPtr & indices,
1043 const pcl::PointCloud<pcl::PointXYZ>::Ptr & subtractCloud,
1044 const pcl::IndicesPtr & subtractIndices,
1046 int minNeighborsInRadius = 1);
1049 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1050 const pcl::IndicesPtr & indices,
1051 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & subtractCloud,
1052 const pcl::IndicesPtr & subtractIndices,
1054 int minNeighborsInRadius = 1);
1057 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1058 const pcl::IndicesPtr & indices,
1059 const pcl::PointCloud<pcl::PointNormal>::Ptr & subtractCloud,
1060 const pcl::IndicesPtr & subtractIndices,
1062 float maxAngle = M_PI/4.0f,
1063 int minNeighborsInRadius = 1);
1066 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1067 const pcl::IndicesPtr & indices,
1068 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & subtractCloud,
1069 const pcl::IndicesPtr & subtractIndices,
1071 float maxAngle = M_PI/4.0f,
1072 int minNeighborsInRadius = 1);
1075 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1076 const pcl::IndicesPtr & indices,
1077 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & subtractCloud,
1078 const pcl::IndicesPtr & subtractIndices,
1080 float maxAngle = M_PI/4.0f,
1081 int minNeighborsInRadius = 1);
1084 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1085 const pcl::PointCloud<pcl::PointXYZ>::Ptr & subtractCloud,
1087 int minNeighborsInRadius = 1);
1090 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1091 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & subtractCloud,
1093 int minNeighborsInRadius = 1);
1096 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1097 const pcl::PointCloud<pcl::PointNormal>::Ptr & subtractCloud,
1099 float maxAngle = M_PI/4.0f,
1100 int minNeighborsInRadius = 1);
1103 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1104 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & subtractCloud,
1106 float maxAngle = M_PI/4.0f,
1107 int minNeighborsInRadius = 1);
1110 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1111 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & subtractCloud,
1113 float maxAngle = M_PI/4.0f,
1114 int minNeighborsInRadius = 1);
1139 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1140 const pcl::IndicesPtr & indices,
1141 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & subtractCloud,
1142 const pcl::IndicesPtr & subtractIndices,
1143 float radiusSearchRatio = 0.01,
1144 int minNeighborsInRadius = 1,
1145 const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
1175 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1176 const pcl::IndicesPtr & indices,
1177 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & subtractCloud,
1178 const pcl::IndicesPtr & subtractIndices,
1179 float radiusSearchRatio = 0.01,
1180 float maxAngle = M_PI/4.0f,
1181 int minNeighborsInRadius = 1,
1182 const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
1216 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1218 const Eigen::Vector4f & normal,
1220 const Eigen::Vector4f & viewpoint,
1221 float groundNormalsUp = 0.0f);
1224 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1226 const Eigen::Vector4f & normal,
1228 const Eigen::Vector4f & viewpoint,
1229 float groundNormalsUp = 0.0f);
1232 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1233 const pcl::IndicesPtr & indices,
1235 const Eigen::Vector4f & normal,
1237 const Eigen::Vector4f & viewpoint,
1238 float groundNormalsUp = 0.0f);
1241 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1242 const pcl::IndicesPtr & indices,
1244 const Eigen::Vector4f & normal,
1246 const Eigen::Vector4f & viewpoint,
1247 float groundNormalsUp = 0.0f);
1250 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1251 const pcl::IndicesPtr & indices,
1253 const Eigen::Vector4f & normal,
1255 const Eigen::Vector4f & viewpoint,
1256 float groundNormalsUp = 0.0f);
1259 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1260 const pcl::IndicesPtr & indices,
1262 const Eigen::Vector4f & normal,
1264 const Eigen::Vector4f & viewpoint,
1265 float groundNormalsUp = 0.0f);
1268 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1269 const pcl::IndicesPtr & indices,
1271 const Eigen::Vector4f & normal,
1273 const Eigen::Vector4f & viewpoint,
1274 float groundNormalsUp = 0.0f);
1277 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1278 const pcl::IndicesPtr & indices,
1280 const Eigen::Vector4f & normal,
1282 const Eigen::Vector4f & viewpoint,
1283 float groundNormalsUp = 0.0f);
1312 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1313 float clusterTolerance,
1315 int maxClusterSize = std::numeric_limits<int>::max(),
1316 int * biggestClusterIndex = 0);
1319 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1320 float clusterTolerance,
1322 int maxClusterSize = std::numeric_limits<int>::max(),
1323 int * biggestClusterIndex = 0);
1326 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1327 const pcl::IndicesPtr & indices,
1328 float clusterTolerance,
1330 int maxClusterSize = std::numeric_limits<int>::max(),
1331 int * biggestClusterIndex = 0);
1334 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1335 const pcl::IndicesPtr & indices,
1336 float clusterTolerance,
1338 int maxClusterSize = std::numeric_limits<int>::max(),
1339 int * biggestClusterIndex = 0);
1342 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1343 const pcl::IndicesPtr & indices,
1344 float clusterTolerance,
1346 int maxClusterSize = std::numeric_limits<int>::max(),
1347 int * biggestClusterIndex = 0);
1350 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1351 const pcl::IndicesPtr & indices,
1352 float clusterTolerance,
1354 int maxClusterSize = std::numeric_limits<int>::max(),
1355 int * biggestClusterIndex = 0);
1358 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1359 const pcl::IndicesPtr & indices,
1360 float clusterTolerance,
1362 int maxClusterSize = std::numeric_limits<int>::max(),
1363 int * biggestClusterIndex = 0);
1366 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1367 const pcl::IndicesPtr & indices,
1368 float clusterTolerance,
1370 int maxClusterSize = std::numeric_limits<int>::max(),
1371 int * biggestClusterIndex = 0);
1399 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1400 const pcl::IndicesPtr & indices,
1404 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1405 const pcl::IndicesPtr & indices,
1409 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1410 const pcl::IndicesPtr & indices,
1414 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1415 const pcl::IndicesPtr & indices,
1419 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1420 const pcl::IndicesPtr & indices,
1424 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1425 const pcl::IndicesPtr & indices,
1429 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1430 const pcl::IndicesPtr & indices,
1432 bool keepOrganized);
1435 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1436 const pcl::IndicesPtr & indices,
1438 bool keepOrganized);
1441 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1442 const pcl::IndicesPtr & indices,
1444 bool keepOrganized);
1447 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1448 const pcl::IndicesPtr & indices,
1450 bool keepOrganized);
1453 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1454 const pcl::IndicesPtr & indices,
1456 bool keepOrganized);
1480 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1481 const pcl::IndicesPtr & indices,
1482 float distanceThreshold,
1483 int maxIterations = 100,
1484 pcl::ModelCoefficients * coefficientsOut = 0);
1486 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1487 float distanceThreshold,
1488 int maxIterations = 100,
1489 pcl::ModelCoefficients * coefficientsOut = 0);
Represents 2D or 3D laser scan data with support for multiple point data formats.
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 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::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.
LaserScan RTABMAP_CORE_EXPORT downsample(const LaserScan &cloud, int step)
Downsamples a LaserScan.
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.
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 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 radiusFiltering(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
Radius filtering for point cloud of type pcl::PointXYZ.
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::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::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::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::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::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.
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,...
pcl::PointCloud< pcl::PointXYZ >::Ptr uniformSampling(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float voxelSize)
DEPRECATED: Use voxelize() instead.
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.
LaserScan RTABMAP_CORE_EXPORT rangeFiltering(const LaserScan &scan, float rangeMin, float rangeMax)
Filters a LaserScan data on a minimum and maximum Euclidean range.