Point Cloud Library (PCL)  1.9.1-dev
point_types.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id$
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/pcl_macros.h>
43 #include <bitset>
44 #include <pcl/register_point_struct.h>
45 #include <boost/mpl/contains.hpp>
46 #include <boost/mpl/fold.hpp>
47 #include <boost/mpl/vector.hpp>
48 
49 /**
50  * \file pcl/point_types.h
51  * Defines all the PCL implemented PointT point type structures
52  * \ingroup common
53  */
54 
55 // We're doing a lot of black magic with Boost here, so disable warnings in Maintainer mode, as we will never
56 // be able to fix them anyway
57 #if defined _MSC_VER
58  #pragma warning(disable: 4201)
59 #endif
60 //#pragma warning(push, 1)
61 #if defined __GNUC__
62 # pragma GCC system_header
63 #endif
64 
65 /** @{*/
66 namespace pcl
67 {
68  /** \brief Members: float x, y, z
69  * \ingroup common
70  */
71  struct PointXYZ;
72 
73  /** \brief Members: rgba
74  * \ingroup common
75  */
76  struct RGB;
77 
78  /** \brief Members: intensity (float)
79  * \ingroup common
80  */
81  struct Intensity;
82 
83  /** \brief Members: intensity (std::uint8_t)
84  * \ingroup common
85  */
86  struct Intensity8u;
87 
88  /** \brief Members: intensity (std::uint32_t)
89  * \ingroup common
90  */
91  struct Intensity32u;
92 
93  /** \brief Members: float x, y, z, intensity
94  * \ingroup common
95  */
96  struct PointXYZI;
97 
98  /** \brief Members: float x, y, z, uin32_t label
99  * \ingroup common
100  */
101  struct PointXYZL;
102 
103  /** \brief Members: std::uint32_t label
104  * \ingroup common
105  */
106  struct Label;
107 
108  /** \brief Members: float x, y, z; std::uint32_t rgba
109  * \ingroup common
110  */
111  struct PointXYZRGBA;
112 
113  /** \brief Members: float x, y, z, rgb
114  * \ingroup common
115  */
116  struct PointXYZRGB;
117 
118  /** \brief Members: float x, y, z, rgb, std::uint32_t label
119  * \ingroup common
120  */
121  struct PointXYZRGBL;
122 
123  /** \brief Members: float x, y, z, h, s, v
124  * \ingroup common
125  */
126  struct PointXYZHSV;
127 
128  /** \brief Members: float x, y
129  * \ingroup common
130  */
131  struct PointXY;
132 
133  /** \brief Members: float u, v
134  * \ingroup common
135  */
136  struct PointUV;
137 
138  /** \brief Members: float x, y, z, strength
139  * \ingroup common
140  */
141  struct InterestPoint;
142 
143  /** \brief Members: float normal[3], curvature
144  * \ingroup common
145  */
146  struct Normal;
147 
148  /** \brief Members: float normal[3]
149  * \ingroup common
150  */
151  struct Axis;
152 
153  /** \brief Members: float x, y, z; float normal[3], curvature
154  * \ingroup common
155  */
156  struct PointNormal;
157 
158  /** \brief Members: float x, y, z, rgb, normal[3], curvature
159  * \ingroup common
160  */
161  struct PointXYZRGBNormal;
162 
163  /** \brief Members: float x, y, z, intensity, normal[3], curvature
164  * \ingroup common
165  */
166  struct PointXYZINormal;
167 
168  /** \brief Members: float x, y, z, label, normal[3], curvature
169  * \ingroup common
170  */
171  struct PointXYZLNormal;
172 
173  /** \brief Members: float x, y, z (union with float point[4]), range
174  * \ingroup common
175  */
176  struct PointWithRange;
177 
178  /** \brief Members: float x, y, z, vp_x, vp_y, vp_z
179  * \ingroup common
180  */
181  struct PointWithViewpoint;
182 
183  /** \brief Members: float j1, j2, j3
184  * \ingroup common
185  */
186  struct MomentInvariants;
187 
188  /** \brief Members: float r_min, r_max
189  * \ingroup common
190  */
191  struct PrincipalRadiiRSD;
192 
193  /** \brief Members: std::uint8_t boundary_point
194  * \ingroup common
195  */
196  struct Boundary;
197 
198  /** \brief Members: float principal_curvature[3], pc1, pc2
199  * \ingroup common
200  */
201  struct PrincipalCurvatures;
202 
203  /** \brief Members: float descriptor[352], rf[9]
204  * \ingroup common
205  */
206  struct SHOT352;
207 
208  /** \brief Members: float descriptor[1344], rf[9]
209  * \ingroup common
210  */
211  struct SHOT1344;
212 
213  /** \brief Members: Axis x_axis, y_axis, z_axis
214  * \ingroup common
215  */
216  struct ReferenceFrame;
217 
218  /** \brief Members: float descriptor[1980], rf[9]
219  * \ingroup common
220  */
221  struct ShapeContext1980;
222 
223  /** \brief Members: float descriptor[1960], rf[9]
224  * \ingroup common
225  */
226  struct UniqueShapeContext1960;
227 
228  /** \brief Members: float pfh[125]
229  * \ingroup common
230  */
231  struct PFHSignature125;
232 
233  /** \brief Members: float pfhrgb[250]
234  * \ingroup common
235  */
236  struct PFHRGBSignature250;
237 
238  /** \brief Members: float f1, f2, f3, f4, alpha_m
239  * \ingroup common
240  */
241  struct PPFSignature;
242 
243  /** \brief Members: float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, alpha_m
244  * \ingroup common
245  */
246  struct CPPFSignature;
247 
248  /** \brief Members: float f1, f2, f3, f4, r_ratio, g_ratio, b_ratio, alpha_m
249  * \ingroup common
250  */
251  struct PPFRGBSignature;
252 
253  /** \brief Members: float values[12]
254  * \ingroup common
255  */
256  struct NormalBasedSignature12;
257 
258  /** \brief Members: float fpfh[33]
259  * \ingroup common
260  */
261  struct FPFHSignature33;
262 
263  /** \brief Members: float vfh[308]
264  * \ingroup common
265  */
266  struct VFHSignature308;
267 
268  /** \brief Members: float grsd[21]
269  * \ingroup common
270  */
271  struct GRSDSignature21;
272 
273  /** \brief Members: float esf[640]
274  * \ingroup common
275  */
276  struct ESFSignature640;
277 
278  /** \brief Members: float gasd[512]
279  * \ingroup common
280  */
281  struct GASDSignature512;
282 
283  /** \brief Members: float gasd[984]
284  * \ingroup common
285  */
286  struct GASDSignature984;
287 
288  /** \brief Members: float gasd[7992]
289  * \ingroup common
290  */
291  struct GASDSignature7992;
292 
293  /** \brief Members: float histogram[16]
294  * \ingroup common
295  */
296  struct GFPFHSignature16;
297 
298  /** \brief Members: float scale; float orientation; std::uint8_t descriptor[64]
299  * \ingroup common
300  */
301  struct BRISKSignature512;
302 
303  /** \brief Members: float x, y, z, roll, pitch, yaw; float descriptor[36]
304  * \ingroup common
305  */
306  struct Narf36;
307 
308  /** \brief Data type to store extended information about a transition from foreground to backgroundSpecification of the fields for BorderDescription::traits.
309  * \ingroup common
310  */
311  using BorderTraits = std::bitset<32>;
312 
313  /** \brief Specification of the fields for BorderDescription::traits.
314  * \ingroup common
315  */
317  {
323  };
324 
325  /** \brief Members: int x, y; BorderTraits traits
326  * \ingroup common
327  */
328  struct BorderDescription;
329 
330  /** \brief Members: float gradient[3]
331  * \ingroup common
332  */
333  struct IntensityGradient;
334 
335  /** \brief Members: float histogram[N]
336  * \ingroup common
337  */
338  template<int N>
339  struct Histogram;
340 
341  /** \brief Members: float x, y, z, scale, angle, response, octave
342  * \ingroup common
343  */
344  struct PointWithScale;
345 
346  /** \brief Members: float x, y, z, normal[3], rgba, radius, confidence, curvature
347  * \ingroup common
348  */
349  struct PointSurfel;
350 
351  /** \brief Members: float x, y, z, intensity, intensity_variance, height_variance
352  * \ingroup common
353  */
354  struct PointDEM;
355 }
356 
357 /** @} */
358 
359 #include <pcl/impl/point_types.hpp> // Include struct definitions
360 
361 // ==============================
362 // =====POINT_CLOUD_REGISTER=====
363 // ==============================
364 
366  (std::uint32_t, rgba, rgba)
367 )
368 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::RGB, pcl::_RGB)
369 
371  (float, intensity, intensity)
372 )
373 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity, pcl::_Intensity)
374 
376  (std::uint8_t, intensity, intensity)
377 )
378 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity8u, pcl::_Intensity8u)
379 
381  (std::uint32_t, intensity, intensity)
382 )
383 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity32u, pcl::_Intensity32u)
384 
386  (float, x, x)
387  (float, y, y)
388  (float, z, z)
389 )
390 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZ, pcl::_PointXYZ)
391 
393  (float, x, x)
394  (float, y, y)
395  (float, z, z)
396  (std::uint32_t, rgba, rgba)
397 )
398 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBA, pcl::_PointXYZRGBA)
399 
401  (float, x, x)
402  (float, y, y)
403  (float, z, z)
404  (float, rgb, rgb)
405 )
406 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGB, pcl::_PointXYZRGB)
407 
409  (float, x, x)
410  (float, y, y)
411  (float, z, z)
412  (std::uint32_t, rgba, rgba)
413  (std::uint32_t, label, label)
414 )
415 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBL, pcl::_PointXYZRGBL)
416 
418  (float, x, x)
419  (float, y, y)
420  (float, z, z)
421  (float, h, h)
422  (float, s, s)
423  (float, v, v)
424 )
425 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZHSV, pcl::_PointXYZHSV)
426 
428  (float, x, x)
429  (float, y, y)
430 )
431 
433  (float, u, u)
434  (float, v, v)
435 )
436 
438  (float, x, x)
439  (float, y, y)
440  (float, z, z)
441  (float, strength, strength)
442 )
443 
445  (float, x, x)
446  (float, y, y)
447  (float, z, z)
448  (float, intensity, intensity)
449 )
450 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZI, pcl::_PointXYZI)
451 
453  (float, x, x)
454  (float, y, y)
455  (float, z, z)
456  (std::uint32_t, label, label)
457 )
458 
460  (std::uint32_t, label, label)
461 )
462 
464  (float, normal_x, normal_x)
465  (float, normal_y, normal_y)
466  (float, normal_z, normal_z)
467  (float, curvature, curvature)
468 )
469 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Normal, pcl::_Normal)
470 
472  (float, normal_x, normal_x)
473  (float, normal_y, normal_y)
474  (float, normal_z, normal_z)
475 )
476 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Axis, pcl::_Axis)
477 
479  (float, x, x)
480  (float, y, y)
481  (float, z, z)
482  (float, normal_x, normal_x)
483  (float, normal_y, normal_y)
484  (float, normal_z, normal_z)
485  (float, curvature, curvature)
486 )
488  (float, x, x)
489  (float, y, y)
490  (float, z, z)
491  (float, rgb, rgb)
492  (float, normal_x, normal_x)
493  (float, normal_y, normal_y)
494  (float, normal_z, normal_z)
495  (float, curvature, curvature)
496 )
497 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBNormal, pcl::_PointXYZRGBNormal)
499  (float, x, x)
500  (float, y, y)
501  (float, z, z)
502  (float, intensity, intensity)
503  (float, normal_x, normal_x)
504  (float, normal_y, normal_y)
505  (float, normal_z, normal_z)
506  (float, curvature, curvature)
507 )
509  (float, x, x)
510  (float, y, y)
511  (float, z, z)
512  (std::uint32_t, label, label)
513  (float, normal_x, normal_x)
514  (float, normal_y, normal_y)
515  (float, normal_z, normal_z)
516  (float, curvature, curvature)
517 )
519  (float, x, x)
520  (float, y, y)
521  (float, z, z)
522  (float, range, range)
523 )
524 
526  (float, x, x)
527  (float, y, y)
528  (float, z, z)
529  (float, vp_x, vp_x)
530  (float, vp_y, vp_y)
531  (float, vp_z, vp_z)
532 )
533 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointWithViewpoint, pcl::_PointWithViewpoint)
534 
536  (float, j1, j1)
537  (float, j2, j2)
538  (float, j3, j3)
539 )
540 
542  (float, r_min, r_min)
543  (float, r_max, r_max)
544 )
545 
547  (std::uint8_t, boundary_point, boundary_point)
548 )
549 
551  (float, principal_curvature_x, principal_curvature_x)
552  (float, principal_curvature_y, principal_curvature_y)
553  (float, principal_curvature_z, principal_curvature_z)
554  (float, pc1, pc1)
555  (float, pc2, pc2)
556 )
557 
559  (float[125], histogram, pfh)
560 )
561 
563  (float[250], histogram, pfhrgb)
564 )
565 
567  (float, f1, f1)
568  (float, f2, f2)
569  (float, f3, f3)
570  (float, f4, f4)
571  (float, alpha_m, alpha_m)
572 )
573 
575  (float, f1, f1)
576  (float, f2, f2)
577  (float, f3, f3)
578  (float, f4, f4)
579  (float, f5, f5)
580  (float, f6, f6)
581  (float, f7, f7)
582  (float, f8, f8)
583  (float, f9, f9)
584  (float, f10, f10)
585  (float, alpha_m, alpha_m)
586 )
587 
589  (float, f1, f1)
590  (float, f2, f2)
591  (float, f3, f3)
592  (float, f4, f4)
593  (float, r_ratio, r_ratio)
594  (float, g_ratio, g_ratio)
595  (float, b_ratio, b_ratio)
596  (float, alpha_m, alpha_m)
597 )
598 
600  (float[12], values, values)
601 )
602 
604  (float[1980], descriptor, shape_context)
605  (float[9], rf, rf)
606 )
607 
609  (float[1960], descriptor, shape_context)
610  (float[9], rf, rf)
611 )
612 
614  (float[352], descriptor, shot)
615  (float[9], rf, rf)
616 )
617 
619  (float[1344], descriptor, shot)
620  (float[9], rf, rf)
621 )
622 
624  (float[33], histogram, fpfh)
625 )
626 
628  (float, scale, brisk_scale)
629  (float, orientation, brisk_orientation)
630  (unsigned char[64], descriptor, brisk_descriptor512)
631 )
632 
634  (float[308], histogram, vfh)
635 )
636 
638  (float[21], histogram, grsd)
639 )
640 
642  (float[640], histogram, esf)
643 )
644 
646  (float[512], histogram, gasd)
647 )
648 
650  (float[984], histogram, gasd)
651 )
652 
654  (float[7992], histogram, gasd)
655 )
656 
658  (float[36], descriptor, descriptor)
659 )
660 
662  (float[16], histogram, gfpfh)
663 )
664 
666  (float, gradient_x, gradient_x)
667  (float, gradient_y, gradient_y)
668  (float, gradient_z, gradient_z)
669 )
670 
672  (float, x, x)
673  (float, y, y)
674  (float, z, z)
675  (float, scale, scale)
676 )
677 
679  (float, x, x)
680  (float, y, y)
681  (float, z, z)
682  (float, normal_x, normal_x)
683  (float, normal_y, normal_y)
684  (float, normal_z, normal_z)
685  (std::uint32_t, rgba, rgba)
686  (float, radius, radius)
687  (float, confidence, confidence)
688  (float, curvature, curvature)
689 )
690 
692  (float[3], x_axis, x_axis)
693  (float[3], y_axis, y_axis)
694  (float[3], z_axis, z_axis)
695 )
696 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::ReferenceFrame, pcl::_ReferenceFrame)
697 
699  (float, x, x)
700  (float, y, y)
701  (float, z, z)
702  (float, intensity, intensity)
703  (float, intensity_variance, intensity_variance)
704  (float, height_variance, height_variance)
705 )
706 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointDEM, pcl::_PointDEM)
707 
708 namespace pcl
709 {
710  // Allow float 'rgb' data to match to the newer uint32 'rgba' tag. This is so
711  // you can load old 'rgb' PCD files into e.g. a PointCloud<PointXYZRGBA>.
712  template<typename PointT>
713  struct FieldMatches<PointT, fields::rgba>
714  {
715  bool operator() (const pcl::PCLPointField& field)
716  {
717  if (field.name == "rgb")
718  {
719  // For fixing the alpha value bug #1141, the rgb field can also match
720  // uint32.
721  return ((field.datatype == pcl::PCLPointField::FLOAT32 ||
723  field.count == 1);
724  }
725  else
726  {
730  }
731  }
732  };
733  template<typename PointT>
734  struct FieldMatches<PointT, fields::rgb>
735  {
736  bool operator() (const pcl::PCLPointField& field)
737  {
738  if (field.name == "rgba")
739  {
740  return (field.datatype == pcl::PCLPointField::UINT32 &&
741  field.count == 1);
742  }
743  else
744  {
745  // For fixing the alpha value bug #1141, rgb can also match uint32
750  }
751  }
752  };
753 
754  namespace traits
755  {
756 
757  /** \brief Metafunction to check if a given point type has a given field.
758  *
759  * Example usage at run-time:
760  *
761  * \code
762  * bool curvature_available = pcl::traits::has_field<PointT, pcl::fields::curvature>::value;
763  * \endcode
764  *
765  * Example usage at compile-time:
766  *
767  * \code
768  * BOOST_MPL_ASSERT_MSG ((pcl::traits::has_field<PointT, pcl::fields::label>::value),
769  * POINT_TYPE_SHOULD_HAVE_LABEL_FIELD,
770  * (PointT));
771  * \endcode
772  */
773  template <typename PointT, typename Field>
774  struct has_field : boost::mpl::contains<typename pcl::traits::fieldList<PointT>::type, Field>::type
775  { };
776 
777  /** Metafunction to check if a given point type has all given fields. */
778  template <typename PointT, typename Field>
779  struct has_all_fields : boost::mpl::fold<Field,
780  boost::mpl::bool_<true>,
781  boost::mpl::and_<boost::mpl::_1,
782  has_field<PointT, boost::mpl::_2> > >::type
783  { };
784 
785  /** Metafunction to check if a given point type has any of the given fields. */
786  template <typename PointT, typename Field>
787  struct has_any_field : boost::mpl::fold<Field,
788  boost::mpl::bool_<false>,
789  boost::mpl::or_<boost::mpl::_1,
790  has_field<PointT, boost::mpl::_2> > >::type
791  { };
792 
793  /** \brief Traits defined for ease of use with fields already registered before
794  *
795  * has_<fields to be detected>: struct with `value` datamember defined at compiletime
796  * has_<fields to be detected>_v: constexpr boolean
797  * Has<Fields to be detected>: concept modelling name alias for `enable_if`
798  */
799 
800  /** Metafunction to check if a given point type has x and y fields. */
801  template <typename PointT>
802  struct has_xy : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
803  pcl::fields::y> >
804  { };
805 
806  template <typename PointT>
807  constexpr auto has_xy_v = has_xy<PointT>::value;
808 
809  template <typename PointT>
810  using HasXY = std::enable_if_t<has_xy_v<PointT>, bool>;
811 
812  template <typename PointT>
813  using HasNoXY = std::enable_if_t<!has_xy_v<PointT>, bool>;
814 
815  /** Metafunction to check if a given point type has x, y, and z fields. */
816  template <typename PointT>
817  struct has_xyz : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
818  pcl::fields::y,
819  pcl::fields::z> >
820  { };
821 
822  template <typename PointT>
823  constexpr auto has_xyz_v = has_xyz<PointT>::value;
824 
825  template <typename PointT>
826  using HasXYZ = std::enable_if_t<has_xyz_v<PointT>, bool>;
827 
828  template <typename PointT>
829  using HasNoXYZ = std::enable_if_t<!has_xyz_v<PointT>, bool>;
830 
831  /** Metafunction to check if a given point type has normal_x, normal_y, and
832  * normal_z fields. */
833  template <typename PointT>
834  struct has_normal : has_all_fields<PointT, boost::mpl::vector<pcl::fields::normal_x,
835  pcl::fields::normal_y,
836  pcl::fields::normal_z> >
837  { };
838 
839  template <typename PointT>
840  constexpr auto has_normal_v = has_normal<PointT>::value;
841 
842  template <typename PointT>
843  using HasNormal = std::enable_if_t<has_normal_v<PointT>, bool>;
844 
845  template <typename PointT>
846  using HasNoNormal = std::enable_if_t<!has_normal_v<PointT>, bool>;
847 
848  /** Metafunction to check if a given point type has curvature field. */
849  template <typename PointT>
850  struct has_curvature : has_field<PointT, pcl::fields::curvature>
851  { };
852 
853  template <typename PointT>
854  constexpr auto has_curvature_v = has_curvature<PointT>::value;
855 
856  template <typename PointT>
857  using HasCurvature = std::enable_if_t<has_curvature_v<PointT>, bool>;
858 
859  template <typename PointT>
860  using HasNoCurvature = std::enable_if_t<!has_curvature_v<PointT>, bool>;
861 
862  /** Metafunction to check if a given point type has intensity field. */
863  template <typename PointT>
864  struct has_intensity : has_field<PointT, pcl::fields::intensity>
865  { };
866 
867  template <typename PointT>
868  constexpr auto has_intensity_v = has_intensity<PointT>::value;
869 
870  template <typename PointT>
871  using HasIntensity = std::enable_if_t<has_intensity_v<PointT>, bool>;
872 
873  template <typename PointT>
874  using HasNoIntensity = std::enable_if_t<!has_intensity_v<PointT>, bool>;
875 
876  /** Metafunction to check if a given point type has either rgb or rgba field. */
877  template <typename PointT>
878  struct has_color : has_any_field<PointT, boost::mpl::vector<pcl::fields::rgb,
879  pcl::fields::rgba> >
880  { };
881 
882  template <typename PointT>
883  constexpr auto has_color_v = has_color<PointT>::value;
884 
885  template <typename PointT>
886  using HasColor = std::enable_if_t<has_color_v<PointT>, bool>;
887 
888  template <typename PointT>
889  using HasNoColor = std::enable_if_t<!has_color_v<PointT>, bool>;
890 
891  /** Metafunction to check if a given point type has label field. */
892  template <typename PointT>
893  struct has_label : has_field<PointT, pcl::fields::label>
894  { };
895 
896  template <typename PointT>
897  constexpr auto has_label_v = has_label<PointT>::value;
898 
899  template <typename PointT>
900  using HasLabel = std::enable_if_t<has_label_v<PointT>, bool>;
901 
902  template <typename PointT>
903  using HasNoLabel = std::enable_if_t<!has_label_v<PointT>, bool>;
904  }
905 
906 } // namespace pcl
907 
908 // Not strictly required, merely to preserve API for PCL users < 1.4
909 #include <pcl/common/point_tests.h>
910 
911 #if defined _MSC_VER
912  #pragma warning(default: 4201)
913 #endif
914 //#pragma warning(pop)
A point structure representing normal coordinates and the surface curvature estimate.
A point structure representing the grayscale intensity in single-channel images.
A point structure representing a Shape Context.
std::bitset< 32 > BorderTraits
Data type to store extended information about a transition from foreground to backgroundSpecification...
Definition: point_types.h:311
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...
Histogram< 250 > PFHRGBSignature250
Definition: internal.hpp:74
A point structure representing Euclidean xyz coordinates, padded with an extra range float...
A point structure representing the Normal Based Signature for a feature matrix of 4-by-3...
A point structure representing a Unique Shape Context.
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
BorderTrait
Specification of the fields for BorderDescription::traits.
Definition: point_types.h:316
A structure representing the Local Reference Frame of a point.
Histogram< 33 > FPFHSignature33
Definition: internal.hpp:75
A point structure representing Digital Elevation Map.
A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
A point structure representing an Axis using its normal coordinates.
Histogram< 125 > PFHSignature125
Definition: internal.hpp:73
A point structure representing Euclidean xyz coordinates, and the RGBA color.
A point structure representing the grayscale intensity in single-channel images.
A point structure representing the Fast Point Feature Histogram (FPFH).
A 2D point structure representing Euclidean xy coordinates.
Histogram< 308 > VFHSignature308
Definition: internal.hpp:76
std::uint32_t count
Definition: PCLPointField.h:21
A structure representing RGB color information.
A point structure representing an N-D histogram.
A 2D point structure representing pixel image coordinates.
A point structure representing the GFPFH descriptor with 16 bins.
A point structure representing the Point Feature Histogram with colors (PFHRGB).
A point structure representing Euclidean xyz coordinates, and the intensity value.
std::uint8_t Label
Definition: tree.h:73
POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::_PointXYZLAB,(float, x, x)(float, y, y)(float, z, z)(float, L, L)(float, a, a)(float, b, b)) namespace pcl
Definition: gicp6d.h:78
A point structure representing Euclidean xyz coordinates.
A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates...
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
A point structure representing the three moment invariants.
float4 PointXYZRGB
Definition: internal.hpp:60
A point structure representing the grayscale intensity in single-channel images.
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape onl...
A structure to store if a point in a range image lies on a border between an obstacle and the backgro...
A point structure representing Euclidean xyz coordinates, together with normal coordinates and the su...
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
A point structure for storing the Point Pair Feature (CPPF) values.
A point structure representing Euclidean xyz coordinates together with the viewpoint from which it wa...
A point structure representing the intensity gradient of an XYZI point cloud.
bool operator()(const pcl::PCLPointField &field)
Definition: point_traits.h:195
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+col...
std::string name
Definition: PCLPointField.h:17
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.
std::uint8_t datatype
Definition: PCLPointField.h:20
A point structure representing the principal curvatures and their magnitudes.
A point structure representing the Point Feature Histogram (PFH).
A point structure representing the Ensemble of Shape Functions (ESF).
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor...
A point structure representing the Global Radius-based Surface Descriptor (GRSD). ...
A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coo...
Defines all the PCL and non-PCL macros used.
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.
A point structure for storing the Point Pair Color Feature (PPFRGB) values.