Skip to content

Segmentation module has inconsistent API #756

@catskul

Description

@catskul

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions