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>
48 #include <pcl/point_types.h>
76 template <
typename Po
intT>
void
79 template <
typename Po
intT>
void
80 get (
PointT& t,
size_t n)
const { t.getVector3fMap () =
xyz / n; }
82 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
99 template <
typename Po
intT>
void
102 template <
typename Po
intT>
void
105 t.getNormalVector4fMap () =
normal;
106 t.getNormalVector4fMap ().normalize ();
109 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
124 template <
typename Po
intT>
void
127 template <
typename Po
intT>
void
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<uint32_t
> (
a / n) << 24 |
156 static_cast<uint32_t> (
r / n) << 16 |
157 static_cast<uint32_t
> (
g / n) << 8 |
158 static_cast<uint32_t> (
b / n);
174 template <
typename Po
intT>
void
177 template <
typename Po
intT>
void
194 template <
typename Po
intT>
void
197 std::map<uint32_t, size_t>::iterator itr =
labels.find (t.label);
199 labels.insert (std::make_pair (t.label, 1));
204 template <
typename Po
intT>
void
208 std::map<uint32_t, size_t>::const_iterator itr;
209 for (itr =
labels.begin (); itr !=
labels.end (); ++itr)
210 if (itr->second > max)
213 t.label = itr->first;
222 template <
typename Po
int1T,
typename Po
int2T = Po
int1T>
227 template <
typename AccumulatorT,
typename Po
intT>
228 struct IsCompatible : boost::mpl::apply<typename AccumulatorT::IsCompatible, PointT> { };
233 typename boost::fusion::result_of::as_vector<
234 typename boost::mpl::filter_view<
255 template <
typename Po
intT>
263 template <
typename AccumulatorT>
void
274 template <
typename Po
intT>
283 template <
typename AccumulatorT>
void
286 accumulator.get (
p,
n);
void add(const PointT &t)
void add(const PointT &t)
pcl::traits::has_xyz< boost::mpl::_1 > IsCompatible
AddPoint(const PointT &point)
boost::fusion::result_of::as_vector< typename boost::mpl::filter_view< boost::mpl::vector< AccumulatorXYZ, AccumulatorNormal, AccumulatorCurvature, AccumulatorRGBA, AccumulatorIntensity, AccumulatorLabel >, boost::mpl::and_< IsCompatible< boost::mpl::_1, Point1T >, IsCompatible< boost::mpl::_1, Point2T > > > >::type type
void add(const PointT &t)
void add(const PointT &t)
pcl::traits::has_normal< boost::mpl::_1 > IsCompatible
void operator()(AccumulatorT &accumulator) const
pcl::traits::has_intensity< boost::mpl::_1 > IsCompatible
pcl::traits::has_color< boost::mpl::_1 > IsCompatible
pcl::traits::has_curvature< boost::mpl::_1 > IsCompatible
void add(const PointT &t)
pcl::traits::has_label< boost::mpl::_1 > IsCompatible
void operator()(AccumulatorT &accumulator) const
void add(const PointT &t)
std::map< uint32_t, size_t > labels
A point structure representing Euclidean xyz coordinates, and the RGB color.
GetPoint(PointT &point, size_t num)