PointCloudLibrary / PointCloudLibrary/pcl

Segmentation module has inconsistent API

Open
#756 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

effort: high kind: todo module: segmentation
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

EuclideanClusterExtraction::extract requires std::vector<PointIndices> while PCLBase::setIndices requires PointIndices::Ptr.

The result is that if you want to get one to the other a

std::vector<pcl::PointIndices> clusters;
ec.extract( clusters );

extractor.setIndices( 
    boost::shared_ptr<pcl::PointIndices>( 
        new pcl::PointIndices( clusters[0] ) ) );

I suspect this pattern exists in other parts of pcl.

Code that fits the pattern should probably be adjusted to use vector<PointIndices::Ptr> instead if not shared_ptr<vector<PointIndices::Ptr> >

Likewise PCLBase should add an overload for PointIndices and make a copy

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing EuclideanClusterExtraction::extract with PCLBase::setIndices and trace the related PointIndices types. Survey whether the same value-versus-pointer mismatch appears elsewhere in the segmentation module; done means the affected APIs use a consistent, documented representation without requiring the manual conversion shown here.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.