MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / processImpl

Method processImpl

apps/modeler/src/normal_estimation_worker.cpp:106–138  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

104
105//////////////////////////////////////////////////////////////////////////////////////////////
106void
107pcl::modeler::NormalEstimationWorker::processImpl(CloudMeshItem* cloud_mesh_item)
108{
109 CloudMesh::PointCloudPtr cloud = cloud_mesh_item->getCloudMesh()->getCloud();
110
111 // Create the normal estimation class, and pass the input dataset to it
112 pcl::NormalEstimation<pcl::PointSurfel, pcl::PointNormal> normal_estimator;
113 normal_estimator.setInputCloud(cloud);
114
115 pcl::IndicesPtr indices(new pcl::Indices());
116 pcl::removeNaNFromPointCloud(*cloud, *indices);
117 normal_estimator.setIndices(indices);
118
119 // Create an empty kdtree representation, and pass it to the normal estimation object.
120 // Its content will be filled inside the object, based on the given input dataset (as
121 // no other search surface is given).
122 pcl::search::KdTree<pcl::PointSurfel>::Ptr tree(
123 new pcl::search::KdTree<pcl::PointSurfel>());
124 normal_estimator.setSearchMethod(tree);
125
126 // Use all neighbors in a sphere of the search radius
127 normal_estimator.setRadiusSearch(*search_radius_);
128
129 pcl::PointCloud<pcl::PointNormal> normals;
130 normal_estimator.compute(normals);
131
132 for (std::size_t i = 0, i_end = indices->size(); i < i_end; ++i) {
133 std::size_t dest = (*indices)[i];
134 (*cloud)[dest].normal_x = normals[i].normal_x;
135 (*cloud)[dest].normal_y = normals[i].normal_y;
136 (*cloud)[dest].normal_z = normals[i].normal_z;
137 }
138}

Callers

nothing calls this directly

Calls 7

getCloudMethod · 0.45
setInputCloudMethod · 0.45
setIndicesMethod · 0.45
setSearchMethodMethod · 0.45
setRadiusSearchMethod · 0.45
computeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected