PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.89k stars 4.61k forks source link

MovingLeastSquares cannot be written as a function #5944

Closed mcmingchang closed 7 months ago

mcmingchang commented 8 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.

mvieth commented 8 months ago

@mcmingchang

mvieth commented 7 months ago

@mcmingchang If you do not provide additional information (the questions I asked in my previous comment) then I will close this issue soon.