c++ - Vector iterator passed to function error -
i pass point cloud input argument function proposed point cloud library, here's problem: have vector of point cloud, , want pass them 1 1 filter set them vector of point cloud filtered. using iterator that, function expecting point cloud input not take iterator... don't understand why. code:
std::vector <pcl::pointcloud<pcl::pointxyzrgb>::ptr> pcl_filter(std::vector <pcl::pointcloud<pcl::pointxyzrgb>::ptr> rdy_to_pro_pcls){ std::vector<int> indices; std::vector <pcl::pointcloud<pcl::pointxyzrgb>::ptr>::iterator vit_pcls = rdy_to_pro_pcls.begin(); std::vector <pcl::pointcloud<pcl::pointxyzrgb>::ptr> vfilt_pcls; pcl::pointcloud<pcl::pointxyzrgb>::ptr without_nanpcl(new pcl::pointcloud<pcl::pointxyzrgb>); pcl::pointcloud<pcl::pointxyzrgb>::ptr filt_pcl(new pcl::pointcloud<pcl::pointxyzrgb>); (vit_pcls = rdy_to_pro_pcls.begin(); vit_pcls != rdy_to_pro_pcls.end(); vit_pcls++){ pcl::removenanfrompointcloud(*vit_pcls, *without_nanpcl, indices); pcl::voxelgrid<pcl::pointxyzrgb> sor; sor.setinputcloud(*vit_pcls); sor.setleafsize(0.01f, 0.01f, 0.01f); sor.filter(*filt_pcl); vfilt_pcls.push_back(filt_pcl); } homecoming vfilt_pcls; } i want to set without_nanpcl object vector. can't go farther since debugger doesn't approve i'm doing. can see below there function called setinputcloud accepts vector iterator, , want exact same thing pcl::removenanfrompointcloud, can't figure out why not working.
here error output (line 8 of sample of code):
error c2784: 'void pcl::removenanfrompointcloud(const pcl::pointcloud<pointt> &,pcl::pointcloud<pointt> &,std::vector<int,std::allocator<_ty>> &)' : not deduce template argument 'const pcl::pointcloud<pointt> &' 'boost::shared_ptr<pcl::pointcloud<pcl::pointxyzrgb>>' and here pcl::removenanfrompointcloud declaration:
void pcl::removenanfrompointcloud ( const pcl::pointcloud< pointt > & cloud_in, pcl::pointcloud< pointt > & cloud_out, std::vector< int > & index ) could help me on this? give thanks you
from function signature, can see expects reference pcl::pointcloud< pointt > (i assume it's function template , pointt template parameter), you're passing in pcl::pointcloud<pcl::pointxyzrgb>::ptr, obtained dereferencing iterator. need dereference pointer @ point cloud object:
pcl::removenanfrompointcloud(**vit_pcls, *without_nanpcl, indices); c++ vector iterator point-cloud-library
No comments:
Post a Comment