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;
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;
128 kdtree->setInputCloud(
cloud);
132 std::vector<float> dists;
134 for(std::size_t i = 0; i < cloud_size; ++i)
147 kdtree->setInputCloud(
cloud);
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)
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
Point Cloud Data (PCD) file format reader.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
shared_ptr< KdTree< PointT, Tree > > Ptr
Simple point cloud visualization class.
bool wasStopped(int millis_to_wait=1)
Check if the gui was quit, you should quit also.
void showCloud(const ColorCloud::ConstPtr &cloud, const std::string &cloudname="cloud")
Show a cloud, with an optional key for multiple clouds.
Define standard C methods and C++ classes that are common to all methods.
Defines all the PCL implemented PointT point type structures.
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.
shared_ptr< Indices > IndicesPtr
A point structure representing normal coordinates and the surface curvature estimate.
A point structure representing Euclidean xyz coordinates.
PointXYZ operator()(const Normal &n) const
PointCloud< Normal >::Ptr normals_surface
PointCloud< Normal >::Ptr normals
static const int max_elements
PointCloud< PointXYZ >::Ptr surface
DataSource(const std::string &file="d:/office_chair_model.pcd")
std::vector< std::vector< int > > neighbors_all
void getNeghborsArray(std::vector< int > &data)
void generateIndices(std::size_t step=100)
void findRadiusNeghbors(float radius=-1)
void runCloudViewer() const
PointCloud< PointXYZ >::Ptr cloud