PointCloudLibrary / pcl

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

[compile error] Calculating FPFH/PFH descriptor pointer error in version PCL1.14 #6164

Open dancelycs opened 3 weeks ago

dancelycs commented 3 weeks ago

Using the method on the official website, a pointer error occurred at the end of the calculation, but the relevant descriptors have already been calculated!!!!! Expression: _CrtlsValidHeapPointer(block)

include <pcl/point_types.h>

include <pcl/features/pfh.h>

{ pcl::PointCloud::Ptr cloud (new pcl::PointCloud); pcl::PointCloud::Ptr normals (new pcl::PointCloud ());

... read, pass in or create a point cloud with normals ... ... (note: you can create a single PointCloud if you want) ...

// Create the PFH estimation class, and pass the input dataset+normals to it pcl::PFHEstimation<pcl::PointXYZ, pcl::Normal, pcl::PFHSignature125> pfh; pfh.setInputCloud (cloud); pfh.setInputNormals (normals); // alternatively, if cloud is of tpe PointNormal, do pfh.setInputNormals (cloud);

// Create an empty kdtree representation, and pass it to the PFH estimation object. // Its content will be filled inside the object, based on the given input dataset (as no other search surface is given). pcl::search::KdTree::Ptr tree (new pcl::search::KdTree ()); //pcl::KdTreeFLANN::Ptr tree (new pcl::KdTreeFLANN ()); -- older call for PCL 1.5- pfh.setSearchMethod (tree);

// Output datasets pcl::PointCloud::Ptr pfhs (new pcl::PointCloud ());

// Use all neighbors in a sphere of radius 5cm // IMPORTANT: the radius used here has to be larger than the radius used to estimate the surface normals!!! pfh.setRadiusSearch (0.05);

// Compute the features pfh.compute (pfhs); // pfhs->size () should have the same size as the input cloud->size () }

mvieth commented 3 weeks ago
dancelycs commented 3 weeks ago
  • Which operating system do you use? WIN11.
  • Which PCL version do you use? How did you install it? PCL1.14.0. The installation package comes from “https://github.com/PointCloudLibrary/pcl/releases”.
  • Which compiler do you use? Do you use CMake? The compiler we use is the Microsoft MSVC compiler and does not use cmake.
  • You marked this as a "compile error". Does the problem really happen during compilation, or does it happen when you run the program? It's not a compilation error, it's a runtime error that throws an error “Expression: _CrtlsValidHeapPointer(block)” after the “pfh.compute (pfhs);” finishes running.
mvieth commented 3 weeks ago

Did you enable AVX and/or AVX2 for the compilation of the code? We usually highly recommend using CMake because it automatically handles these options.

dancelycs commented 3 weeks ago

Thank you very much, it was in the 'not set' state before.