40 #ifndef PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_
41 #define PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_
45 #include <boost/make_shared.hpp>
54 template<
typename Po
intT,
typename Po
intNT>
65 typedef boost::shared_ptr<PlaneCoefficientComparator<PointT, PointNT> >
Ptr;
66 typedef boost::shared_ptr<const PlaneCoefficientComparator<PointT, PointNT> >
ConstPtr;
74 , angular_threshold_ (pcl::
deg2rad (2.0f))
75 , distance_threshold_ (0.02f)
76 , depth_dependent_ (true)
77 , z_axis_ (Eigen::Vector3f (0.0, 0.0, 1.0) )
86 , plane_coeff_d_ (plane_coeff_d)
87 , angular_threshold_ (pcl::
deg2rad (2.0f))
88 , distance_threshold_ (0.02f)
89 , depth_dependent_ (true)
90 , z_axis_ (Eigen::Vector3f (0.0f, 0.0f, 1.0f) )
128 plane_coeff_d_ = plane_coeff_d;
137 plane_coeff_d_ = boost::make_shared<std::vector<float> >(plane_coeff_d);
141 const std::vector<float>&
144 return (plane_coeff_d_);
153 angular_threshold_ = cosf (angular_threshold);
160 return (acosf (angular_threshold_) );
169 bool depth_dependent =
false)
171 distance_threshold_ = distance_threshold;
172 depth_dependent_ = depth_dependent;
179 return (distance_threshold_);
190 float threshold = distance_threshold_;
191 if (depth_dependent_)
193 Eigen::Vector3f vec = input_->points[idx1].getVector3fMap ();
195 float z = vec.dot (z_axis_);
198 return ( (fabs ((*plane_coeff_d_)[idx1] - (*plane_coeff_d_)[idx2]) < threshold)
199 && (normals_->points[idx1].getNormalVector3fMap ().dot (normals_->points[idx2].getNormalVector3fMap () ) > angular_threshold_ ) );
204 boost::shared_ptr<std::vector<float> > plane_coeff_d_;
205 float angular_threshold_;
206 float distance_threshold_;
207 bool depth_dependent_;
208 Eigen::Vector3f z_axis_;
211 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
215 #endif // PCL_SEGMENTATION_PLANE_COEFFICIENT_COMPARATOR_H_