Point Cloud Library (PCL)  1.11.0
point_types.hpp
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010, 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  */
38 
39 #pragma once
40 
41 #include <pcl/memory.h> // for PCL_MAKE_ALIGNED_OPERATOR_NEW
42 #include <pcl/pcl_macros.h> // for PCL_EXPORTS
43 #include <pcl/PCLPointField.h> // for PCLPointField
44 #include <pcl/point_types.h> // implementee
45 #include <pcl/register_point_struct.h> // for POINT_CLOUD_REGISTER_POINT_STRUCT, POINT_CLOUD_REGISTER_POINT_WRAPPER
46 
47 #include <boost/mpl/and.hpp> // for boost::mpl::and_
48 #include <boost/mpl/bool.hpp> // for boost::mpl::bool_
49 #include <boost/mpl/contains.hpp> // for boost::mpl::contains
50 #include <boost/mpl/fold.hpp> // for boost::mpl::fold
51 #include <boost/mpl/or.hpp> // for boost::mpl::or_
52 #include <boost/mpl/placeholders.hpp> // for boost::mpl::_1, boost::mpl::_2
53 #include <boost/mpl/vector.hpp> // for boost::mpl::vector
54 
55 #include <Eigen/Core> // for MatrixMap
56 
57 #include <algorithm> // for copy_n, fill_n
58 #include <cstdint> // for uint8_t, uint32_t
59 #include <ostream> // for ostream, operator<<
60 #include <type_traits> // for enable_if_t
61 
62 // Define all PCL point types
63 #define PCL_POINT_TYPES \
64  (pcl::PointXYZ) \
65  (pcl::PointXYZI) \
66  (pcl::PointXYZL) \
67  (pcl::Label) \
68  (pcl::PointXYZRGBA) \
69  (pcl::PointXYZRGB) \
70  (pcl::PointXYZRGBL) \
71  (pcl::PointXYZHSV) \
72  (pcl::PointXY) \
73  (pcl::InterestPoint) \
74  (pcl::Axis) \
75  (pcl::Normal) \
76  (pcl::PointNormal) \
77  (pcl::PointXYZRGBNormal) \
78  (pcl::PointXYZINormal) \
79  (pcl::PointXYZLNormal) \
80  (pcl::PointWithRange) \
81  (pcl::PointWithViewpoint) \
82  (pcl::MomentInvariants) \
83  (pcl::PrincipalRadiiRSD) \
84  (pcl::Boundary) \
85  (pcl::PrincipalCurvatures) \
86  (pcl::PFHSignature125) \
87  (pcl::PFHRGBSignature250) \
88  (pcl::PPFSignature) \
89  (pcl::CPPFSignature) \
90  (pcl::PPFRGBSignature) \
91  (pcl::NormalBasedSignature12) \
92  (pcl::FPFHSignature33) \
93  (pcl::VFHSignature308) \
94  (pcl::GASDSignature512) \
95  (pcl::GASDSignature984) \
96  (pcl::GASDSignature7992) \
97  (pcl::GRSDSignature21) \
98  (pcl::ESFSignature640) \
99  (pcl::BRISKSignature512) \
100  (pcl::Narf36) \
101  (pcl::IntensityGradient) \
102  (pcl::PointWithScale) \
103  (pcl::PointSurfel) \
104  (pcl::ShapeContext1980) \
105  (pcl::UniqueShapeContext1960) \
106  (pcl::SHOT352) \
107  (pcl::SHOT1344) \
108  (pcl::PointUV) \
109  (pcl::ReferenceFrame) \
110  (pcl::PointDEM)
111 
112 // Define all point types that include RGB data
113 #define PCL_RGB_POINT_TYPES \
114  (pcl::PointXYZRGBA) \
115  (pcl::PointXYZRGB) \
116  (pcl::PointXYZRGBL) \
117  (pcl::PointXYZRGBNormal) \
118  (pcl::PointSurfel) \
119 
120 // Define all point types that include XYZ data
121 #define PCL_XYZ_POINT_TYPES \
122  (pcl::PointXYZ) \
123  (pcl::PointXYZI) \
124  (pcl::PointXYZL) \
125  (pcl::PointXYZRGBA) \
126  (pcl::PointXYZRGB) \
127  (pcl::PointXYZRGBL) \
128  (pcl::PointXYZHSV) \
129  (pcl::InterestPoint) \
130  (pcl::PointNormal) \
131  (pcl::PointXYZRGBNormal) \
132  (pcl::PointXYZINormal) \
133  (pcl::PointXYZLNormal) \
134  (pcl::PointWithRange) \
135  (pcl::PointWithViewpoint) \
136  (pcl::PointWithScale) \
137  (pcl::PointSurfel) \
138  (pcl::PointDEM)
139 
140 // Define all point types with XYZ and label
141 #define PCL_XYZL_POINT_TYPES \
142  (pcl::PointXYZL) \
143  (pcl::PointXYZRGBL) \
144  (pcl::PointXYZLNormal)
145 
146 // Define all point types that include normal[3] data
147 #define PCL_NORMAL_POINT_TYPES \
148  (pcl::Normal) \
149  (pcl::PointNormal) \
150  (pcl::PointXYZRGBNormal) \
151  (pcl::PointXYZINormal) \
152  (pcl::PointXYZLNormal) \
153  (pcl::PointSurfel)
154 
155 // Define all point types that represent features
156 #define PCL_FEATURE_POINT_TYPES \
157  (pcl::PFHSignature125) \
158  (pcl::PFHRGBSignature250) \
159  (pcl::PPFSignature) \
160  (pcl::CPPFSignature) \
161  (pcl::PPFRGBSignature) \
162  (pcl::NormalBasedSignature12) \
163  (pcl::FPFHSignature33) \
164  (pcl::VFHSignature308) \
165  (pcl::GASDSignature512) \
166  (pcl::GASDSignature984) \
167  (pcl::GASDSignature7992) \
168  (pcl::GRSDSignature21) \
169  (pcl::ESFSignature640) \
170  (pcl::BRISKSignature512) \
171  (pcl::Narf36)
172 
173 namespace pcl
174 {
175 
176  using Array3fMap = Eigen::Map<Eigen::Array3f>;
177  using Array3fMapConst = const Eigen::Map<const Eigen::Array3f>;
178  using Array4fMap = Eigen::Map<Eigen::Array4f, Eigen::Aligned>;
179  using Array4fMapConst = const Eigen::Map<const Eigen::Array4f, Eigen::Aligned>;
180  using Vector3fMap = Eigen::Map<Eigen::Vector3f>;
181  using Vector3fMapConst = const Eigen::Map<const Eigen::Vector3f>;
182  using Vector4fMap = Eigen::Map<Eigen::Vector4f, Eigen::Aligned>;
183  using Vector4fMapConst = const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned>;
184 
185  using Vector3c = Eigen::Matrix<std::uint8_t, 3, 1>;
186  using Vector3cMap = Eigen::Map<Vector3c>;
187  using Vector3cMapConst = const Eigen::Map<const Vector3c>;
188  using Vector4c = Eigen::Matrix<std::uint8_t, 4, 1>;
189  using Vector4cMap = Eigen::Map<Vector4c, Eigen::Aligned>;
190  using Vector4cMapConst = const Eigen::Map<const Vector4c, Eigen::Aligned>;
191 
192 #define PCL_ADD_UNION_POINT4D \
193  union EIGEN_ALIGN16 { \
194  float data[4]; \
195  struct { \
196  float x; \
197  float y; \
198  float z; \
199  }; \
200  };
201 
202 #define PCL_ADD_EIGEN_MAPS_POINT4D \
203  inline pcl::Vector3fMap getVector3fMap () { return (pcl::Vector3fMap (data)); } \
204  inline pcl::Vector3fMapConst getVector3fMap () const { return (pcl::Vector3fMapConst (data)); } \
205  inline pcl::Vector4fMap getVector4fMap () { return (pcl::Vector4fMap (data)); } \
206  inline pcl::Vector4fMapConst getVector4fMap () const { return (pcl::Vector4fMapConst (data)); } \
207  inline pcl::Array3fMap getArray3fMap () { return (pcl::Array3fMap (data)); } \
208  inline pcl::Array3fMapConst getArray3fMap () const { return (pcl::Array3fMapConst (data)); } \
209  inline pcl::Array4fMap getArray4fMap () { return (pcl::Array4fMap (data)); } \
210  inline pcl::Array4fMapConst getArray4fMap () const { return (pcl::Array4fMapConst (data)); }
211 
212 #define PCL_ADD_POINT4D \
213  PCL_ADD_UNION_POINT4D \
214  PCL_ADD_EIGEN_MAPS_POINT4D
215 
216 #define PCL_ADD_UNION_NORMAL4D \
217  union EIGEN_ALIGN16 { \
218  float data_n[4]; \
219  float normal[3]; \
220  struct { \
221  float normal_x; \
222  float normal_y; \
223  float normal_z; \
224  }; \
225  };
226 
227 #define PCL_ADD_EIGEN_MAPS_NORMAL4D \
228  inline pcl::Vector3fMap getNormalVector3fMap () { return (pcl::Vector3fMap (data_n)); } \
229  inline pcl::Vector3fMapConst getNormalVector3fMap () const { return (pcl::Vector3fMapConst (data_n)); } \
230  inline pcl::Vector4fMap getNormalVector4fMap () { return (pcl::Vector4fMap (data_n)); } \
231  inline pcl::Vector4fMapConst getNormalVector4fMap () const { return (pcl::Vector4fMapConst (data_n)); }
232 
233 #define PCL_ADD_NORMAL4D \
234  PCL_ADD_UNION_NORMAL4D \
235  PCL_ADD_EIGEN_MAPS_NORMAL4D
236 
237 #define PCL_ADD_UNION_RGB \
238  union \
239  { \
240  union \
241  { \
242  struct \
243  { \
244  std::uint8_t b; \
245  std::uint8_t g; \
246  std::uint8_t r; \
247  std::uint8_t a; \
248  }; \
249  float rgb; \
250  }; \
251  std::uint32_t rgba; \
252  };
253 
254 #define PCL_ADD_EIGEN_MAPS_RGB \
255  inline Eigen::Vector3i getRGBVector3i () { return (Eigen::Vector3i (r, g, b)); } \
256  inline const Eigen::Vector3i getRGBVector3i () const { return (Eigen::Vector3i (r, g, b)); } \
257  inline Eigen::Vector4i getRGBVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \
258  inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \
259  inline Eigen::Vector4i getRGBAVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \
260  inline const Eigen::Vector4i getRGBAVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \
261  inline pcl::Vector3cMap getBGRVector3cMap () { return (pcl::Vector3cMap (reinterpret_cast<std::uint8_t*> (&rgba))); } \
262  inline pcl::Vector3cMapConst getBGRVector3cMap () const { return (pcl::Vector3cMapConst (reinterpret_cast<const std::uint8_t*> (&rgba))); } \
263  inline pcl::Vector4cMap getBGRAVector4cMap () { return (pcl::Vector4cMap (reinterpret_cast<std::uint8_t*> (&rgba))); } \
264  inline pcl::Vector4cMapConst getBGRAVector4cMap () const { return (pcl::Vector4cMapConst (reinterpret_cast<const std::uint8_t*> (&rgba))); }
265 
266 #define PCL_ADD_RGB \
267  PCL_ADD_UNION_RGB \
268  PCL_ADD_EIGEN_MAPS_RGB
269 
270 #define PCL_ADD_INTENSITY \
271  struct \
272  { \
273  float intensity; \
274  }; \
275 
276 #define PCL_ADD_INTENSITY_8U \
277  struct \
278  { \
279  std::uint8_t intensity; \
280  }; \
281 
282 #define PCL_ADD_INTENSITY_32U \
283  struct \
284  { \
285  std::uint32_t intensity; \
286  }; \
287 
288 
289  struct _PointXYZ
290  {
291  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
292 
294  };
295 
296  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZ& p);
297  /** \brief A point structure representing Euclidean xyz coordinates. (SSE friendly)
298  * \ingroup common
299  */
300  struct EIGEN_ALIGN16 PointXYZ : public _PointXYZ
301  {
302  inline PointXYZ (const _PointXYZ &p): PointXYZ(p.x, p.y, p.z) {}
303 
304  inline PointXYZ (): PointXYZ(0.f, 0.f, 0.f) {}
305 
306  inline PointXYZ (float _x, float _y, float _z)
307  {
308  x = _x; y = _y; z = _z;
309  data[3] = 1.0f;
310  }
311 
312  friend std::ostream& operator << (std::ostream& os, const PointXYZ& p);
314  };
315 
316 
317 #ifdef RGB
318 #undef RGB
319 #endif
320  struct _RGB
321  {
323  };
324 
325  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const RGB& p);
326  /** \brief A structure representing RGB color information.
327  *
328  * The RGBA information is available either as separate r, g, b, or as a
329  * packed std::uint32_t rgba value. To pack it, use:
330  *
331  * \code
332  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
333  * \endcode
334  *
335  * To unpack it use:
336  *
337  * \code
338  * int rgb = ...;
339  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
340  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
341  * std::uint8_t b = (rgb) & 0x0000ff;
342  * \endcode
343  *
344  */
345  struct RGB: public _RGB
346  {
347  inline RGB (const _RGB &p)
348  {
349  rgba = p.rgba;
350  }
351 
352  inline RGB (): RGB(0, 0, 0) {}
353 
354  inline RGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
355  {
356  r = _r; g = _g; b = _b;
357  a = 255;
358  }
359 
360  friend std::ostream& operator << (std::ostream& os, const RGB& p);
361  };
362 
363  struct _Intensity
364  {
366  };
367 
368  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity& p);
369  /** \brief A point structure representing the grayscale intensity in single-channel images.
370  * Intensity is represented as a float value.
371  * \ingroup common
372  */
373  struct Intensity: public _Intensity
374  {
375  inline Intensity (const _Intensity &p)
376  {
377  intensity = p.intensity;
378  }
379 
380  inline Intensity (float _intensity = 0.f)
381  {
382  intensity = _intensity;
383  }
384 
385  friend std::ostream& operator << (std::ostream& os, const Intensity& p);
386  };
387 
388 
390  {
392  };
393 
394  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity8u& p);
395  /** \brief A point structure representing the grayscale intensity in single-channel images.
396  * Intensity is represented as a std::uint8_t value.
397  * \ingroup common
398  */
399  struct Intensity8u: public _Intensity8u
400  {
401  inline Intensity8u (const _Intensity8u &p)
402  {
403  intensity = p.intensity;
404  }
405 
406  inline Intensity8u (std::uint8_t _intensity = 0)
407  {
408  intensity = _intensity;
409  }
410 
411 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
412  operator unsigned char() const
413  {
414  return intensity;
415  }
416 #endif
417 
418  friend std::ostream& operator << (std::ostream& os, const Intensity8u& p);
419  };
420 
422  {
424  };
425 
426  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity32u& p);
427  /** \brief A point structure representing the grayscale intensity in single-channel images.
428  * Intensity is represented as a std::uint32_t value.
429  * \ingroup common
430  */
432  {
433  inline Intensity32u (const _Intensity32u &p)
434  {
435  intensity = p.intensity;
436  }
437 
438  inline Intensity32u (std::uint32_t _intensity = 0)
439  {
440  intensity = _intensity;
441  }
442 
443  friend std::ostream& operator << (std::ostream& os, const Intensity32u& p);
444  };
445 
446  /** \brief A point structure representing Euclidean xyz coordinates, and the intensity value.
447  * \ingroup common
448  */
449  struct EIGEN_ALIGN16 _PointXYZI
450  {
451  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
452  union
453  {
454  struct
455  {
456  float intensity;
457  };
458  float data_c[4];
459  };
461  };
462 
463  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZI& p);
464  struct PointXYZI : public _PointXYZI
465  {
466  inline PointXYZI (const _PointXYZI &p)
467  {
468  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
469  intensity = p.intensity;
470  }
471 
472  inline PointXYZI (float _intensity = 0.f): PointXYZI(0.f, 0.f, 0.f, _intensity) {}
473 
474  inline PointXYZI (float _x, float _y, float _z, float _intensity = 0.f)
475  {
476  x = _x; y = _y; z = _z;
477  data[3] = 1.0f;
478  intensity = _intensity;
479  }
480 
481  friend std::ostream& operator << (std::ostream& os, const PointXYZI& p);
482  };
483 
484 
485  struct EIGEN_ALIGN16 _PointXYZL
486  {
487  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
488  std::uint32_t label;
490  };
491 
492  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZL& p);
493  struct PointXYZL : public _PointXYZL
494  {
495  inline PointXYZL (const _PointXYZL &p)
496  {
497  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
498  label = p.label;
499  }
500 
501  inline PointXYZL (std::uint32_t _label = 0): PointXYZL(0.f, 0.f, 0.f, _label) {}
502 
503  inline PointXYZL (float _x, float _y, float _z, std::uint32_t _label = 0)
504  {
505  x = _x; y = _y; z = _z;
506  data[3] = 1.0f;
507  label = _label;
508  }
509 
510  friend std::ostream& operator << (std::ostream& os, const PointXYZL& p);
511  };
512 
513 
514  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Label& p);
515  struct Label
516  {
517  std::uint32_t label = 0;
518 
519  Label (std::uint32_t _label = 0): label(_label) {}
520 
521  friend std::ostream& operator << (std::ostream& os, const Label& p);
522  };
523 
524 
525  struct EIGEN_ALIGN16 _PointXYZRGBA
526  {
527  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
530  };
531 
532  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
533  /** \brief A point structure representing Euclidean xyz coordinates, and the RGBA color.
534  *
535  * The RGBA information is available either as separate r, g, b, or as a
536  * packed std::uint32_t rgba value. To pack it, use:
537  *
538  * \code
539  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
540  * \endcode
541  *
542  * To unpack it use:
543  *
544  * \code
545  * int rgb = ...;
546  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
547  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
548  * std::uint8_t b = (rgb) & 0x0000ff;
549  * \endcode
550  *
551  * \ingroup common
552  */
553  struct EIGEN_ALIGN16 PointXYZRGBA : public _PointXYZRGBA
554  {
555  inline PointXYZRGBA (const _PointXYZRGBA &p)
556  {
557  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
558  rgba = p.rgba;
559  }
560 
561  inline PointXYZRGBA (): PointXYZRGBA (0, 0, 0, 0) {}
562 
563  inline PointXYZRGBA (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a):
564  PointXYZRGBA (0.f, 0.f, 0.f, _r, _g, _b, _a) {}
565 
566  inline PointXYZRGBA (float _x, float _y, float _z):
567  PointXYZRGBA (_x, _y, _z, 0, 0, 0, 0) {}
568 
569  inline PointXYZRGBA (float _x, float _y, float _z, std::uint8_t _r,
570  std::uint8_t _g, std::uint8_t _b, std::uint8_t _a)
571  {
572  x = _x; y = _y; z = _z;
573  data[3] = 1.0f;
574  r = _r; g = _g; b = _b; a = _a;
575  }
576 
577  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
578  };
579 
580 
581  struct EIGEN_ALIGN16 _PointXYZRGB
582  {
583  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
586  };
587 
588  struct EIGEN_ALIGN16 _PointXYZRGBL
589  {
590  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
592  std::uint32_t label;
594  };
595 
596  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
597  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color.
598  *
599  * Due to historical reasons (PCL was first developed as a ROS package), the
600  * RGB information is packed into an integer and casted to a float. This is
601  * something we wish to remove in the near future, but in the meantime, the
602  * following code snippet should help you pack and unpack RGB colors in your
603  * PointXYZRGB structure:
604  *
605  * \code
606  * // pack r/g/b into rgb
607  * std::uint8_t r = 255, g = 0, b = 0; // Example: Red color
608  * std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b);
609  * p.rgb = *reinterpret_cast<float*>(&rgb);
610  * \endcode
611  *
612  * To unpack the data into separate values, use:
613  *
614  * \code
615  * PointXYZRGB p;
616  * // unpack rgb into r/g/b
617  * std::uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
618  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
619  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
620  * std::uint8_t b = (rgb) & 0x0000ff;
621  * \endcode
622  *
623  *
624  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
625  *
626  * \ingroup common
627  */
628  struct EIGEN_ALIGN16 PointXYZRGB : public _PointXYZRGB
629  {
630  inline PointXYZRGB (const _PointXYZRGB &p)
631  {
632  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
633  rgb = p.rgb;
634  }
635 
636  inline PointXYZRGB (): PointXYZRGB (0.f, 0.f, 0.f) {}
637 
638  inline PointXYZRGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
639  PointXYZRGB (0.f, 0.f, 0.f, _r, _g, _b) {}
640 
641  inline PointXYZRGB (float _x, float _y, float _z):
642  PointXYZRGB (_x, _y, _z, 0, 0, 0) {}
643 
644  inline PointXYZRGB (float _x, float _y, float _z,
645  std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
646  {
647  x = _x; y = _y; z = _z;
648  data[3] = 1.0f;
649  r = _r; g = _g; b = _b;
650  a = 255;
651  }
652 
653  friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
655  };
656 
657 
658  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
659  struct EIGEN_ALIGN16 PointXYZRGBL : public _PointXYZRGBL
660  {
661  inline PointXYZRGBL (const _PointXYZRGBL &p)
662  {
663  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
664  rgba = p.rgba;
665  label = p.label;
666  }
667 
668  inline PointXYZRGBL (std::uint32_t _label = 0):
669  PointXYZRGBL (0.f, 0.f, 0.f, 0, 0, 0, _label) {}
670 
671  inline PointXYZRGBL (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
672  PointXYZRGBL (0.f, 0.f, 0.f, _r, _g, _b) {}
673 
674  inline PointXYZRGBL (float _x, float _y, float _z):
675  PointXYZRGBL (_x, _y, _z, 0, 0, 0) {}
676 
677  inline PointXYZRGBL (float _x, float _y, float _z,
678  std::uint8_t _r, std::uint8_t _g, std::uint8_t _b,
679  std::uint32_t _label = 0)
680  {
681  x = _x; y = _y; z = _z;
682  data[3] = 1.0f;
683  r = _r; g = _g; b = _b;
684  a = 255;
685  label = _label;
686  }
687 
688  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
690  };
691 
692 
693  struct EIGEN_ALIGN16 _PointXYZHSV
694  {
695  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
696  union
697  {
698  struct
699  {
700  float h;
701  float s;
702  float v;
703  };
704  float data_c[4];
705  };
707  };
708 
709  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
710  struct EIGEN_ALIGN16 PointXYZHSV : public _PointXYZHSV
711  {
712  inline PointXYZHSV (const _PointXYZHSV &p)
713  {
714  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
715  h = p.h; s = p.s; v = p.v;
716  }
717 
718  inline PointXYZHSV (): PointXYZHSV (0.f, 0.f, 0.f) {}
719 
720  // @TODO: Use strong types??
721  // This is a dangerous type, doesn't behave like others
722  inline PointXYZHSV (float _h, float _s, float _v):
723  PointXYZHSV (0.f, 0.f, 0.f, _h, _s, _v) {}
724 
725  inline PointXYZHSV (float _x, float _y, float _z,
726  float _h, float _s, float _v)
727  {
728  x = _x; y = _y; z = _z;
729  data[3] = 1.0f;
730  h = _h; s = _s; v = _v;
731  data_c[3] = 0;
732  }
733 
734  friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
736  };
737 
738 
739 
740  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXY& p);
741  /** \brief A 2D point structure representing Euclidean xy coordinates.
742  * \ingroup common
743  */
744  struct PointXY
745  {
746  float x = 0.f;
747  float y = 0.f;
748 
749  inline PointXY() = default;
750 
751  inline PointXY(float _x, float _y): x(_x), y(_y) {}
752 
753  friend std::ostream& operator << (std::ostream& os, const PointXY& p);
754  };
755 
756  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointUV& p);
757  /** \brief A 2D point structure representing pixel image coordinates.
758  * \note We use float to be able to represent subpixels.
759  * \ingroup common
760  */
761  struct PointUV
762  {
763  float u = 0.f;
764  float v = 0.f;
765 
766  inline PointUV() = default;
767 
768  inline PointUV(float _u, float _v): u(_u), v(_v) {}
769 
770  friend std::ostream& operator << (std::ostream& os, const PointUV& p);
771  };
772 
773  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const InterestPoint& p);
774  /** \brief A point structure representing an interest point with Euclidean xyz coordinates, and an interest value.
775  * \ingroup common
776  */
777  // @TODO: inheritance trick like on other PointTypes
778  struct EIGEN_ALIGN16 InterestPoint
779  {
780  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
781  union
782  {
783  struct
784  {
785  float strength;
786  };
787  float data_c[4];
788  };
790 
791  friend std::ostream& operator << (std::ostream& os, const InterestPoint& p);
792  };
793 
794  struct EIGEN_ALIGN16 _Normal
795  {
796  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
797  union
798  {
799  struct
800  {
801  float curvature;
802  };
803  float data_c[4];
804  };
806  };
807 
808  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Normal& p);
809  /** \brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)
810  * \ingroup common
811  */
812  struct Normal : public _Normal
813  {
814  inline Normal (const _Normal &p)
815  {
816  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
817  data_n[3] = 0.0f;
818  curvature = p.curvature;
819  }
820 
821  inline Normal (float _curvature = 0.f): Normal (0.f, 0.f, 0.f, _curvature) {}
822 
823  inline Normal (float n_x, float n_y, float n_z, float _curvature = 0.f)
824  {
825  normal_x = n_x; normal_y = n_y; normal_z = n_z;
826  data_n[3] = 0.0f;
827  curvature = _curvature;
828  }
829 
830  friend std::ostream& operator << (std::ostream& os, const Normal& p);
832  };
833 
834 
835  struct EIGEN_ALIGN16 _Axis
836  {
839  };
840 
841  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Axis& p);
842  /** \brief A point structure representing an Axis using its normal coordinates. (SSE friendly)
843  * \ingroup common
844  */
845  struct EIGEN_ALIGN16 Axis : public _Axis
846  {
847  inline Axis (const _Axis &p)
848  {
849  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
850  data_n[3] = 0.0f;
851  }
852 
853  inline Axis (): Axis (0.f, 0.f, 0.f) {}
854 
855  inline Axis (float n_x, float n_y, float n_z)
856  {
857  normal_x = n_x; normal_y = n_y; normal_z = n_z;
858  data_n[3] = 0.0f;
859  }
860 
861  friend std::ostream& operator << (std::ostream& os, const Axis& p);
863  };
864 
865 
866  struct EIGEN_ALIGN16 _PointNormal
867  {
868  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
869  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
870  union
871  {
872  struct
873  {
874  float curvature;
875  };
876  float data_c[4];
877  };
879  };
880 
881  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointNormal& p);
882  /** \brief A point structure representing Euclidean xyz coordinates, together with normal coordinates and the surface curvature estimate. (SSE friendly)
883  * \ingroup common
884  */
885  struct PointNormal : public _PointNormal
886  {
887  inline PointNormal (const _PointNormal &p)
888  {
889  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
890  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
891  curvature = p.curvature;
892  }
893 
894  inline PointNormal (float _curvature = 0.f): PointNormal (0.f, 0.f, 0.f, 0.f, 0.f, 0.f, _curvature) {}
895 
896  inline PointNormal (float _x, float _y, float _z):
897  PointNormal (_x, _y, _z, 0.f, 0.f, 0.f, 0.f) {}
898 
899  inline PointNormal (float _x, float _y, float _z, float n_x, float n_y, float n_z, float _curvature = 0.f)
900  {
901  x = _x; y = _y; z = _z;
902  data[3] = 1.0f;
903  normal_x = n_x; normal_y = n_y; normal_z = n_z;
904  data_n[3] = 0.0f;
905  curvature = _curvature;
906  }
907 
908  friend std::ostream& operator << (std::ostream& os, const PointNormal& p);
909  };
910 
911 
912  struct EIGEN_ALIGN16 _PointXYZRGBNormal
913  {
914  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
915  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
916  union
917  {
918  struct
919  {
921  float curvature;
922  };
923  float data_c[4];
924  };
927  };
928 
929  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
930  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate.
931  * Due to historical reasons (PCL was first developed as a ROS package), the
932  * RGB information is packed into an integer and casted to a float. This is
933  * something we wish to remove in the near future, but in the meantime, the
934  * following code snippet should help you pack and unpack RGB colors in your
935  * PointXYZRGB structure:
936  *
937  * \code
938  * // pack r/g/b into rgb
939  * std::uint8_t r = 255, g = 0, b = 0; // Example: Red color
940  * std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b);
941  * p.rgb = *reinterpret_cast<float*>(&rgb);
942  * \endcode
943  *
944  * To unpack the data into separate values, use:
945  *
946  * \code
947  * PointXYZRGB p;
948  * // unpack rgb into r/g/b
949  * std::uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
950  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
951  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
952  * std::uint8_t b = (rgb) & 0x0000ff;
953  * \endcode
954  *
955  *
956  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
957  * \ingroup common
958  */
960  {
962  {
963  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
964  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
965  curvature = p.curvature;
966  rgba = p.rgba;
967  }
968 
969  inline PointXYZRGBNormal (float _curvature = 0.f):
970  PointXYZRGBNormal (0.f, 0.f, 0.f, 0, 0, 0, 0.f, 0.f, 0.f, _curvature) {}
971 
972  inline PointXYZRGBNormal (float _x, float _y, float _z):
973  PointXYZRGBNormal (_x, _y, _z, 0, 0, 0) {}
974 
975  inline PointXYZRGBNormal (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
976  PointXYZRGBNormal (0.f, 0.f, 0.f, _r, _g, _b) {}
977 
978  inline PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
979  PointXYZRGBNormal (_x, _y, _z, _r, _g, _b, 0.f, 0.f, 0.f) {}
980 
981  inline PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b,
982  float n_x, float n_y, float n_z, float _curvature = 0.f)
983  {
984  x = _x; y = _y; z = _z;
985  data[3] = 1.0f;
986  r = _r; g = _g; b = _b;
987  a = 255;
988  normal_x = n_x; normal_y = n_y; normal_z = n_z;
989  data_n[3] = 0.f;
990  curvature = _curvature;
991  }
992 
993  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
994  };
995 
996  struct EIGEN_ALIGN16 _PointXYZINormal
997  {
998  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
999  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1000  union
1001  {
1002  struct
1003  {
1004  float intensity;
1005  float curvature;
1006  };
1007  float data_c[4];
1008  };
1010  };
1011 
1012  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
1013  /** \brief A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates and the surface curvature estimate.
1014  * \ingroup common
1015  */
1017  {
1019  {
1020  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1021  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
1022  curvature = p.curvature;
1023  intensity = p.intensity;
1024  }
1025 
1026  inline PointXYZINormal (float _intensity = 0.f): PointXYZINormal (0.f, 0.f, 0.f, _intensity) {}
1027 
1028  inline PointXYZINormal (float _x, float _y, float _z, float _intensity = 0.f):
1029  PointXYZINormal (_x, _y, _z, _intensity, 0.f, 0.f, 0.f) {}
1030 
1031  inline PointXYZINormal (float _x, float _y, float _z, float _intensity,
1032  float n_x, float n_y, float n_z, float _curvature = 0.f)
1033  {
1034  x = _x; y = _y; z = _z;
1035  data[3] = 1.0f;
1036  intensity = _intensity;
1037  normal_x = n_x; normal_y = n_y; normal_z = n_z;
1038  data_n[3] = 0.f;
1039  curvature = _curvature;
1040  }
1041 
1042  friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
1043  };
1044 
1045 //----
1046  struct EIGEN_ALIGN16 _PointXYZLNormal
1047  {
1048  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1049  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1050  union
1051  {
1052  struct
1053  {
1054  std::uint32_t label;
1055  float curvature;
1056  };
1057  float data_c[4];
1058  };
1060  };
1061 
1062  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1063  /** \brief A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates and the surface curvature estimate.
1064  * \ingroup common
1065  */
1067  {
1069  {
1070  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1071  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
1072  curvature = p.curvature;
1073  label = p.label;
1074  }
1075 
1076  inline PointXYZLNormal (std::uint32_t _label = 0): PointXYZLNormal (0.f, 0.f, 0.f, _label) {}
1077 
1078  inline PointXYZLNormal (float _x, float _y, float _z, std::uint32_t _label = 0.f):
1079  PointXYZLNormal (_x, _y, _z, _label, 0.f, 0.f, 0.f) {}
1080 
1081  inline PointXYZLNormal (float _x, float _y, float _z, std::uint32_t _label,
1082  float n_x, float n_y, float n_z, float _curvature = 0.f)
1083  {
1084  x = _x; y = _y; z = _z;
1085  data[3] = 1.0f;
1086  label = _label;
1087  normal_x = n_x; normal_y = n_y; normal_z = n_z;
1088  data_n[3] = 0.f;
1089  curvature = _curvature;
1090  }
1091 
1092  friend std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1093  };
1094 
1095 // ---
1096 
1097 
1098  struct EIGEN_ALIGN16 _PointWithRange
1099  {
1100  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1101  union
1102  {
1103  struct
1104  {
1105  float range;
1106  };
1107  float data_c[4];
1108  };
1110  };
1111 
1112  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1113  /** \brief A point structure representing Euclidean xyz coordinates, padded with an extra range float.
1114  * \ingroup common
1115  */
1117  {
1119  {
1120  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1121  range = p.range;
1122  }
1123 
1124  inline PointWithRange (float _range = 0.f): PointWithRange (0.f, 0.f, 0.f, _range) {}
1125 
1126  inline PointWithRange (float _x, float _y, float _z, float _range = 0.f)
1127  {
1128  x = _x; y = _y; z = _z;
1129  data[3] = 1.0f;
1130  range = _range;
1131  }
1132 
1133  friend std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1134  };
1135 
1136 
1137  struct EIGEN_ALIGN16 _PointWithViewpoint
1138  {
1139  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1140  union
1141  {
1142  struct
1143  {
1144  float vp_x;
1145  float vp_y;
1146  float vp_z;
1147  };
1148  float data_c[4];
1149  };
1151  };
1152 
1153  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1154  /** \brief A point structure representing Euclidean xyz coordinates together with the viewpoint from which it was seen.
1155  * \ingroup common
1156  */
1157  struct EIGEN_ALIGN16 PointWithViewpoint : public _PointWithViewpoint
1158  {
1160  {
1161  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1162  vp_x = p.vp_x; vp_y = p.vp_y; vp_z = p.vp_z;
1163  }
1164 
1165  inline PointWithViewpoint (): PointWithViewpoint (0.f, 0.f, 0.f) {}
1166 
1167  PCL_DEPRECATED(1, 12, "Use ctor accepting all position (x, y, z) data")
1168  inline PointWithViewpoint (float _x, float _y = 0.f):
1169  PointWithViewpoint (_x, _y, 0.f) {}
1170 
1171  PCL_DEPRECATED(1, 12, "Use ctor accepting all viewpoint (vp_x, vp_y, vp_z) data")
1172  inline PointWithViewpoint (float _x, float _y, float _z, float _vp_x, float _vp_y = 0.f):
1173  PointWithViewpoint (_x, _y, _z, _vp_x, _vp_y, 0.f) {}
1174 
1175  inline PointWithViewpoint (float _x, float _y, float _z): PointWithViewpoint (_x, _y, _z, 0.f, 0.f, 0.f) {}
1176 
1177  inline PointWithViewpoint (float _x, float _y, float _z, float _vp_x, float _vp_y, float _vp_z)
1178  {
1179  x = _x; y = _y; z = _z;
1180  data[3] = 1.0f;
1181  vp_x = _vp_x; vp_y = _vp_y; vp_z = _vp_z;
1182  }
1183 
1184  friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1185  };
1186 
1187  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1188  /** \brief A point structure representing the three moment invariants.
1189  * \ingroup common
1190  */
1192  {
1193  float j1 = 0.f, j2 = 0.f, j3 = 0.f;
1194 
1195  inline MomentInvariants () = default;
1196 
1197  inline MomentInvariants (float _j1, float _j2, float _j3): j1 (_j1), j2 (_j2), j3 (_j3) {}
1198 
1199  friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1200  };
1201 
1202  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1203  /** \brief A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
1204  * \ingroup common
1205  */
1207  {
1208  float r_min = 0.f, r_max = 0.f;
1209 
1210  inline PrincipalRadiiRSD () = default;
1211 
1212  inline PrincipalRadiiRSD (float _r_min, float _r_max): r_min (_r_min), r_max (_r_max) {}
1213 
1214  friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1215  };
1216 
1217  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Boundary& p);
1218  /** \brief A point structure representing a description of whether a point is lying on a surface boundary or not.
1219  * \ingroup common
1220  */
1221  struct Boundary
1222  {
1223  std::uint8_t boundary_point = 0;
1224 
1225 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
1226  operator unsigned char() const
1227  {
1228  return boundary_point;
1229  }
1230 #endif
1231 
1232  inline Boundary (std::uint8_t _boundary = 0): boundary_point (_boundary) {}
1233 
1234  friend std::ostream& operator << (std::ostream& os, const Boundary& p);
1235  };
1236 
1237  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1238  /** \brief A point structure representing the principal curvatures and their magnitudes.
1239  * \ingroup common
1240  */
1242  {
1243  union
1244  {
1246  struct
1247  {
1251  };
1252  };
1253  float pc1 = 0.f;
1254  float pc2 = 0.f;
1255 
1256  inline PrincipalCurvatures (): PrincipalCurvatures (0.f, 0.f) {}
1257 
1258  inline PrincipalCurvatures (float _pc1, float _pc2): PrincipalCurvatures (0.f, 0.f, 0.f, _pc1, _pc2) {}
1259 
1260  inline PrincipalCurvatures (float _x, float _y, float _z): PrincipalCurvatures (_x, _y, _z, 0.f, 0.f) {}
1261 
1262  inline PrincipalCurvatures (float _x, float _y, float _z, float _pc1, float _pc2):
1263  principal_curvature_x (_x), principal_curvature_y (_y), principal_curvature_z (_z), pc1 (_pc1), pc2 (_pc2) {}
1264 
1265  friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1266  };
1267 
1268  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1269  /** \brief A point structure representing the Point Feature Histogram (PFH).
1270  * \ingroup common
1271  */
1273  {
1274  float histogram[125] = {0.f};
1275  static int descriptorSize () { return 125; }
1276 
1277  inline PFHSignature125 () = default;
1278 
1279  friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1280  };
1281 
1282  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1283  /** \brief A point structure representing the Point Feature Histogram with colors (PFHRGB).
1284  * \ingroup common
1285  */
1287  {
1288  float histogram[250] = {0.f};
1289  static int descriptorSize () { return 250; }
1290 
1291  inline PFHRGBSignature250 () = default;
1292 
1293  friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1294  };
1295 
1296  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1297  /** \brief A point structure for storing the Point Pair Feature (PPF) values
1298  * \ingroup common
1299  */
1301  {
1302  float f1 = 0.f, f2 = 0.f, f3 = 0.f, f4 = 0.f;
1303  float alpha_m = 0.f;
1304 
1305  inline PPFSignature (float _alpha = 0.f): PPFSignature (0.f, 0.f, 0.f, 0.f, _alpha) {}
1306 
1307  inline PPFSignature (float _f1, float _f2, float _f3, float _f4, float _alpha = 0.f):
1308  f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), alpha_m (_alpha) {}
1309 
1310  friend std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1311  };
1312 
1313  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1314  /** \brief A point structure for storing the Point Pair Feature (CPPF) values
1315  * \ingroup common
1316  */
1318  {
1319  float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1320  float alpha_m;
1321 
1322  inline CPPFSignature (float _alpha = 0.f):
1323  CPPFSignature (0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, _alpha) {}
1324 
1325  inline CPPFSignature (float _f1, float _f2, float _f3, float _f4, float _f5, float _f6,
1326  float _f7, float _f8, float _f9, float _f10, float _alpha = 0.f):
1327  f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), f5 (_f5), f6 (_f6),
1328  f7 (_f7), f8 (_f8), f9 (_f9), f10 (_f10), alpha_m (_alpha) {}
1329 
1330  friend std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1331  };
1332 
1333  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1334  /** \brief A point structure for storing the Point Pair Color Feature (PPFRGB) values
1335  * \ingroup common
1336  */
1338  {
1339  float f1 = 0.f, f2 = 0.f, f3 = 0.f, f4 = 0.f;
1340  float r_ratio = 0.f, g_ratio = 0.f, b_ratio = 0.f;
1341  float alpha_m = 0.f;
1342 
1343  inline PPFRGBSignature (float _alpha = 0.f): PPFRGBSignature (0.f, 0.f, 0.f, 0.f, _alpha) {}
1344 
1345  inline PPFRGBSignature (float _f1, float _f2, float _f3, float _f4, float _alpha = 0.f):
1346  PPFRGBSignature (_f1, _f2, _f3, _f4, _alpha, 0.f, 0.f, 0.f) {}
1347 
1348  inline PPFRGBSignature (float _f1, float _f2, float _f3, float _f4, float _alpha, float _r, float _g, float _b):
1349  f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), r_ratio (_r), g_ratio (_g), b_ratio (_b), alpha_m (_alpha) {}
1350 
1351  friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1352  };
1353 
1354  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1355  /** \brief A point structure representing the Normal Based Signature for
1356  * a feature matrix of 4-by-3
1357  * \ingroup common
1358  */
1360  {
1361  float values[12] = {0.f};
1362 
1363  inline NormalBasedSignature12 () = default;
1364 
1365  friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1366  };
1367 
1368  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1369  /** \brief A point structure representing a Shape Context.
1370  * \ingroup common
1371  */
1373  {
1374  float descriptor[1980] = {0.f};
1375  float rf[9] = {0.f};
1376  static int descriptorSize () { return 1980; }
1377 
1378  inline ShapeContext1980 () = default;
1379 
1380  friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1381  };
1382 
1383  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1384  /** \brief A point structure representing a Unique Shape Context.
1385  * \ingroup common
1386  */
1388  {
1389  float descriptor[1960] = {0.f};
1390  float rf[9] = {0.f};
1391  static int descriptorSize () { return 1960; }
1392 
1393  inline UniqueShapeContext1960 () = default;
1394 
1395  friend std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1396  };
1397 
1398  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT352& p);
1399  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape only.
1400  * \ingroup common
1401  */
1402  struct SHOT352
1403  {
1404  float descriptor[352] = {0.f};
1405  float rf[9] = {0.f};
1406  static int descriptorSize () { return 352; }
1407 
1408  inline SHOT352 () = default;
1409 
1410  friend std::ostream& operator << (std::ostream& os, const SHOT352& p);
1411  };
1412 
1413 
1414  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1415  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+color.
1416  * \ingroup common
1417  */
1418  struct SHOT1344
1419  {
1420  float descriptor[1344] = {0.f};
1421  float rf[9] = {0.f};
1422  static int descriptorSize () { return 1344; }
1423 
1424  inline SHOT1344 () = default;
1425 
1426  friend std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1427  };
1428 
1429 
1430  /** \brief A structure representing the Local Reference Frame of a point.
1431  * \ingroup common
1432  */
1433  struct EIGEN_ALIGN16 _ReferenceFrame
1434  {
1435  union
1436  {
1437  float rf[9];
1438  struct
1439  {
1440  float x_axis[3];
1441  float y_axis[3];
1442  float z_axis[3];
1443  };
1444  };
1445 
1446  inline Eigen::Map<Eigen::Vector3f> getXAxisVector3fMap () { return (Eigen::Vector3f::Map (x_axis)); }
1447  inline const Eigen::Map<const Eigen::Vector3f> getXAxisVector3fMap () const { return (Eigen::Vector3f::Map (x_axis)); }
1448  inline Eigen::Map<Eigen::Vector3f> getYAxisVector3fMap () { return (Eigen::Vector3f::Map (y_axis)); }
1449  inline const Eigen::Map<const Eigen::Vector3f> getYAxisVector3fMap () const { return (Eigen::Vector3f::Map (y_axis)); }
1450  inline Eigen::Map<Eigen::Vector3f> getZAxisVector3fMap () { return (Eigen::Vector3f::Map (z_axis)); }
1451  inline const Eigen::Map<const Eigen::Vector3f> getZAxisVector3fMap () const { return (Eigen::Vector3f::Map (z_axis)); }
1452  inline Eigen::Map<Eigen::Matrix3f> getMatrix3fMap () { return (Eigen::Matrix3f::Map (rf)); }
1453  inline const Eigen::Map<const Eigen::Matrix3f> getMatrix3fMap () const { return (Eigen::Matrix3f::Map (rf)); }
1454 
1456  };
1457 
1458  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1459  struct EIGEN_ALIGN16 ReferenceFrame : public _ReferenceFrame
1460  {
1462  {
1463  std::copy_n(p.rf, 9, rf);
1464  }
1465 
1466  inline ReferenceFrame ()
1467  {
1468  std::fill_n(x_axis, 3, 0.f);
1469  std::fill_n(y_axis, 3, 0.f);
1470  std::fill_n(z_axis, 3, 0.f);
1471  }
1472 
1473  // @TODO: add other ctors
1474 
1475  friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1477  };
1478 
1479 
1480  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1481  /** \brief A point structure representing the Fast Point Feature Histogram (FPFH).
1482  * \ingroup common
1483  */
1485  {
1486  float histogram[33] = {0.f};
1487  static int descriptorSize () { return 33; }
1488 
1489  inline FPFHSignature33 () = default;
1490 
1491  friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1492  };
1493 
1494  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1495  /** \brief A point structure representing the Viewpoint Feature Histogram (VFH).
1496  * \ingroup common
1497  */
1499  {
1500  float histogram[308] = {0.f};
1501  static int descriptorSize () { return 308; }
1502 
1503  inline VFHSignature308 () = default;
1504 
1505  friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1506  };
1507 
1508  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1509  /** \brief A point structure representing the Global Radius-based Surface Descriptor (GRSD).
1510  * \ingroup common
1511  */
1513  {
1514  float histogram[21] = {0.f};
1515  static int descriptorSize () { return 21; }
1516 
1517  inline GRSDSignature21 () = default;
1518 
1519  friend std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1520  };
1521 
1522  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1523  /** \brief A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
1524  * \ingroup common
1525  */
1527  {
1528  float scale = 0.f;
1529  float orientation = 0.f;
1530  unsigned char descriptor[64] = {0};
1531  static int descriptorSize () { return 64; }
1532 
1533  inline BRISKSignature512 () = default;
1534 
1535  inline BRISKSignature512 (float _scale, float _orientation): scale (_scale), orientation (_orientation) {}
1536 
1537  friend std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1538  };
1539 
1540  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1541  /** \brief A point structure representing the Ensemble of Shape Functions (ESF).
1542  * \ingroup common
1543  */
1545  {
1546  float histogram[640] = {0.f};
1547  static int descriptorSize () { return 640; }
1548 
1549  inline ESFSignature640 () = default;
1550 
1551  friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1552  };
1553 
1554  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature512& p);
1555  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor.
1556  * \ingroup common
1557  */
1559  {
1560  float histogram[512] = {0.f};
1561  static int descriptorSize() { return 512; }
1562 
1563  inline GASDSignature512 () = default;
1564 
1565  friend std::ostream& operator << (std::ostream& os, const GASDSignature512& p);
1566  };
1567 
1568  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature984& p);
1569  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descriptor.
1570  * \ingroup common
1571  */
1573  {
1574  float histogram[984] = {0.f};
1575  static int descriptorSize() { return 984; }
1576 
1577  inline GASDSignature984 () = default;
1578 
1579  friend std::ostream& operator << (std::ostream& os, const GASDSignature984& p);
1580  };
1581 
1582  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature7992& p);
1583  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descriptor.
1584  * \ingroup common
1585  */
1587  {
1588  float histogram[7992] = {0.f};
1589  static int descriptorSize() { return 7992; }
1590 
1591  inline GASDSignature7992 () = default;
1592 
1593  friend std::ostream& operator << (std::ostream& os, const GASDSignature7992& p);
1594  };
1595 
1596  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1597  /** \brief A point structure representing the GFPFH descriptor with 16 bins.
1598  * \ingroup common
1599  */
1601  {
1602  float histogram[16] = {0.f};
1603  static int descriptorSize () { return 16; }
1604 
1605  inline GFPFHSignature16 () = default;
1606 
1607  friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1608  };
1609 
1610  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Narf36& p);
1611  /** \brief A point structure representing the Narf descriptor.
1612  * \ingroup common
1613  */
1614  struct Narf36
1615  {
1616  float x = 0.f, y = 0.f, z = 0.f, roll = 0.f, pitch = 0.f, yaw = 0.f;
1617  float descriptor[36] = {0.f};
1618  static int descriptorSize () { return 36; }
1619 
1620  inline Narf36 () = default;
1621 
1622  inline Narf36 (float _x, float _y, float _z): Narf36 (_x, _y, _z, 0.f, 0.f, 0.f) {}
1623 
1624  inline Narf36 (float _x, float _y, float _z, float _roll, float _pitch, float _yaw):
1625  x (_x), y (_y), z (_z), roll (_roll), pitch (_pitch), yaw (_yaw) {}
1626 
1627  friend std::ostream& operator << (std::ostream& os, const Narf36& p);
1628  };
1629 
1630  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1631  /** \brief A structure to store if a point in a range image lies on a border between an obstacle and the background.
1632  * \ingroup common
1633  */
1635  {
1636  int x = 0, y = 0;
1638  //std::vector<const BorderDescription*> neighbors;
1639 
1640  inline BorderDescription () = default;
1641 
1642  // TODO: provide other ctors
1643 
1644  friend std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1645  };
1646 
1647 
1648  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1649  /** \brief A point structure representing the intensity gradient of an XYZI point cloud.
1650  * \ingroup common
1651  */
1653  {
1654  union
1655  {
1656  float gradient[3];
1657  struct
1658  {
1659  float gradient_x;
1660  float gradient_y;
1661  float gradient_z;
1662  };
1663  };
1664 
1665  inline IntensityGradient (): IntensityGradient (0.f, 0.f, 0.f) {}
1666 
1667  inline IntensityGradient (float _x, float _y, float _z): gradient_x (_x), gradient_y (_y), gradient_z (_z) {}
1668 
1669  friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1670  };
1671 
1672  // TODO: Maybe make other histogram based structs an alias for this
1673  /** \brief A point structure representing an N-D histogram.
1674  * \ingroup common
1675  */
1676  template <int N>
1677  struct Histogram
1678  {
1679  float histogram[N];
1680  static int descriptorSize () { return N; }
1681  };
1682 
1683  struct EIGEN_ALIGN16 _PointWithScale
1684  {
1685  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1686 
1687  union
1688  {
1689  /** \brief Diameter of the meaningful keypoint neighborhood. */
1690  float scale;
1691  float size;
1692  };
1693 
1694  /** \brief Computed orientation of the keypoint (-1 if not applicable). */
1695  float angle;
1696  /** \brief The response by which the most strong keypoints have been selected. */
1697  float response;
1698  /** \brief octave (pyramid layer) from which the keypoint has been extracted. */
1699  int octave;
1700 
1702  };
1703 
1704  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1705  /** \brief A point structure representing a 3-D position and scale.
1706  * \ingroup common
1707  */
1709  {
1711  {
1712  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1713  scale = p.scale;
1714  angle = p.angle;
1715  response = p.response;
1716  octave = p.octave;
1717  }
1718 
1719  inline PointWithScale (): PointWithScale (0.f, 0.f, 0.f) {}
1720 
1721  inline PointWithScale (float _x, float _y, float _z, float _scale = 1.f,
1722  float _angle = -1.f, float _response = 0.f, int _octave = 0)
1723  {
1724  x = _x; y = _y; z = _z;
1725  data[3] = 1.0f;
1726  scale = _scale;
1727  angle = _angle;
1728  response = _response;
1729  octave = _octave;
1730  }
1731 
1732  friend std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1733  };
1734 
1735 
1736  struct EIGEN_ALIGN16 _PointSurfel
1737  {
1738  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1739  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1740  union
1741  {
1742  struct
1743  {
1745  float radius;
1746  float confidence;
1747  float curvature;
1748  };
1749  float data_c[4];
1750  };
1753  };
1754 
1755  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1756  /** \brief A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coordinates, a RGBA color, a radius, a confidence value and the surface curvature estimate.
1757  * \ingroup common
1758  */
1759  struct PointSurfel : public _PointSurfel
1760  {
1761  inline PointSurfel (const _PointSurfel &p)
1762  {
1763  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1764  rgba = p.rgba;
1765  radius = p.radius;
1766  confidence = p.confidence;
1767  curvature = p.curvature;
1768  }
1769 
1770  inline PointSurfel ()
1771  {
1772  x = y = z = 0.0f;
1773  data[3] = 1.0f;
1774  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
1775  r = g = b = 0;
1776  a = 255;
1777  radius = confidence = curvature = 0.0f;
1778  }
1779 
1780  // TODO: add other ctor to PointSurfel
1781 
1782  friend std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1783  };
1784 
1785  struct EIGEN_ALIGN16 _PointDEM
1786  {
1788  float intensity;
1792  };
1793 
1794  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointDEM& p);
1795  /** \brief A point structure representing Digital Elevation Map.
1796  * \ingroup common
1797  */
1798  struct PointDEM : public _PointDEM
1799  {
1800  inline PointDEM (const _PointDEM &p)
1801  {
1802  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1803  intensity = p.intensity;
1806  }
1807 
1808  inline PointDEM (): PointDEM (0.f, 0.f, 0.f) {}
1809 
1810  inline PointDEM (float _x, float _y, float _z): PointDEM (_x, _y, _z, 0.f, 0.f, 0.f) {}
1811 
1812  inline PointDEM (float _x, float _y, float _z, float _intensity,
1813  float _intensity_variance, float _height_variance)
1814  {
1815  x = _x; y = _y; z = _z;
1816  data[3] = 1.0f;
1817  intensity = _intensity;
1818  intensity_variance = _intensity_variance;
1819  height_variance = _height_variance;
1820  }
1821 
1822  friend std::ostream& operator << (std::ostream& os, const PointDEM& p);
1823  };
1824 
1825  template <int N> std::ostream&
1826  operator << (std::ostream& os, const Histogram<N>& p)
1827  {
1828  // make constexpr
1829  if (N > 0)
1830  {
1831  os << "(" << p.histogram[0];
1832  std::for_each(p.histogram + 1, std::end(p.histogram),
1833  [&os](const auto& hist) { os << ", " << hist; });
1834  os << ")";
1835  }
1836  return (os);
1837  }
1838 } // namespace pcl
1839 
1840 // Register point structs and wrappers
1842  (std::uint32_t, rgba, rgba)
1843 )
1844 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::RGB, pcl::_RGB)
1845 
1847  (float, intensity, intensity)
1848 )
1849 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity, pcl::_Intensity)
1850 
1851 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity8u,
1852  (std::uint8_t, intensity, intensity)
1853 )
1854 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity8u, pcl::_Intensity8u)
1855 
1856 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity32u,
1857  (std::uint32_t, intensity, intensity)
1858 )
1859 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity32u, pcl::_Intensity32u)
1860 
1862  (float, x, x)
1863  (float, y, y)
1864  (float, z, z)
1865 )
1866 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZ, pcl::_PointXYZ)
1867 
1868 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBA,
1869  (float, x, x)
1870  (float, y, y)
1871  (float, z, z)
1872  (std::uint32_t, rgba, rgba)
1873 )
1874 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBA, pcl::_PointXYZRGBA)
1875 
1876 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGB,
1877  (float, x, x)
1878  (float, y, y)
1879  (float, z, z)
1880  (float, rgb, rgb)
1881 )
1882 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGB, pcl::_PointXYZRGB)
1883 
1884 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBL,
1885  (float, x, x)
1886  (float, y, y)
1887  (float, z, z)
1888  (std::uint32_t, rgba, rgba)
1889  (std::uint32_t, label, label)
1890 )
1891 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBL, pcl::_PointXYZRGBL)
1892 
1893 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZHSV,
1894  (float, x, x)
1895  (float, y, y)
1896  (float, z, z)
1897  (float, h, h)
1898  (float, s, s)
1899  (float, v, v)
1900 )
1901 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZHSV, pcl::_PointXYZHSV)
1902 
1904  (float, x, x)
1905  (float, y, y)
1906 )
1907 
1909  (float, u, u)
1910  (float, v, v)
1911 )
1912 
1913 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::InterestPoint,
1914  (float, x, x)
1915  (float, y, y)
1916  (float, z, z)
1917  (float, strength, strength)
1918 )
1919 
1921  (float, x, x)
1922  (float, y, y)
1923  (float, z, z)
1924  (float, intensity, intensity)
1925 )
1926 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZI, pcl::_PointXYZI)
1927 
1929  (float, x, x)
1930  (float, y, y)
1931  (float, z, z)
1932  (std::uint32_t, label, label)
1933 )
1934 
1936  (std::uint32_t, label, label)
1937 )
1938 
1940  (float, normal_x, normal_x)
1941  (float, normal_y, normal_y)
1942  (float, normal_z, normal_z)
1943  (float, curvature, curvature)
1944 )
1945 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Normal, pcl::_Normal)
1946 
1948  (float, normal_x, normal_x)
1949  (float, normal_y, normal_y)
1950  (float, normal_z, normal_z)
1951 )
1952 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Axis, pcl::_Axis)
1953 
1955  (float, x, x)
1956  (float, y, y)
1957  (float, z, z)
1958  (float, normal_x, normal_x)
1959  (float, normal_y, normal_y)
1960  (float, normal_z, normal_z)
1961  (float, curvature, curvature)
1962 )
1963 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBNormal,
1964  (float, x, x)
1965  (float, y, y)
1966  (float, z, z)
1967  (float, rgb, rgb)
1968  (float, normal_x, normal_x)
1969  (float, normal_y, normal_y)
1970  (float, normal_z, normal_z)
1971  (float, curvature, curvature)
1972 )
1973 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBNormal, pcl::_PointXYZRGBNormal)
1974 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZINormal,
1975  (float, x, x)
1976  (float, y, y)
1977  (float, z, z)
1978  (float, intensity, intensity)
1979  (float, normal_x, normal_x)
1980  (float, normal_y, normal_y)
1981  (float, normal_z, normal_z)
1982  (float, curvature, curvature)
1983 )
1984 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZLNormal,
1985  (float, x, x)
1986  (float, y, y)
1987  (float, z, z)
1988  (std::uint32_t, label, label)
1989  (float, normal_x, normal_x)
1990  (float, normal_y, normal_y)
1991  (float, normal_z, normal_z)
1992  (float, curvature, curvature)
1993 )
1994 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointWithRange,
1995  (float, x, x)
1996  (float, y, y)
1997  (float, z, z)
1998  (float, range, range)
1999 )
2000 
2001 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointWithViewpoint,
2002  (float, x, x)
2003  (float, y, y)
2004  (float, z, z)
2005  (float, vp_x, vp_x)
2006  (float, vp_y, vp_y)
2007  (float, vp_z, vp_z)
2008 )
2009 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointWithViewpoint, pcl::_PointWithViewpoint)
2010 
2011 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::MomentInvariants,
2012  (float, j1, j1)
2013  (float, j2, j2)
2014  (float, j3, j3)
2015 )
2016 
2017 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalRadiiRSD,
2018  (float, r_min, r_min)
2019  (float, r_max, r_max)
2020 )
2021 
2023  (std::uint8_t, boundary_point, boundary_point)
2024 )
2025 
2026 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalCurvatures,
2027  (float, principal_curvature_x, principal_curvature_x)
2028  (float, principal_curvature_y, principal_curvature_y)
2029  (float, principal_curvature_z, principal_curvature_z)
2030  (float, pc1, pc1)
2031  (float, pc2, pc2)
2032 )
2033 
2034 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PFHSignature125,
2035  (float[125], histogram, pfh)
2036 )
2037 
2038 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PFHRGBSignature250,
2039  (float[250], histogram, pfhrgb)
2040 )
2041 
2042 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PPFSignature,
2043  (float, f1, f1)
2044  (float, f2, f2)
2045  (float, f3, f3)
2046  (float, f4, f4)
2047  (float, alpha_m, alpha_m)
2048 )
2049 
2050 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::CPPFSignature,
2051  (float, f1, f1)
2052  (float, f2, f2)
2053  (float, f3, f3)
2054  (float, f4, f4)
2055  (float, f5, f5)
2056  (float, f6, f6)
2057  (float, f7, f7)
2058  (float, f8, f8)
2059  (float, f9, f9)
2060  (float, f10, f10)
2061  (float, alpha_m, alpha_m)
2062 )
2063 
2064 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PPFRGBSignature,
2065  (float, f1, f1)
2066  (float, f2, f2)
2067  (float, f3, f3)
2068  (float, f4, f4)
2069  (float, r_ratio, r_ratio)
2070  (float, g_ratio, g_ratio)
2071  (float, b_ratio, b_ratio)
2072  (float, alpha_m, alpha_m)
2073 )
2074 
2075 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::NormalBasedSignature12,
2076  (float[12], values, values)
2077 )
2078 
2079 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ShapeContext1980,
2080  (float[1980], descriptor, shape_context)
2081  (float[9], rf, rf)
2082 )
2083 
2084 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::UniqueShapeContext1960,
2085  (float[1960], descriptor, shape_context)
2086  (float[9], rf, rf)
2087 )
2088 
2090  (float[352], descriptor, shot)
2091  (float[9], rf, rf)
2092 )
2093 
2095  (float[1344], descriptor, shot)
2096  (float[9], rf, rf)
2097 )
2098 
2099 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::FPFHSignature33,
2100  (float[33], histogram, fpfh)
2101 )
2102 
2103 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::BRISKSignature512,
2104  (float, scale, brisk_scale)
2105  (float, orientation, brisk_orientation)
2106  (unsigned char[64], descriptor, brisk_descriptor512)
2107 )
2108 
2109 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::VFHSignature308,
2110  (float[308], histogram, vfh)
2111 )
2112 
2113 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::GRSDSignature21,
2114  (float[21], histogram, grsd)
2115 )
2116 
2117 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ESFSignature640,
2118  (float[640], histogram, esf)
2119 )
2120 
2121 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature512,
2122  (float[512], histogram, gasd)
2123 )
2124 
2125 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature984,
2126  (float[984], histogram, gasd)
2127 )
2128 
2129 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature7992,
2130  (float[7992], histogram, gasd)
2131 )
2132 
2134  (float[36], descriptor, descriptor)
2135 )
2136 
2137 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::GFPFHSignature16,
2138  (float[16], histogram, gfpfh)
2139 )
2140 
2141 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::IntensityGradient,
2142  (float, gradient_x, gradient_x)
2143  (float, gradient_y, gradient_y)
2144  (float, gradient_z, gradient_z)
2145 )
2146 
2147 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointWithScale,
2148  (float, x, x)
2149  (float, y, y)
2150  (float, z, z)
2151  (float, scale, scale)
2152 )
2153 
2155  (float, x, x)
2156  (float, y, y)
2157  (float, z, z)
2158  (float, normal_x, normal_x)
2159  (float, normal_y, normal_y)
2160  (float, normal_z, normal_z)
2161  (std::uint32_t, rgba, rgba)
2162  (float, radius, radius)
2163  (float, confidence, confidence)
2164  (float, curvature, curvature)
2165 )
2166 
2167 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_ReferenceFrame,
2168  (float[3], x_axis, x_axis)
2169  (float[3], y_axis, y_axis)
2170  (float[3], z_axis, z_axis)
2171 )
2172 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::ReferenceFrame, pcl::_ReferenceFrame)
2173 
2175  (float, x, x)
2176  (float, y, y)
2177  (float, z, z)
2178  (float, intensity, intensity)
2179  (float, intensity_variance, intensity_variance)
2180  (float, height_variance, height_variance)
2181 )
2182 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointDEM, pcl::_PointDEM)
2183 
2184 namespace pcl
2185 {
2186 
2187 // Allow float 'rgb' data to match to the newer uint32 'rgba' tag. This is so
2188 // you can load old 'rgb' PCD files into e.g. a PointCloud<PointXYZRGBA>.
2189 template<typename PointT>
2190 struct FieldMatches<PointT, ::pcl::fields::rgba>
2191 {
2192  bool operator() (const pcl::PCLPointField& field)
2193  {
2194  if (field.name == "rgb")
2195  {
2196  // For fixing the alpha value bug #1141, the rgb field can also match
2197  // uint32.
2198  return ((field.datatype == pcl::PCLPointField::FLOAT32 ||
2200  field.count == 1);
2201  }
2202  else
2203  {
2204  return (field.name == traits::name<PointT, fields::rgba>::value &&
2205  field.datatype == traits::datatype<PointT, fields::rgba>::value &&
2206  field.count == traits::datatype<PointT, fields::rgba>::size);
2207  }
2208  }
2209 };
2210 template<typename PointT>
2211 struct FieldMatches<PointT, fields::rgb>
2212 {
2213  bool operator() (const pcl::PCLPointField& field)
2214  {
2215  if (field.name == "rgba")
2216  {
2217  return (field.datatype == pcl::PCLPointField::UINT32 &&
2218  field.count == 1);
2219  }
2220  else
2221  {
2222  // For fixing the alpha value bug #1141, rgb can also match uint32
2223  return (field.name == traits::name<PointT, fields::rgb>::value &&
2224  (field.datatype == traits::datatype<PointT, fields::rgb>::value ||
2226  field.count == traits::datatype<PointT, fields::rgb>::size);
2227  }
2228  }
2229 };
2230 
2231 
2232 // We're doing a lot of black magic with Boost here, so disable warnings in Maintainer mode, as we will never
2233 // be able to fix them anyway
2234 #if defined _MSC_VER
2235  #pragma warning(disable: 4201)
2236 #endif
2237 
2238 namespace traits
2239 {
2240 
2241  /** \brief Metafunction to check if a given point type has a given field.
2242  *
2243  * Example usage at run-time:
2244  *
2245  * \code
2246  * bool curvature_available = pcl::traits::has_field<PointT, pcl::fields::curvature>::value;
2247  * \endcode
2248  *
2249  * Example usage at compile-time:
2250  *
2251  * \code
2252  * BOOST_MPL_ASSERT_MSG ((pcl::traits::has_field<PointT, pcl::fields::label>::value),
2253  * POINT_TYPE_SHOULD_HAVE_LABEL_FIELD,
2254  * (PointT));
2255  * \endcode
2256  */
2257  template <typename PointT, typename Field>
2258  struct has_field : boost::mpl::contains<typename pcl::traits::fieldList<PointT>::type, Field>::type
2259  { };
2260 
2261  /** Metafunction to check if a given point type has all given fields. */
2262  template <typename PointT, typename Field>
2263  struct has_all_fields : boost::mpl::fold<Field,
2264  boost::mpl::bool_<true>,
2265  boost::mpl::and_<boost::mpl::_1,
2266  has_field<PointT, boost::mpl::_2> > >::type
2267  { };
2268 
2269  /** Metafunction to check if a given point type has any of the given fields. */
2270  template <typename PointT, typename Field>
2271  struct has_any_field : boost::mpl::fold<Field,
2272  boost::mpl::bool_<false>,
2273  boost::mpl::or_<boost::mpl::_1,
2274  has_field<PointT, boost::mpl::_2> > >::type
2275  { };
2276 
2277  /** \brief Traits defined for ease of use with fields already registered before
2278  *
2279  * has_<fields to be detected>: struct with `value` datamember defined at compiletime
2280  * has_<fields to be detected>_v: constexpr boolean
2281  * Has<Fields to be detected>: concept modelling name alias for `enable_if`
2282  */
2283 
2284  /** Metafunction to check if a given point type has x and y fields. */
2285  template <typename PointT>
2286  struct has_xy : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
2287  pcl::fields::y> >
2288  { };
2289 
2290  template <typename PointT>
2291  constexpr auto has_xy_v = has_xy<PointT>::value;
2292 
2293  template <typename PointT>
2294  using HasXY = std::enable_if_t<has_xy_v<PointT>, bool>;
2295 
2296  template <typename PointT>
2297  using HasNoXY = std::enable_if_t<!has_xy_v<PointT>, bool>;
2298 
2299  /** Metafunction to check if a given point type has x, y, and z fields. */
2300  template <typename PointT>
2301  struct has_xyz : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
2302  pcl::fields::y,
2303  pcl::fields::z> >
2304  { };
2305 
2306  template <typename PointT>
2307  constexpr auto has_xyz_v = has_xyz<PointT>::value;
2308 
2309  template <typename PointT>
2310  using HasXYZ = std::enable_if_t<has_xyz_v<PointT>, bool>;
2311 
2312  template <typename PointT>
2313  using HasNoXYZ = std::enable_if_t<!has_xyz_v<PointT>, bool>;
2314 
2315  /** Metafunction to check if a given point type has normal_x, normal_y, and
2316  * normal_z fields. */
2317  template <typename PointT>
2318  struct has_normal : has_all_fields<PointT, boost::mpl::vector<pcl::fields::normal_x,
2319  pcl::fields::normal_y,
2320  pcl::fields::normal_z> >
2321  { };
2322 
2323  template <typename PointT>
2324  constexpr auto has_normal_v = has_normal<PointT>::value;
2325 
2326  template <typename PointT>
2327  using HasNormal = std::enable_if_t<has_normal_v<PointT>, bool>;
2328 
2329  template <typename PointT>
2330  using HasNoNormal = std::enable_if_t<!has_normal_v<PointT>, bool>;
2331 
2332  /** Metafunction to check if a given point type has curvature field. */
2333  template <typename PointT>
2334  struct has_curvature : has_field<PointT, pcl::fields::curvature>
2335  { };
2336 
2337  template <typename PointT>
2338  constexpr auto has_curvature_v = has_curvature<PointT>::value;
2339 
2340  template <typename PointT>
2341  using HasCurvature = std::enable_if_t<has_curvature_v<PointT>, bool>;
2342 
2343  template <typename PointT>
2344  using HasNoCurvature = std::enable_if_t<!has_curvature_v<PointT>, bool>;
2345 
2346  /** Metafunction to check if a given point type has intensity field. */
2347  template <typename PointT>
2348  struct has_intensity : has_field<PointT, pcl::fields::intensity>
2349  { };
2350 
2351  template <typename PointT>
2352  constexpr auto has_intensity_v = has_intensity<PointT>::value;
2353 
2354  template <typename PointT>
2355  using HasIntensity = std::enable_if_t<has_intensity_v<PointT>, bool>;
2356 
2357  template <typename PointT>
2358  using HasNoIntensity = std::enable_if_t<!has_intensity_v<PointT>, bool>;
2359 
2360  /** Metafunction to check if a given point type has either rgb or rgba field. */
2361  template <typename PointT>
2362  struct has_color : has_any_field<PointT, boost::mpl::vector<pcl::fields::rgb,
2363  pcl::fields::rgba> >
2364  { };
2365 
2366  template <typename PointT>
2367  constexpr auto has_color_v = has_color<PointT>::value;
2368 
2369  template <typename PointT>
2370  using HasColor = std::enable_if_t<has_color_v<PointT>, bool>;
2371 
2372  template <typename PointT>
2373  using HasNoColor = std::enable_if_t<!has_color_v<PointT>, bool>;
2374 
2375  /** Metafunction to check if a given point type has label field. */
2376  template <typename PointT>
2377  struct has_label : has_field<PointT, pcl::fields::label>
2378  { };
2379 
2380  template <typename PointT>
2381  constexpr auto has_label_v = has_label<PointT>::value;
2382 
2383  template <typename PointT>
2384  using HasLabel = std::enable_if_t<has_label_v<PointT>, bool>;
2385 
2386  template <typename PointT>
2387  using HasNoLabel = std::enable_if_t<!has_label_v<PointT>, bool>;
2388 }
2389 
2390 #if defined _MSC_VER
2391  #pragma warning(default: 4201)
2392 #endif
2393 
2394 } // namespace pcl
2395 
A point structure representing normal coordinates and the surface curvature estimate.
Eigen::Map< Eigen::Vector3f > Vector3fMap
std::uint32_t label
A point structure representing the grayscale intensity in single-channel images.
friend std::ostream & operator<<(std::ostream &os, const CPPFSignature &p)
A point structure representing a Shape Context.
PointXYZRGBNormal(float _x, float _y, float _z)
PointWithViewpoint(float _x, float _y, float _z)
PrincipalRadiiRSD(float _r_min, float _r_max)
Eigen::Map< Eigen::Vector3f > getXAxisVector3fMap()
std::bitset< 32 > BorderTraits
Data type to store extended information about a transition from foreground to backgroundSpecification...
Definition: point_types.h:302
friend std::ostream & operator<<(std::ostream &os, const UniqueShapeContext1960 &p)
PointNormal(float _x, float _y, float _z)
GASDSignature512()=default
Label(std::uint32_t _label=0)
Axis(const _Axis &p)
A point structure representing a description of whether a point is lying on a surface boundary or not...
PPFRGBSignature(float _f1, float _f2, float _f3, float _f4, float _alpha, float _r, float _g, float _b)
friend std::ostream & operator<<(std::ostream &os, const GASDSignature7992 &p)
A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates a...
friend std::ostream & operator<<(std::ostream &os, const PointDEM &p)
A point structure representing Euclidean xyz coordinates, padded with an extra range float...
float intensity_variance
PointDEM(const _PointDEM &p)
PointXYZI(float _x, float _y, float _z, float _intensity=0.f)
friend std::ostream & operator<<(std::ostream &os, const Normal &p)
const Eigen::Map< const Eigen::Vector4f, Eigen::Aligned > Vector4fMapConst
PrincipalCurvatures(float _pc1, float _pc2)
PointXYZRGBA(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a)
static int descriptorSize()
PointXYZRGBL(float _x, float _y, float _z)
float scale
Diameter of the meaningful keypoint neighborhood.
A point structure representing the Normal Based Signature for a feature matrix of 4-by-3...
A point structure representing a Unique Shape Context.
PointXYZL(float _x, float _y, float _z, std::uint32_t _label=0)
PointXYZI(float _intensity=0.f)
PointXYZRGB(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
Eigen::Map< Eigen::Vector3f > getZAxisVector3fMap()
A structure representing the Local Reference Frame of a point.
unsigned char descriptor[64]
friend std::ostream & operator<<(std::ostream &os, const PointXY &p)
float angle
Computed orientation of the keypoint (-1 if not applicable).
PPFRGBSignature(float _f1, float _f2, float _f3, float _f4, float _alpha=0.f)
PPFSignature(float _alpha=0.f)
PointXYZRGBNormal(const _PointXYZRGBNormal &p)
static int descriptorSize()
PrincipalCurvatures(float _x, float _y, float _z, float _pc1, float _pc2)
friend std::ostream & operator<<(std::ostream &os, const GASDSignature512 &p)
PointXYZRGBL(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
const Eigen::Map< const Eigen::Vector3f > getZAxisVector3fMap() const
A point structure representing Digital Elevation Map.
friend std::ostream & operator<<(std::ostream &os, const MomentInvariants &p)
static int descriptorSize()
friend std::ostream & operator<<(std::ostream &os, const GFPFHSignature16 &p)
Intensity(float _intensity=0.f)
A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
float histogram[N]
PointXYZ(float _x, float _y, float _z)
friend std::ostream & operator<<(std::ostream &os, const Intensity8u &p)
PointXYZRGBA(const _PointXYZRGBA &p)
friend std::ostream & operator<<(std::ostream &os, const PointXYZI &p)
float response
The response by which the most strong keypoints have been selected.
Eigen::Map< Vector3c > Vector3cMap
static int descriptorSize()
PointWithViewpoint(float _x, float _y, float _z, float _vp_x, float _vp_y, float _vp_z)
SHOT1344()=default
Normal(float n_x, float n_y, float n_z, float _curvature=0.f)
A point structure representing an Axis using its normal coordinates.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: memory.h:63
friend std::ostream & operator<<(std::ostream &os, const FPFHSignature33 &p)
PointXYZRGB(float _x, float _y, float _z)
friend std::ostream & operator<<(std::ostream &os, const PrincipalCurvatures &p)
PointNormal(float _x, float _y, float _z, float n_x, float n_y, float n_z, float _curvature=0.f)
GASDSignature984()=default
A point structure representing Euclidean xyz coordinates, and the RGBA color.
Intensity8u(const _Intensity8u &p)
PointXYZINormal(float _intensity=0.f)
A point structure representing the grayscale intensity in single-channel images.
VFHSignature308()=default
PointXYZRGBA(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a)
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
A point structure representing the Fast Point Feature Histogram (FPFH).
PointWithRange(float _x, float _y, float _z, float _range=0.f)
A 2D point structure representing Euclidean xy coordinates.
PointXYZRGBNormal(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
friend std::ostream & operator<<(std::ostream &os, const ShapeContext1980 &p)
PointWithScale(float _x, float _y, float _z, float _scale=1.f, float _angle=-1.f, float _response=0.f, int _octave=0)
Narf36(float _x, float _y, float _z)
std::uint32_t count
Definition: PCLPointField.h:17
Narf36()=default
PointXYZ(const _PointXYZ &p)
PointXYZRGBNormal(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
friend std::ostream & operator<<(std::ostream &os, const PointSurfel &p)
friend std::ostream & operator<<(std::ostream &os, const PointNormal &p)
PointWithRange(float _range=0.f)
A structure representing RGB color information.
friend std::ostream & operator<<(std::ostream &os, const Boundary &p)
A point structure representing an N-D histogram.
A 2D point structure representing pixel image coordinates.
A point structure representing the GFPFH descriptor with 16 bins.
friend std::ostream & operator<<(std::ostream &os, const SHOT352 &p)
const Eigen::Map< const Eigen::Vector3f > getXAxisVector3fMap() const
friend std::ostream & operator<<(std::ostream &os, const PointWithScale &p)
A point structure representing the Point Feature Histogram with colors (PFHRGB).
A point structure representing Euclidean xyz coordinates, and the intensity value.
Eigen::Map< Eigen::Array3f > Array3fMap
friend std::ostream & operator<<(std::ostream &os, const PointUV &p)
PointXYZINormal(float _x, float _y, float _z, float _intensity=0.f)
PointXYZLNormal(float _x, float _y, float _z, std::uint32_t _label=0.f)
static int descriptorSize()
friend std::ostream & operator<<(std::ostream &os, const ESFSignature640 &p)
PointXYZRGBL(const _PointXYZRGBL &p)
PointXYZHSV(float _h, float _s, float _v)
POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::_PointXYZLAB,(float, x, x)(float, y, y)(float, z, z)(float, L, L)(float, a, a)(float, b, b)) namespace pcl
Definition: gicp6d.h:79
friend std::ostream & operator<<(std::ostream &os, const PPFSignature &p)
PointXYZRGBA(float _x, float _y, float _z)
A point structure representing Euclidean xyz coordinates.
A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates...
MomentInvariants()=default
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
static int descriptorSize()
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
PointXYZINormal(const _PointXYZINormal &p)
PointDEM(float _x, float _y, float _z, float _intensity, float _intensity_variance, float _height_variance)
friend std::ostream & operator<<(std::ostream &os, const GASDSignature984 &p)
const Eigen::Map< const Vector4c, Eigen::Aligned > Vector4cMapConst
A point structure representing the three moment invariants.
SHOT352()=default
PointXYZLNormal(const _PointXYZLNormal &p)
const Eigen::Map< const Eigen::Vector3f > Vector3fMapConst
friend std::ostream & operator<<(std::ostream &os, const Intensity32u &p)
PointXYZL(std::uint32_t _label=0)
Eigen::Map< Eigen::Vector3f > getYAxisVector3fMap()
PointXYZI(const _PointXYZI &p)
const Eigen::Map< const Eigen::Matrix3f > getMatrix3fMap() const
static int descriptorSize()
friend std::ostream & operator<<(std::ostream &os, const PointXYZINormal &p)
MomentInvariants(float _j1, float _j2, float _j3)
A point structure representing the grayscale intensity in single-channel images.
PointUV(float _u, float _v)
CPPFSignature(float _alpha=0.f)
GRSDSignature21()=default
friend std::ostream & operator<<(std::ostream &os, const PointXYZLNormal &p)
PointXYZHSV(const _PointXYZHSV &p)
static int descriptorSize()
std::uint8_t boundary_point
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape onl...
static int descriptorSize()
PointXYZLNormal(float _x, float _y, float _z, std::uint32_t _label, float n_x, float n_y, float n_z, float _curvature=0.f)
Axis(float n_x, float n_y, float n_z)
PointSurfel(const _PointSurfel &p)
friend std::ostream & operator<<(std::ostream &os, const RGB &p)
friend std::ostream & operator<<(std::ostream &os, const GRSDSignature21 &p)
static int descriptorSize()
PointXYZRGBL(std::uint32_t _label=0)
int octave
octave (pyramid layer) from which the keypoint has been extracted.
A structure to store if a point in a range image lies on a border between an obstacle and the backgro...
friend std::ostream & operator<<(std::ostream &os, const PointWithRange &p)
friend std::ostream & operator<<(std::ostream &os, const BorderDescription &p)
ReferenceFrame(const _ReferenceFrame &p)
A point structure representing Euclidean xyz coordinates, together with normal coordinates and the su...
Eigen::Map< Eigen::Array4f, Eigen::Aligned > Array4fMap
PPFRGBSignature(float _alpha=0.f)
friend std::ostream & operator<<(std::ostream &os, const PPFRGBSignature &p)
const Eigen::Map< const Eigen::Array4f, Eigen::Aligned > Array4fMapConst
friend std::ostream & operator<<(std::ostream &os, const IntensityGradient &p)
PFHSignature125()=default
PointXY()=default
friend std::ostream & operator<<(std::ostream &os, const PointXYZL &p)
Intensity32u(std::uint32_t _intensity=0)
friend std::ostream & operator<<(std::ostream &os, const Narf36 &p)
Intensity32u(const _Intensity32u &p)
CPPFSignature(float _f1, float _f2, float _f3, float _f4, float _f5, float _f6, float _f7, float _f8, float _f9, float _f10, float _alpha=0.f)
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
A point structure for storing the Point Pair Feature (CPPF) values.
A point structure representing Euclidean xyz coordinates together with the viewpoint from which it wa...
friend std::ostream & operator<<(std::ostream &os, const PrincipalRadiiRSD &p)
PointDEM(float _x, float _y, float _z)
A point structure representing the intensity gradient of an XYZI point cloud.
PointXYZRGBNormal(float _curvature=0.f)
friend std::ostream & operator<<(std::ostream &os, const PFHSignature125 &p)
PPFSignature(float _f1, float _f2, float _f3, float _f4, float _alpha=0.f)
ESFSignature640()=default
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+col...
static int descriptorSize()
Normal(float _curvature=0.f)
PointXYZRGB(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
PointXYZINormal(float _x, float _y, float _z, float _intensity, float n_x, float n_y, float n_z, float _curvature=0.f)
PointXYZRGBL(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint32_t _label=0)
BRISKSignature512(float _scale, float _orientation)
PointXYZRGBNormal(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, float n_x, float n_y, float n_z, float _curvature=0.f)
friend std::ostream & operator<<(std::ostream &os, const BRISKSignature512 &p)
std::string name
Definition: PCLPointField.h:13
friend std::ostream & operator<<(std::ostream &os, const PointXYZRGBNormal &p)
GFPFHSignature16()=default
friend std::ostream & operator<<(std::ostream &os, const SHOT1344 &p)
PointXYZRGB(const _PointXYZRGB &p)
RGB(const _RGB &p)
A point structure representing the Viewpoint Feature Histogram (VFH).
friend std::ostream & operator<<(std::ostream &os, const PFHRGBSignature250 &p)
ShapeContext1980()=default
A point structure representing a 3-D position and scale.
A point structure representing the minimum and maximum surface radii (in meters) computed using RSD...
PointUV()=default
Eigen::Matrix< std::uint8_t, 4, 1 > Vector4c
A point structure representing the Narf descriptor.
const Eigen::Map< const Vector3c > Vector3cMapConst
A point structure representing Euclidean xyz coordinates, and the RGB color.
std::uint8_t datatype
Definition: PCLPointField.h:16
float descriptor[1344]
A point structure representing the principal curvatures and their magnitudes.
PointWithRange(const _PointWithRange &p)
Eigen::Map< Vector4c, Eigen::Aligned > Vector4cMap
PointWithScale(const _PointWithScale &p)
PointXYZHSV(float _x, float _y, float _z, float _h, float _s, float _v)
friend std::ostream & operator<<(std::ostream &os, const VFHSignature308 &p)
A point structure representing the Point Feature Histogram (PFH).
static int descriptorSize()
std::uint32_t label
Narf36(float _x, float _y, float _z, float _roll, float _pitch, float _yaw)
PointWithViewpoint(const _PointWithViewpoint &p)
float descriptor[352]
PointNormal(float _curvature=0.f)
Intensity8u(std::uint8_t _intensity=0)
A point structure representing the Ensemble of Shape Functions (ESF).
FPFHSignature33()=default
static int descriptorSize()
const Eigen::Map< const Eigen::Array3f > Array3fMapConst
PrincipalCurvatures(float _x, float _y, float _z)
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor...
Intensity(const _Intensity &p)
friend std::ostream & operator<<(std::ostream &os, const Label &p)
PointXYZLNormal(std::uint32_t _label=0)
std::uint32_t label
static int descriptorSize()
float descriptor[36]
A point structure representing the Global Radius-based Surface Descriptor (GRSD). ...
friend std::ostream & operator<<(std::ostream &os, const NormalBasedSignature12 &p)
Boundary(std::uint8_t _boundary=0)
PointXYZL(const _PointXYZL &p)
IntensityGradient(float _x, float _y, float _z)
RGB(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coo...
Eigen::Map< Eigen::Vector4f, Eigen::Aligned > Vector4fMap
Eigen::Matrix< std::uint8_t, 3, 1 > Vector3c
PointNormal(const _PointNormal &p)
friend std::ostream & operator<<(std::ostream &os, const Intensity &p)
static int descriptorSize()
A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coo...
A point structure for storing the Point Pair Feature (PPF) values.
PointXY(float _x, float _y)
Normal(const _Normal &p)
const Eigen::Map< const Eigen::Vector3f > getYAxisVector3fMap() const
Eigen::Map< Eigen::Matrix3f > getMatrix3fMap()
A point structure for storing the Point Pair Color Feature (PPFRGB) values.