Hello everyone,

I have a vector which is populated by the indices of points ( given in

indices.txt ) corresponding to a particular point cloud. I do not have access to the original point cloud.

I want to create a pointer of type i) pcl::ConstCloudIterator<PointT>& OR ii) const pcl::PointCloud<PointT>&.

This type of pointers are required to use the method pcl::compute3DCentroid() given

here.

I have tried with the following code snippet.

vector<int> indices;

std::vector<int>::iterator it;

boost::shared_ptr<vector<int> > indicesptr (new vector<int> (indices));

for (size_t i = 0; i < int(indices.size()); i++){

Eigen::Vector4f centroid;

pcl::compute3DCentroid (*indicesptr, centroid);

cout << centroid[0] << " " << centroid[1] << " " << centroid[2] << " " << centroid[3] << " \n";

}

**Error is:**### error: no matching function for call to ‘compute3DCentroid(boost::shared_ptr<std::vector<int> >&, Eigen::Vector4f&)’

I have also tried in the following way:

std::vector <pcl::PointCloud<pcl::PointXYZ>::Ptr> indices;

pcl::PointCloud<pcl::PointXYZ>::Ptr indicesptr (new vector <pcl::PointCloud<pcl::PointXYZ>::Ptr> (indices));

My question is how to create the specific pointers which points to the populated vector and utilize them in the function:

**pcl::compute3DCentroid (*indicesptr, centroid);***Where am I doing wrong?*Thanks in advance for any kind of help.