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