Point Cloud Library (PCL)  1.9.1-dev
crf_segmentation.hpp
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the copyright holder(s) nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *
35  * Author : Christian Potthast
36  * Email : potthast@usc.edu
37  *
38  */
39 
40 #ifndef PCL_CRF_SEGMENTATION_HPP_
41 #define PCL_CRF_SEGMENTATION_HPP_
42 
43 #include <pcl/segmentation/crf_segmentation.h>
44 
45 #include <pcl/common/io.h>
46 
47 #include <cstdio>
48 #include <cstdlib>
49 #include <ctime>
50 
51 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
52 template <typename PointT>
54  voxel_grid_ (),
55  input_cloud_ (new pcl::PointCloud<PointT>),
56  normal_cloud_ (new pcl::PointCloud<pcl::PointNormal>),
57  filtered_cloud_ (new pcl::PointCloud<PointT>),
58  filtered_anno_ (new pcl::PointCloud<pcl::PointXYZRGBL>),
59  filtered_normal_ (new pcl::PointCloud<pcl::PointNormal>),
60  voxel_grid_leaf_size_ (Eigen::Vector4f (0.001f, 0.001f, 0.001f, 0.0f))
61 {
62 }
63 
64 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
65 template <typename PointT>
67 {
68 }
69 
70 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
71 template <typename PointT> void
73 {
74  if (input_cloud_ != NULL)
75  input_cloud_.reset ();
76 
77  input_cloud_ = input_cloud;
78 }
79 
80 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
81 template <typename PointT> void
83 {
84  if (anno_cloud_ != NULL)
85  anno_cloud_.reset ();
86 
87  anno_cloud_ = anno_cloud;
88 }
89 
90 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
91 template <typename PointT> void
93 {
94  if (normal_cloud_ != NULL)
95  normal_cloud_.reset ();
96 
97  normal_cloud_ = normal_cloud;
98 }
99 
100 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
101 template <typename PointT> void
102 pcl::CrfSegmentation<PointT>::setVoxelGridLeafSize (const float x, const float y, const float z)
103 {
104  voxel_grid_leaf_size_.x () = x;
105  voxel_grid_leaf_size_.y () = y;
106  voxel_grid_leaf_size_.z () = z;
107 }
108 
109 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
110 template <typename PointT> void
111 pcl::CrfSegmentation<PointT>::setSmoothnessKernelParameters (const float sx, const float sy, const float sz,
112  const float w)
113 {
114  smoothness_kernel_param_[0] = sx;
115  smoothness_kernel_param_[1] = sy;
116  smoothness_kernel_param_[2] = sz;
118 }
119 
120 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
121 template <typename PointT> void
123  float sr, float sg, float sb,
124  float w)
125 {
126  appearance_kernel_param_[0] = sx;
127  appearance_kernel_param_[1] = sy;
128  appearance_kernel_param_[2] = sz;
129  appearance_kernel_param_[3] = sr;
130  appearance_kernel_param_[4] = sg;
131  appearance_kernel_param_[5] = sb;
133 }
134 
135 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
136 template <typename PointT> void
138  float snx, float sny, float snz,
139  float w)
140 {
141  surface_kernel_param_[0] = sx;
142  surface_kernel_param_[1] = sy;
143  surface_kernel_param_[2] = sz;
144  surface_kernel_param_[3] = snx;
145  surface_kernel_param_[4] = sny;
146  surface_kernel_param_[5] = snz;
147  surface_kernel_param_[6] = w;
148 }
149 
150 
151 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
152 template <typename PointT> void
154 {
155  // Filter the input cloud
156  // Set the voxel grid input cloud
157  voxel_grid_.setInputCloud (input_cloud_);
158  // Set the voxel grid leaf size
160  // Only downsample XYZ (if this is set to false, color values set to 0)
161  voxel_grid_.setDownsampleAllData (true);
162  // Save leaf information
163  //voxel_grid_.setSaveLeafLayout (true);
164  // apply the filter
165  voxel_grid_.filter (*filtered_cloud_);
166 
167  // Filter the annotated cloud
168  if (anno_cloud_->points.size () > 0)
169  {
171 
173  // Set the voxel grid leaf size
175  // Only downsample XYZ
176  vg.setDownsampleAllData (true);
177  // Save leaf information
178  //vg.setSaveLeafLayout (false);
179  // apply the filter
180  vg.filter (*filtered_anno_);
181  }
182 
183  // Filter the annotated cloud
184  if (normal_cloud_->points.size () > 0)
185  {
188  // Set the voxel grid leaf size
190  // Only downsample XYZ
191  vg.setDownsampleAllData (true);
192  // Save leaf information
193  //vg.setSaveLeafLayout (false);
194  // apply the filter
195  vg.filter (*filtered_normal_);
196  }
197 
198 }
199 
200 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
201 template <typename PointT> void
203 {
204  // get the dimension of the voxel grid
205  //Eigen::Vector3i min_b, max_b;
206  //min_b = voxel_grid_.getMinBoxCoordinates ();
207  //max_b = voxel_grid_.getMaxBoxCoordinates ();
208 
209  //std::cout << "min_b: " << min_b.x () << " " << min_b.y () << " " << min_b.z () << std::endl;
210  //std::cout << "max_b: " << max_b.x () << " " << max_b.y () << " " << max_b.z () << std::endl;
211 
212  // compute the voxel grid dimensions
213  //dim_.x () = abs (max_b.x () - min_b.x ());
214  //dim_.y () = abs (max_b.y () - min_b.y ());
215  //dim_.z () = abs (max_b.z () - min_b.z ());
216 
217  //std::cout << dim_.x () * dim_.y () * dim_.z () << std::endl;
218 
219  // reserve the space for the data vector
220  //data_.reserve (dim_.x () * dim_.y () * dim_.z ());
221 
222 /*
223  std::vector<Eigen::Vector3i, Eigen::aligned_allocator<Eigen::Vector3i> > data;
224  std::vector<Eigen::Vector3i, Eigen::aligned_allocator<Eigen::Vector3i> > color;
225  // fill the data vector
226  for (int kk = min_b.z (), k = 0; kk <= max_b.z (); kk++, k++)
227  {
228  for (int jj = min_b.y (), j = 0; jj <= max_b.y (); jj++, j++)
229  {
230  for (int ii = min_b.x (), i = 0; ii <= max_b.x (); ii++, i++)
231  {
232  Eigen::Vector3i ijk (ii, jj, kk);
233  int index = voxel_grid_.getCentroidIndexAt (ijk);
234  if (index != -1)
235  {
236  data_.push_back (Eigen::Vector3i (i, j, k));
237  color_.push_back (input_cloud_->points[index].getRGBVector3i ());
238  }
239  }
240  }
241  }
242 */
243 
244 
245 /*
246  // get the size of the input fields
247  std::vector< pcl::PCLPointField > fields;
248  pcl::getFields (*input_cloud_, fields);
249 
250  for (int i = 0; i < fields.size (); i++)
251  std::cout << fields[i] << std::endl;
252 */
253 
254 
255  // reserve space for the data vector
256  data_.resize (filtered_cloud_->points.size ());
257 
258  std::vector< pcl::PCLPointField > fields;
259  // check if we have color data
260  bool color_data = false;
261  int rgba_index = -1;
262  rgba_index = pcl::getFieldIndex (*input_cloud_, "rgb", fields);
263  if (rgba_index == -1)
264  rgba_index = pcl::getFieldIndex (*input_cloud_, "rgba", fields);
265  if (rgba_index >= 0)
266  {
267  color_data = true;
268  color_.resize (filtered_cloud_->points.size ());
269  }
270 
271 
272 /*
273  // check if we have normal data
274  bool normal_data = false;
275  int normal_index = -1;
276  rgba_index = pcl::getFieldIndex (*input_cloud_, "normal_x", fields);
277  if (rgba_index >= 0)
278  {
279  normal_data = true;
280  normal_.resize (filtered_cloud_->points.size ());
281  }
282 */
283 
284  // fill the data vector
285  for (size_t i = 0; i < filtered_cloud_->points.size (); i++)
286  {
287  Eigen::Vector3f p (filtered_anno_->points[i].x,
288  filtered_anno_->points[i].y,
289  filtered_anno_->points[i].z);
290  Eigen::Vector3i c = voxel_grid_.getGridCoordinates (p.x (), p.y (), p.y ());
291  data_[i] = c;
292 
293  if (color_data)
294  {
295  uint32_t rgb = *reinterpret_cast<int*>(&filtered_cloud_->points[i].rgba);
296  uint8_t r = (rgb >> 16) & 0x0000ff;
297  uint8_t g = (rgb >> 8) & 0x0000ff;
298  uint8_t b = (rgb) & 0x0000ff;
299  color_[i] = Eigen::Vector3i (r, g, b);
300  }
301 
302 /*
303  if (normal_data)
304  {
305  float n_x = filtered_cloud_->points[i].normal_x;
306  float n_y = filtered_cloud_->points[i].normal_y;
307  float n_z = filtered_cloud_->points[i].normal_z;
308  normal_[i] = Eigen::Vector3f (n_x, n_y, n_z);
309  }
310 */
311  }
312 
313  normal_.resize (filtered_normal_->points.size ());
314  for (size_t i = 0; i < filtered_normal_->points.size (); i++)
315  {
316  float n_x = filtered_normal_->points[i].normal_x;
317  float n_y = filtered_normal_->points[i].normal_y;
318  float n_z = filtered_normal_->points[i].normal_z;
319  normal_[i] = Eigen::Vector3f (n_x, n_y, n_z);
320  }
321 
322 
323 }
324 
325 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
326 template <typename PointT> void
328  std::vector<int> &labels,
329  unsigned int n_labels)
330 {
331  /* initialize random seed: */
332  srand ( static_cast<unsigned int> (time (NULL)) );
333  //srand ( time (NULL) );
334 
335  // Certainty that the groundtruth is correct
336  const float GT_PROB = 0.9f;
337  const float u_energy = -logf ( 1.0f / static_cast<float> (n_labels) );
338  const float n_energy = -logf ( (1.0f - GT_PROB) / static_cast<float>(n_labels - 1) );
339  const float p_energy = -logf ( GT_PROB );
340 
341  for (size_t k = 0; k < filtered_anno_->points.size (); k++)
342  {
343  int label = filtered_anno_->points[k].label;
344 
345  if (labels.size () == 0 && label > 0)
346  labels.push_back (label);
347 
348  // add color to the color vector if not added yet
349  for (int c_idx = 0; c_idx < static_cast<int> (labels.size ()) ; c_idx++)
350  {
351  if (labels[c_idx] == label)
352  break;
353 
354  if (c_idx == static_cast<int>(labels.size () -1) && label > 0)
355  {
356  if (labels.size () < n_labels)
357  labels.push_back (label);
358  else
359  label = 0;
360  }
361  }
362 
363  // set the engeries for the labels
364  size_t u_idx = k * n_labels;
365  if (label > 0)
366  {
367  for (size_t i = 0; i < n_labels; i++)
368  unary[u_idx + i] = n_energy;
369  unary[u_idx + labels.size ()] = p_energy;
370 
371  if (label == 1)
372  {
373  const float PROB = 0.2f;
374  const float n_energy2 = -logf ( (1.0f - PROB) / static_cast<float>(n_labels - 1) );
375  const float p_energy2 = -logf ( PROB );
376 
377  for (size_t i = 0; i < n_labels; i++)
378  unary[u_idx + i] = n_energy2;
379  unary[u_idx + labels.size ()] = p_energy2;
380  }
381 
382  }
383  else
384  {
385  for (size_t i = 0; i < n_labels; i++)
386  unary[u_idx + i] = u_energy;
387  }
388  }
389 }
390 
391 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
392 template <typename PointT> void
394 {
395  // create the voxel grid
396  createVoxelGrid ();
397  std::cout << "create Voxel Grid - DONE" << std::endl;
398 
399  // create the data Vector
401  std::cout << "create Data Vector from Voxel Grid - DONE" << std::endl;
402 
403  // number of labels
404  const int n_labels = 10;
405  // number of data points
406  int N = static_cast<int> (data_.size ());
407 
408  // create unary potentials
409  std::vector<int> labels;
410  std::vector<float> unary;
411  if (anno_cloud_->points.size () > 0)
412  {
413  unary.resize (N * n_labels);
414  createUnaryPotentials (unary, labels, n_labels);
415 
416 
417  std::cout << "labels size: " << labels.size () << std::endl;
418  for (size_t i = 0; i < labels.size (); i++)
419  {
420  std::cout << labels[i] << std::endl;
421  }
422 
423  }
424  std::cout << "create unary potentials - DONE" << std::endl;
425 
426 
427 /*
428  pcl::PointCloud<pcl::PointXYZRGBL> tmp_cloud_OLD;
429  tmp_cloud_OLD = *filtered_anno_;
430 
431  // Setup the CRF model
432  DenseCRF2D crfOLD(N, 1, n_labels);
433 
434  float * unaryORI = new float[N*n_labels];
435  for (int i = 0; i < N*n_labels; i++)
436  unaryORI[i] = unary[i];
437  crfOLD.setUnaryEnergy( unaryORI );
438 
439  float * pos = new float[N*3];
440  for (int i = 0; i < N; i++)
441  {
442  pos[i * 3] = data_[i].x ();
443  pos[i * 3 +1] = data_[i].y ();
444  pos[i * 3 +2] = data_[i].z ();
445  }
446  crfOLD.addPairwiseGaussian( pos, 3, 3, 3, 2.0 );
447 
448  float * col = new float[N*3];
449  for (int i = 0; i < N; i++)
450  {
451  col[i * 3] = color_[i].x ();
452  col[i * 3 +1] = color_[i].y ();
453  col[i * 3 +2] = color_[i].z ();
454  }
455  crfOLD.addPairwiseBilateral(pos, col, 20, 20, 20, 10, 10, 10, 1.3 );
456 
457  short * map = new short[N];
458  crfOLD.map(10, map);
459 
460  for (size_t i = 0; i < N; i++)
461  {
462  tmp_cloud_OLD.points[i].label = map[i];
463  }
464 
465 
466 */
467 
468  //float * resultOLD = new float[N*n_labels];
469  //crfOLD.inference (10, resultOLD);
470 
471  //std::vector<float> baryOLD;
472  //crfOLD.getBarycentric (0, baryOLD);
473  //std::vector<float> featuresOLD;
474  //crfOLD.getFeature (1, featuresOLD);
475 
476 /*
477  for(int i = 0; i < 25; i++)
478  {
479  std::cout << baryOLD[i] << std::endl;
480  }
481 */
482 
483 
484  // create the output cloud
485  //output = *filtered_anno_;
486 
487 
488 
489  // ----------------------------------//
490  // -------- -------------------//
491 
493  tmp_cloud = *filtered_anno_;
494 
495  // create dense CRF
496  DenseCrf crf (N, n_labels);
497 
498  // set the unary potentials
499  crf.setUnaryEnergy (unary);
500 
501  // set the data vector
502  crf.setDataVector (data_);
503 
504  // set the color vector
505  crf.setColorVector (color_);
506 
507  std::cout << "create dense CRF - DONE" << std::endl;
508 
509 
510  // add the smoothness kernel
515  std::cout << "add smoothness kernel - DONE" << std::endl;
516 
517  // add the appearance kernel
525  std::cout << "add appearance kernel - DONE" << std::endl;
526 
535  std::cout << "add surface kernel - DONE" << std::endl;
536 
537  // map inference
538  std::vector<int> r (N);
539  crf.mapInference (n_iterations_, r);
540 
541  //std::vector<float> result (N*n_labels);
542  //crf.inference (n_iterations_, result);
543 
544  //std::vector<float> bary;
545  //crf.getBarycentric (0, bary);
546  //std::vector<float> features;
547  //crf.getFeatures (1, features);
548 
549  std::cout << "Map inference - DONE" << std::endl;
550 
551  // create the output cloud
552  output = *filtered_anno_;
553 
554  for (int i = 0; i < N; i++)
555  {
556  output.points[i].label = labels[r[i]];
557  }
558 
559 
560 /*
561  bool c = true;
562  for (size_t i = 0; i < tmp_cloud.points.size (); i++)
563  {
564  if (tmp_cloud.points[i].label != tmp_cloud_OLD.points[i].label)
565  {
566 
567  std::cout << "idx: " << i << " = " <<tmp_cloud.points[i].label << " | " << tmp_cloud_OLD.points[i].label << std::endl;
568  c = false;
569  break;
570  }
571  }
572 
573  if (c)
574  std::cout << "DEBUG - OUTPUT - OK" << std::endl;
575  else
576  std::cout << "DEBUG - OUTPUT - ERROR" << std::endl;
577 */
578 
579 
580 
581 /*
582  for (size_t i = 0; i < 25; i++)
583  {
584  std::cout << result[i] << " | " << resultOLD[i] << std::endl;
585  }
586 
587 
588  c = true;
589  for (size_t i = 0; i < result.size (); i++)
590  {
591  if (result[i] != resultOLD[i])
592  {
593  std::cout << result[i] << " | " << resultOLD[i] << std::endl;
594 
595  c = false;
596  break;
597  }
598  }
599 
600  if (c)
601  std::cout << "DEBUG - OUTPUT - OK" << std::endl;
602  else
603  std::cout << "DEBUG - OUTPUT - ERROR" << std::endl;
604 */
605 
606 
607 }
608 
609 #define PCL_INSTANTIATE_CrfSegmentation(T) template class pcl::CrfSegmentation<T>;
610 
611 #endif // PCL_CRF_SEGMENTATION_HPP_
float smoothness_kernel_param_[4]
smoothness kernel parameters [0] = standard deviation x [1] = standard deviation y [2] = standard dev...
~CrfSegmentation()
This destructor destroys the cloud...
CrfSegmentation()
Constructor that sets default values for member variables.
int getFieldIndex(const pcl::PCLPointCloud2 &cloud, const std::string &field_name)
Get the index of a specified field (i.e., dimension/channel)
Definition: io.h:58
void createVoxelGrid()
Create a voxel grid to discretize the scene.
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
Definition: point_cloud.h:409
void addPairwiseGaussian(float sx, float sy, float sz, float w)
Add a pairwise gaussian kernel.
void addPairwiseNormals(std::vector< Eigen::Vector3i, Eigen::aligned_allocator< Eigen::Vector3i > > &coord, std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &normals, float sx, float sy, float sz, float snx, float sny, float snz, float w)
void setAppearanceKernelParameters(float sx, float sy, float sz, float sr, float sg, float sb, float w)
Set the appearanche kernel parameters.
void mapInference(int n_iterations, std::vector< int > &result, float relax=1.0f)
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:44
void setInputCloud(typename pcl::PointCloud< PointT >::Ptr input_cloud)
This method sets the input cloud.
void setUnaryEnergy(const std::vector< float > unary)
pcl::PointCloud< PointT >::Ptr input_cloud_
input cloud that will be segmented.
void setVoxelGridLeafSize(const float x, const float y, const float z)
Set the leaf size for the voxel grid.
void addPairwiseBilateral(float sx, float sy, float sz, float sr, float sg, float sb, float w)
Add a bilateral gaussian kernel.
void setDownsampleAllData(bool downsample)
Set to true if all fields need to be downsampled, or false if just XYZ.
Definition: voxel_grid.h:257
pcl::VoxelGrid< PointT > voxel_grid_
Voxel grid to discretize the scene.
void filter(PointCloud &output)
Calls the filtering method and returns the filtered dataset in output.
Definition: filter.h:131
VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data...
Definition: voxel_grid.h:177
std::vector< Eigen::Vector3i, Eigen::aligned_allocator< Eigen::Vector3i > > color_
void segmentPoints(pcl::PointCloud< pcl::PointXYZRGBL > &output)
This method simply launches the segmentation algorithm.
Definition: bfgs.h:9
float appearance_kernel_param_[7]
appearance kernel parameters [0] = standard deviation x [1] = standard deviation y [2] = standard dev...
Eigen::Vector4f voxel_grid_leaf_size_
indices of the filtered cloud.
pcl::PointCloud< PointT >::Ptr filtered_cloud_
voxel grid filtered cloud.
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:427
std::vector< Eigen::Vector3i, Eigen::aligned_allocator< Eigen::Vector3i > > data_
voxel grid data points packing order [x0y0z0, x1y0z0,x2y0z0,...,x0y1z0,x1y1z0,...,x0y0z1,x1y0z1,...]
unsigned int n_iterations_
void createDataVectorFromVoxelGrid()
Get the data from the voxel grid and convert it into a vector.
pcl::PointCloud< pcl::PointNormal >::Ptr normal_cloud_
void setColorVector(const std::vector< Eigen::Vector3i, Eigen::aligned_allocator< Eigen::Vector3i > > color)
The associated color of the data.
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > normal_
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void createUnaryPotentials(std::vector< float > &unary, std::vector< int > &colors, unsigned int n_labels)
A point structure representing Euclidean xyz coordinates, together with normal coordinates and the su...
pcl::PointCloud< pcl::PointNormal >::Ptr filtered_normal_
void setSurfaceKernelParameters(float sx, float sy, float sz, float snx, float sny, float snz, float w)
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
Definition: pcl_base.hpp:66
pcl::PointCloud< pcl::PointXYZRGBL >::Ptr anno_cloud_
A point structure representing Euclidean xyz coordinates, and the RGB color.
void setSmoothnessKernelParameters(const float sx, const float sy, const float sz, const float w)
Set the smoothness kernel parameters.
void setDataVector(const std::vector< Eigen::Vector3i, Eigen::aligned_allocator< Eigen::Vector3i > > data)
set the input data vector.
void setAnnotatedCloud(typename pcl::PointCloud< pcl::PointXYZRGBL >::Ptr anno_cloud)
pcl::PointCloud< pcl::PointXYZRGBL >::Ptr filtered_anno_
void setLeafSize(const Eigen::Vector4f &leaf_size)
Set the voxel grid leaf size.
Definition: voxel_grid.h:223
void setNormalCloud(typename pcl::PointCloud< pcl::PointNormal >::Ptr normal_cloud)