Point Cloud Library (PCL)
1.10.1
|
38 #ifndef PCL_COMMON_IMPL_DETAIL_ACCUMULATORS_HPP
39 #define PCL_COMMON_IMPL_DETAIL_ACCUMULATORS_HPP
43 #include <boost/mpl/filter_view.hpp>
44 #include <boost/fusion/include/mpl.hpp>
45 #include <boost/fusion/include/for_each.hpp>
46 #include <boost/fusion/include/as_vector.hpp>
47 #include <boost/fusion/include/filter_if.hpp>
74 Eigen::Vector3f
xyz = Eigen::Vector3f::Zero ();
76 template <
typename Po
intT>
void
79 template <
typename Po
intT>
void
80 get (
PointT& t, std::size_t n)
const { t.getVector3fMap () =
xyz / n; }
93 Eigen::Vector4f
normal = Eigen::Vector4f::Zero ();
97 template <
typename Po
intT>
void
100 template <
typename Po
intT>
void
103 #if EIGEN_VERSION_AT_LEAST (3, 3, 0)
104 t.getNormalVector4fMap () =
normal.normalized ();
106 if (
normal.squaredNorm() > 0)
107 t.getNormalVector4fMap () =
normal.normalized ();
109 t.getNormalVector4fMap () = Eigen::Vector4f::Zero ();
126 template <
typename Po
intT>
void
129 template <
typename Po
intT>
void
141 float r = 0,
g = 0,
b = 0,
a = 0;
143 template <
typename Po
intT>
void
146 r +=
static_cast<float> (t.r);
147 g +=
static_cast<float> (t.g);
148 b +=
static_cast<float> (t.b);
149 a +=
static_cast<float> (t.a);
152 template <
typename Po
intT>
void
155 t.rgba =
static_cast<std::uint32_t
> (
a / n) << 24 |
156 static_cast<std::uint32_t
> (
r / n) << 16 |
157 static_cast<std::uint32_t
> (
g / n) << 8 |
158 static_cast<std::uint32_t
> (
b / n);
172 template <
typename Po
intT>
void
175 template <
typename Po
intT>
void
188 std::map<std::uint32_t, std::size_t>
labels;
190 template <
typename Po
intT>
void
193 auto itr =
labels.find (t.label);
195 labels.insert (std::make_pair (t.label, 1));
200 template <
typename Po
intT>
void
204 for (
const auto &label :
labels)
205 if (label.second > max)
208 t.label = label.first;
216 template <
typename Po
int1T,
typename Po
int2T = Po
int1T>
219 template <
typename AccumulatorT>
221 boost::mpl::apply<typename AccumulatorT::IsCompatible, Point1T>,
222 boost::mpl::apply<typename AccumulatorT::IsCompatible, Point2T>
228 template <
typename Po
intT>
232 typename boost::fusion::result_of::as_vector<
233 typename boost::mpl::filter_view<
249 template <
typename Po
intT>
257 template <
typename AccumulatorT>
void
267 template <
typename Po
intT>
276 template <
typename AccumulatorT>
void
279 accumulator.get (
p,
n);
pcl::traits::has_curvature< boost::mpl::_1 > IsCompatible
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
void operator()(AccumulatorT &accumulator) const
void operator()(AccumulatorT &accumulator) const
void add(const PointT &t)
pcl::traits::has_color< boost::mpl::_1 > IsCompatible
typename boost::fusion::result_of::as_vector< typename boost::mpl::filter_view< boost::mpl::vector< AccumulatorXYZ, AccumulatorNormal, AccumulatorCurvature, AccumulatorRGBA, AccumulatorIntensity, AccumulatorLabel >, IsAccumulatorCompatible< PointT > > >::type type
GetPoint(PointT &point, std::size_t num)
void get(PointT &t, std::size_t n) const
AddPoint(const PointT &point)
A point structure representing Euclidean xyz coordinates, and the RGB color.
pcl::traits::has_xyz< boost::mpl::_1 > IsCompatible
void get(PointT &t, std::size_t n) const
pcl::traits::has_intensity< boost::mpl::_1 > IsCompatible
void add(const PointT &t)
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
void add(const PointT &t)
void add(const PointT &t)
void get(PointT &t, std::size_t n) const
void add(const PointT &t)
pcl::traits::has_normal< boost::mpl::_1 > IsCompatible
pcl::traits::has_label< boost::mpl::_1 > IsCompatible
void add(const PointT &t)
std::map< std::uint32_t, std::size_t > labels
void get(PointT &t, std::size_t n) const
void get(PointT &t, std::size_t) const
void get(PointT &t, std::size_t) const