Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dancelycs opened this issue Nov 5, 2024 · 4 comments
Labels

Comments

@dancelycs
Copy link

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::PointCloudpcl::PointXYZ::Ptr cloud (new pcl::PointCloudpcl::PointXYZ);
pcl::PointCloudpcl::Normal::Ptr normals (new pcl::PointCloudpcl::Normal ());

... 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::KdTreepcl::PointXYZ::Ptr tree (new pcl::search::KdTreepcl::PointXYZ ());
//pcl::KdTreeFLANNpcl::PointXYZ::Ptr tree (new pcl::KdTreeFLANNpcl::PointXYZ ()); -- older call for PCL 1.5-
pfh.setSearchMethod (tree);

// Output datasets
pcl::PointCloudpcl::PFHSignature125::Ptr pfhs (new pcl::PointCloudpcl::PFHSignature125 ());

// 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 ()

}

@dancelycs dancelycs added kind: compile error Type of issue status: triage Labels incomplete labels Nov 5, 2024
@mvieth
Copy link
Member

mvieth commented Nov 5, 2024

  • Which operating system do you use?
  • Which PCL version do you use? How did you install it?
  • Which compiler do you use? Do you 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?

@dancelycs
Copy link
Author

  • 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 mvieth added kind: bug Type of issue module: features and removed kind: compile error Type of issue status: triage Labels incomplete labels Nov 5, 2024
@mvieth
Copy link
Member

mvieth commented Nov 5, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants