40 #include <pcl/pcl_exports.h>
41 #include <pcl/common/point_tests.h>
42 #include <pcl/filters/filter.h>
45 template <
typename Po
intT>
void
51 if (&cloud_in != &cloud_out)
59 index.resize (cloud_in.
size ());
66 for (std::size_t j = 0; j < cloud_out.
size (); ++j)
72 for (std::size_t i = 0; i < cloud_in.
size (); ++i)
74 if (!std::isfinite (cloud_in[i].x) ||
75 !std::isfinite (cloud_in[i].y) ||
76 !std::isfinite (cloud_in[i].z))
78 cloud_out[j] = cloud_in[i];
82 if (j != cloud_in.
size ())
90 cloud_out.
width =
static_cast<std::uint32_t
>(j);
98 template <
typename Po
intT>
void
104 if (&cloud_in != &cloud_out)
112 index.resize (cloud_in.
size ());
118 for (std::size_t i = 0; i < cloud_in.
size (); ++i)
120 if (!std::isfinite (cloud_in[i].normal_x) ||
121 !std::isfinite (cloud_in[i].normal_y) ||
122 !std::isfinite (cloud_in[i].normal_z))
126 cloud_out[j] = cloud_in[i];
130 if (j != cloud_in.
size ())
142 #define PCL_INSTANTIATE_removeNaNFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNFromPointCloud<T>(const pcl::PointCloud<T>&, pcl::PointCloud<T>&, Indices&);
143 #define PCL_INSTANTIATE_removeNaNNormalsFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNNormalsFromPointCloud<T>(const pcl::PointCloud<T>&, pcl::PointCloud<T>&, Indices&);
PointCloud represents the base class in PCL for storing collections of 3D points.
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
void resize(std::size_t count)
Resizes the container to contain count elements.
Eigen::Quaternionf sensor_orientation_
Sensor acquisition pose (rotation).
std::uint32_t width
The point cloud width (if organized as an image-structure).
pcl::PCLHeader header
The point cloud header.
std::uint32_t height
The point cloud height (if organized as an image-structure).
Eigen::Vector4f sensor_origin_
Sensor acquisition pose (origin/translation).
void removeNaNNormalsFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, Indices &index)
Removes points that have their normals invalid (i.e., equal to NaN)
void removeNaNFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, Indices &index)
Removes points with x, y, or z equal to NaN.
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...
IndicesAllocator<> Indices
Type used for indices in PCL.