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> 76 template <
typename Po
intT>
void 79 template <
typename Po
intT>
void 82 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
99 template <
typename Po
intT>
void 102 template <
typename Po
intT>
void 105 #if EIGEN_VERSION_AT_LEAST (3, 3, 0) 106 t.getNormalVector4fMap () =
normal.normalized ();
108 if (
normal.squaredNorm() > 0)
109 t.getNormalVector4fMap () =
normal.normalized ();
111 t.getNormalVector4fMap () = Eigen::Vector4f::Zero ();
115 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
130 template <
typename Po
intT>
void 133 template <
typename Po
intT>
void 149 template <
typename Po
intT>
void 152 r += static_cast<float> (t.r);
153 g += static_cast<float> (t.g);
154 b += static_cast<float> (t.b);
155 a += static_cast<float> (t.a);
158 template <
typename Po
intT>
void 161 t.rgba = static_cast<uint32_t> (
a / n) << 24 |
162 static_cast<uint32_t> (
r / n) << 16 |
163 static_cast<uint32_t> (
g / n) << 8 |
164 static_cast<uint32_t> (
b / n);
180 template <
typename Po
intT>
void 183 template <
typename Po
intT>
void 200 template <
typename Po
intT>
void 203 std::map<uint32_t, size_t>::iterator itr =
labels.find (t.label);
205 labels.insert (std::make_pair (t.label, 1));
210 template <
typename Po
intT>
void 214 std::map<uint32_t, size_t>::const_iterator itr;
215 for (itr =
labels.begin (); itr !=
labels.end (); ++itr)
216 if (itr->second > max)
219 t.label = itr->first;
228 template <
typename Po
int1T,
typename Po
int2T = Po
int1T>
233 template <
typename AccumulatorT,
typename Po
intT>
234 struct IsCompatible : boost::mpl::apply<typename AccumulatorT::IsCompatible, PointT> { };
239 typename boost::fusion::result_of::as_vector<
240 typename boost::mpl::filter_view<
261 template <
typename Po
intT>
269 template <
typename AccumulatorT>
void 280 template <
typename Po
intT>
289 template <
typename AccumulatorT>
void 292 accumulator.get (
p,
n);
void get(PointT &t, size_t n) const
void get(PointT &t, size_t n) const
void add(const PointT &t)
void add(const PointT &t)
void operator()(AccumulatorT &accumulator) const
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
pcl::traits::has_intensity< boost::mpl::_1 > IsCompatible
pcl::traits::has_color< boost::mpl::_1 > IsCompatible
Defines all the PCL implemented PointT point type structures.
pcl::traits::has_curvature< boost::mpl::_1 > IsCompatible
void add(const PointT &t)
pcl::traits::has_label< boost::mpl::_1 > IsCompatible
void get(PointT &t, size_t n) const
void add(const PointT &t)
std::map< uint32_t, size_t > labels
void get(PointT &t, size_t) const
void get(PointT &t, size_t) const
void get(PointT &t, size_t n) const
A point structure representing Euclidean xyz coordinates, and the RGB color.
GetPoint(PointT &point, size_t num)
void operator()(AccumulatorT &accumulator) const