41 #ifndef PCL_NORMAL_3D_H_
42 #define PCL_NORMAL_3D_H_
44 #include <pcl/features/feature.h>
45 #include <pcl/common/centroid.h>
59 template <
typename Po
intT>
inline void
61 Eigen::Vector4f &plane_parameters,
float &curvature)
66 Eigen::Vector4f xyz_centroid;
68 if (cloud.
size () < 3 ||
71 plane_parameters.setConstant (std::numeric_limits<float>::quiet_NaN ());
72 curvature = std::numeric_limits<float>::quiet_NaN ();
91 template <
typename Po
intT>
inline void
93 Eigen::Vector4f &plane_parameters,
float &curvature)
98 Eigen::Vector4f xyz_centroid;
99 if (indices.size () < 3 ||
102 plane_parameters.setConstant (std::numeric_limits<float>::quiet_NaN ());
103 curvature = std::numeric_limits<float>::quiet_NaN ();
118 template <
typename Po
intT,
typename Scalar>
inline void
120 Eigen::Matrix<Scalar, 4, 1>& normal)
122 Eigen::Matrix <Scalar, 4, 1> vp (vp_x - point.x, vp_y - point.y, vp_z - point.z, 0);
125 float cos_theta = vp.dot (normal);
133 normal[3] = -1 * normal.dot (point.getVector4fMap ());
145 template <
typename Po
intT,
typename Scalar>
inline void
147 Eigen::Matrix<Scalar, 3, 1>& normal)
149 Eigen::Matrix <Scalar, 3, 1> vp (vp_x - point.x, vp_y - point.y, vp_z - point.z);
152 if (vp.dot (normal) < 0)
166 template <
typename Po
intT>
inline void
168 float &nx,
float &ny,
float &nz)
176 float cos_theta = (vp_x * nx + vp_y * ny + vp_z * nz);
196 template <
typename Po
intInT,
typename Po
intOutT>
200 typedef boost::shared_ptr<NormalEstimation<PointInT, PointOutT> >
Ptr;
201 typedef boost::shared_ptr<const NormalEstimation<PointInT, PointOutT> >
ConstPtr;
241 Eigen::Vector4f &plane_parameters,
float &curvature)
243 if (indices.size () < 3 ||
246 plane_parameters.setConstant (std::numeric_limits<float>::quiet_NaN ());
247 curvature = std::numeric_limits<float>::quiet_NaN ();
269 float &nx,
float &ny,
float &nz,
float &curvature)
271 if (indices.size () < 3 ||
274 nx = ny = nz = curvature = std::numeric_limits<float>::quiet_NaN ();
372 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
376 #ifdef PCL_NO_PRECOMPILE
377 #include <pcl/features/impl/normal_3d.hpp>
380 #endif //#ifndef PCL_NORMAL_3D_H_