Point Cloud Library (PCL)  1.9.1-dev
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 #ifndef PCL_IMPL_POINT_TYPES_HPP_
40 #define PCL_IMPL_POINT_TYPES_HPP_
41 
42 #if defined __GNUC__
43 # pragma GCC system_header
44 #endif
45 
46 #include <Eigen/Core>
47 #include <ostream>
48 #include <pcl/pcl_macros.h>
49 
50 // Define all PCL point types
51 #define PCL_POINT_TYPES \
52  (pcl::PointXYZ) \
53  (pcl::PointXYZI) \
54  (pcl::PointXYZL) \
55  (pcl::Label) \
56  (pcl::PointXYZRGBA) \
57  (pcl::PointXYZRGB) \
58  (pcl::PointXYZRGBL) \
59  (pcl::PointXYZHSV) \
60  (pcl::PointXY) \
61  (pcl::InterestPoint) \
62  (pcl::Axis) \
63  (pcl::Normal) \
64  (pcl::PointNormal) \
65  (pcl::PointXYZRGBNormal) \
66  (pcl::PointXYZINormal) \
67  (pcl::PointXYZLNormal) \
68  (pcl::PointWithRange) \
69  (pcl::PointWithViewpoint) \
70  (pcl::MomentInvariants) \
71  (pcl::PrincipalRadiiRSD) \
72  (pcl::Boundary) \
73  (pcl::PrincipalCurvatures) \
74  (pcl::PFHSignature125) \
75  (pcl::PFHRGBSignature250) \
76  (pcl::PPFSignature) \
77  (pcl::CPPFSignature) \
78  (pcl::PPFRGBSignature) \
79  (pcl::NormalBasedSignature12) \
80  (pcl::FPFHSignature33) \
81  (pcl::VFHSignature308) \
82  (pcl::GASDSignature512) \
83  (pcl::GASDSignature984) \
84  (pcl::GASDSignature7992) \
85  (pcl::GRSDSignature21) \
86  (pcl::ESFSignature640) \
87  (pcl::BRISKSignature512) \
88  (pcl::Narf36) \
89  (pcl::IntensityGradient) \
90  (pcl::PointWithScale) \
91  (pcl::PointSurfel) \
92  (pcl::ShapeContext1980) \
93  (pcl::UniqueShapeContext1960) \
94  (pcl::SHOT352) \
95  (pcl::SHOT1344) \
96  (pcl::PointUV) \
97  (pcl::ReferenceFrame) \
98  (pcl::PointDEM)
99 
100 // Define all point types that include RGB data
101 #define PCL_RGB_POINT_TYPES \
102  (pcl::PointXYZRGBA) \
103  (pcl::PointXYZRGB) \
104  (pcl::PointXYZRGBL) \
105  (pcl::PointXYZRGBNormal) \
106  (pcl::PointSurfel) \
107 
108 // Define all point types that include XYZ data
109 #define PCL_XYZ_POINT_TYPES \
110  (pcl::PointXYZ) \
111  (pcl::PointXYZI) \
112  (pcl::PointXYZL) \
113  (pcl::PointXYZRGBA) \
114  (pcl::PointXYZRGB) \
115  (pcl::PointXYZRGBL) \
116  (pcl::PointXYZHSV) \
117  (pcl::InterestPoint) \
118  (pcl::PointNormal) \
119  (pcl::PointXYZRGBNormal) \
120  (pcl::PointXYZINormal) \
121  (pcl::PointXYZLNormal) \
122  (pcl::PointWithRange) \
123  (pcl::PointWithViewpoint) \
124  (pcl::PointWithScale) \
125  (pcl::PointSurfel) \
126  (pcl::PointDEM)
127 
128 // Define all point types with XYZ and label
129 #define PCL_XYZL_POINT_TYPES \
130  (pcl::PointXYZL) \
131  (pcl::PointXYZRGBL) \
132  (pcl::PointXYZLNormal)
133 
134 // Define all point types that include normal[3] data
135 #define PCL_NORMAL_POINT_TYPES \
136  (pcl::Normal) \
137  (pcl::PointNormal) \
138  (pcl::PointXYZRGBNormal) \
139  (pcl::PointXYZINormal) \
140  (pcl::PointXYZLNormal) \
141  (pcl::PointSurfel)
142 
143 // Define all point types that represent features
144 #define PCL_FEATURE_POINT_TYPES \
145  (pcl::PFHSignature125) \
146  (pcl::PFHRGBSignature250) \
147  (pcl::PPFSignature) \
148  (pcl::CPPFSignature) \
149  (pcl::PPFRGBSignature) \
150  (pcl::NormalBasedSignature12) \
151  (pcl::FPFHSignature33) \
152  (pcl::VFHSignature308) \
153  (pcl::GASDSignature512) \
154  (pcl::GASDSignature984) \
155  (pcl::GASDSignature7992) \
156  (pcl::GRSDSignature21) \
157  (pcl::ESFSignature640) \
158  (pcl::BRISKSignature512) \
159  (pcl::Narf36)
160 
161 namespace pcl
162 {
163 
164  using Array3fMap = Eigen::Map<Eigen::Array3f>;
165  using Array3fMapConst = const Eigen::Map<const Eigen::Array3f>;
166  using Array4fMap = Eigen::Map<Eigen::Array4f, Eigen::Aligned>;
167  using Array4fMapConst = const Eigen::Map<const Eigen::Array4f, Eigen::Aligned>;
168  using Vector3fMap = Eigen::Map<Eigen::Vector3f>;
169  using Vector3fMapConst = const Eigen::Map<const Eigen::Vector3f>;
170  using Vector4fMap = Eigen::Map<Eigen::Vector4f, Eigen::Aligned>;
171  using Vector4fMapConst = const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned>;
172 
173  using Vector3c = Eigen::Matrix<uint8_t, 3, 1>;
174  using Vector3cMap = Eigen::Map<Vector3c>;
175  using Vector3cMapConst = const Eigen::Map<const Vector3c>;
176  using Vector4c = Eigen::Matrix<uint8_t, 4, 1>;
177  using Vector4cMap = Eigen::Map<Vector4c, Eigen::Aligned>;
178  using Vector4cMapConst = const Eigen::Map<const Vector4c, Eigen::Aligned>;
179 
180 #define PCL_ADD_UNION_POINT4D \
181  union EIGEN_ALIGN16 { \
182  float data[4]; \
183  struct { \
184  float x; \
185  float y; \
186  float z; \
187  }; \
188  };
189 
190 #define PCL_ADD_EIGEN_MAPS_POINT4D \
191  inline pcl::Vector3fMap getVector3fMap () { return (pcl::Vector3fMap (data)); } \
192  inline pcl::Vector3fMapConst getVector3fMap () const { return (pcl::Vector3fMapConst (data)); } \
193  inline pcl::Vector4fMap getVector4fMap () { return (pcl::Vector4fMap (data)); } \
194  inline pcl::Vector4fMapConst getVector4fMap () const { return (pcl::Vector4fMapConst (data)); } \
195  inline pcl::Array3fMap getArray3fMap () { return (pcl::Array3fMap (data)); } \
196  inline pcl::Array3fMapConst getArray3fMap () const { return (pcl::Array3fMapConst (data)); } \
197  inline pcl::Array4fMap getArray4fMap () { return (pcl::Array4fMap (data)); } \
198  inline pcl::Array4fMapConst getArray4fMap () const { return (pcl::Array4fMapConst (data)); }
199 
200 #define PCL_ADD_POINT4D \
201  PCL_ADD_UNION_POINT4D \
202  PCL_ADD_EIGEN_MAPS_POINT4D
203 
204 #define PCL_ADD_UNION_NORMAL4D \
205  union EIGEN_ALIGN16 { \
206  float data_n[4]; \
207  float normal[3]; \
208  struct { \
209  float normal_x; \
210  float normal_y; \
211  float normal_z; \
212  }; \
213  };
214 
215 #define PCL_ADD_EIGEN_MAPS_NORMAL4D \
216  inline pcl::Vector3fMap getNormalVector3fMap () { return (pcl::Vector3fMap (data_n)); } \
217  inline pcl::Vector3fMapConst getNormalVector3fMap () const { return (pcl::Vector3fMapConst (data_n)); } \
218  inline pcl::Vector4fMap getNormalVector4fMap () { return (pcl::Vector4fMap (data_n)); } \
219  inline pcl::Vector4fMapConst getNormalVector4fMap () const { return (pcl::Vector4fMapConst (data_n)); }
220 
221 #define PCL_ADD_NORMAL4D \
222  PCL_ADD_UNION_NORMAL4D \
223  PCL_ADD_EIGEN_MAPS_NORMAL4D
224 
225 #define PCL_ADD_UNION_RGB \
226  union \
227  { \
228  union \
229  { \
230  struct \
231  { \
232  uint8_t b; \
233  uint8_t g; \
234  uint8_t r; \
235  uint8_t a; \
236  }; \
237  float rgb; \
238  }; \
239  uint32_t rgba; \
240  };
241 
242 #define PCL_ADD_EIGEN_MAPS_RGB \
243  inline Eigen::Vector3i getRGBVector3i () { return (Eigen::Vector3i (r, g, b)); } \
244  inline const Eigen::Vector3i getRGBVector3i () const { return (Eigen::Vector3i (r, g, b)); } \
245  inline Eigen::Vector4i getRGBVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \
246  inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \
247  inline Eigen::Vector4i getRGBAVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \
248  inline const Eigen::Vector4i getRGBAVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \
249  inline pcl::Vector3cMap getBGRVector3cMap () { return (pcl::Vector3cMap (reinterpret_cast<uint8_t*> (&rgba))); } \
250  inline pcl::Vector3cMapConst getBGRVector3cMap () const { return (pcl::Vector3cMapConst (reinterpret_cast<const uint8_t*> (&rgba))); } \
251  inline pcl::Vector4cMap getBGRAVector4cMap () { return (pcl::Vector4cMap (reinterpret_cast<uint8_t*> (&rgba))); } \
252  inline pcl::Vector4cMapConst getBGRAVector4cMap () const { return (pcl::Vector4cMapConst (reinterpret_cast<const uint8_t*> (&rgba))); }
253 
254 #define PCL_ADD_RGB \
255  PCL_ADD_UNION_RGB \
256  PCL_ADD_EIGEN_MAPS_RGB
257 
258 #define PCL_ADD_INTENSITY \
259  struct \
260  { \
261  float intensity; \
262  }; \
263 
264 #define PCL_ADD_INTENSITY_8U \
265  struct \
266  { \
267  uint8_t intensity; \
268  }; \
269 
270 #define PCL_ADD_INTENSITY_32U \
271  struct \
272  { \
273  uint32_t intensity; \
274  }; \
275 
276 
277  struct _PointXYZ
278  {
279  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
280 
282  };
283 
284  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZ& p);
285  /** \brief A point structure representing Euclidean xyz coordinates. (SSE friendly)
286  * \ingroup common
287  */
288  struct EIGEN_ALIGN16 PointXYZ : public _PointXYZ
289  {
290  inline PointXYZ (const _PointXYZ &p)
291  {
292  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
293  }
294 
295  inline PointXYZ ()
296  {
297  x = y = z = 0.0f;
298  data[3] = 1.0f;
299  }
300 
301  inline PointXYZ (float _x, float _y, float _z)
302  {
303  x = _x; y = _y; z = _z;
304  data[3] = 1.0f;
305  }
306 
307  friend std::ostream& operator << (std::ostream& os, const PointXYZ& p);
309  };
310 
311 
312 #ifdef RGB
313 #undef RGB
314 #endif
315  struct _RGB
316  {
318  };
319 
320  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const RGB& p);
321  /** \brief A structure representing RGB color information.
322  *
323  * The RGBA information is available either as separate r, g, b, or as a
324  * packed uint32_t rgba value. To pack it, use:
325  *
326  * \code
327  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
328  * \endcode
329  *
330  * To unpack it use:
331  *
332  * \code
333  * int rgb = ...;
334  * uint8_t r = (rgb >> 16) & 0x0000ff;
335  * uint8_t g = (rgb >> 8) & 0x0000ff;
336  * uint8_t b = (rgb) & 0x0000ff;
337  * \endcode
338  *
339  */
340  struct RGB: public _RGB
341  {
342  inline RGB (const _RGB &p)
343  {
344  rgba = p.rgba;
345  }
346 
347  inline RGB ()
348  {
349  r = g = b = 0;
350  a = 255;
351  }
352 
353  inline RGB (uint8_t _r, uint8_t _g, uint8_t _b)
354  {
355  r = _r;
356  g = _g;
357  b = _b;
358  a = 255;
359  }
360 
361  friend std::ostream& operator << (std::ostream& os, const RGB& p);
362  };
363 
364  struct _Intensity
365  {
367  };
368 
369  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity& p);
370  /** \brief A point structure representing the grayscale intensity in single-channel images.
371  * Intensity is represented as a float value.
372  * \ingroup common
373  */
374  struct Intensity: public _Intensity
375  {
376  inline Intensity (const _Intensity &p)
377  {
378  intensity = p.intensity;
379  }
380 
381  inline Intensity ()
382  {
383  intensity = 0.0f;
384  }
385 
386  friend std::ostream& operator << (std::ostream& os, const Intensity& p);
387  };
388 
389 
391  {
393  };
394 
395  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity8u& p);
396  /** \brief A point structure representing the grayscale intensity in single-channel images.
397  * Intensity is represented as a uint8_t value.
398  * \ingroup common
399  */
400  struct Intensity8u: public _Intensity8u
401  {
402  inline Intensity8u (const _Intensity8u &p)
403  {
404  intensity = p.intensity;
405  }
406 
407  inline Intensity8u ()
408  {
409  intensity = 0;
410  }
411 
412 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
413  operator unsigned char() const
414  {
415  return intensity;
416  }
417 #endif
418 
419  friend std::ostream& operator << (std::ostream& os, const Intensity8u& p);
420  };
421 
423  {
425  };
426 
427  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity32u& p);
428  /** \brief A point structure representing the grayscale intensity in single-channel images.
429  * Intensity is represented as a uint32_t value.
430  * \ingroup common
431  */
433  {
434  inline Intensity32u (const _Intensity32u &p)
435  {
436  intensity = p.intensity;
437  }
438 
439  inline Intensity32u ()
440  {
441  intensity = 0;
442  }
443 
444  friend std::ostream& operator << (std::ostream& os, const Intensity32u& p);
445  };
446 
447  /** \brief A point structure representing Euclidean xyz coordinates, and the intensity value.
448  * \ingroup common
449  */
450  struct EIGEN_ALIGN16 _PointXYZI
451  {
452  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
453  union
454  {
455  struct
456  {
457  float intensity;
458  };
459  float data_c[4];
460  };
462  };
463 
464  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZI& p);
465  struct PointXYZI : public _PointXYZI
466  {
467  inline PointXYZI (const _PointXYZI &p)
468  {
469  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
470  intensity = p.intensity;
471  }
472 
473  inline PointXYZI ()
474  {
475  x = y = z = 0.0f;
476  data[3] = 1.0f;
477  intensity = 0.0f;
478  }
479  inline PointXYZI (float _intensity)
480  {
481  x = y = z = 0.0f;
482  data[3] = 1.0f;
483  intensity = _intensity;
484  }
485  friend std::ostream& operator << (std::ostream& os, const PointXYZI& p);
486  };
487 
488 
489  struct EIGEN_ALIGN16 _PointXYZL
490  {
491  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
492  uint32_t label;
494  };
495 
496  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZL& p);
497  struct PointXYZL : public _PointXYZL
498  {
499  inline PointXYZL (const _PointXYZL &p)
500  {
501  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
502  label = p.label;
503  }
504 
505  inline PointXYZL ()
506  {
507  x = y = z = 0.0f;
508  data[3] = 1.0f;
509  label = 0;
510  }
511 
512  friend std::ostream& operator << (std::ostream& os, const PointXYZL& p);
513  };
514 
515 
516  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Label& p);
517  struct Label
518  {
519  uint32_t 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 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  * uint8_t r = (rgb >> 16) & 0x0000ff;
547  * uint8_t g = (rgb >> 8) & 0x0000ff;
548  * 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 ()
562  {
563  x = y = z = 0.0f;
564  data[3] = 1.0f;
565  r = g = b = 0;
566  a = 255;
567  }
568 
569  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
570  };
571 
572 
573  struct EIGEN_ALIGN16 _PointXYZRGB
574  {
575  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
578  };
579 
580  struct EIGEN_ALIGN16 _PointXYZRGBL
581  {
582  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
584  uint32_t label;
586  };
587 
588  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
589  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color.
590  *
591  * Due to historical reasons (PCL was first developed as a ROS package), the
592  * RGB information is packed into an integer and casted to a float. This is
593  * something we wish to remove in the near future, but in the meantime, the
594  * following code snippet should help you pack and unpack RGB colors in your
595  * PointXYZRGB structure:
596  *
597  * \code
598  * // pack r/g/b into rgb
599  * uint8_t r = 255, g = 0, b = 0; // Example: Red color
600  * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
601  * p.rgb = *reinterpret_cast<float*>(&rgb);
602  * \endcode
603  *
604  * To unpack the data into separate values, use:
605  *
606  * \code
607  * PointXYZRGB p;
608  * // unpack rgb into r/g/b
609  * uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
610  * uint8_t r = (rgb >> 16) & 0x0000ff;
611  * uint8_t g = (rgb >> 8) & 0x0000ff;
612  * uint8_t b = (rgb) & 0x0000ff;
613  * \endcode
614  *
615  *
616  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
617  *
618  * \ingroup common
619  */
620  struct EIGEN_ALIGN16 PointXYZRGB : public _PointXYZRGB
621  {
622  inline PointXYZRGB (const _PointXYZRGB &p)
623  {
624  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
625  rgb = p.rgb;
626  }
627 
628  inline PointXYZRGB ()
629  {
630  x = y = z = 0.0f;
631  data[3] = 1.0f;
632  r = g = b = 0;
633  a = 255;
634  }
635  inline PointXYZRGB (uint8_t _r, uint8_t _g, uint8_t _b)
636  {
637  x = y = z = 0.0f;
638  data[3] = 1.0f;
639  r = _r;
640  g = _g;
641  b = _b;
642  a = 255;
643  }
644 
645  friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
647  };
648 
649 
650  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
651  struct EIGEN_ALIGN16 PointXYZRGBL : public _PointXYZRGBL
652  {
653  inline PointXYZRGBL (const _PointXYZRGBL &p)
654  {
655  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
656  rgba = p.rgba;
657  label = p.label;
658  }
659 
660  inline PointXYZRGBL ()
661  {
662  x = y = z = 0.0f;
663  data[3] = 1.0f;
664  r = g = b = 0;
665  a = 255;
666  label = 0;
667  }
668  inline PointXYZRGBL (uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label)
669  {
670  x = y = z = 0.0f;
671  data[3] = 1.0f;
672  r = _r;
673  g = _g;
674  b = _b;
675  a = 255;
676  label = _label;
677  }
678 
679  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
681  };
682 
683 
684  struct EIGEN_ALIGN16 _PointXYZHSV
685  {
686  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
687  union
688  {
689  struct
690  {
691  float h;
692  float s;
693  float v;
694  };
695  float data_c[4];
696  };
698  };
699 
700  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
701  struct EIGEN_ALIGN16 PointXYZHSV : public _PointXYZHSV
702  {
703  inline PointXYZHSV (const _PointXYZHSV &p)
704  {
705  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
706  h = p.h; s = p.s; v = p.v;
707  }
708 
709  inline PointXYZHSV ()
710  {
711  x = y = z = 0.0f;
712  data[3] = 1.0f;
713  h = s = v = data_c[3] = 0;
714  }
715  inline PointXYZHSV (float _h, float _v, float _s)
716  {
717  x = y = z = 0.0f;
718  data[3] = 1.0f;
719  h = _h; v = _v; s = _s;
720  data_c[3] = 0;
721  }
722 
723  friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
725  };
726 
727 
728 
729  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXY& p);
730  /** \brief A 2D point structure representing Euclidean xy coordinates.
731  * \ingroup common
732  */
733  struct PointXY
734  {
735  float x;
736  float y;
737 
738  friend std::ostream& operator << (std::ostream& os, const PointXY& p);
739  };
740 
741  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointUV& p);
742  /** \brief A 2D point structure representing pixel image coordinates.
743  * \note We use float to be able to represent subpixels.
744  * \ingroup common
745  */
746  struct PointUV
747  {
748  float u;
749  float v;
750 
751  friend std::ostream& operator << (std::ostream& os, const PointUV& p);
752  };
753 
754  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const InterestPoint& p);
755  /** \brief A point structure representing an interest point with Euclidean xyz coordinates, and an interest value.
756  * \ingroup common
757  */
758  struct EIGEN_ALIGN16 InterestPoint
759  {
760  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
761  union
762  {
763  struct
764  {
765  float strength;
766  };
767  float data_c[4];
768  };
770 
771  friend std::ostream& operator << (std::ostream& os, const InterestPoint& p);
772  };
773 
774  struct EIGEN_ALIGN16 _Normal
775  {
776  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
777  union
778  {
779  struct
780  {
781  float curvature;
782  };
783  float data_c[4];
784  };
786  };
787 
788  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Normal& p);
789  /** \brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)
790  * \ingroup common
791  */
792  struct Normal : public _Normal
793  {
794  inline Normal (const _Normal &p)
795  {
796  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
797  data_n[3] = 0.0f;
798  curvature = p.curvature;
799  }
800 
801  inline Normal ()
802  {
803  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
804  curvature = 0;
805  }
806 
807  inline Normal (float n_x, float n_y, float n_z)
808  {
809  normal_x = n_x; normal_y = n_y; normal_z = n_z;
810  curvature = 0;
811  data_n[3] = 0.0f;
812  }
813 
814  friend std::ostream& operator << (std::ostream& os, const Normal& p);
816  };
817 
818 
819  struct EIGEN_ALIGN16 _Axis
820  {
823  };
824 
825  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Axis& p);
826  /** \brief A point structure representing an Axis using its normal coordinates. (SSE friendly)
827  * \ingroup common
828  */
829  struct EIGEN_ALIGN16 Axis : public _Axis
830  {
831  inline Axis (const _Axis &p)
832  {
833  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
834  data_n[3] = 0.0f;
835  }
836 
837  inline Axis ()
838  {
839  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
840  }
841 
842  inline Axis (float n_x, float n_y, float n_z)
843  {
844  normal_x = n_x; normal_y = n_y; normal_z = n_z;
845  data_n[3] = 0.0f;
846  }
847 
848  friend std::ostream& operator << (std::ostream& os, const Axis& p);
850  };
851 
852 
853  struct EIGEN_ALIGN16 _PointNormal
854  {
855  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
856  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
857  union
858  {
859  struct
860  {
861  float curvature;
862  };
863  float data_c[4];
864  };
866  };
867 
868  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointNormal& p);
869  /** \brief A point structure representing Euclidean xyz coordinates, together with normal coordinates and the surface curvature estimate. (SSE friendly)
870  * \ingroup common
871  */
872  struct PointNormal : public _PointNormal
873  {
874  inline PointNormal (const _PointNormal &p)
875  {
876  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
877  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
878  curvature = p.curvature;
879  }
880 
881  inline PointNormal ()
882  {
883  x = y = z = 0.0f;
884  data[3] = 1.0f;
885  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
886  curvature = 0.f;
887  }
888 
889  friend std::ostream& operator << (std::ostream& os, const PointNormal& p);
890  };
891 
892 
893  struct EIGEN_ALIGN16 _PointXYZRGBNormal
894  {
895  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
896  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
897  union
898  {
899  struct
900  {
902  float curvature;
903  };
904  float data_c[4];
905  };
908  };
909 
910  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
911  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate.
912  * Due to historical reasons (PCL was first developed as a ROS package), the
913  * RGB information is packed into an integer and casted to a float. This is
914  * something we wish to remove in the near future, but in the meantime, the
915  * following code snippet should help you pack and unpack RGB colors in your
916  * PointXYZRGB structure:
917  *
918  * \code
919  * // pack r/g/b into rgb
920  * uint8_t r = 255, g = 0, b = 0; // Example: Red color
921  * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
922  * p.rgb = *reinterpret_cast<float*>(&rgb);
923  * \endcode
924  *
925  * To unpack the data into separate values, use:
926  *
927  * \code
928  * PointXYZRGB p;
929  * // unpack rgb into r/g/b
930  * uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
931  * uint8_t r = (rgb >> 16) & 0x0000ff;
932  * uint8_t g = (rgb >> 8) & 0x0000ff;
933  * uint8_t b = (rgb) & 0x0000ff;
934  * \endcode
935  *
936  *
937  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
938  * \ingroup common
939  */
941  {
943  {
944  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
945  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
946  curvature = p.curvature;
947  rgba = p.rgba;
948  }
949 
951  {
952  x = y = z = 0.0f;
953  data[3] = 1.0f;
954  r = g = b = 0;
955  a = 255;
956  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
957  curvature = 0;
958  }
959 
960  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
961  };
962 
963  struct EIGEN_ALIGN16 _PointXYZINormal
964  {
965  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
966  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
967  union
968  {
969  struct
970  {
971  float intensity;
972  float curvature;
973  };
974  float data_c[4];
975  };
977  };
978 
979  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
980  /** \brief A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates and the surface curvature estimate.
981  * \ingroup common
982  */
984  {
986  {
987  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
988  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
989  curvature = p.curvature;
990  intensity = p.intensity;
991  }
992 
993  inline PointXYZINormal ()
994  {
995  x = y = z = 0.0f;
996  data[3] = 1.0f;
997  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
998  intensity = 0.0f;
999  curvature = 0;
1000  }
1001 
1002  friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
1003  };
1004 
1005 //----
1006  struct EIGEN_ALIGN16 _PointXYZLNormal
1007  {
1008  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1009  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1010  union
1011  {
1012  struct
1013  {
1014  uint32_t label;
1015  float curvature;
1016  };
1017  float data_c[4];
1018  };
1020  };
1021 
1022  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1023  /** \brief A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates and the surface curvature estimate.
1024  * \ingroup common
1025  */
1027  {
1029  {
1030  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1031  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
1032  curvature = p.curvature;
1033  label = p.label;
1034  }
1035 
1037  {
1038  x = y = z = 0.0f;
1039  data[3] = 1.0f;
1040  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
1041  label = 0;
1042  curvature = 0;
1043  }
1044 
1045  friend std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1046  };
1047 
1048 // ---
1049 
1050 
1051  struct EIGEN_ALIGN16 _PointWithRange
1052  {
1053  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1054  union
1055  {
1056  struct
1057  {
1058  float range;
1059  };
1060  float data_c[4];
1061  };
1063  };
1064 
1065  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1066  /** \brief A point structure representing Euclidean xyz coordinates, padded with an extra range float.
1067  * \ingroup common
1068  */
1070  {
1072  {
1073  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1074  range = p.range;
1075  }
1076 
1077  inline PointWithRange ()
1078  {
1079  x = y = z = 0.0f;
1080  data[3] = 1.0f;
1081  range = 0.0f;
1082  }
1083 
1084  friend std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1085  };
1086 
1087 
1088  struct EIGEN_ALIGN16 _PointWithViewpoint
1089  {
1090  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1091  union
1092  {
1093  struct
1094  {
1095  float vp_x;
1096  float vp_y;
1097  float vp_z;
1098  };
1099  float data_c[4];
1100  };
1102  };
1103 
1104  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1105  /** \brief A point structure representing Euclidean xyz coordinates together with the viewpoint from which it was seen.
1106  * \ingroup common
1107  */
1108  struct EIGEN_ALIGN16 PointWithViewpoint : public _PointWithViewpoint
1109  {
1111  {
1112  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1113  vp_x = p.vp_x; vp_y = p.vp_y; vp_z = p.vp_z;
1114  }
1115 
1116  inline PointWithViewpoint (float _x = 0.0f, float _y = 0.0f, float _z = 0.0f,
1117  float _vp_x = 0.0f, float _vp_y = 0.0f, float _vp_z = 0.0f)
1118  {
1119  x = _x; y = _y; z = _z;
1120  data[3] = 1.0f;
1121  vp_x = _vp_x; vp_y = _vp_y; vp_z = _vp_z;
1122  }
1123 
1124  friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1125  };
1126 
1127  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1128  /** \brief A point structure representing the three moment invariants.
1129  * \ingroup common
1130  */
1132  {
1133  float j1, j2, j3;
1134 
1135  friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1136  };
1137 
1138  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1139  /** \brief A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
1140  * \ingroup common
1141  */
1143  {
1144  float r_min, r_max;
1145 
1146  friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1147  };
1148 
1149  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Boundary& p);
1150  /** \brief A point structure representing a description of whether a point is lying on a surface boundary or not.
1151  * \ingroup common
1152  */
1153  struct Boundary
1154  {
1156 
1157 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
1158  operator unsigned char() const
1159  {
1160  return boundary_point;
1161  }
1162 #endif
1163 
1164  friend std::ostream& operator << (std::ostream& os, const Boundary& p);
1165  };
1166 
1167  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1168  /** \brief A point structure representing the principal curvatures and their magnitudes.
1169  * \ingroup common
1170  */
1172  {
1173  union
1174  {
1175  float principal_curvature[3];
1176  struct
1177  {
1181  };
1182  };
1183  float pc1;
1184  float pc2;
1185 
1186  friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1187  };
1188 
1189  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1190  /** \brief A point structure representing the Point Feature Histogram (PFH).
1191  * \ingroup common
1192  */
1194  {
1195  float histogram[125];
1196  static int descriptorSize () { return 125; }
1197 
1198  friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1199  };
1200 
1201  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1202  /** \brief A point structure representing the Point Feature Histogram with colors (PFHRGB).
1203  * \ingroup common
1204  */
1206  {
1207  float histogram[250];
1208  static int descriptorSize () { return 250; }
1209 
1210  friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1211  };
1212 
1213  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1214  /** \brief A point structure for storing the Point Pair Feature (PPF) values
1215  * \ingroup common
1216  */
1218  {
1219  float f1, f2, f3, f4;
1220  float alpha_m;
1221 
1222  friend std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1223  };
1224 
1225  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1226  /** \brief A point structure for storing the Point Pair Feature (CPPF) values
1227  * \ingroup common
1228  */
1230  {
1231  float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1232  float alpha_m;
1233 
1234  friend std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1235  };
1236 
1237  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1238  /** \brief A point structure for storing the Point Pair Color Feature (PPFRGB) values
1239  * \ingroup common
1240  */
1242  {
1243  float f1, f2, f3, f4;
1244  float r_ratio, g_ratio, b_ratio;
1245  float alpha_m;
1246 
1247  friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1248  };
1249 
1250  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1251  /** \brief A point structure representing the Normal Based Signature for
1252  * a feature matrix of 4-by-3
1253  * \ingroup common
1254  */
1256  {
1257  float values[12];
1258 
1259  friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1260  };
1261 
1262  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1263  /** \brief A point structure representing a Shape Context.
1264  * \ingroup common
1265  */
1267  {
1268  float descriptor[1980];
1269  float rf[9];
1270  static int descriptorSize () { return 1980; }
1271 
1272  friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1273  };
1274 
1275  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1276  /** \brief A point structure representing a Unique Shape Context.
1277  * \ingroup common
1278  */
1280  {
1281  float descriptor[1960];
1282  float rf[9];
1283  static int descriptorSize () { return 1960; }
1284 
1285  friend std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1286  };
1287 
1288  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT352& p);
1289  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape only.
1290  * \ingroup common
1291  */
1292  struct SHOT352
1293  {
1294  float descriptor[352];
1295  float rf[9];
1296  static int descriptorSize () { return 352; }
1297 
1298  friend std::ostream& operator << (std::ostream& os, const SHOT352& p);
1299  };
1300 
1301 
1302  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1303  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+color.
1304  * \ingroup common
1305  */
1306  struct SHOT1344
1307  {
1308  float descriptor[1344];
1309  float rf[9];
1310  static int descriptorSize () { return 1344; }
1311 
1312  friend std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1313  };
1314 
1315 
1316  /** \brief A structure representing the Local Reference Frame of a point.
1317  * \ingroup common
1318  */
1319  struct EIGEN_ALIGN16 _ReferenceFrame
1320  {
1321  union
1322  {
1323  float rf[9];
1324  struct
1325  {
1326  float x_axis[3];
1327  float y_axis[3];
1328  float z_axis[3];
1329  };
1330  };
1331 
1332  inline Eigen::Map<Eigen::Vector3f> getXAxisVector3fMap () { return (Eigen::Vector3f::Map (x_axis)); }
1333  inline const Eigen::Map<const Eigen::Vector3f> getXAxisVector3fMap () const { return (Eigen::Vector3f::Map (x_axis)); }
1334  inline Eigen::Map<Eigen::Vector3f> getYAxisVector3fMap () { return (Eigen::Vector3f::Map (y_axis)); }
1335  inline const Eigen::Map<const Eigen::Vector3f> getYAxisVector3fMap () const { return (Eigen::Vector3f::Map (y_axis)); }
1336  inline Eigen::Map<Eigen::Vector3f> getZAxisVector3fMap () { return (Eigen::Vector3f::Map (z_axis)); }
1337  inline const Eigen::Map<const Eigen::Vector3f> getZAxisVector3fMap () const { return (Eigen::Vector3f::Map (z_axis)); }
1338  inline Eigen::Map<Eigen::Matrix3f> getMatrix3fMap () { return (Eigen::Matrix3f::Map (rf)); }
1339  inline const Eigen::Map<const Eigen::Matrix3f> getMatrix3fMap () const { return (Eigen::Matrix3f::Map (rf)); }
1340 
1342  };
1343 
1344  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1345  struct EIGEN_ALIGN16 ReferenceFrame : public _ReferenceFrame
1346  {
1348  {
1349  for (int d = 0; d < 9; ++d)
1350  rf[d] = p.rf[d];
1351  }
1352 
1353  inline ReferenceFrame ()
1354  {
1355  for (int d = 0; d < 3; ++d)
1356  x_axis[d] = y_axis[d] = z_axis[d] = 0;
1357  }
1358 
1359  friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1361  };
1362 
1363 
1364  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1365  /** \brief A point structure representing the Fast Point Feature Histogram (FPFH).
1366  * \ingroup common
1367  */
1369  {
1370  float histogram[33];
1371  static int descriptorSize () { return 33; }
1372 
1373  friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1374  };
1375 
1376  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1377  /** \brief A point structure representing the Viewpoint Feature Histogram (VFH).
1378  * \ingroup common
1379  */
1381  {
1382  float histogram[308];
1383  static int descriptorSize () { return 308; }
1384 
1385  friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1386  };
1387 
1388  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1389  /** \brief A point structure representing the Global Radius-based Surface Descriptor (GRSD).
1390  * \ingroup common
1391  */
1393  {
1394  float histogram[21];
1395  static int descriptorSize () { return 21; }
1396 
1397  friend std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1398  };
1399 
1400  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1401  /** \brief A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
1402  * \ingroup common
1403  */
1405  {
1406  float scale;
1408  unsigned char descriptor[64];
1409  static int descriptorSize () { return 64; }
1410 
1411  friend std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1412  };
1413 
1414  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1415  /** \brief A point structure representing the Ensemble of Shape Functions (ESF).
1416  * \ingroup common
1417  */
1419  {
1420  float histogram[640];
1421  static int descriptorSize () { return 640; }
1422 
1423  friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1424  };
1425 
1426  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature512& p);
1427  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor.
1428  * \ingroup common
1429  */
1431  {
1432  float histogram[512];
1433  static int descriptorSize() { return 512; }
1434 
1435  friend std::ostream& operator << (std::ostream& os, const GASDSignature512& p);
1436  };
1437 
1438  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature984& p);
1439  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descriptor.
1440  * \ingroup common
1441  */
1443  {
1444  float histogram[984];
1445  static int descriptorSize() { return 984; }
1446 
1447  friend std::ostream& operator << (std::ostream& os, const GASDSignature984& p);
1448  };
1449 
1450  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature7992& p);
1451  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descriptor.
1452  * \ingroup common
1453  */
1455  {
1456  float histogram[7992];
1457  static int descriptorSize() { return 7992; }
1458 
1459  friend std::ostream& operator << (std::ostream& os, const GASDSignature7992& p);
1460  };
1461 
1462  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1463  /** \brief A point structure representing the GFPFH descriptor with 16 bins.
1464  * \ingroup common
1465  */
1467  {
1468  float histogram[16];
1469  static int descriptorSize () { return 16; }
1470 
1471  friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1472  };
1473 
1474  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Narf36& p);
1475  /** \brief A point structure representing the Narf descriptor.
1476  * \ingroup common
1477  */
1478  struct Narf36
1479  {
1480  float x, y, z, roll, pitch, yaw;
1481  float descriptor[36];
1482  static int descriptorSize () { return 36; }
1483 
1484  friend std::ostream& operator << (std::ostream& os, const Narf36& p);
1485  };
1486 
1487  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1488  /** \brief A structure to store if a point in a range image lies on a border between an obstacle and the background.
1489  * \ingroup common
1490  */
1492  {
1493  int x, y;
1495  //std::vector<const BorderDescription*> neighbors;
1496 
1497  friend std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1498  };
1499 
1500 
1501  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1502  /** \brief A point structure representing the intensity gradient of an XYZI point cloud.
1503  * \ingroup common
1504  */
1506  {
1507  union
1508  {
1509  float gradient[3];
1510  struct
1511  {
1512  float gradient_x;
1513  float gradient_y;
1514  float gradient_z;
1515  };
1516  };
1517 
1518  friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1519  };
1520 
1521  /** \brief A point structure representing an N-D histogram.
1522  * \ingroup common
1523  */
1524  template <int N>
1525  struct Histogram
1526  {
1527  float histogram[N];
1528  static int descriptorSize () { return N; }
1529  };
1530 
1531  struct EIGEN_ALIGN16 _PointWithScale
1532  {
1533  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1534 
1535  union
1536  {
1537  /** \brief Diameter of the meaningful keypoint neighborhood. */
1538  float scale;
1539  float size;
1540  };
1541 
1542  /** \brief Computed orientation of the keypoint (-1 if not applicable). */
1543  float angle;
1544  /** \brief The response by which the most strong keypoints have been selected. */
1545  float response;
1546  /** \brief octave (pyramid layer) from which the keypoint has been extracted. */
1547  int octave;
1548 
1550  };
1551 
1552  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1553  /** \brief A point structure representing a 3-D position and scale.
1554  * \ingroup common
1555  */
1557  {
1559  {
1560  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1561  scale = p.scale;
1562  angle = p.angle;
1563  response = p.response;
1564  octave = p.octave;
1565  }
1566 
1567  inline PointWithScale ()
1568  {
1569  x = y = z = 0.0f;
1570  scale = 1.0f;
1571  angle = -1.0f;
1572  response = 0.0f;
1573  octave = 0;
1574  data[3] = 1.0f;
1575  }
1576 
1577  inline PointWithScale (float _x, float _y, float _z, float _scale)
1578  {
1579  x = _x;
1580  y = _y;
1581  z = _z;
1582  scale = _scale;
1583  angle = -1.0f;
1584  response = 0.0f;
1585  octave = 0;
1586  data[3] = 1.0f;
1587  }
1588 
1589  inline PointWithScale (float _x, float _y, float _z, float _scale, float _angle, float _response, int _octave)
1590  {
1591  x = _x;
1592  y = _y;
1593  z = _z;
1594  scale = _scale;
1595  angle = _angle;
1596  response = _response;
1597  octave = _octave;
1598  data[3] = 1.0f;
1599  }
1600 
1601  friend std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1602  };
1603 
1604 
1605  struct EIGEN_ALIGN16 _PointSurfel
1606  {
1607  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1608  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1609  union
1610  {
1611  struct
1612  {
1614  float radius;
1615  float confidence;
1616  float curvature;
1617  };
1618  float data_c[4];
1619  };
1622  };
1623 
1624  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1625  /** \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.
1626  * \ingroup common
1627  */
1628  struct PointSurfel : public _PointSurfel
1629  {
1630  inline PointSurfel (const _PointSurfel &p)
1631  {
1632  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1633  rgba = p.rgba;
1634  radius = p.radius;
1635  confidence = p.confidence;
1636  curvature = p.curvature;
1637  }
1638 
1639  inline PointSurfel ()
1640  {
1641  x = y = z = 0.0f;
1642  data[3] = 1.0f;
1643  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
1644  r = g = b = 0;
1645  a = 255;
1646  radius = confidence = curvature = 0.0f;
1647  }
1648 
1649  friend std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1650  };
1651 
1652  struct EIGEN_ALIGN16 _PointDEM
1653  {
1655  float intensity;
1659  };
1660 
1661  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointDEM& p);
1662  /** \brief A point structure representing Digital Elevation Map.
1663  * \ingroup common
1664  */
1665  struct PointDEM : public _PointDEM
1666  {
1667  inline PointDEM (const _PointDEM &p)
1668  {
1669  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1670  intensity = p.intensity;
1671  intensity_variance = p.intensity_variance;
1672  height_variance = p.height_variance;
1673  }
1674 
1675  inline PointDEM ()
1676  {
1677  x = y = z = 0.0f; data[3] = 1.0f;
1678  intensity = 0.0f;
1679  intensity_variance = height_variance = 0.0f;
1680  }
1681 
1682  friend std::ostream& operator << (std::ostream& os, const PointDEM& p);
1683  };
1684 
1685  template <int N> std::ostream&
1686  operator << (std::ostream& os, const Histogram<N>& p)
1687  {
1688  for (int i = 0; i < N; ++i)
1689  os << (i == 0 ? "(" : "") << p.histogram[i] << (i < N-1 ? ", " : ")");
1690  return (os);
1691  }
1692 } // End namespace
1693 
1694 // Preserve API for PCL users < 1.4
1695 #include <pcl/common/point_tests.h>
1696 
1697 #endif
PointXYZI(float _intensity)
A point structure representing normal coordinates and the surface curvature estimate.
Eigen::Map< Eigen::Vector3f > Vector3fMap
A point structure representing the grayscale intensity in single-channel images.
A point structure representing a Shape Context.
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:311
Axis(const _Axis &p)
A point structure representing a description of whether a point is lying on a surface boundary or not...
A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates a...
Eigen::Matrix< uint8_t, 3, 1 > Vector3c
A point structure representing Euclidean xyz coordinates, padded with an extra range float...
float intensity_variance
PointDEM(const _PointDEM &p)
const Eigen::Map< const Eigen::Vector4f, Eigen::Aligned > Vector4fMapConst
static int descriptorSize()
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.
PointWithScale(float _x, float _y, float _z, float _scale)
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
Eigen::Map< Eigen::Vector3f > getZAxisVector3fMap()
A structure representing the Local Reference Frame of a point.
Eigen::Matrix< uint8_t, 4, 1 > Vector4c
float angle
Computed orientation of the keypoint (-1 if not applicable).
PointXYZRGBNormal(const _PointXYZRGBNormal &p)
static int descriptorSize()
const Eigen::Map< const Eigen::Vector3f > getZAxisVector3fMap() const
A point structure representing Digital Elevation Map.
static int descriptorSize()
A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
PointXYZ(float _x, float _y, float _z)
PointXYZRGBA(const _PointXYZRGBA &p)
float response
The response by which the most strong keypoints have been selected.
Eigen::Map< Vector3c > Vector3cMap
static int descriptorSize()
PointWithScale(float _x, float _y, float _z, float _scale, float _angle, float _response, int _octave)
PointXYZRGB(uint8_t _r, uint8_t _g, uint8_t _b)
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: pcl_macros.h:344
A point structure representing Euclidean xyz coordinates, and the RGBA color.
Intensity8u(const _Intensity8u &p)
A point structure representing the grayscale intensity in single-channel images.
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
A point structure representing the Fast Point Feature Histogram (FPFH).
A 2D point structure representing Euclidean xy coordinates.
PointXYZ(const _PointXYZ &p)
A structure representing RGB color information.
A point structure representing an N-D histogram.
A 2D point structure representing pixel image coordinates.
PointXYZRGBL(uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label)
A point structure representing the GFPFH descriptor with 16 bins.
const Eigen::Map< const Eigen::Vector3f > getXAxisVector3fMap() const
A point structure representing the Point Feature Histogram with colors (PFHRGB).
uint8_t boundary_point
A point structure representing Euclidean xyz coordinates, and the intensity value.
Eigen::Map< Eigen::Array3f > Array3fMap
static int descriptorSize()
PointXYZRGBL(const _PointXYZRGBL &p)
A point structure representing Euclidean xyz coordinates.
A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates...
uint32_t label
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)
const Eigen::Map< const Vector4c, Eigen::Aligned > Vector4cMapConst
A point structure representing the three moment invariants.
PointXYZLNormal(const _PointXYZLNormal &p)
RGB(uint8_t _r, uint8_t _g, uint8_t _b)
const Eigen::Map< const Eigen::Vector3f > Vector3fMapConst
Eigen::Map< Eigen::Vector3f > getYAxisVector3fMap()
PointXYZI(const _PointXYZI &p)
const Eigen::Map< const Eigen::Matrix3f > getMatrix3fMap() const
static int descriptorSize()
A point structure representing the grayscale intensity in single-channel images.
PointXYZHSV(const _PointXYZHSV &p)
static int descriptorSize()
Normal(float n_x, float n_y, float n_z)
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape onl...
static int descriptorSize()
Axis(float n_x, float n_y, float n_z)
PointSurfel(const _PointSurfel &p)
static int descriptorSize()
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...
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
const Eigen::Map< const Eigen::Array4f, Eigen::Aligned > Array4fMapConst
Intensity32u(const _Intensity32u &p)
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...
A point structure representing the intensity gradient of an XYZI point cloud.
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+col...
static int descriptorSize()
PointXYZRGB(const _PointXYZRGB &p)
RGB(const _RGB &p)
A point structure representing the Viewpoint Feature Histogram (VFH).
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...
A point structure representing the Narf descriptor.
const Eigen::Map< const Vector3c > Vector3cMapConst
A point structure representing Euclidean xyz coordinates, and the RGB color.
A point structure representing the principal curvatures and their magnitudes.
PointWithRange(const _PointWithRange &p)
Eigen::Map< Vector4c, Eigen::Aligned > Vector4cMap
PointWithScale(const _PointWithScale &p)
A point structure representing the Point Feature Histogram (PFH).
static int descriptorSize()
PointWithViewpoint(const _PointWithViewpoint &p)
A point structure representing the Ensemble of Shape Functions (ESF).
static int descriptorSize()
const Eigen::Map< const Eigen::Array3f > Array3fMapConst
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor...
Intensity(const _Intensity &p)
static int descriptorSize()
PointXYZHSV(float _h, float _v, float _s)
A point structure representing the Global Radius-based Surface Descriptor (GRSD). ...
PointXYZL(const _PointXYZL &p)
A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coo...
Eigen::Map< Eigen::Vector4f, Eigen::Aligned > Vector4fMap
PointNormal(const _PointNormal &p)
PointWithViewpoint(float _x=0.0f, float _y=0.0f, float _z=0.0f, float _vp_x=0.0f, float _vp_y=0.0f, float _vp_z=0.0f)
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.
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.