40 #ifndef PCL_NORMAL_3D_H_
41 #define PCL_NORMAL_3D_H_
57 template <
typename Po
intT>
inline void
59 Eigen::Vector4f &plane_parameters,
float &curvature)
64 Eigen::Vector4f xyz_centroid;
68 plane_parameters.setConstant (std::numeric_limits<float>::quiet_NaN ());
69 curvature = std::numeric_limits<float>::quiet_NaN ();
88 template <
typename Po
intT>
inline void
90 Eigen::Vector4f &plane_parameters,
float &curvature)
95 Eigen::Vector4f xyz_centroid;
98 plane_parameters.setConstant (std::numeric_limits<float>::quiet_NaN ());
99 curvature = std::numeric_limits<float>::quiet_NaN ();
114 template <
typename Po
intT,
typename Scalar>
inline void
116 Eigen::Matrix<Scalar, 4, 1>& normal)
118 Eigen::Matrix <Scalar, 4, 1> vp (vp_x - point.x, vp_y - point.x, vp_z - point.z, 0);
121 float cos_theta = vp.dot (normal);
129 normal[3] = -1 * normal.dot (point.getVector4fMap ());
141 template <
typename Po
intT,
typename Scalar>
inline void
143 Eigen::Matrix<Scalar, 3, 1>& normal)
145 Eigen::Matrix <Scalar, 3, 1> vp (vp_x - point.x, vp_y - point.x, vp_z - point.z);
148 if (vp.dot (normal) < 0)
162 template <
typename Po
intT>
inline void
164 float &nx,
float &ny,
float &nz)
172 float cos_theta = (vp_x * nx + vp_y * ny + vp_z * nz);
192 template <
typename Po
intInT,
typename Po
intOutT>
213 , covariance_matrix_ ()
215 , use_sensor_origin_ (true)
217 feature_name_ =
"NormalEstimation";
235 plane_parameters.setConstant (std::numeric_limits<float>::quiet_NaN ());
236 curvature = std::numeric_limits<float>::quiet_NaN ();
261 nx = ny = nz = curvature = std::numeric_limits<float>::quiet_NaN ();
276 if (use_sensor_origin_)
278 vpx_ = input_->sensor_origin_.coeff (0);
279 vpy_ = input_->sensor_origin_.coeff (1);
280 vpz_ = input_->sensor_origin_.coeff (2);
295 use_sensor_origin_ =
false;
321 use_sensor_origin_ =
true;
324 vpx_ = input_->sensor_origin_.coeff (0);
325 vpy_ = input_->sensor_origin_.coeff (1);
326 vpz_ = input_->sensor_origin_.coeff (2);
347 float vpx_, vpy_, vpz_;
353 Eigen::Vector4f xyz_centroid_;
356 bool use_sensor_origin_;
374 template <
typename Po
intInT>
406 #endif //#ifndef PCL_NORMAL_3D_H_