41 #ifndef PCL_FEATURES_IMPL_CPPF_H_ 42 #define PCL_FEATURES_IMPL_CPPF_H_ 44 #include <pcl/features/cppf.h> 45 #include <pcl/features/pfh.h> 48 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
60 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void 66 output.
width =
static_cast<uint32_t
> (output.
points.size ());
70 for (
size_t index_i = 0; index_i <
indices_->size (); ++index_i)
72 size_t i = (*indices_)[index_i];
73 for (
size_t j = 0 ; j <
input_->points.size (); ++j)
80 normals_->points[i].getNormalVector4fMap (),
81 input_->points[i].getRGBVector4i (),
82 input_->points[j].getVector4fMap (),
83 normals_->points[j].getNormalVector4fMap (),
84 input_->points[j].getRGBVector4i (),
85 p.f1, p.f2, p.f3, p.f4, p.f5, p.f6, p.f7, p.f8, p.f9, p.f10))
88 Eigen::Vector3f model_reference_point =
input_->points[i].getVector3fMap (),
89 model_reference_normal =
normals_->points[i].getNormalVector3fMap (),
90 model_point =
input_->points[j].getVector3fMap ();
91 Eigen::AngleAxisf rotation_mg (acosf (model_reference_normal.dot (Eigen::Vector3f::UnitX ())),
92 model_reference_normal.cross (Eigen::Vector3f::UnitX ()).normalized ());
93 Eigen::Affine3f transform_mg = Eigen::Translation3f ( rotation_mg * ((-1) * model_reference_point)) * rotation_mg;
95 Eigen::Vector3f model_point_transformed = transform_mg * model_point;
96 float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
97 if (sin (angle) * model_point_transformed(2) < 0.0f)
103 PCL_ERROR (
"[pcl::%s::computeFeature] Computing pair feature vector between points %lu and %lu went wrong.\n",
getClassName ().c_str (), i, j);
104 p.f1 = p.f2 = p.f3 = p.f4 = p.f5 = p.f6 = p.f7 = p.f8 = p.f9 = p.f10 = p.alpha_m = std::numeric_limits<float>::quiet_NaN ();
112 p.f1 = p.f2 = p.f3 = p.f4 = p.f5 = p.f6 = p.f7 = p.f8 = p.f9 = p.f10 = p.alpha_m = std::numeric_limits<float>::quiet_NaN ();
121 #define PCL_INSTANTIATE_CPPFEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::CPPFEstimation<T,NT,OutT>; 124 #endif // PCL_FEATURES_IMPL_CPPF_H_ search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
PCL_EXPORTS bool computeCPPFPairFeature(const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, const Eigen::Vector4i &c1, const Eigen::Vector4f &p2, const Eigen::Vector4f &n2, const Eigen::Vector4i &c2, float &f1, float &f2, float &f3, float &f4, float &f5, float &f6, float &f7, float &f8, float &f9, float &f10)
Class that calculates the "surflet" features for each pair in the given pointcloud.
std::string feature_name_
The feature name.
CPPFEstimation()
Empty Constructor.
IndicesPtr indices_
A pointer to the vector of point indices to use.
const std::string & getClassName() const
Get a string representation of the name of this class.
uint32_t height
The point cloud height (if organized as an image-structure).
uint32_t width
The point cloud width (if organized as an image-structure).
PointCloud represents the base class in PCL for storing collections of 3D points. ...
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values).
PointCloudConstPtr input_
The input point cloud dataset.
Feature represents the base feature class.