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

Method extractDescriptors

apps/src/feature_matching.cpp:272–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271template <typename FeatureType>
272void
273ICCVTutorial<FeatureType>::extractDescriptors(
274 typename pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr input,
275 const typename pcl::PointCloud<pcl::PointXYZI>::Ptr& keypoints,
276 typename pcl::PointCloud<FeatureType>::Ptr features)
277{
278 typename pcl::PointCloud<pcl::PointXYZRGB>::Ptr kpts(
279 new pcl::PointCloud<pcl::PointXYZRGB>);
280 kpts->points.resize(keypoints->size());
281
282 pcl::copyPointCloud(*keypoints, *kpts);
283
284 typename pcl::FeatureFromNormals<pcl::PointXYZRGB, pcl::Normal, FeatureType>::Ptr
285 feature_from_normals = pcl::dynamic_pointer_cast<
286 pcl::FeatureFromNormals<pcl::PointXYZRGB, pcl::Normal, FeatureType>>(
287 feature_extractor_);
288
289 feature_extractor_->setSearchSurface(input);
290 feature_extractor_->setInputCloud(kpts);
291
292 if (feature_from_normals) {
293 std::cout << "normal estimation..." << std::flush;
294 typename pcl::PointCloud<pcl::Normal>::Ptr normals(
295 new pcl::PointCloud<pcl::Normal>);
296 pcl::NormalEstimation<pcl::PointXYZRGB, pcl::Normal> normal_estimation;
297 normal_estimation.setSearchMethod(pcl::search::Search<pcl::PointXYZRGB>::Ptr(
298 new pcl::search::KdTree<pcl::PointXYZRGB>));
299 normal_estimation.setRadiusSearch(0.01);
300 normal_estimation.setInputCloud(input);
301 normal_estimation.compute(*normals);
302 feature_from_normals->setInputNormals(normals);
303 std::cout << "OK" << std::endl;
304 }
305
306 std::cout << "descriptor extraction..." << std::flush;
307 feature_extractor_->compute(*features);
308 std::cout << "OK" << std::endl;
309}
310
311template <typename FeatureType>
312void

Callers

nothing calls this directly

Calls 9

copyPointCloudFunction · 0.85
resizeMethod · 0.45
sizeMethod · 0.45
setSearchSurfaceMethod · 0.45
setInputCloudMethod · 0.45
setSearchMethodMethod · 0.45
setRadiusSearchMethod · 0.45
computeMethod · 0.45
setInputNormalsMethod · 0.45

Tested by

no test coverage detected