28 #ifndef UTIL3D_FILTERING_H_ 29 #define UTIL3D_FILTERING_H_ 33 #include <pcl/point_cloud.h> 34 #include <pcl/point_types.h> 35 #include <pcl/pcl_base.h> 36 #include <pcl/ModelCoefficients.h> 52 const LaserScan & scan,
54 float rangeMin = 0.0f,
55 float rangeMax = 0.0f,
56 float voxelSize = 0.0f,
58 float normalRadius = 0.0f,
59 bool forceGroundNormalsUp =
false);
62 const LaserScan & scan,
67 const LaserScan & cloud,
70 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
73 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
76 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
79 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
83 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
84 const pcl::IndicesPtr & indices,
87 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
88 const pcl::IndicesPtr & indices,
91 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
92 const pcl::IndicesPtr & indices,
95 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
96 const pcl::IndicesPtr & indices,
99 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
100 const pcl::IndicesPtr & indices,
103 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
104 const pcl::IndicesPtr & indices,
107 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
110 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
113 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
116 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
119 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
122 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
126 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
132 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
138 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
146 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
149 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
154 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
155 const pcl::IndicesPtr & indices,
156 const std::string &
axis,
159 bool negative =
false);
161 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
162 const pcl::IndicesPtr & indices,
163 const std::string & axis,
166 bool negative =
false);
168 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
169 const pcl::IndicesPtr & indices,
170 const std::string & axis,
173 bool negative =
false);
175 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
176 const pcl::IndicesPtr & indices,
177 const std::string & axis,
180 bool negative =
false);
182 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
183 const pcl::IndicesPtr & indices,
184 const std::string & axis,
187 bool negative =
false);
189 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
190 const pcl::IndicesPtr & indices,
191 const std::string & axis,
194 bool negative =
false);
196 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
197 const std::string & axis,
200 bool negative =
false);
202 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
203 const std::string & axis,
206 bool negative =
false);
208 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
209 const std::string & axis,
212 bool negative =
false);
214 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
215 const std::string & axis,
218 bool negative =
false);
220 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
221 const std::string & axis,
224 bool negative =
false);
226 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
227 const std::string & axis,
230 bool negative =
false);
233 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
234 const pcl::IndicesPtr & indices,
235 const Eigen::Vector4f & min,
236 const Eigen::Vector4f & max,
238 bool negative =
false);
240 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
241 const pcl::IndicesPtr & indices,
242 const Eigen::Vector4f & min,
243 const Eigen::Vector4f & max,
245 bool negative =
false);
247 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
248 const pcl::IndicesPtr & indices,
249 const Eigen::Vector4f & min,
250 const Eigen::Vector4f & max,
252 bool negative =
false);
254 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
255 const pcl::IndicesPtr & indices,
256 const Eigen::Vector4f & min,
257 const Eigen::Vector4f & max,
259 bool negative =
false);
261 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
262 const Eigen::Vector4f & min,
263 const Eigen::Vector4f & max,
265 bool negative =
false);
267 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
268 const Eigen::Vector4f & min,
269 const Eigen::Vector4f & max,
271 bool negative =
false);
273 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
274 const Eigen::Vector4f & min,
275 const Eigen::Vector4f & max,
277 bool negative =
false);
279 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
280 const Eigen::Vector4f & min,
281 const Eigen::Vector4f & max,
283 bool negative =
false);
287 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
288 const pcl::IndicesPtr & indices,
292 float nearClipPlaneDistance,
293 float farClipPlaneDistance,
294 bool negative =
false);
297 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
301 float nearClipPlaneDistance,
302 float farClipPlaneDistance,
303 bool negative =
false);
306 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
310 float nearClipPlaneDistance,
311 float farClipPlaneDistance,
312 bool negative =
false);
316 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud);
318 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud);
322 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud);
324 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud);
331 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
333 int minNeighborsInRadius);
335 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
337 int minNeighborsInRadius);
339 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
341 int minNeighborsInRadius);
343 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
345 int minNeighborsInRadius);
360 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
361 const pcl::IndicesPtr & indices,
363 int minNeighborsInRadius);
365 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
366 const pcl::IndicesPtr & indices,
368 int minNeighborsInRadius);
370 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
371 const pcl::IndicesPtr & indices,
373 int minNeighborsInRadius);
375 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
376 const pcl::IndicesPtr & indices,
378 int minNeighborsInRadius);
384 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
385 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & substractCloud,
387 int minNeighborsInRadius = 1);
399 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
400 const pcl::IndicesPtr & indices,
401 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & substractCloud,
402 const pcl::IndicesPtr & substractIndices,
404 int minNeighborsInRadius = 1);
410 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
411 const pcl::PointCloud<pcl::PointNormal>::Ptr & substractCloud,
413 float maxAngle =
M_PI/4.0
f,
414 int minNeighborsInRadius = 1);
426 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
427 const pcl::IndicesPtr & indices,
428 const pcl::PointCloud<pcl::PointNormal>::Ptr & substractCloud,
429 const pcl::IndicesPtr & substractIndices,
431 float maxAngle =
M_PI/4.0
f,
432 int minNeighborsInRadius = 1);
438 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
439 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & substractCloud,
441 float maxAngle =
M_PI/4.0
f,
442 int minNeighborsInRadius = 1);
454 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
455 const pcl::IndicesPtr & indices,
456 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & substractCloud,
457 const pcl::IndicesPtr & substractIndices,
459 float maxAngle =
M_PI/4.0
f,
460 int minNeighborsInRadius = 1);
472 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
473 const pcl::IndicesPtr & indices,
474 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & substractCloud,
475 const pcl::IndicesPtr & substractIndices,
476 float radiusSearchRatio = 0.01,
477 int minNeighborsInRadius = 1,
478 const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
490 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
491 const pcl::IndicesPtr & indices,
492 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & substractCloud,
493 const pcl::IndicesPtr & substractIndices,
494 float radiusSearchRatio = 0.01,
495 float maxAngle =
M_PI/4.0
f,
496 int minNeighborsInRadius = 1,
497 const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
505 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
507 const Eigen::Vector4f & normal,
509 const Eigen::Vector4f & viewpoint);
511 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
513 const Eigen::Vector4f & normal,
515 const Eigen::Vector4f & viewpoint);
534 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
535 const pcl::IndicesPtr & indices,
537 const Eigen::Vector4f & normal,
539 const Eigen::Vector4f & viewpoint);
541 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
542 const pcl::IndicesPtr & indices,
544 const Eigen::Vector4f & normal,
546 const Eigen::Vector4f & viewpoint);
548 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
549 const pcl::IndicesPtr & indices,
551 const Eigen::Vector4f & normal,
553 const Eigen::Vector4f & viewpoint);
555 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
556 const pcl::IndicesPtr & indices,
558 const Eigen::Vector4f & normal,
560 const Eigen::Vector4f & viewpoint);
566 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
567 float clusterTolerance,
570 int * biggestClusterIndex = 0);
572 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
573 float clusterTolerance,
576 int * biggestClusterIndex = 0);
591 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
592 const pcl::IndicesPtr & indices,
593 float clusterTolerance,
596 int * biggestClusterIndex = 0);
598 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
599 const pcl::IndicesPtr & indices,
600 float clusterTolerance,
603 int * biggestClusterIndex = 0);
605 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
606 const pcl::IndicesPtr & indices,
607 float clusterTolerance,
610 int * biggestClusterIndex = 0);
612 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
613 const pcl::IndicesPtr & indices,
614 float clusterTolerance,
617 int * biggestClusterIndex = 0);
620 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
621 const pcl::IndicesPtr & indices,
624 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
625 const pcl::IndicesPtr & indices,
628 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
629 const pcl::IndicesPtr & indices,
632 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
633 const pcl::IndicesPtr & indices,
637 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
638 const pcl::IndicesPtr & indices,
642 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
643 const pcl::IndicesPtr & indices,
653 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
654 const pcl::IndicesPtr & indices,
659 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
660 float distanceThreshold,
661 int maxIterations = 100,
662 pcl::ModelCoefficients * coefficientsOut = 0);
664 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
665 const pcl::IndicesPtr & indices,
666 float distanceThreshold,
667 int maxIterations = 100,
668 pcl::ModelCoefficients * coefficientsOut = 0);
pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_EXP subtractFiltering(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &substractCloud, float radiusSearch, int minNeighborsInRadius=1)
pcl::IndicesPtr RTABMAP_EXP 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)
std::vector< pcl::IndicesPtr > RTABMAP_EXP extractClusters(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float clusterTolerance, int minClusterSize, int maxClusterSize=std::numeric_limits< int >::max(), int *biggestClusterIndex=0)
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
pcl::IndicesPtr RTABMAP_EXP passThrough(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, const std::string &axis, float min, float max, bool negative=false)
GLM_FUNC_DECL detail::tvec3< T, P > axis(detail::tquat< T, P > const &x)
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP removeNaNFromPointCloud(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud)
pcl::IndicesPtr RTABMAP_EXP subtractAdaptiveFiltering(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &cloud, const pcl::IndicesPtr &indices, const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &substractCloud, const pcl::IndicesPtr &substractIndices, float radiusSearchRatio=0.01, int minNeighborsInRadius=1, const Eigen::Vector3f &viewpoint=Eigen::Vector3f(0, 0, 0))
GLM_FUNC_DECL genType step(genType const &edge, genType const &x)
pcl::IndicesPtr RTABMAP_EXP 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)
pcl::IndicesPtr RTABMAP_EXP extractIndices(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, bool negative)
LaserScan RTABMAP_EXP downsample(const LaserScan &cloud, int step)
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP randomSampling(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, int samples)
pcl::IndicesPtr RTABMAP_EXP radiusFiltering(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float radiusSearch, int minNeighborsInRadius)
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
pcl::IndicesPtr extractPlane(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float distanceThreshold, int maxIterations=100, pcl::ModelCoefficients *coefficientsOut=0)
pcl::PointCloud< pcl::PointXYZ >::Ptr uniformSampling(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float voxelSize)
LaserScan RTABMAP_EXP rangeFiltering(const LaserScan &scan, float rangeMin, float rangeMax)
pcl::PointCloud< pcl::PointNormal >::Ptr RTABMAP_EXP removeNaNNormalsFromPointCloud(const pcl::PointCloud< pcl::PointNormal >::Ptr &cloud)
LaserScan RTABMAP_EXP 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, bool forceGroundNormalsUp=false)
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP voxelize(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)
pcl::IndicesPtr RTABMAP_EXP normalFiltering(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint)