42#include <pcl/filters/median_filter.h>
43#include <pcl/common/point_tests.h>
45template <
typename Po
intT>
void
48 if (!input_->isOrganized ())
50 PCL_ERROR (
"[pcl::MedianFilter] Input cloud needs to be organized\n");
57 int height =
static_cast<int> (
output.height);
58 int width =
static_cast<int> (
output.width);
59 for (
int y = 0; y < height; ++y)
60 for (
int x = 0; x < width; ++x)
63 std::vector<float>
vals;
64 vals.reserve (window_size_ * window_size_);
83 if (std::abs (
new_depth - (*input_)(x, y).z) < max_allowed_movement_)
86 output (x, y).z = (*input_)(x, y).z +
87 max_allowed_movement_ * (
new_depth - (*input_)(x, y).z) / std::abs (
new_depth - (*input_)(x, y).z);
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...