Point Cloud Library (PCL)  1.9.1-dev
io.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, Inc.
6  * Copyright (c) 2012-, Open Perception, Inc.
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the copyright holder(s) nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  * $Id$
38  *
39  */
40 
41 #pragma once
42 
43 #include <string>
44 #include <pcl/pcl_base.h>
45 #include <pcl/PointIndices.h>
46 #include <pcl/conversions.h>
47 #include <pcl/exceptions.h>
48 #include <locale>
49 
50 namespace pcl
51 {
52  /** \brief Get the index of a specified field (i.e., dimension/channel)
53  * \param[in] cloud the point cloud message
54  * \param[in] field_name the string defining the field name
55  * \ingroup common
56  */
57  inline int
58  getFieldIndex (const pcl::PCLPointCloud2 &cloud, const std::string &field_name)
59  {
60  // Get the index we need
61  for (size_t d = 0; d < cloud.fields.size (); ++d)
62  if (cloud.fields[d].name == field_name)
63  return (static_cast<int>(d));
64  return (-1);
65  }
66 
67  /** \brief Get the index of a specified field (i.e., dimension/channel)
68  * \param[in] cloud the point cloud message
69  * \param[in] field_name the string defining the field name
70  * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains
71  * \ingroup common
72  */
73  template <typename PointT> inline int
74  getFieldIndex (const pcl::PointCloud<PointT> &cloud, const std::string &field_name,
75  std::vector<pcl::PCLPointField> &fields);
76 
77  /** \brief Get the index of a specified field (i.e., dimension/channel)
78  * \param[in] field_name the string defining the field name
79  * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains
80  * \ingroup common
81  */
82  template <typename PointT> inline int
83  getFieldIndex (const std::string &field_name,
84  std::vector<pcl::PCLPointField> &fields);
85 
86  /** \brief Get the list of available fields (i.e., dimension/channel)
87  * \param[in] cloud the point cloud message
88  * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains
89  * \ingroup common
90  */
91  template <typename PointT> inline void
92  getFields (const pcl::PointCloud<PointT> &cloud, std::vector<pcl::PCLPointField> &fields);
93 
94  /** \brief Get the list of available fields (i.e., dimension/channel)
95  * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains
96  * \ingroup common
97  */
98  template <typename PointT> inline void
99  getFields (std::vector<pcl::PCLPointField> &fields);
100 
101  /** \brief Get the list of all fields available in a given cloud
102  * \param[in] cloud the point cloud message
103  * \ingroup common
104  */
105  template <typename PointT> inline std::string
106  getFieldsList (const pcl::PointCloud<PointT> &cloud);
107 
108  /** \brief Get the available point cloud fields as a space separated string
109  * \param[in] cloud a pointer to the PointCloud message
110  * \ingroup common
111  */
112  inline std::string
114  {
115  std::string result;
116  for (size_t i = 0; i < cloud.fields.size () - 1; ++i)
117  result += cloud.fields[i].name + " ";
118  result += cloud.fields[cloud.fields.size () - 1].name;
119  return (result);
120  }
121 
122  /** \brief Obtains the size of a specific field data type in bytes
123  * \param[in] datatype the field data type (see PCLPointField.h)
124  * \ingroup common
125  */
126  inline int
127  getFieldSize (const int datatype)
128  {
129  switch (datatype)
130  {
133  return (1);
134 
137  return (2);
138 
142  return (4);
143 
145  return (8);
146 
147  default:
148  return (0);
149  }
150  }
151 
152  /** \brief Obtain a vector with the sizes of all valid fields (e.g., not "_")
153  * \param[in] fields the input vector containing the fields
154  * \param[out] field_sizes the resultant field sizes in bytes
155  */
156  PCL_EXPORTS void
157  getFieldsSizes (const std::vector<pcl::PCLPointField> &fields,
158  std::vector<int> &field_sizes);
159 
160  /** \brief Obtains the type of the PCLPointField from a specific size and type
161  * \param[in] size the size in bytes of the data field
162  * \param[in] type a char describing the type of the field ('F' = float, 'I' = signed, 'U' = unsigned)
163  * \ingroup common
164  */
165  inline int
166  getFieldType (const int size, char type)
167  {
168  type = std::toupper (type, std::locale::classic ());
169  switch (size)
170  {
171  case 1:
172  if (type == 'I')
173  return (pcl::PCLPointField::INT8);
174  if (type == 'U')
175  return (pcl::PCLPointField::UINT8);
176  break;
177 
178  case 2:
179  if (type == 'I')
180  return (pcl::PCLPointField::INT16);
181  if (type == 'U')
183  break;
184 
185  case 4:
186  if (type == 'I')
187  return (pcl::PCLPointField::INT32);
188  if (type == 'U')
190  if (type == 'F')
192  break;
193 
194  case 8:
195  if (type == 'F')
197  break;
198  }
199  return (-1);
200  }
201 
202  /** \brief Obtains the type of the PCLPointField from a specific PCLPointField as a char
203  * \param[in] type the PCLPointField field type
204  * \ingroup common
205  */
206  inline char
207  getFieldType (const int type)
208  {
209  switch (type)
210  {
214  return ('I');
215 
219  return ('U');
220 
223  return ('F');
224  default:
225  return ('?');
226  }
227  }
228 
230  {
235  };
236 
237  /** \brief \return the right index according to the interpolation type.
238  * \note this is adapted from OpenCV
239  * \param p the index of point to interpolate
240  * \param length the top/bottom row or left/right column index
241  * \param type the requested interpolation
242  * \throws pcl::BadArgumentException if type is unknown
243  */
244  PCL_EXPORTS int
245  interpolatePointIndex (int p, int length, InterpolationType type);
246 
247  /** \brief Concatenate two pcl::PointCloud<PointT>
248  * \param[in] cloud1 the first input point cloud dataset
249  * \param[in] cloud2 the second input point cloud dataset
250  * \param[out] cloud_out the resultant output point cloud dataset
251  * \return true if successful, false if failed
252  * \ingroup common
253  */
254  template <typename PointT>
255  PCL_EXPORTS bool
257  const pcl::PointCloud<PointT> &cloud2,
258  pcl::PointCloud<PointT> &cloud_out)
259  {
260  return pcl::PointCloud<PointT>::concatenate(cloud1, cloud2, cloud_out);
261  }
262 
263  /** \brief Concatenate two pcl::PCLPointCloud2
264  *
265  * \warn This function subtly differs from the deprecated `concatenatePointloud`
266  * The difference is thatthis function will concatenate IFF the non-skip fields
267  * are in the correct order and same in number. The deprecated function skipped
268  * fields even if both clouds didn't agree on the number of output fields
269  * \param[in] cloud1 the first input point cloud dataset
270  * \param[in] cloud2 the second input point cloud dataset
271  * \param[out] cloud_out the resultant output point cloud dataset
272  * \return true if successful, false if failed
273  * \ingroup common
274  */
275  PCL_EXPORTS bool
276  concatenate (const pcl::PCLPointCloud2 &cloud1,
277  const pcl::PCLPointCloud2 &cloud2,
278  pcl::PCLPointCloud2 &cloud_out);
279 
280  /** \brief Concatenate two pcl::PCLPointCloud2
281  * \param[in] cloud1 the first input point cloud dataset
282  * \param[in] cloud2 the second input point cloud dataset
283  * \param[out] cloud_out the resultant output point cloud dataset
284  * \return true if successful, false if failed (e.g., name/number of fields differs)
285  * \ingroup common
286  */
287  [[deprecated("use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)")]]
288  PCL_EXPORTS bool
290  const pcl::PCLPointCloud2 &cloud2,
291  pcl::PCLPointCloud2 &cloud_out);
292 
293  /** \brief Extract the indices of a given point cloud as a new point cloud
294  * \param[in] cloud_in the input point cloud dataset
295  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
296  * \param[out] cloud_out the resultant output point cloud dataset
297  * \note Assumes unique indices.
298  * \ingroup common
299  */
300  PCL_EXPORTS void
301  copyPointCloud (const pcl::PCLPointCloud2 &cloud_in,
302  const std::vector<int> &indices,
303  pcl::PCLPointCloud2 &cloud_out);
304 
305  /** \brief Extract the indices of a given point cloud as a new point cloud
306  * \param[in] cloud_in the input point cloud dataset
307  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
308  * \param[out] cloud_out the resultant output point cloud dataset
309  * \note Assumes unique indices.
310  * \ingroup common
311  */
312  PCL_EXPORTS void
313  copyPointCloud (const pcl::PCLPointCloud2 &cloud_in,
314  const std::vector<int, Eigen::aligned_allocator<int> > &indices,
315  pcl::PCLPointCloud2 &cloud_out);
316 
317  /** \brief Copy fields and point cloud data from \a cloud_in to \a cloud_out
318  * \param[in] cloud_in the input point cloud dataset
319  * \param[out] cloud_out the resultant output point cloud dataset
320  * \ingroup common
321  */
322  PCL_EXPORTS void
323  copyPointCloud (const pcl::PCLPointCloud2 &cloud_in,
324  pcl::PCLPointCloud2 &cloud_out);
325 
326  /** \brief Check if two given point types are the same or not. */
327  template <typename Point1T, typename Point2T> inline bool
329  {
330  return (typeid (Point1T) == typeid (Point2T));
331  }
332 
333  /** \brief Extract the indices of a given point cloud as a new point cloud
334  * \param[in] cloud_in the input point cloud dataset
335  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
336  * \param[out] cloud_out the resultant output point cloud dataset
337  * \note Assumes unique indices.
338  * \ingroup common
339  */
340  template <typename PointT> void
341  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
342  const std::vector<int> &indices,
343  pcl::PointCloud<PointT> &cloud_out);
344 
345  /** \brief Extract the indices of a given point cloud as a new point cloud
346  * \param[in] cloud_in the input point cloud dataset
347  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
348  * \param[out] cloud_out the resultant output point cloud dataset
349  * \note Assumes unique indices.
350  * \ingroup common
351  */
352  template <typename PointT> void
353  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
354  const std::vector<int, Eigen::aligned_allocator<int> > &indices,
355  pcl::PointCloud<PointT> &cloud_out);
356 
357  /** \brief Extract the indices of a given point cloud as a new point cloud
358  * \param[in] cloud_in the input point cloud dataset
359  * \param[in] indices the PointIndices structure representing the points to be copied from cloud_in
360  * \param[out] cloud_out the resultant output point cloud dataset
361  * \note Assumes unique indices.
362  * \ingroup common
363  */
364  template <typename PointT> void
365  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
366  const PointIndices &indices,
367  pcl::PointCloud<PointT> &cloud_out);
368 
369  /** \brief Extract the indices of a given point cloud as a new point cloud
370  * \param[in] cloud_in the input point cloud dataset
371  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
372  * \param[out] cloud_out the resultant output point cloud dataset
373  * \note Assumes unique indices.
374  * \ingroup common
375  */
376  template <typename PointT> void
377  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
378  const std::vector<pcl::PointIndices> &indices,
379  pcl::PointCloud<PointT> &cloud_out);
380 
381  /** \brief Copy all the fields from a given point cloud into a new point cloud
382  * \param[in] cloud_in the input point cloud dataset
383  * \param[out] cloud_out the resultant output point cloud dataset
384  * \ingroup common
385  */
386  template <typename PointInT, typename PointOutT> void
387  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
388  pcl::PointCloud<PointOutT> &cloud_out);
389 
390  /** \brief Extract the indices of a given point cloud as a new point cloud
391  * \param[in] cloud_in the input point cloud dataset
392  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
393  * \param[out] cloud_out the resultant output point cloud dataset
394  * \note Assumes unique indices.
395  * \ingroup common
396  */
397  template <typename PointInT, typename PointOutT> void
398  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
399  const std::vector<int> &indices,
400  pcl::PointCloud<PointOutT> &cloud_out);
401 
402  /** \brief Extract the indices of a given point cloud as a new point cloud
403  * \param[in] cloud_in the input point cloud dataset
404  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
405  * \param[out] cloud_out the resultant output point cloud dataset
406  * \note Assumes unique indices.
407  * \ingroup common
408  */
409  template <typename PointInT, typename PointOutT> void
410  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
411  const std::vector<int, Eigen::aligned_allocator<int> > &indices,
412  pcl::PointCloud<PointOutT> &cloud_out);
413 
414  /** \brief Extract the indices of a given point cloud as a new point cloud
415  * \param[in] cloud_in the input point cloud dataset
416  * \param[in] indices the PointIndices structure representing the points to be copied from cloud_in
417  * \param[out] cloud_out the resultant output point cloud dataset
418  * \note Assumes unique indices.
419  * \ingroup common
420  */
421  template <typename PointInT, typename PointOutT> void
422  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
423  const PointIndices &indices,
424  pcl::PointCloud<PointOutT> &cloud_out);
425 
426  /** \brief Extract the indices of a given point cloud as a new point cloud
427  * \param[in] cloud_in the input point cloud dataset
428  * \param[in] indices the vector of indices representing the points to be copied from cloud_in
429  * \param[out] cloud_out the resultant output point cloud dataset
430  * \note Assumes unique indices.
431  * \ingroup common
432  */
433  template <typename PointInT, typename PointOutT> void
434  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
435  const std::vector<pcl::PointIndices> &indices,
436  pcl::PointCloud<PointOutT> &cloud_out);
437 
438  /** \brief Copy a point cloud inside a larger one interpolating borders.
439  * \param[in] cloud_in the input point cloud dataset
440  * \param[out] cloud_out the resultant output point cloud dataset
441  * \param top
442  * \param bottom
443  * \param left
444  * \param right
445  * Position of cloud_in inside cloud_out is given by \a top, \a left, \a bottom \a right.
446  * \param[in] border_type the interpolating method (pcl::BORDER_XXX)
447  * BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
448  * BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
449  * BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
450  * BORDER_WRAP: cdefgh|abcdefgh|abcdefg
451  * BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii with some specified 'i'
452  * BORDER_TRANSPARENT: mnopqr|abcdefgh|tuvwxyz where m-r and t-z are original values of cloud_out
453  * \param value
454  * \throw pcl::BadArgumentException if any of top, bottom, left or right is negative.
455  * \ingroup common
456  */
457  template <typename PointT> void
458  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
459  pcl::PointCloud<PointT> &cloud_out,
460  int top, int bottom, int left, int right,
461  pcl::InterpolationType border_type, const PointT& value);
462 
463  /** \brief Concatenate two datasets representing different fields.
464  *
465  * \note If the input datasets have overlapping fields (i.e., both contain
466  * the same fields), then the data in the second cloud (cloud2_in) will
467  * overwrite the data in the first (cloud1_in).
468  *
469  * \param[in] cloud1_in the first input dataset
470  * \param[in] cloud2_in the second input dataset (overwrites the fields of the first dataset for those that are shared)
471  * \param[out] cloud_out the resultant output dataset created by the concatenation of all the fields in the input datasets
472  * \ingroup common
473  */
474  template <typename PointIn1T, typename PointIn2T, typename PointOutT> void
476  const pcl::PointCloud<PointIn2T> &cloud2_in,
477  pcl::PointCloud<PointOutT> &cloud_out);
478 
479  /** \brief Concatenate two datasets representing different fields.
480  *
481  * \note If the input datasets have overlapping fields (i.e., both contain
482  * the same fields), then the data in the second cloud (cloud2_in) will
483  * overwrite the data in the first (cloud1_in).
484  *
485  * \param[in] cloud1_in the first input dataset
486  * \param[in] cloud2_in the second input dataset (overwrites the fields of the first dataset for those that are shared)
487  * \param[out] cloud_out the output dataset created by concatenating all the fields in the input datasets
488  * \ingroup common
489  */
490  PCL_EXPORTS bool
491  concatenateFields (const pcl::PCLPointCloud2 &cloud1_in,
492  const pcl::PCLPointCloud2 &cloud2_in,
493  pcl::PCLPointCloud2 &cloud_out);
494 
495  /** \brief Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format
496  * \param[in] in the point cloud message
497  * \param[out] out the resultant Eigen MatrixXf format containing XYZ0 / point
498  * \ingroup common
499  */
500  PCL_EXPORTS bool
501  getPointCloudAsEigen (const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out);
502 
503  /** \brief Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message
504  * \param[in] in the Eigen MatrixXf format containing XYZ0 / point
505  * \param[out] out the resultant point cloud message
506  * \note the method assumes that the PCLPointCloud2 message already has the fields set up properly !
507  * \ingroup common
508  */
509  PCL_EXPORTS bool
510  getEigenAsPointCloud (Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out);
511 
512  namespace io
513  {
514  /** \brief swap bytes order of a char array of length N
515  * \param bytes char array to swap
516  * \ingroup common
517  */
518  template <std::size_t N> void
519  swapByte (char* bytes);
520 
521  /** \brief specialization of swapByte for dimension 1
522  * \param bytes char array to swap
523  */
524  template <> inline void
525  swapByte<1> (char* bytes) { bytes[0] = bytes[0]; }
526 
527 
528  /** \brief specialization of swapByte for dimension 2
529  * \param bytes char array to swap
530  */
531  template <> inline void
532  swapByte<2> (char* bytes) { std::swap (bytes[0], bytes[1]); }
533 
534  /** \brief specialization of swapByte for dimension 4
535  * \param bytes char array to swap
536  */
537  template <> inline void
538  swapByte<4> (char* bytes)
539  {
540  std::swap (bytes[0], bytes[3]);
541  std::swap (bytes[1], bytes[2]);
542  }
543 
544  /** \brief specialization of swapByte for dimension 8
545  * \param bytes char array to swap
546  */
547  template <> inline void
548  swapByte<8> (char* bytes)
549  {
550  std::swap (bytes[0], bytes[7]);
551  std::swap (bytes[1], bytes[6]);
552  std::swap (bytes[2], bytes[5]);
553  std::swap (bytes[3], bytes[4]);
554  }
555 
556  /** \brief swaps byte of an arbitrary type T casting it to char*
557  * \param value the data you want its bytes swapped
558  */
559  template <typename T> void
560  swapByte (T& value)
561  {
562  pcl::io::swapByte<sizeof(T)> (reinterpret_cast<char*> (&value));
563  }
564  }
565 }
566 
567 #include <pcl/common/impl/io.hpp>
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
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
std::string getFieldsList(const pcl::PointCloud< PointT > &cloud)
Get the list of all fields available in a given cloud.
Definition: io.hpp:97
void swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
Definition: io.h:548
bool isSamePointType()
Check if two given point types are the same or not.
Definition: io.h:328
void swapByte(char *bytes)
swap bytes order of a char array of length N
PCL_EXPORTS void copyPointCloud(const pcl::PCLPointCloud2 &cloud_in, const std::vector< int > &indices, pcl::PCLPointCloud2 &cloud_out)
Extract the indices of a given point cloud as a new point cloud.
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
Definition: io.h:166
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
PCL_EXPORTS void getFieldsSizes(const std::vector< pcl::PCLPointField > &fields, std::vector< int > &field_sizes)
Obtain a vector with the sizes of all valid fields (e.g., not "_")
PCL_EXPORTS bool concatenate(const pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2, pcl::PointCloud< PointT > &cloud_out)
Concatenate two pcl::PointCloud<PointT>
Definition: io.h:256
void swapByte< 1 >(char *bytes)
specialization of swapByte for dimension 1
Definition: io.h:525
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
Definition: io.h:127
PointCloud represents the base class in PCL for storing collections of 3D points. ...
InterpolationType
Definition: io.h:229
std::vector< ::pcl::PCLPointField > fields
PCL_EXPORTS bool getEigenAsPointCloud(Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out)
Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message.
static bool concatenate(pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2)
Definition: point_cloud.h:265
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
Definition: io.h:532
PCL_EXPORTS bool concatenatePointCloud(const pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2, pcl::PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
A point structure representing Euclidean xyz coordinates, and the RGB color.
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
Definition: io.h:538
void concatenateFields(const pcl::PointCloud< PointIn1T > &cloud1_in, const pcl::PointCloud< PointIn2T > &cloud2_in, pcl::PointCloud< PointOutT > &cloud_out)
Concatenate two datasets representing different fields.
Definition: io.hpp:346
#define PCL_EXPORTS
Definition: pcl_macros.h:226
void getFields(const pcl::PointCloud< PointT > &cloud, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
Definition: io.hpp:79