00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef PCL_BOUNDARY_H_
00039 #define PCL_BOUNDARY_H_
00040
00041 #include <pcl/features/feature.h>
00042 #include <Eigen/Geometry>
00043
00044 namespace pcl
00045 {
00049 inline float
00050 getAngle2D (const float point[2])
00051 {
00052 float rad = atan2(point[1], point[0]);
00053 if (rad < 0)
00054 rad += 2 * M_PI;
00055 return (rad);
00056 }
00057
00059
00066 template <typename PointInT, typename PointNT, typename PointOutT>
00067 class BoundaryEstimation: public FeatureFromNormals<PointInT, PointNT, PointOutT>
00068 {
00069 public:
00070 using Feature<PointInT, PointOutT>::feature_name_;
00071 using Feature<PointInT, PointOutT>::getClassName;
00072 using Feature<PointInT, PointOutT>::input_;
00073 using Feature<PointInT, PointOutT>::indices_;
00074 using Feature<PointInT, PointOutT>::k_;
00075 using Feature<PointInT, PointOutT>::search_parameter_;
00076 using Feature<PointInT, PointOutT>::surface_;
00077 using FeatureFromNormals<PointInT, PointNT, PointOutT>::normals_;
00078
00079 typedef typename Feature<PointInT, PointOutT>::PointCloudOut PointCloudOut;
00080
00081 public:
00083 BoundaryEstimation () : angle_threshold_ (M_PI/2.0)
00084 {
00085 feature_name_ = "BoundaryEstimation";
00086 };
00087
00093 inline void
00094 getCoordinateSystemOnPlane (const PointNT &p_coeff,
00095 Eigen::Vector3f &u, Eigen::Vector3f &v)
00096 {
00097 pcl::Vector3fMapConst p_coeff_v = p_coeff.getNormalVector3fMap ();
00098 v = p_coeff_v.unitOrthogonal ();
00099 u = p_coeff_v.cross (v);
00100 }
00101
00111 bool isBoundaryPoint (const pcl::PointCloud<PointInT> &cloud, int q_idx, const std::vector<int> &indices, const Eigen::Vector3f &u, const Eigen::Vector3f &v, float angle_threshold);
00112
00122 bool isBoundaryPoint (const pcl::PointCloud<PointInT> &cloud, const PointInT &q_point, const std::vector<int> &indices, const Eigen::Vector3f &u, const Eigen::Vector3f &v, float angle_threshold);
00123
00125 float angle_threshold_;
00126
00127 protected:
00128
00134 void computeFeature (PointCloudOut &output);
00135 };
00136 }
00137
00138 #endif //#ifndef PCL_BOUNDARY_H_
00139
00140