-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNormal.cpp
More file actions
37 lines (28 loc) · 943 Bytes
/
Normal.cpp
File metadata and controls
37 lines (28 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Normal.cpp
*
* Created on: Apr 9, 2017
* Author: abds
*/
#include <pcl/features/normal_3d_omp.h>
#include <pcl/gpu/features/features.hpp>
#include "Normal.h"
pcl::PointCloud<pcl::Normal>::Ptr NormalOMP(PointCloud::Ptr cloudin){
pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal> ());
pcl::NormalEstimationOMP<PointT , pcl::Normal> norm_est;
norm_est.setKSearch (10);
norm_est.setInputCloud (cloudin);
norm_est.compute (*normals);
return normals;
}
PointCloudWithNormals::Ptr NormalEst(PointCloud::Ptr cloudin){
PointCloudWithNormals::Ptr out (new PointCloudWithNormals);
pcl::NormalEstimation<PointT,PointNormalT> norm_est;
pcl::search::KdTree<PointT>::Ptr tree (new pcl::search::KdTree<PointT>);
norm_est.setSearchMethod (tree);
norm_est.setKSearch (30);
norm_est.setInputCloud (cloudin);
norm_est.compute (*out);
return out;
std::cout<<"normal compute finished"<<std::endl;
}