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