| Point Cloud Library (PCL)
    1.11.0-dev
    | 
 
 
 
   38 #ifndef PCL_GPU_FEATURES_TEST_DATA_SOURCE_HPP_ 
   39 #define PCL_GPU_FEATURES_TEST_DATA_SOURCE_HPP_ 
   44 #include <pcl/point_cloud.h> 
   45 #include <pcl/io/pcd_io.h> 
   47 #include <pcl/features/normal_3d.h> 
   48 #include <pcl/visualization/cloud_viewer.h> 
   49 #include <pcl/gpu/containers/kernel_containers.h> 
   50 #include <pcl/search/search.h> 
   52 #include <Eigen/StdVector> 
   54 #if defined (_WIN32) || defined(_WIN64) 
   67             const static int k = 32;
 
   82             DataSource(
const std::string& file = 
"d:/office_chair_model.pcd") 
 
   91                 float sz = (maxp.x - minp.x + maxp.y - minp.y + maxp.z - minp.z) / 3;
 
   99                     int r = std::max(1, std::min(255, 
static_cast<int>((
double(rand())/RAND_MAX)*255)));
 
  100                     int g = std::max(1, std::min(255, 
static_cast<int>((
double(rand())/RAND_MAX)*255)));
 
  101                     int b = std::max(1, std::min(255, 
static_cast<int>((
double(rand())/RAND_MAX)*255)));
 
  103                     *
reinterpret_cast<int*
>(&p.data[3]) = (b << 16) + (g << 8) + r;
 
  130                 const auto cloud_size = 
cloud->size();
 
  132                 std::vector<float> dists;
 
  134                 for(std::size_t i = 0; i < cloud_size; ++i)
 
  149                 const auto cloud_size = 
cloud->size();
 
  151                 std::vector<float> dists;
 
  153                 for(std::size_t i = 0; i < cloud_size; ++i)
 
  172                 for(std::size_t i = 0; i < 
cloud->size(); i+= 10)               
 
  180                     for(std::size_t i = 0; i < 
normals->size(); i+= 10)               
 
  191                 for(std::size_t i = 0; i < 
cloud->size(); i += step)
 
  
A point structure representing normal coordinates and the surface curvature estimate.
NormalEstimation estimates local surface properties (surface normals and curvatures)at each 3D point.
shared_ptr< Indices > IndicesPtr
Simple point cloud visualization class.
PointCloud< Normal >::Ptr normals
DataSource(const std::string &file="d:/office_chair_model.pcd")
PointCloud< PointXYZ >::Ptr cloud
void getNeghborsArray(std::vector< int > &data)
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< KdTree< PointT, Tree > > Ptr
std::vector< std::vector< int > > neighbors_all
void setInputCloud(const PointCloudConstPtr &cloud) override
Provide a pointer to the input dataset.
void runCloudViewer() const
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
__PCL_GPU_HOST_DEVICE__ T * ptr(int y=0)
A point structure representing Euclidean xyz coordinates.
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
void compute(PointCloudOut &output)
Base method for feature estimation for all points given in <setInputCloud (), setIndices ()> using th...
int radiusSearch(const PointT &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
Search for all the nearest neighbors of the query point in a given radius.
PointCloud< Normal >::Ptr normals_surface
void setKSearch(int k)
Set the number of k nearest neighbors to use for the feature estimation.
bool wasStopped(int millis_to_wait=1)
Check if the gui was quit, you should quit also.
const static int max_elements
PointXYZ operator()(const Normal &n) const
shared_ptr< PointCloud< PointT > > Ptr
void getMinMax3D(const pcl::PointCloud< PointT > &cloud, PointT &min_pt, PointT &max_pt)
Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud.
void generateIndices(std::size_t step=100)
PointCloud< PointXYZ >::Ptr surface
void showCloud(const ColorCloud::ConstPtr &cloud, const std::string &cloudname="cloud")
Show a cloud, with an optional key for multiple clouds.
Point Cloud Data (PCD) file format reader.
void findRadiusNeghbors(float radius=-1)
int read(const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &pcd_version, const int offset=0) override
Read a point cloud data from a PCD file and store it into a pcl/PCLPointCloud2.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input dataset.
shared_ptr< KdTreeFLANN< PointT, Dist > > Ptr
int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const override
Search for k-nearest neighbors for the given query point.
void setSearchMethod(const KdTreePtr &tree)
Provide a pointer to the search object.