Skip to content

Commit

Permalink
Adding statistical filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jmguerreroh committed Feb 20, 2024
1 parent a0c3476 commit f1b705f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/small_objects_detector/Detector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "pcl/filters/extract_indices.h"
#include "pcl/segmentation/sac_segmentation.h"
#include "pcl/sample_consensus/ransac.h"
#include <pcl/filters/statistical_outlier_removal.h>

namespace small_objects_detector
{
Expand Down
14 changes: 14 additions & 0 deletions src/small_objects_detector/Detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ const
cloud_filtered_ptr_inliers.swap(cloud_f);
} while (cloud_p->size() > plane_size_);

//----------------------------------------------------
// StatisticalOutlierRemoval Filter
//----------------------------------------------------
// Create the filtering object
pcl::StatisticalOutlierRemoval<pcl::PointXYZRGB> f;
// pass the input point cloud to the processing module
f.setInputCloud (cloud_f);
// set some parameters
f.setMeanK (50);
f.setStddevMulThresh (3.0);
// get the output point cloud
f.filter (*cloud_f);
// std::cerr << "PointCloud inliners: " << cloud_filtered_ptr_inliers->width * cloud_filtered_ptr_inliers->height << " data points." << std::endl;

// Create output pointcloud
pcl::PointCloud<pcl::PointXYZRGB> out_pointcloud = *cloud_f;

Expand Down

0 comments on commit f1b705f

Please sign in to comment.