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