Point Cloud Library (PCL)  1.8.0
point_types.hpp
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010, Willow Garage, Inc.
6  * Copyright (c) 2012-, Open Perception, Inc.
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the copyright holder(s) nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #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 = a = 0;
343  }
344 
345  friend std::ostream& operator << (std::ostream& os, const RGB& p);
346  };
347 
348 
349  struct _Intensity
350  {
352  };
353 
354  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity& p);
355  /** \brief A point structure representing the grayscale intensity in single-channel images.
356  * Intensity is represented as a float value.
357  * \ingroup common
358  */
359  struct Intensity: public _Intensity
360  {
361  inline Intensity (const _Intensity &p)
362  {
363  intensity = p.intensity;
364  }
365 
366  inline Intensity ()
367  {
368  intensity = 0.0f;
369  }
370 
371  friend std::ostream& operator << (std::ostream& os, const Intensity& p);
372  };
373 
374 
376  {
378  };
379 
380  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity8u& p);
381  /** \brief A point structure representing the grayscale intensity in single-channel images.
382  * Intensity is represented as a uint8_t value.
383  * \ingroup common
384  */
385  struct Intensity8u: public _Intensity8u
386  {
387  inline Intensity8u (const _Intensity8u &p)
388  {
389  intensity = p.intensity;
390  }
391 
392  inline Intensity8u ()
393  {
394  intensity = 0;
395  }
396 
397 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
398  operator unsigned char() const
399  {
400  return intensity;
401  }
402 #endif
403 
404  friend std::ostream& operator << (std::ostream& os, const Intensity8u& p);
405  };
406 
408  {
410  };
411 
412  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity32u& p);
413  /** \brief A point structure representing the grayscale intensity in single-channel images.
414  * Intensity is represented as a uint8_t value.
415  * \ingroup common
416  */
418  {
419  inline Intensity32u (const _Intensity32u &p)
420  {
421  intensity = p.intensity;
422  }
423 
424  inline Intensity32u ()
425  {
426  intensity = 0;
427  }
428 
429  friend std::ostream& operator << (std::ostream& os, const Intensity32u& p);
430  };
431 
432  /** \brief A point structure representing Euclidean xyz coordinates, and the intensity value.
433  * \ingroup common
434  */
436  {
437  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
438  union
439  {
440  struct
441  {
442  float intensity;
443  };
444  float data_c[4];
445  };
446  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
447  };
448 
449  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZI& p);
450  struct PointXYZI : public _PointXYZI
451  {
452  inline PointXYZI (const _PointXYZI &p)
453  {
454  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
455  intensity = p.intensity;
456  }
457 
458  inline PointXYZI ()
459  {
460  x = y = z = 0.0f;
461  data[3] = 1.0f;
462  intensity = 0.0f;
463  }
464  inline PointXYZI (float _intensity)
465  {
466  x = y = z = 0.0f;
467  data[3] = 1.0f;
468  intensity = _intensity;
469  }
470  friend std::ostream& operator << (std::ostream& os, const PointXYZI& p);
471  };
472 
473 
475  {
476  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
477  uint32_t label;
478  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
479  };
480 
481  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZL& p);
482  struct PointXYZL : public _PointXYZL
483  {
484  inline PointXYZL (const _PointXYZL &p)
485  {
486  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
487  label = p.label;
488  }
489 
490  inline PointXYZL ()
491  {
492  x = y = z = 0.0f;
493  data[3] = 1.0f;
494  label = 0;
495  }
496 
497  friend std::ostream& operator << (std::ostream& os, const PointXYZL& p);
498  };
499 
500 
501  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Label& p);
502  struct Label
503  {
504  uint32_t label;
505 
506  friend std::ostream& operator << (std::ostream& os, const Label& p);
507  };
508 
509 
511  {
512  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
514  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
515  };
516 
517  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
518  /** \brief A point structure representing Euclidean xyz coordinates, and the RGBA color.
519  *
520  * The RGBA information is available either as separate r, g, b, or as a
521  * packed uint32_t rgba value. To pack it, use:
522  *
523  * \code
524  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
525  * \endcode
526  *
527  * To unpack it use:
528  *
529  * \code
530  * int rgb = ...;
531  * uint8_t r = (rgb >> 16) & 0x0000ff;
532  * uint8_t g = (rgb >> 8) & 0x0000ff;
533  * uint8_t b = (rgb) & 0x0000ff;
534  * \endcode
535  *
536  * \ingroup common
537  */
539  {
540  inline PointXYZRGBA (const _PointXYZRGBA &p)
541  {
542  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
543  rgba = p.rgba;
544  }
545 
546  inline PointXYZRGBA ()
547  {
548  x = y = z = 0.0f;
549  data[3] = 1.0f;
550  r = g = b = 0;
551  a = 255;
552  }
553 
554  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
555  };
556 
557 
559  {
560  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
562  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
563  };
564 
566  {
567  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
569  uint32_t label;
570  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
571  };
572 
573  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
574  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color.
575  *
576  * Due to historical reasons (PCL was first developed as a ROS package), the
577  * RGB information is packed into an integer and casted to a float. This is
578  * something we wish to remove in the near future, but in the meantime, the
579  * following code snippet should help you pack and unpack RGB colors in your
580  * PointXYZRGB structure:
581  *
582  * \code
583  * // pack r/g/b into rgb
584  * uint8_t r = 255, g = 0, b = 0; // Example: Red color
585  * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
586  * p.rgb = *reinterpret_cast<float*>(&rgb);
587  * \endcode
588  *
589  * To unpack the data into separate values, use:
590  *
591  * \code
592  * PointXYZRGB p;
593  * // unpack rgb into r/g/b
594  * uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
595  * uint8_t r = (rgb >> 16) & 0x0000ff;
596  * uint8_t g = (rgb >> 8) & 0x0000ff;
597  * uint8_t b = (rgb) & 0x0000ff;
598  * \endcode
599  *
600  *
601  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
602  *
603  * \ingroup common
604  */
606  {
607  inline PointXYZRGB (const _PointXYZRGB &p)
608  {
609  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
610  rgb = p.rgb;
611  }
612 
613  inline PointXYZRGB ()
614  {
615  x = y = z = 0.0f;
616  data[3] = 1.0f;
617  r = g = b = a = 0;
618  }
619  inline PointXYZRGB (uint8_t _r, uint8_t _g, uint8_t _b)
620  {
621  x = y = z = 0.0f;
622  data[3] = 1.0f;
623  r = _r;
624  g = _g;
625  b = _b;
626  a = 0;
627  }
628 
629  friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
630  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
631  };
632 
633 
634  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
636  {
637  inline PointXYZRGBL (const _PointXYZRGBL &p)
638  {
639  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
640  rgba = p.rgba;
641  label = p.label;
642  }
643 
644  inline PointXYZRGBL ()
645  {
646  x = y = z = 0.0f;
647  data[3] = 1.0f;
648  r = g = b = 0;
649  a = 0;
650  label = 255;
651  }
652  inline PointXYZRGBL (uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label)
653  {
654  x = y = z = 0.0f;
655  data[3] = 1.0f;
656  r = _r;
657  g = _g;
658  b = _b;
659  a = 0;
660  label = _label;
661  }
662 
663  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
664  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
665  };
666 
667 
669  {
670  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
671  union
672  {
673  struct
674  {
675  float h;
676  float s;
677  float v;
678  };
679  float data_c[4];
680  };
681  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
682  } EIGEN_ALIGN16;
683 
684  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
685  struct EIGEN_ALIGN16 PointXYZHSV : public _PointXYZHSV
686  {
687  inline PointXYZHSV (const _PointXYZHSV &p)
688  {
689  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
690  h = p.h; s = p.s; v = p.v;
691  }
692 
693  inline PointXYZHSV ()
694  {
695  x = y = z = 0.0f;
696  data[3] = 1.0f;
697  h = s = v = data_c[3] = 0;
698  }
699  inline PointXYZHSV (float _h, float _v, float _s)
700  {
701  x = y = z = 0.0f;
702  data[3] = 1.0f;
703  h = _h; v = _v; s = _s;
704  data_c[3] = 0;
705  }
706 
707  friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
708  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
709  };
710 
711 
712 
713  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXY& p);
714  /** \brief A 2D point structure representing Euclidean xy coordinates.
715  * \ingroup common
716  */
717  struct PointXY
718  {
719  float x;
720  float y;
721 
722  friend std::ostream& operator << (std::ostream& os, const PointXY& p);
723  };
724 
725  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointUV& p);
726  /** \brief A 2D point structure representing pixel image coordinates.
727  * \note We use float to be able to represent subpixels.
728  * \ingroup common
729  */
730  struct PointUV
731  {
732  float u;
733  float v;
734 
735  friend std::ostream& operator << (std::ostream& os, const PointUV& p);
736  };
737 
738  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const InterestPoint& p);
739  /** \brief A point structure representing an interest point with Euclidean xyz coordinates, and an interest value.
740  * \ingroup common
741  */
742  struct EIGEN_ALIGN16 InterestPoint
743  {
744  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
745  union
746  {
747  struct
748  {
749  float strength;
750  };
751  float data_c[4];
752  };
753  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
754 
755  friend std::ostream& operator << (std::ostream& os, const InterestPoint& p);
756  };
757 
758  struct EIGEN_ALIGN16 _Normal
759  {
760  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
761  union
762  {
763  struct
764  {
765  float curvature;
766  };
767  float data_c[4];
768  };
769  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
770  };
771 
772  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Normal& p);
773  /** \brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)
774  * \ingroup common
775  */
776  struct Normal : public _Normal
777  {
778  inline Normal (const _Normal &p)
779  {
780  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
781  data_n[3] = 0.0f;
782  curvature = p.curvature;
783  }
784 
785  inline Normal ()
786  {
787  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
788  curvature = 0;
789  }
790 
791  inline Normal (float n_x, float n_y, float n_z)
792  {
793  normal_x = n_x; normal_y = n_y; normal_z = n_z;
794  curvature = 0;
795  data_n[3] = 0.0f;
796  }
797 
798  friend std::ostream& operator << (std::ostream& os, const Normal& p);
799  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
800  };
801 
802 
803  struct EIGEN_ALIGN16 _Axis
804  {
806  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
807  };
808 
809  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Axis& p);
810  /** \brief A point structure representing an Axis using its normal coordinates. (SSE friendly)
811  * \ingroup common
812  */
813  struct EIGEN_ALIGN16 Axis : public _Axis
814  {
815  inline Axis (const _Axis &p)
816  {
817  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
818  data_n[3] = 0.0f;
819  }
820 
821  inline Axis ()
822  {
823  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
824  }
825 
826  inline Axis (float n_x, float n_y, float n_z)
827  {
828  normal_x = n_x; normal_y = n_y; normal_z = n_z;
829  data_n[3] = 0.0f;
830  }
831 
832  friend std::ostream& operator << (std::ostream& os, const Axis& p);
833  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
834  };
835 
836 
837  struct EIGEN_ALIGN16 _PointNormal
838  {
839  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
840  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
841  union
842  {
843  struct
844  {
845  float curvature;
846  };
847  float data_c[4];
848  };
849  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
850  };
851 
852  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointNormal& p);
853  /** \brief A point structure representing Euclidean xyz coordinates, together with normal coordinates and the surface curvature estimate. (SSE friendly)
854  * \ingroup common
855  */
856  struct PointNormal : public _PointNormal
857  {
858  inline PointNormal (const _PointNormal &p)
859  {
860  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
861  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
862  curvature = p.curvature;
863  }
864 
865  inline PointNormal ()
866  {
867  x = y = z = 0.0f;
868  data[3] = 1.0f;
869  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
870  }
871 
872  friend std::ostream& operator << (std::ostream& os, const PointNormal& p);
873  };
874 
875 
876  struct EIGEN_ALIGN16 _PointXYZRGBNormal
877  {
878  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
879  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
880  union
881  {
882  struct
883  {
885  float curvature;
886  };
887  float data_c[4];
888  };
890  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
891  };
892 
893  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
894  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate.
895  * Due to historical reasons (PCL was first developed as a ROS package), the
896  * RGB information is packed into an integer and casted to a float. This is
897  * something we wish to remove in the near future, but in the meantime, the
898  * following code snippet should help you pack and unpack RGB colors in your
899  * PointXYZRGB structure:
900  *
901  * \code
902  * // pack r/g/b into rgb
903  * uint8_t r = 255, g = 0, b = 0; // Example: Red color
904  * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
905  * p.rgb = *reinterpret_cast<float*>(&rgb);
906  * \endcode
907  *
908  * To unpack the data into separate values, use:
909  *
910  * \code
911  * PointXYZRGB p;
912  * // unpack rgb into r/g/b
913  * uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
914  * uint8_t r = (rgb >> 16) & 0x0000ff;
915  * uint8_t g = (rgb >> 8) & 0x0000ff;
916  * uint8_t b = (rgb) & 0x0000ff;
917  * \endcode
918  *
919  *
920  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
921  * \ingroup common
922  */
924  {
926  {
927  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
928  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
929  curvature = p.curvature;
930  rgba = p.rgba;
931  }
932 
934  {
935  x = y = z = 0.0f;
936  data[3] = 1.0f;
937  r = g = b = a = 0;
938  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
939  curvature = 0;
940  }
941 
942  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
943  };
944 
945  struct EIGEN_ALIGN16 _PointXYZINormal
946  {
947  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
948  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
949  union
950  {
951  struct
952  {
953  float intensity;
954  float curvature;
955  };
956  float data_c[4];
957  };
958  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
959  };
960 
961  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
962  /** \brief A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates and the surface curvature estimate.
963  * \ingroup common
964  */
966  {
968  {
969  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
970  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
971  curvature = p.curvature;
972  intensity = p.intensity;
973  }
974 
975  inline PointXYZINormal ()
976  {
977  x = y = z = 0.0f;
978  data[3] = 1.0f;
979  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
980  intensity = 0.0f;
981  curvature = 0;
982  }
983 
984  friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
985  };
986 
987 //----
988  struct EIGEN_ALIGN16 _PointXYZLNormal
989  {
990  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
991  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
992  union
993  {
994  struct
995  {
996  uint32_t label;
997  float curvature;
998  };
999  float data_c[4];
1000  };
1001  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1002  };
1003 
1004  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1005  /** \brief A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates and the surface curvature estimate.
1006  * \ingroup common
1007  */
1009  {
1011  {
1012  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1013  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
1014  curvature = p.curvature;
1015  label = p.label;
1016  }
1017 
1019  {
1020  x = y = z = 0.0f;
1021  data[3] = 1.0f;
1022  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
1023  label = 0;
1024  curvature = 0;
1025  }
1026 
1027  friend std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1028  };
1029 
1030 // ---
1031 
1032 
1033  struct EIGEN_ALIGN16 _PointWithRange
1034  {
1035  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1036  union
1037  {
1038  struct
1039  {
1040  float range;
1041  };
1042  float data_c[4];
1043  };
1044  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1045  };
1046 
1047  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1048  /** \brief A point structure representing Euclidean xyz coordinates, padded with an extra range float.
1049  * \ingroup common
1050  */
1052  {
1054  {
1055  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1056  range = p.range;
1057  }
1058 
1059  inline PointWithRange ()
1060  {
1061  x = y = z = 0.0f;
1062  data[3] = 1.0f;
1063  range = 0.0f;
1064  }
1065 
1066  friend std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1067  };
1068 
1069 
1070  struct EIGEN_ALIGN16 _PointWithViewpoint
1071  {
1072  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1073  union
1074  {
1075  struct
1076  {
1077  float vp_x;
1078  float vp_y;
1079  float vp_z;
1080  };
1081  float data_c[4];
1082  };
1083  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1084  };
1085 
1086  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1087  /** \brief A point structure representing Euclidean xyz coordinates together with the viewpoint from which it was seen.
1088  * \ingroup common
1089  */
1090  struct EIGEN_ALIGN16 PointWithViewpoint : public _PointWithViewpoint
1091  {
1093  {
1094  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1095  vp_x = p.vp_x; vp_y = p.vp_y; vp_z = p.vp_z;
1096  }
1097 
1098  inline PointWithViewpoint (float _x = 0.0f, float _y = 0.0f, float _z = 0.0f,
1099  float _vp_x = 0.0f, float _vp_y = 0.0f, float _vp_z = 0.0f)
1100  {
1101  x = _x; y = _y; z = _z;
1102  data[3] = 1.0f;
1103  vp_x = _vp_x; vp_y = _vp_y; vp_z = _vp_z;
1104  }
1105 
1106  friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1107  };
1108 
1109  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1110  /** \brief A point structure representing the three moment invariants.
1111  * \ingroup common
1112  */
1114  {
1115  float j1, j2, j3;
1116 
1117  friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1118  };
1119 
1120  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1121  /** \brief A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
1122  * \ingroup common
1123  */
1125  {
1126  float r_min, r_max;
1127 
1128  friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1129  };
1130 
1131  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Boundary& p);
1132  /** \brief A point structure representing a description of whether a point is lying on a surface boundary or not.
1133  * \ingroup common
1134  */
1135  struct Boundary
1136  {
1138 
1139 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
1140  operator unsigned char() const
1141  {
1142  return boundary_point;
1143  }
1144 #endif
1145 
1146  friend std::ostream& operator << (std::ostream& os, const Boundary& p);
1147  };
1148 
1149  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1150  /** \brief A point structure representing the principal curvatures and their magnitudes.
1151  * \ingroup common
1152  */
1154  {
1155  union
1156  {
1157  float principal_curvature[3];
1158  struct
1159  {
1163  };
1164  };
1165  float pc1;
1166  float pc2;
1167 
1168  friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1169  };
1170 
1171  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1172  /** \brief A point structure representing the Point Feature Histogram (PFH).
1173  * \ingroup common
1174  */
1176  {
1177  float histogram[125];
1178  static int descriptorSize () { return 125; }
1179 
1180  friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1181  };
1182 
1183  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1184  /** \brief A point structure representing the Point Feature Histogram with colors (PFHRGB).
1185  * \ingroup common
1186  */
1188  {
1189  float histogram[250];
1190  static int descriptorSize () { return 250; }
1191 
1192  friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1193  };
1194 
1195  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1196  /** \brief A point structure for storing the Point Pair Feature (PPF) values
1197  * \ingroup common
1198  */
1200  {
1201  float f1, f2, f3, f4;
1202  float alpha_m;
1203 
1204  friend std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1205  };
1206 
1207  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1208  /** \brief A point structure for storing the Point Pair Feature (CPPF) values
1209  * \ingroup common
1210  */
1212  {
1213  float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1214  float alpha_m;
1215 
1216  friend std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1217  };
1218 
1219  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1220  /** \brief A point structure for storing the Point Pair Color Feature (PPFRGB) values
1221  * \ingroup common
1222  */
1224  {
1225  float f1, f2, f3, f4;
1226  float r_ratio, g_ratio, b_ratio;
1227  float alpha_m;
1228 
1229  friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1230  };
1231 
1232  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1233  /** \brief A point structure representing the Normal Based Signature for
1234  * a feature matrix of 4-by-3
1235  * \ingroup common
1236  */
1238  {
1239  float values[12];
1240 
1241  friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1242  };
1243 
1244  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1245  /** \brief A point structure representing a Shape Context.
1246  * \ingroup common
1247  */
1249  {
1250  float descriptor[1980];
1251  float rf[9];
1252  static int descriptorSize () { return 1980; }
1253 
1254  friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1255  };
1256 
1257  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1258  /** \brief A point structure representing a Unique Shape Context.
1259  * \ingroup common
1260  */
1262  {
1263  float descriptor[1960];
1264  float rf[9];
1265  static int descriptorSize () { return 1960; }
1266 
1267  friend std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1268  };
1269 
1270  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT352& p);
1271  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape only.
1272  * \ingroup common
1273  */
1274  struct SHOT352
1275  {
1276  float descriptor[352];
1277  float rf[9];
1278  static int descriptorSize () { return 352; }
1279 
1280  friend std::ostream& operator << (std::ostream& os, const SHOT352& p);
1281  };
1282 
1283 
1284  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1285  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+color.
1286  * \ingroup common
1287  */
1288  struct SHOT1344
1289  {
1290  float descriptor[1344];
1291  float rf[9];
1292  static int descriptorSize () { return 1344; }
1293 
1294  friend std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1295  };
1296 
1297 
1298  /** \brief A structure representing the Local Reference Frame of a point.
1299  * \ingroup common
1300  */
1301  struct EIGEN_ALIGN16 _ReferenceFrame
1302  {
1303  union
1304  {
1305  float rf[9];
1306  struct
1307  {
1308  float x_axis[3];
1309  float y_axis[3];
1310  float z_axis[3];
1311  };
1312  };
1313 
1314  inline Eigen::Map<Eigen::Vector3f> getXAxisVector3fMap () { return (Eigen::Vector3f::Map (x_axis)); }
1315  inline const Eigen::Map<const Eigen::Vector3f> getXAxisVector3fMap () const { return (Eigen::Vector3f::Map (x_axis)); }
1316  inline Eigen::Map<Eigen::Vector3f> getYAxisVector3fMap () { return (Eigen::Vector3f::Map (y_axis)); }
1317  inline const Eigen::Map<const Eigen::Vector3f> getYAxisVector3fMap () const { return (Eigen::Vector3f::Map (y_axis)); }
1318  inline Eigen::Map<Eigen::Vector3f> getZAxisVector3fMap () { return (Eigen::Vector3f::Map (z_axis)); }
1319  inline const Eigen::Map<const Eigen::Vector3f> getZAxisVector3fMap () const { return (Eigen::Vector3f::Map (z_axis)); }
1320  inline Eigen::Map<Eigen::Matrix3f> getMatrix3fMap () { return (Eigen::Matrix3f::Map (rf)); }
1321  inline const Eigen::Map<const Eigen::Matrix3f> getMatrix3fMap () const { return (Eigen::Matrix3f::Map (rf)); }
1322 
1323  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1324  };
1325 
1326  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1327  struct EIGEN_ALIGN16 ReferenceFrame : public _ReferenceFrame
1328  {
1330  {
1331  for (int d = 0; d < 9; ++d)
1332  rf[d] = p.rf[d];
1333  }
1334 
1335  inline ReferenceFrame ()
1336  {
1337  for (int d = 0; d < 3; ++d)
1338  x_axis[d] = y_axis[d] = z_axis[d] = 0;
1339  }
1340 
1341  friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1342  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1343  };
1344 
1345 
1346  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1347  /** \brief A point structure representing the Fast Point Feature Histogram (FPFH).
1348  * \ingroup common
1349  */
1351  {
1352  float histogram[33];
1353  static int descriptorSize () { return 33; }
1354 
1355  friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1356  };
1357 
1358  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1359  /** \brief A point structure representing the Viewpoint Feature Histogram (VFH).
1360  * \ingroup common
1361  */
1363  {
1364  float histogram[308];
1365  static int descriptorSize () { return 308; }
1366 
1367  friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1368  };
1369 
1370  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1371  /** \brief A point structure representing the Global Radius-based Surface Descriptor (GRSD).
1372  * \ingroup common
1373  */
1375  {
1376  float histogram[21];
1377  static int descriptorSize () { return 21; }
1378 
1379  friend std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1380  };
1381 
1382  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1383  /** \brief A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
1384  * \ingroup common
1385  */
1387  {
1388  float scale;
1390  unsigned char descriptor[64];
1391  static int descriptorSize () { return 64; }
1392 
1393  friend std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1394  };
1395 
1396  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1397  /** \brief A point structure representing the Ensemble of Shape Functions (ESF).
1398  * \ingroup common
1399  */
1401  {
1402  float histogram[640];
1403  static int descriptorSize () { return 640; }
1404 
1405  friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1406  };
1407 
1408  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1409  /** \brief A point structure representing the GFPFH descriptor with 16 bins.
1410  * \ingroup common
1411  */
1413  {
1414  float histogram[16];
1415  static int descriptorSize () { return 16; }
1416 
1417  friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1418  };
1419 
1420  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Narf36& p);
1421  /** \brief A point structure representing the Narf descriptor.
1422  * \ingroup common
1423  */
1424  struct Narf36
1425  {
1426  float x, y, z, roll, pitch, yaw;
1427  float descriptor[36];
1428  static int descriptorSize () { return 36; }
1429 
1430  friend std::ostream& operator << (std::ostream& os, const Narf36& p);
1431  };
1432 
1433  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1434  /** \brief A structure to store if a point in a range image lies on a border between an obstacle and the background.
1435  * \ingroup common
1436  */
1438  {
1439  int x, y;
1441  //std::vector<const BorderDescription*> neighbors;
1442 
1443  friend std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1444  };
1445 
1446 
1447  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1448  /** \brief A point structure representing the intensity gradient of an XYZI point cloud.
1449  * \ingroup common
1450  */
1452  {
1453  union
1454  {
1455  float gradient[3];
1456  struct
1457  {
1458  float gradient_x;
1459  float gradient_y;
1460  float gradient_z;
1461  };
1462  };
1463 
1464  friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1465  };
1466 
1467  /** \brief A point structure representing an N-D histogram.
1468  * \ingroup common
1469  */
1470  template <int N>
1471  struct Histogram
1472  {
1473  float histogram[N];
1474  static int descriptorSize () { return N; }
1475  };
1476 
1477  struct EIGEN_ALIGN16 _PointWithScale
1478  {
1479  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1480 
1481  union
1482  {
1483  /** \brief Diameter of the meaningfull keypoint neighborhood. */
1484  float scale;
1485  float size;
1486  };
1487 
1488  /** \brief Computed orientation of the keypoint (-1 if not applicable). */
1489  float angle;
1490  /** \brief The response by which the most strong keypoints have been selected. */
1491  float response;
1492  /** \brief octave (pyramid layer) from which the keypoint has been extracted. */
1493  int octave;
1494 
1495  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1496  };
1497 
1498  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1499  /** \brief A point structure representing a 3-D position and scale.
1500  * \ingroup common
1501  */
1503  {
1505  {
1506  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1507  scale = p.scale;
1508  angle = p.angle;
1509  response = p.response;
1510  octave = p.octave;
1511  }
1512 
1513  inline PointWithScale ()
1514  {
1515  x = y = z = 0.0f;
1516  scale = 1.0f;
1517  angle = -1.0f;
1518  response = 0.0f;
1519  octave = 0;
1520  data[3] = 1.0f;
1521  }
1522 
1523  inline PointWithScale (float _x, float _y, float _z, float _scale)
1524  {
1525  x = _x;
1526  y = _y;
1527  z = _z;
1528  scale = _scale;
1529  angle = -1.0f;
1530  response = 0.0f;
1531  octave = 0;
1532  data[3] = 1.0f;
1533  }
1534 
1535  inline PointWithScale (float _x, float _y, float _z, float _scale, float _angle, float _response, int _octave)
1536  {
1537  x = _x;
1538  y = _y;
1539  z = _z;
1540  scale = _scale;
1541  angle = _angle;
1542  response = _response;
1543  octave = _octave;
1544  data[3] = 1.0f;
1545  }
1546 
1547  friend std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1548  };
1549 
1550 
1551  struct EIGEN_ALIGN16 _PointSurfel
1552  {
1553  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1554  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1555  union
1556  {
1557  struct
1558  {
1560  float radius;
1561  float confidence;
1562  float curvature;
1563  };
1564  float data_c[4];
1565  };
1567  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1568  };
1569 
1570  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1571  /** \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.
1572  * \ingroup common
1573  */
1574  struct PointSurfel : public _PointSurfel
1575  {
1576  inline PointSurfel (const _PointSurfel &p)
1577  {
1578  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1579  rgba = p.rgba;
1580  radius = p.radius;
1581  confidence = p.confidence;
1582  curvature = p.curvature;
1583  }
1584 
1585  inline PointSurfel ()
1586  {
1587  x = y = z = 0.0f;
1588  data[3] = 1.0f;
1589  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
1590  rgba = 0;
1591  radius = confidence = curvature = 0.0f;
1592  }
1593 
1594  friend std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1595  };
1596 
1597  struct EIGEN_ALIGN16 _PointDEM
1598  {
1600  float intensity;
1603  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1604  };
1605 
1606  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointDEM& p);
1607  /** \brief A point structure representing Digital Elevation Map.
1608  * \ingroup common
1609  */
1610  struct PointDEM : public _PointDEM
1611  {
1612  inline PointDEM (const _PointDEM &p)
1613  {
1614  x = p.x; y = p.y; x = p.z; data[3] = 1.0f;
1615  intensity = p.intensity;
1616  intensity_variance = p.intensity_variance;
1617  height_variance = p.height_variance;
1618  }
1619 
1620  inline PointDEM ()
1621  {
1622  x = y = z = 0.0f; data[3] = 1.0f;
1623  intensity = 0.0f;
1624  intensity_variance = height_variance = 0.0f;
1625  }
1626 
1627  friend std::ostream& operator << (std::ostream& os, const PointDEM& p);
1628  };
1629 
1630  template <int N> std::ostream&
1631  operator << (std::ostream& os, const Histogram<N>& p)
1632  {
1633  for (int i = 0; i < N; ++i)
1634  os << (i == 0 ? "(" : "") << p.histogram[i] << (i < N-1 ? ", " : ")");
1635  return (os);
1636  }
1637 } // End namespace
1638 
1639 // Preserve API for PCL users < 1.4
1640 #include <pcl/common/point_tests.h>
1641 
1642 #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.
A point structure representing a Shape Context.
Eigen::Map< Eigen::Vector3f > getXAxisVector3fMap()
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...
A point structure representing Euclidean xyz coordinates, padded with an extra range float...
float intensity_variance
PointDEM(const _PointDEM &p)
struct pcl::PointXYZIEdge EIGEN_ALIGN16
static int descriptorSize()
const Eigen::Map< const Eigen::Vector3f > getXAxisVector3fMap() const
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
float angle
Computed orientation of the keypoint (-1 if not applicable).
Eigen::Map< Eigen::Vector3f > Vector3fMap
PointXYZRGBNormal(const _PointXYZRGBNormal &p)
static int descriptorSize()
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.
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.
const Eigen::Map< const Eigen::Vector4f, Eigen::Aligned > Vector4fMapConst
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
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::Matrix3f > getMatrix3fMap() 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.
static int descriptorSize()
PointXYZRGBL(const _PointXYZRGBL &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...
const Eigen::Map< const Eigen::Vector3f > getYAxisVector3fMap() const
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)
Eigen::Map< Eigen::Vector3f > getYAxisVector3fMap()
PointXYZI(const _PointXYZI &p)
A point structure representing the grayscale intensity in single-channel images.
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)
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...
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...
A point structure representing the intensity gradient of an XYZI point cloud.
const Eigen::Map< const Eigen::Vector3f > getZAxisVector3fMap() const
Eigen::Map< Eigen::Array3f > Array3fMap
const Eigen::Map< const Vector3c > Vector3cMapConst
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()
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.
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)
PointWithScale(const _PointWithScale &p)
A point structure representing the Point Feature Histogram (PFH).
PointWithViewpoint(const _PointWithViewpoint &p)
A point structure representing the Ensemble of Shape Functions (ESF).
static int descriptorSize()
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). ...
Eigen::Matrix< uint8_t, 3, 1 > Vector3c
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)
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)
Eigen::Map< Eigen::Matrix3f > getMatrix3fMap()
A point structure for storing the Point Pair Color Feature (PPFRGB) values.