Point Cloud Library (PCL)
1.9.1
|
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)
59 index.resize (cloud_in.
points.size ());
67 for (j = 0; j < cloud_out.
points.size (); ++j)
68 index[j] =
static_cast<int>(j);
72 for (
size_t i = 0; i < cloud_in.
points.size (); ++i)
74 if (!pcl_isfinite (cloud_in.
points[i].x) ||
75 !pcl_isfinite (cloud_in.
points[i].y) ||
76 !pcl_isfinite (cloud_in.
points[i].z))
79 index[j] =
static_cast<int>(i);
82 if (j != cloud_in.
points.size ())
85 cloud_out.
points.resize (j);
90 cloud_out.
width =
static_cast<uint32_t
>(j);
98 template <
typename Po
intT>
void
101 std::vector<int> &index)
104 if (&cloud_in != &cloud_out)
112 index.resize (cloud_in.
points.size ());
115 for (
size_t i = 0; i < cloud_in.
points.size (); ++i)
117 if (!pcl_isfinite (cloud_in.
points[i].normal_x) ||
118 !pcl_isfinite (cloud_in.
points[i].normal_y) ||
119 !pcl_isfinite (cloud_in.
points[i].normal_z))
122 index[j] =
static_cast<int>(i);
125 if (j != cloud_in.
points.size ())
128 cloud_out.
points.resize (j);
133 cloud_out.
width =
static_cast<uint32_t
>(j);
137 #define PCL_INSTANTIATE_removeNaNFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNFromPointCloud<T>(const pcl::PointCloud<T>&, pcl::PointCloud<T>&, std::vector<int>&);
138 #define PCL_INSTANTIATE_removeNaNNormalsFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNNormalsFromPointCloud<T>(const pcl::PointCloud<T>&, pcl::PointCloud<T>&, std::vector<int>&);
140 #endif // PCL_FILTERS_IMPL_FILTER_H_
uint32_t width
The point cloud width (if organized as an image-structure).
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
PointCloud represents the base class in PCL for storing collections of 3D points.
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)
Eigen::Vector4f sensor_origin_
Sensor acquisition pose (origin/translation).
Eigen::Quaternionf sensor_orientation_
Sensor acquisition pose (rotation).
uint32_t height
The point cloud height (if organized as an image-structure).
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
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.
pcl::PCLHeader header
The point cloud header.