Closed mcmingchang closed 7 months ago
void pcl_surface_reconstruction(pcl::PointCloud::Ptr& cloud, pcl::PointCloud& mls_points) { pcl::search::KdTree::Ptr tree(new pcl::search::KdTree); pcl::MovingLeastSquares<pcl::PointXYZ, pcl::PointNormal> mls; mls.setInputCloud(cloud); mls.setNumberOfThreads(100); // 调用所有线程 mls.setComputeNormals(true); mls.setPolynomialOrder(2); mls.setSearchMethod(tree); mls.setSearchRadius(5); mls.process(mls_points); // 计算完成后,cloud的点分布更平滑 cout << "!!" << endl; }
In the latest version, writing this method as a function can cause a crash, but writing it directly to main can run normally.
@mcmingchang
@mcmingchang If you do not provide additional information (the questions I asked in my previous comment) then I will close this issue soon.
void pcl_surface_reconstruction(pcl::PointCloud::Ptr& cloud, pcl::PointCloud& mls_points) {
pcl::search::KdTree::Ptr tree(new pcl::search::KdTree);
pcl::MovingLeastSquares<pcl::PointXYZ, pcl::PointNormal> mls;
mls.setInputCloud(cloud);
mls.setNumberOfThreads(100); // 调用所有线程
mls.setComputeNormals(true);
mls.setPolynomialOrder(2);
mls.setSearchMethod(tree);
mls.setSearchRadius(5);
mls.process(mls_points); // 计算完成后,cloud的点分布更平滑
cout << "!!" << endl;
}
In the latest version, writing this method as a function can cause a crash, but writing it directly to main can run normally.