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

Modularize euclidean clustering #4268

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/include/pcl/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ namespace pcl
}

/** \brief Utility function to eliminate unused variable warnings. */
template<typename T> void
ignore(const T&)
template<typename ...T> void
ignore(const T&...)
Comment on lines -61 to +62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged to master in the meantime

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will rebase, once issues are resolved.

{
}
} // namespace utils
Expand Down
6 changes: 3 additions & 3 deletions examples/segmentation/example_extract_clusters_normals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ main (int, char **argv)
std::cout << "Estimated the normals" << std::endl;

// Creating the kdtree object for the search method of the extraction
pcl::KdTree<pcl::PointXYZ>::Ptr tree_ec (new pcl::KdTreeFLANN<pcl::PointXYZ> ());
tree_ec->setInputCloud (cloud_ptr);
auto tree = std::make_shared<pcl::search::KdTree<pcl::PointXYZ>>();
tree->setInputCloud (cloud_ptr);

// Extracting Euclidean clusters using cloud and its normals
std::vector<pcl::PointIndices> cluster_indices;
const float tolerance = 0.5f; // 50cm tolerance in (x, y, z) coordinate system
const double eps_angle = 5 * (M_PI / 180.0); // 5degree tolerance in normals
const unsigned int min_cluster_size = 50;

pcl::extractEuclideanClusters (*cloud_ptr, *cloud_normals, tolerance, tree_ec, cluster_indices, eps_angle, min_cluster_size);
pcl::extractEuclideanClusters (*cloud_ptr, *cloud_normals, tolerance, tree, cluster_indices, eps_angle, min_cluster_size);

std::cout << "No of clusters formed are " << cluster_indices.size () << std::endl;

Expand Down
Loading