| 270 | |
| 271 | template <typename FeatureType> |
| 272 | void |
| 273 | ICCVTutorial<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 | |
| 311 | template <typename FeatureType> |
| 312 | void |
nothing calls this directly
no test coverage detected