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>
86 float rangeMin = 0.0f,
87 float rangeMax = 0.0f,
88 float voxelSize = 0.0f,
90 float normalRadius = 0.0f,
91 float groundNormalsUp = 0.0f);
104 bool forceGroundNormalsUp);
148 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
149 const pcl::IndicesPtr & indices,
154 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
155 const pcl::IndicesPtr & indices,
160 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
161 const pcl::IndicesPtr & indices,
166 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
167 const pcl::IndicesPtr & indices,
193 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
194 const pcl::IndicesPtr & indices,
196 pcl::IndicesPtr & closeIndices,
197 pcl::IndicesPtr & farIndices);
200 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
201 const pcl::IndicesPtr & indices,
203 pcl::IndicesPtr & closeIndices,
204 pcl::IndicesPtr & farIndices);
207 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
208 const pcl::IndicesPtr & indices,
210 pcl::IndicesPtr & closeIndices,
211 pcl::IndicesPtr & farIndices);
214 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
215 const pcl::IndicesPtr & indices,
217 pcl::IndicesPtr & closeIndices,
218 pcl::IndicesPtr & farIndices);
247pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
downsample(
248 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
251pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
downsample(
252 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
255pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
downsample(
256 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
259pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
downsample(
260 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
263pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
downsample(
264 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
267pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
downsample(
268 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
296pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
voxelize(
297 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
298 const pcl::IndicesPtr & indices,
301pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
302 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
303 const pcl::IndicesPtr & indices,
306pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
voxelize(
307 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
308 const pcl::IndicesPtr & indices,
311pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
312 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
313 const pcl::IndicesPtr & indices,
316pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
voxelize(
317 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
318 const pcl::IndicesPtr & indices,
321pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
322 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
323 const pcl::IndicesPtr & indices,
326pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
voxelize(
327 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
330pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
331 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
334pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
voxelize(
335 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
338pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
339 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
342pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
voxelize(
343 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
346pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
voxelize(
347 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
364 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
382 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
400 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
424 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
428 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
432 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
436 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
440 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
444 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
473 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
474 const pcl::IndicesPtr & indices,
475 const std::string & axis,
478 bool negative =
false);
481 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
482 const pcl::IndicesPtr & indices,
483 const std::string & axis,
486 bool negative =
false);
489 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
490 const pcl::IndicesPtr & indices,
491 const std::string & axis,
494 bool negative =
false);
497 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
498 const pcl::IndicesPtr & indices,
499 const std::string & axis,
502 bool negative =
false);
505 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
506 const pcl::IndicesPtr & indices,
507 const std::string & axis,
510 bool negative =
false);
513 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
514 const pcl::IndicesPtr & indices,
515 const std::string & axis,
518 bool negative =
false);
520pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
passThrough(
521 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
522 const std::string & axis,
525 bool negative =
false);
527pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
passThrough(
528 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
529 const std::string & axis,
532 bool negative =
false);
534pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
passThrough(
535 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
536 const std::string & axis,
539 bool negative =
false);
541pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
passThrough(
542 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
543 const std::string & axis,
546 bool negative =
false);
548pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
passThrough(
549 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
550 const std::string & axis,
553 bool negative =
false);
555pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
passThrough(
556 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
557 const std::string & axis,
560 bool negative =
false);
587 const pcl::PCLPointCloud2::Ptr & cloud,
588 const pcl::IndicesPtr & indices,
589 const Eigen::Vector4f & min,
590 const Eigen::Vector4f & max,
592 bool negative =
false);
595 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
596 const pcl::IndicesPtr & indices,
597 const Eigen::Vector4f & min,
598 const Eigen::Vector4f & max,
600 bool negative =
false);
603 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
604 const pcl::IndicesPtr & indices,
605 const Eigen::Vector4f & min,
606 const Eigen::Vector4f & max,
608 bool negative =
false);
611 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
612 const pcl::IndicesPtr & indices,
613 const Eigen::Vector4f & min,
614 const Eigen::Vector4f & max,
616 bool negative =
false);
619 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
620 const pcl::IndicesPtr & indices,
621 const Eigen::Vector4f & min,
622 const Eigen::Vector4f & max,
624 bool negative =
false);
627 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
628 const pcl::IndicesPtr & indices,
629 const Eigen::Vector4f & min,
630 const Eigen::Vector4f & max,
632 bool negative =
false);
635 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
636 const pcl::IndicesPtr & indices,
637 const Eigen::Vector4f & min,
638 const Eigen::Vector4f & max,
640 bool negative =
false);
642pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_CORE_EXPORT
cropBox(
643 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
644 const Eigen::Vector4f & min,
645 const Eigen::Vector4f & max,
647 bool negative =
false);
649pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_CORE_EXPORT
cropBox(
650 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
651 const Eigen::Vector4f & min,
652 const Eigen::Vector4f & max,
654 bool negative =
false);
656pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_CORE_EXPORT
cropBox(
657 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
658 const Eigen::Vector4f & min,
659 const Eigen::Vector4f & max,
661 bool negative =
false);
663pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_CORE_EXPORT
cropBox(
664 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
665 const Eigen::Vector4f & min,
666 const Eigen::Vector4f & max,
668 bool negative =
false);
670pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT
cropBox(
671 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
672 const Eigen::Vector4f & min,
673 const Eigen::Vector4f & max,
675 bool negative =
false);
677pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_CORE_EXPORT
cropBox(
678 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
679 const Eigen::Vector4f & min,
680 const Eigen::Vector4f & max,
682 bool negative =
false);
718 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
719 const pcl::IndicesPtr & indices,
723 float nearClipPlaneDistance,
724 float farClipPlaneDistance,
725 bool negative =
false);
728 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
732 float nearClipPlaneDistance,
733 float farClipPlaneDistance,
734 bool negative =
false);
737 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
741 float nearClipPlaneDistance,
742 float farClipPlaneDistance,
743 bool negative =
false);
764 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud);
767 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud);
770 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud);
773 const pcl::PCLPointCloud2::Ptr & cloud);
792 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud);
795 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud);
798 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud);
826 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
828 int minNeighborsInRadius);
831 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
833 int minNeighborsInRadius);
836 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
838 int minNeighborsInRadius);
841 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
843 int minNeighborsInRadius);
846 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
848 int minNeighborsInRadius);
851 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
853 int minNeighborsInRadius);
856 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
857 const pcl::IndicesPtr & indices,
859 int minNeighborsInRadius);
862 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
863 const pcl::IndicesPtr & indices,
865 int minNeighborsInRadius);
868 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
869 const pcl::IndicesPtr & indices,
871 int minNeighborsInRadius);
874 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
875 const pcl::IndicesPtr & indices,
877 int minNeighborsInRadius);
880 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
881 const pcl::IndicesPtr & indices,
883 int minNeighborsInRadius);
886 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
887 const pcl::IndicesPtr & indices,
889 int minNeighborsInRadius);
931 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
932 const std::vector<int> & viewpointIndices,
933 const std::map<int, Transform> & viewpoints,
935 float neighborScale=2.0f);
938 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
939 const std::vector<int> & viewpointIndices,
940 const std::map<int, Transform> & viewpoints,
942 float neighborScale=2.0f);
945 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
946 const std::vector<int> & viewpointIndices,
947 const std::map<int, Transform> & viewpoints,
949 float neighborScale=2.0f);
952 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
953 const std::vector<int> & viewpointIndices,
954 const std::map<int, Transform> & viewpoints,
956 float neighborScale=2.0f);
959 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
960 const std::vector<int> & viewpointIndices,
961 const std::map<int, Transform> & viewpoints,
963 float neighborScale=2.0f);
966 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
967 const std::vector<int> & viewpointIndices,
968 const std::map<int, Transform> & viewpoints,
970 float neighborScale=2.0f);
974 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
975 const pcl::IndicesPtr & indices,
976 const std::vector<int> & viewpointIndices,
977 const std::map<int, Transform> & viewpoints,
979 float neighborScale=2.0f);
982 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
983 const pcl::IndicesPtr & indices,
984 const std::vector<int> & viewpointIndices,
985 const std::map<int, Transform> & viewpoints,
987 float neighborScale=2.0f);
990 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
991 const pcl::IndicesPtr & indices,
992 const std::vector<int> & viewpointIndices,
993 const std::map<int, Transform> & viewpoints,
995 float neighborScale=2.0f);
998 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
999 const pcl::IndicesPtr & indices,
1000 const std::vector<int> & viewpointIndices,
1001 const std::map<int, Transform> & viewpoints,
1003 float neighborScale=2.0f);
1006 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1007 const pcl::IndicesPtr & indices,
1008 const std::vector<int> & viewpointIndices,
1009 const std::map<int, Transform> & viewpoints,
1011 float neighborScale=2.0f);
1014 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1015 const pcl::IndicesPtr & indices,
1016 const std::vector<int> & viewpointIndices,
1017 const std::map<int, Transform> & viewpoints,
1019 float neighborScale=2.0f);
1045 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1046 const pcl::IndicesPtr & indices,
1047 const pcl::PointCloud<pcl::PointXYZ>::Ptr & subtractCloud,
1048 const pcl::IndicesPtr & subtractIndices,
1050 int minNeighborsInRadius = 1);
1053 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1054 const pcl::IndicesPtr & indices,
1055 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & subtractCloud,
1056 const pcl::IndicesPtr & subtractIndices,
1058 int minNeighborsInRadius = 1);
1061 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1062 const pcl::IndicesPtr & indices,
1063 const pcl::PointCloud<pcl::PointNormal>::Ptr & subtractCloud,
1064 const pcl::IndicesPtr & subtractIndices,
1066 float maxAngle = M_PI/4.0f,
1067 int minNeighborsInRadius = 1);
1070 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1071 const pcl::IndicesPtr & indices,
1072 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & subtractCloud,
1073 const pcl::IndicesPtr & subtractIndices,
1075 float maxAngle = M_PI/4.0f,
1076 int minNeighborsInRadius = 1);
1079 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1080 const pcl::IndicesPtr & indices,
1081 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & subtractCloud,
1082 const pcl::IndicesPtr & subtractIndices,
1084 float maxAngle = M_PI/4.0f,
1085 int minNeighborsInRadius = 1);
1088 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1089 const pcl::PointCloud<pcl::PointXYZ>::Ptr & subtractCloud,
1091 int minNeighborsInRadius = 1);
1094 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1095 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & subtractCloud,
1097 int minNeighborsInRadius = 1);
1100 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1101 const pcl::PointCloud<pcl::PointNormal>::Ptr & subtractCloud,
1103 float maxAngle = M_PI/4.0f,
1104 int minNeighborsInRadius = 1);
1107 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1108 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & subtractCloud,
1110 float maxAngle = M_PI/4.0f,
1111 int minNeighborsInRadius = 1);
1114 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1115 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & subtractCloud,
1117 float maxAngle = M_PI/4.0f,
1118 int minNeighborsInRadius = 1);
1143 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1144 const pcl::IndicesPtr & indices,
1145 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & subtractCloud,
1146 const pcl::IndicesPtr & subtractIndices,
1147 float radiusSearchRatio = 0.01,
1148 int minNeighborsInRadius = 1,
1149 const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
1179 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1180 const pcl::IndicesPtr & indices,
1181 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & subtractCloud,
1182 const pcl::IndicesPtr & subtractIndices,
1183 float radiusSearchRatio = 0.01,
1184 float maxAngle = M_PI/4.0f,
1185 int minNeighborsInRadius = 1,
1186 const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
1220 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1222 const Eigen::Vector4f & normal,
1224 const Eigen::Vector4f & viewpoint,
1225 float groundNormalsUp = 0.0f);
1228 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1230 const Eigen::Vector4f & normal,
1232 const Eigen::Vector4f & viewpoint,
1233 float groundNormalsUp = 0.0f);
1236 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1237 const pcl::IndicesPtr & indices,
1239 const Eigen::Vector4f & normal,
1241 const Eigen::Vector4f & viewpoint,
1242 float groundNormalsUp = 0.0f);
1245 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1246 const pcl::IndicesPtr & indices,
1248 const Eigen::Vector4f & normal,
1250 const Eigen::Vector4f & viewpoint,
1251 float groundNormalsUp = 0.0f);
1254 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1255 const pcl::IndicesPtr & indices,
1257 const Eigen::Vector4f & normal,
1259 const Eigen::Vector4f & viewpoint,
1260 float groundNormalsUp = 0.0f);
1263 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1264 const pcl::IndicesPtr & indices,
1266 const Eigen::Vector4f & normal,
1268 const Eigen::Vector4f & viewpoint,
1269 float groundNormalsUp = 0.0f);
1272 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1273 const pcl::IndicesPtr & indices,
1275 const Eigen::Vector4f & normal,
1277 const Eigen::Vector4f & viewpoint,
1278 float groundNormalsUp = 0.0f);
1281 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1282 const pcl::IndicesPtr & indices,
1284 const Eigen::Vector4f & normal,
1286 const Eigen::Vector4f & viewpoint,
1287 float groundNormalsUp = 0.0f);
1316 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1317 float clusterTolerance,
1319 int maxClusterSize = std::numeric_limits<int>::max(),
1320 int * biggestClusterIndex = 0);
1323 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1324 float clusterTolerance,
1326 int maxClusterSize = std::numeric_limits<int>::max(),
1327 int * biggestClusterIndex = 0);
1330 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1331 const pcl::IndicesPtr & indices,
1332 float clusterTolerance,
1334 int maxClusterSize = std::numeric_limits<int>::max(),
1335 int * biggestClusterIndex = 0);
1338 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1339 const pcl::IndicesPtr & indices,
1340 float clusterTolerance,
1342 int maxClusterSize = std::numeric_limits<int>::max(),
1343 int * biggestClusterIndex = 0);
1346 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1347 const pcl::IndicesPtr & indices,
1348 float clusterTolerance,
1350 int maxClusterSize = std::numeric_limits<int>::max(),
1351 int * biggestClusterIndex = 0);
1354 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1355 const pcl::IndicesPtr & indices,
1356 float clusterTolerance,
1358 int maxClusterSize = std::numeric_limits<int>::max(),
1359 int * biggestClusterIndex = 0);
1362 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1363 const pcl::IndicesPtr & indices,
1364 float clusterTolerance,
1366 int maxClusterSize = std::numeric_limits<int>::max(),
1367 int * biggestClusterIndex = 0);
1370 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1371 const pcl::IndicesPtr & indices,
1372 float clusterTolerance,
1374 int maxClusterSize = std::numeric_limits<int>::max(),
1375 int * biggestClusterIndex = 0);
1403 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1404 const pcl::IndicesPtr & indices,
1408 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
1409 const pcl::IndicesPtr & indices,
1413 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1414 const pcl::IndicesPtr & indices,
1418 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1419 const pcl::IndicesPtr & indices,
1423 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1424 const pcl::IndicesPtr & indices,
1428 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1429 const pcl::IndicesPtr & indices,
1433 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1434 const pcl::IndicesPtr & indices,
1436 bool keepOrganized);
1439 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
1440 const pcl::IndicesPtr & indices,
1442 bool keepOrganized);
1445 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
1446 const pcl::IndicesPtr & indices,
1448 bool keepOrganized);
1451 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
1452 const pcl::IndicesPtr & indices,
1454 bool keepOrganized);
1457 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
1458 const pcl::IndicesPtr & indices,
1460 bool keepOrganized);
1484 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1485 const pcl::IndicesPtr & indices,
1486 float distanceThreshold,
1487 int maxIterations = 100,
1488 pcl::ModelCoefficients * coefficientsOut = 0);
1490 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
1491 float distanceThreshold,
1492 int maxIterations = 100,
1493 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.