38 #ifndef PCL_FILTERS_IMPL_FILTER_H_
39 #define PCL_FILTERS_IMPL_FILTER_H_
41 #include <pcl/pcl_macros.h>
42 #include <pcl/filters/filter.h>
45 template <
typename Po
intT>
void
48 std::vector<int> &index)
51 if (&cloud_in != &cloud_out)
57 index.resize (cloud_in.
points.size ());
65 for (j = 0; j < cloud_out.
points.size (); ++j)
66 index[j] = static_cast<int>(j);
70 for (
size_t i = 0; i < cloud_in.
points.size (); ++i)
72 if (!pcl_isfinite (cloud_in.
points[i].x) ||
73 !pcl_isfinite (cloud_in.
points[i].y) ||
74 !pcl_isfinite (cloud_in.
points[i].z))
77 index[j] =
static_cast<int>(i);
80 if (j != cloud_in.
points.size ())
83 cloud_out.
points.resize (j);
88 cloud_out.
width =
static_cast<uint32_t
>(j);
96 template <
typename Po
intT>
void
99 std::vector<int> &index)
102 if (&cloud_in != &cloud_out)
108 index.resize (cloud_in.
points.size ());
111 for (
size_t i = 0; i < cloud_in.
points.size (); ++i)
113 if (!pcl_isfinite (cloud_in.
points[i].normal_x) ||
114 !pcl_isfinite (cloud_in.
points[i].normal_y) ||
115 !pcl_isfinite (cloud_in.
points[i].normal_z))
118 index[j] =
static_cast<int>(i);
121 if (j != cloud_in.
points.size ())
124 cloud_out.
points.resize (j);
129 cloud_out.
width =
static_cast<uint32_t
>(j);
133 #define PCL_INSTANTIATE_removeNaNFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNFromPointCloud<T>(const pcl::PointCloud<T>&, pcl::PointCloud<T>&, std::vector<int>&);
134 #define PCL_INSTANTIATE_removeNaNNormalsFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNNormalsFromPointCloud<T>(const pcl::PointCloud<T>&, pcl::PointCloud<T>&, std::vector<int>&);
136 #endif // PCL_FILTERS_IMPL_FILTER_H_
void removeNaNNormalsFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, std::vector< int > &index)
Removes points that have their normals invalid (i.e., equal to NaN)
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
void removeNaNFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, std::vector< int > &index)
Removes points with x, y, or z equal to NaN.
uint32_t height
The point cloud height (if organized as an image-structure).
uint32_t width
The point cloud width (if organized as an image-structure).
PointCloud represents the base class in PCL for storing collections of 3D points. ...
pcl::PCLHeader header
The point cloud header.
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values).