util3d_filtering.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef UTIL3D_FILTERING_H_
29 #define UTIL3D_FILTERING_H_
30 
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>
38 
39 namespace rtabmap
40 {
41 
42 namespace util3d
43 {
44 
52  const LaserScan & scan,
53  int downsamplingStep,
54  float rangeMin = 0.0f,
55  float rangeMax = 0.0f,
56  float voxelSize = 0.0f,
57  int normalK = 0,
58  float normalRadius = 0.0f,
59  float groundNormalsUp = 0.0f);
61  const LaserScan & scan,
62  int downsamplingStep,
63  float rangeMin,
64  float rangeMax,
65  float voxelSize,
66  int normalK,
67  float normalRadius,
68  bool forceGroundNormalsUp), "Use version with groundNormalsUp as float. For forceGroundNormalsUp=true, set groundNormalsUp=0.8, otherwise set groundNormalsUp=0.0.");
69 
70 LaserScan RTABMAP_EXP rangeFiltering(
71  const LaserScan & scan,
72  float rangeMin,
73  float rangeMax);
74 
75 LaserScan RTABMAP_EXP downsample(
76  const LaserScan & cloud,
77  int step);
78 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP downsample(
79  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
80  int step);
81 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP downsample(
82  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
83  int step);
84 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP downsample(
85  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
86  int step);
87 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP downsample(
88  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
89  int step);
90 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP downsample(
91  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
92  int step);
93 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP downsample(
94  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
95  int step);
96 
97 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP voxelize(
98  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
99  const pcl::IndicesPtr & indices,
100  float voxelSize);
101 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP voxelize(
102  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
103  const pcl::IndicesPtr & indices,
104  float voxelSize);
105 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP voxelize(
106  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
107  const pcl::IndicesPtr & indices,
108  float voxelSize);
109 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP voxelize(
110  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
111  const pcl::IndicesPtr & indices,
112  float voxelSize);
113 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP voxelize(
114  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
115  const pcl::IndicesPtr & indices,
116  float voxelSize);
117 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP voxelize(
118  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
119  const pcl::IndicesPtr & indices,
120  float voxelSize);
121 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP voxelize(
122  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
123  float voxelSize);
124 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP voxelize(
125  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
126  float voxelSize);
127 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP voxelize(
128  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
129  float voxelSize);
130 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP voxelize(
131  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
132  float voxelSize);
133 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP voxelize(
134  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
135  float voxelSize);
136 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP voxelize(
137  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
138  float voxelSize);
139 
140 inline pcl::PointCloud<pcl::PointXYZ>::Ptr uniformSampling(
141  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
142  float voxelSize)
143 {
144  return voxelize(cloud, voxelSize);
145 }
146 inline pcl::PointCloud<pcl::PointXYZRGB>::Ptr uniformSampling(
147  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
148  float voxelSize)
149 {
150  return voxelize(cloud, voxelSize);
151 }
152 inline pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr uniformSampling(
153  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
154  float voxelSize)
155 {
156  return voxelize(cloud, voxelSize);
157 }
158 
159 
160 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP randomSampling(
161  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
162  int samples);
163 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP randomSampling(
164  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
165  int samples);
166 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP randomSampling(
167  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
168  int samples);
169 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP randomSampling(
170  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
171  int samples);
172 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP randomSampling(
173  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
174  int samples);
175 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP randomSampling(
176  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
177  int samples);
178 
179 
180 pcl::IndicesPtr RTABMAP_EXP passThrough(
181  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
182  const pcl::IndicesPtr & indices,
183  const std::string & axis,
184  float min,
185  float max,
186  bool negative = false);
187 pcl::IndicesPtr RTABMAP_EXP passThrough(
188  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
189  const pcl::IndicesPtr & indices,
190  const std::string & axis,
191  float min,
192  float max,
193  bool negative = false);
194 pcl::IndicesPtr RTABMAP_EXP passThrough(
195  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
196  const pcl::IndicesPtr & indices,
197  const std::string & axis,
198  float min,
199  float max,
200  bool negative = false);
201 pcl::IndicesPtr RTABMAP_EXP passThrough(
202  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
203  const pcl::IndicesPtr & indices,
204  const std::string & axis,
205  float min,
206  float max,
207  bool negative = false);
208 pcl::IndicesPtr RTABMAP_EXP passThrough(
209  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
210  const pcl::IndicesPtr & indices,
211  const std::string & axis,
212  float min,
213  float max,
214  bool negative = false);
215 pcl::IndicesPtr RTABMAP_EXP passThrough(
216  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
217  const pcl::IndicesPtr & indices,
218  const std::string & axis,
219  float min,
220  float max,
221  bool negative = false);
222 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP passThrough(
223  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
224  const std::string & axis,
225  float min,
226  float max,
227  bool negative = false);
228 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP passThrough(
229  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
230  const std::string & axis,
231  float min,
232  float max,
233  bool negative = false);
234 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP passThrough(
235  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
236  const std::string & axis,
237  float min,
238  float max,
239  bool negative = false);
240 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP passThrough(
241  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
242  const std::string & axis,
243  float min,
244  float max,
245  bool negative = false);
246 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP passThrough(
247  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
248  const std::string & axis,
249  float min,
250  float max,
251  bool negative = false);
252 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP passThrough(
253  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
254  const std::string & axis,
255  float min,
256  float max,
257  bool negative = false);
258 
259 pcl::IndicesPtr RTABMAP_EXP cropBox(
260  const pcl::PCLPointCloud2::Ptr & cloud,
261  const pcl::IndicesPtr & indices,
262  const Eigen::Vector4f & min,
263  const Eigen::Vector4f & max,
264  const Transform & transform = Transform::getIdentity(),
265  bool negative = false);
266 pcl::IndicesPtr RTABMAP_EXP cropBox(
267  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
268  const pcl::IndicesPtr & indices,
269  const Eigen::Vector4f & min,
270  const Eigen::Vector4f & max,
271  const Transform & transform = Transform::getIdentity(),
272  bool negative = false);
273 pcl::IndicesPtr RTABMAP_EXP cropBox(
274  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
275  const pcl::IndicesPtr & indices,
276  const Eigen::Vector4f & min,
277  const Eigen::Vector4f & max,
278  const Transform & transform = Transform::getIdentity(),
279  bool negative = false);
280 pcl::IndicesPtr RTABMAP_EXP cropBox(
281  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
282  const pcl::IndicesPtr & indices,
283  const Eigen::Vector4f & min,
284  const Eigen::Vector4f & max,
285  const Transform & transform = Transform::getIdentity(),
286  bool negative = false);
287 pcl::IndicesPtr RTABMAP_EXP cropBox(
288  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
289  const pcl::IndicesPtr & indices,
290  const Eigen::Vector4f & min,
291  const Eigen::Vector4f & max,
292  const Transform & transform = Transform::getIdentity(),
293  bool negative = false);
294 pcl::IndicesPtr RTABMAP_EXP cropBox(
295  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
296  const pcl::IndicesPtr & indices,
297  const Eigen::Vector4f & min,
298  const Eigen::Vector4f & max,
299  const Transform & transform = Transform::getIdentity(),
300  bool negative = false);
301 pcl::IndicesPtr RTABMAP_EXP cropBox(
302  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
303  const pcl::IndicesPtr & indices,
304  const Eigen::Vector4f & min,
305  const Eigen::Vector4f & max,
306  const Transform & transform = Transform::getIdentity(),
307  bool negative = false);
308 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP cropBox(
309  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
310  const Eigen::Vector4f & min,
311  const Eigen::Vector4f & max,
312  const Transform & transform = Transform::getIdentity(),
313  bool negative = false);
314 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP cropBox(
315  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
316  const Eigen::Vector4f & min,
317  const Eigen::Vector4f & max,
318  const Transform & transform = Transform::getIdentity(),
319  bool negative = false);
320 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP cropBox(
321  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
322  const Eigen::Vector4f & min,
323  const Eigen::Vector4f & max,
324  const Transform & transform = Transform::getIdentity(),
325  bool negative = false);
326 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP cropBox(
327  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
328  const Eigen::Vector4f & min,
329  const Eigen::Vector4f & max,
330  const Transform & transform = Transform::getIdentity(),
331  bool negative = false);
332 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP cropBox(
333  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
334  const Eigen::Vector4f & min,
335  const Eigen::Vector4f & max,
336  const Transform & transform = Transform::getIdentity(),
337  bool negative = false);
338 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP cropBox(
339  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
340  const Eigen::Vector4f & min,
341  const Eigen::Vector4f & max,
342  const Transform & transform = Transform::getIdentity(),
343  bool negative = false);
344 
345 //Note: This assumes a coordinate system where X is forward, * Y is up, and Z is right.
346 pcl::IndicesPtr RTABMAP_EXP frustumFiltering(
347  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
348  const pcl::IndicesPtr & indices,
349  const Transform & cameraPose,
350  float horizontalFOV, // in degrees, xfov = atan((image_width/2)/fx)*2
351  float verticalFOV, // in degrees, yfov = atan((image_height/2)/fy)*2
352  float nearClipPlaneDistance,
353  float farClipPlaneDistance,
354  bool negative = false);
355 //Note: This assumes a coordinate system where X is forward, * Y is up, and Z is right.
356 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP frustumFiltering(
357  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
358  const Transform & cameraPose,
359  float horizontalFOV, // in degrees, xfov = atan((image_width/2)/fx)*2
360  float verticalFOV, // in degrees, yfov = atan((image_height/2)/fy)*2
361  float nearClipPlaneDistance,
362  float farClipPlaneDistance,
363  bool negative = false);
364 //Note: This assumes a coordinate system where X is forward, * Y is up, and Z is right.
365 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP frustumFiltering(
366  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
367  const Transform & cameraPose,
368  float horizontalFOV, // in degrees, xfov = atan((image_width/2)/fx)*2
369  float verticalFOV, // in degrees, yfov = atan((image_height/2)/fy)*2
370  float nearClipPlaneDistance,
371  float farClipPlaneDistance,
372  bool negative = false);
373 
374 
375 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP removeNaNFromPointCloud(
376  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud);
377 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP removeNaNFromPointCloud(
378  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud);
379 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP removeNaNFromPointCloud(
380  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud);
381 pcl::PCLPointCloud2::Ptr RTABMAP_EXP removeNaNFromPointCloud(
382  const pcl::PCLPointCloud2::Ptr & cloud);
383 
384 
385 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP removeNaNNormalsFromPointCloud(
386  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud);
387 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP removeNaNNormalsFromPointCloud(
388  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud);
389 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP removeNaNNormalsFromPointCloud(
390  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud);
391 
396 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
397  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
398  float radiusSearch,
399  int minNeighborsInRadius);
400 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
401  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
402  float radiusSearch,
403  int minNeighborsInRadius);
404 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
405  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
406  float radiusSearch,
407  int minNeighborsInRadius);
408 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
409  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
410  float radiusSearch,
411  int minNeighborsInRadius);
412 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
413  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
414  float radiusSearch,
415  int minNeighborsInRadius);
416 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
417  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
418  float radiusSearch,
419  int minNeighborsInRadius);
420 
433 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
434  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
435  const pcl::IndicesPtr & indices,
436  float radiusSearch,
437  int minNeighborsInRadius);
438 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
439  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
440  const pcl::IndicesPtr & indices,
441  float radiusSearch,
442  int minNeighborsInRadius);
443 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
444  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
445  const pcl::IndicesPtr & indices,
446  float radiusSearch,
447  int minNeighborsInRadius);
448 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
449  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
450  const pcl::IndicesPtr & indices,
451  float radiusSearch,
452  int minNeighborsInRadius);
453 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
454  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
455  const pcl::IndicesPtr & indices,
456  float radiusSearch,
457  int minNeighborsInRadius);
458 pcl::IndicesPtr RTABMAP_EXP radiusFiltering(
459  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
460  const pcl::IndicesPtr & indices,
461  float radiusSearch,
462  int minNeighborsInRadius);
463 
464 /* for convenience */
466  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
467  const std::vector<int> & viewpointIndices,
468  const std::map<int, Transform> & viewpoints,
469  float factor=0.01f,
470  float neighborScale=2.0f);
472  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
473  const std::vector<int> & viewpointIndices,
474  const std::map<int, Transform> & viewpoints,
475  float factor=0.01f,
476  float neighborScale=2.0f);
478  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
479  const std::vector<int> & viewpointIndices,
480  const std::map<int, Transform> & viewpoints,
481  float factor=0.01f,
482  float neighborScale=2.0f);
484  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
485  const std::vector<int> & viewpointIndices,
486  const std::map<int, Transform> & viewpoints,
487  float factor=0.01f,
488  float neighborScale=2.0f);
490  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
491  const std::vector<int> & viewpointIndices,
492  const std::map<int, Transform> & viewpoints,
493  float factor=0.01f,
494  float neighborScale=2.0f);
496  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
497  const std::vector<int> & viewpointIndices,
498  const std::map<int, Transform> & viewpoints,
499  float factor=0.01f,
500  float neighborScale=2.0f);
501 
515  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
516  const pcl::IndicesPtr & indices,
517  const std::vector<int> & viewpointIndices,
518  const std::map<int, Transform> & viewpoints,
519  float factor=0.01f,
520  float neighborScale=2.0f);
522  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
523  const pcl::IndicesPtr & indices,
524  const std::vector<int> & viewpointIndices,
525  const std::map<int, Transform> & viewpoints,
526  float factor=0.01f,
527  float neighborScale=2.0f);
529  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
530  const pcl::IndicesPtr & indices,
531  const std::vector<int> & viewpointIndices,
532  const std::map<int, Transform> & viewpoints,
533  float factor=0.01f,
534  float neighborScale=2.0f);
536  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
537  const pcl::IndicesPtr & indices,
538  const std::vector<int> & viewpointIndices,
539  const std::map<int, Transform> & viewpoints,
540  float factor=0.01f,
541  float neighborScale=2.0f);
543  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
544  const pcl::IndicesPtr & indices,
545  const std::vector<int> & viewpointIndices,
546  const std::map<int, Transform> & viewpoints,
547  float factor=0.01f,
548  float neighborScale=2.0f);
550  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
551  const pcl::IndicesPtr & indices,
552  const std::vector<int> & viewpointIndices,
553  const std::map<int, Transform> & viewpoints,
554  float factor=0.01f,
555  float neighborScale=2.0f);
556 
560 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP subtractFiltering(
561  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
562  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & substractCloud,
563  float radiusSearch,
564  int minNeighborsInRadius = 1);
565 
575 pcl::IndicesPtr RTABMAP_EXP subtractFiltering(
576  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
577  const pcl::IndicesPtr & indices,
578  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & substractCloud,
579  const pcl::IndicesPtr & substractIndices,
580  float radiusSearch,
581  int minNeighborsInRadius = 1);
582 
586 pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP subtractFiltering(
587  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
588  const pcl::PointCloud<pcl::PointNormal>::Ptr & substractCloud,
589  float radiusSearch,
590  float maxAngle = M_PI/4.0f,
591  int minNeighborsInRadius = 1);
592 
602 pcl::IndicesPtr RTABMAP_EXP subtractFiltering(
603  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
604  const pcl::IndicesPtr & indices,
605  const pcl::PointCloud<pcl::PointNormal>::Ptr & substractCloud,
606  const pcl::IndicesPtr & substractIndices,
607  float radiusSearch,
608  float maxAngle = M_PI/4.0f,
609  int minNeighborsInRadius = 1);
610 
614 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP subtractFiltering(
615  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
616  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & substractCloud,
617  float radiusSearch,
618  float maxAngle = M_PI/4.0f,
619  int minNeighborsInRadius = 1);
620 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP subtractFiltering(
621  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
622  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & substractCloud,
623  float radiusSearch,
624  float maxAngle = M_PI/4.0f,
625  int minNeighborsInRadius = 1);
626 
636 pcl::IndicesPtr RTABMAP_EXP subtractFiltering(
637  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
638  const pcl::IndicesPtr & indices,
639  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & substractCloud,
640  const pcl::IndicesPtr & substractIndices,
641  float radiusSearch,
642  float maxAngle = M_PI/4.0f,
643  int minNeighborsInRadius = 1);
644 pcl::IndicesPtr RTABMAP_EXP subtractFiltering(
645  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
646  const pcl::IndicesPtr & indices,
647  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & substractCloud,
648  const pcl::IndicesPtr & substractIndices,
649  float radiusSearch,
650  float maxAngle = M_PI/4.0f,
651  int minNeighborsInRadius = 1);
652 
662 pcl::IndicesPtr RTABMAP_EXP subtractAdaptiveFiltering(
663  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
664  const pcl::IndicesPtr & indices,
665  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & substractCloud,
666  const pcl::IndicesPtr & substractIndices,
667  float radiusSearchRatio = 0.01,
668  int minNeighborsInRadius = 1,
669  const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
670 
680 pcl::IndicesPtr RTABMAP_EXP subtractAdaptiveFiltering(
681  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
682  const pcl::IndicesPtr & indices,
683  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & substractCloud,
684  const pcl::IndicesPtr & substractIndices,
685  float radiusSearchRatio = 0.01,
686  float maxAngle = M_PI/4.0f,
687  int minNeighborsInRadius = 1,
688  const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0));
689 
690 
695 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
696  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
697  float angleMax,
698  const Eigen::Vector4f & normal,
699  int normalKSearch,
700  const Eigen::Vector4f & viewpoint,
701  float groundNormalsUp = 0.0f);
702 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
703  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
704  float angleMax,
705  const Eigen::Vector4f & normal,
706  int normalKSearch,
707  const Eigen::Vector4f & viewpoint,
708  float groundNormalsUp = 0.0f);
709 
726 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
727  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
728  const pcl::IndicesPtr & indices,
729  float angleMax,
730  const Eigen::Vector4f & normal,
731  int normalKSearch,
732  const Eigen::Vector4f & viewpoint,
733  float groundNormalsUp = 0.0f);
734 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
735  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
736  const pcl::IndicesPtr & indices,
737  float angleMax,
738  const Eigen::Vector4f & normal,
739  int normalKSearch,
740  const Eigen::Vector4f & viewpoint,
741  float groundNormalsUp = 0.0f);
742 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
743  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
744  const pcl::IndicesPtr & indices,
745  float angleMax,
746  const Eigen::Vector4f & normal,
747  int normalKSearch,
748  const Eigen::Vector4f & viewpoint,
749  float groundNormalsUp = 0.0f);
750 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
751  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
752  const pcl::IndicesPtr & indices,
753  float angleMax,
754  const Eigen::Vector4f & normal,
755  int normalKSearch,
756  const Eigen::Vector4f & viewpoint,
757  float groundNormalsUp = 0.0f);
758 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
759  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
760  const pcl::IndicesPtr & indices,
761  float angleMax,
762  const Eigen::Vector4f & normal,
763  int normalKSearch,
764  const Eigen::Vector4f & viewpoint,
765  float groundNormalsUp = 0.0f);
766 pcl::IndicesPtr RTABMAP_EXP normalFiltering(
767  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
768  const pcl::IndicesPtr & indices,
769  float angleMax,
770  const Eigen::Vector4f & normal,
771  int normalKSearch,
772  const Eigen::Vector4f & viewpoint,
773  float groundNormalsUp = 0.0f);
774 
778 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
779  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
780  float clusterTolerance,
781  int minClusterSize,
782  int maxClusterSize = std::numeric_limits<int>::max(),
783  int * biggestClusterIndex = 0);
784 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
785  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
786  float clusterTolerance,
787  int minClusterSize,
788  int maxClusterSize = std::numeric_limits<int>::max(),
789  int * biggestClusterIndex = 0);
790 
803 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
804  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
805  const pcl::IndicesPtr & indices,
806  float clusterTolerance,
807  int minClusterSize,
808  int maxClusterSize = std::numeric_limits<int>::max(),
809  int * biggestClusterIndex = 0);
810 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
811  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
812  const pcl::IndicesPtr & indices,
813  float clusterTolerance,
814  int minClusterSize,
815  int maxClusterSize = std::numeric_limits<int>::max(),
816  int * biggestClusterIndex = 0);
817 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
818  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
819  const pcl::IndicesPtr & indices,
820  float clusterTolerance,
821  int minClusterSize,
822  int maxClusterSize = std::numeric_limits<int>::max(),
823  int * biggestClusterIndex = 0);
824 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
825  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
826  const pcl::IndicesPtr & indices,
827  float clusterTolerance,
828  int minClusterSize,
829  int maxClusterSize = std::numeric_limits<int>::max(),
830  int * biggestClusterIndex = 0);
831 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
832  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
833  const pcl::IndicesPtr & indices,
834  float clusterTolerance,
835  int minClusterSize,
836  int maxClusterSize = std::numeric_limits<int>::max(),
837  int * biggestClusterIndex = 0);
838 std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
839  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
840  const pcl::IndicesPtr & indices,
841  float clusterTolerance,
842  int minClusterSize,
843  int maxClusterSize = std::numeric_limits<int>::max(),
844  int * biggestClusterIndex = 0);
845 
846 pcl::IndicesPtr RTABMAP_EXP extractIndices(
847  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
848  const pcl::IndicesPtr & indices,
849  bool negative);
850 pcl::IndicesPtr RTABMAP_EXP extractIndices(
851  const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
852  const pcl::IndicesPtr & indices,
853  bool negative);
854 pcl::IndicesPtr RTABMAP_EXP extractIndices(
855  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
856  const pcl::IndicesPtr & indices,
857  bool negative);
858 pcl::IndicesPtr RTABMAP_EXP extractIndices(
859  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
860  const pcl::IndicesPtr & indices,
861  bool negative);
862 pcl::IndicesPtr RTABMAP_EXP extractIndices(
863  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
864  const pcl::IndicesPtr & indices,
865  bool negative);
866 pcl::IndicesPtr RTABMAP_EXP extractIndices(
867  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
868  const pcl::IndicesPtr & indices,
869  bool negative);
870 
871 pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP extractIndices(
872  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
873  const pcl::IndicesPtr & indices,
874  bool negative,
875  bool keepOrganized);
876 pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP extractIndices(
877  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
878  const pcl::IndicesPtr & indices,
879  bool negative,
880  bool keepOrganized);
881 // PCL default lacks of pcl::PointNormal type support
882 //pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP extractIndices(
883 // const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
884 // const pcl::IndicesPtr & indices,
885 // bool negative,
886 // bool keepOrganized);
887 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP extractIndices(
888  const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
889  const pcl::IndicesPtr & indices,
890  bool negative,
891  bool keepOrganized);
892 pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP extractIndices(
893  const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
894  const pcl::IndicesPtr & indices,
895  bool negative,
896  bool keepOrganized);
897 pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP extractIndices(
898  const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
899  const pcl::IndicesPtr & indices,
900  bool negative,
901  bool keepOrganized);
902 
903 pcl::IndicesPtr extractPlane(
904  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
905  float distanceThreshold,
906  int maxIterations = 100,
907  pcl::ModelCoefficients * coefficientsOut = 0);
908 pcl::IndicesPtr extractPlane(
909  const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
910  const pcl::IndicesPtr & indices,
911  float distanceThreshold,
912  int maxIterations = 100,
913  pcl::ModelCoefficients * coefficientsOut = 0);
914 
915 } // namespace util3d
916 } // namespace rtabmap
917 
918 #endif /* UTIL3D_FILTERING_H_ */
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)
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)
f
GLM_FUNC_DECL detail::tvec3< T, P > axis(detail::tquat< T, P > const &x)
static Transform getIdentity()
Definition: Transform.cpp:401
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP removeNaNFromPointCloud(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud)
RTABMAP_DEPRECATED(pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP 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), "Use cloudFromDepth with CameraModel interface.")
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)
pcl::IndicesPtr RTABMAP_EXP normalFiltering(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float angleMax, const Eigen::Vector4f &normal, int normalKSearch, const Eigen::Vector4f &viewpoint, float groundNormalsUp=0.0f)
LaserScan RTABMAP_EXP downsample(const LaserScan &cloud, int step)
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
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, float groundNormalsUp=0.0f)
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::IndicesPtr RTABMAP_EXP 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)
pcl::PointCloud< pcl::PointXYZ >::Ptr uniformSampling(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, float voxelSize)
pcl::IndicesPtr RTABMAP_EXP 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)
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)
pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_EXP voxelize(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:38:58