简体   繁体   中英

is there a way to get a pcl pointcloud from std::istream instead of a filename

I want to output a pcl point cloud from an istream (ply file read directly from server and can't be saved locally). Can anyone help if there is a way to achieve this?

I am familiar with pcl::io::loadPLYFile<pcl::PointXYZRGBA>(std::string fname, *cloud); but the function I am looking for is of the form xxxx(std::istream, *cloud); I tried looking at pcl's codebase in the github but couldn't get anywhere: :(

I don't think PCL has one function to do what you're asking. But looking at the .ply file format , I'd suggest you do something like following

  1. Go through the file line by line
  2. Once you find element vertex X , keep the number X
  3. Once you find end_header , start reading vertex values (I'm guessing in the order of xyz r gba) from the next line to the next X th line
  4. Assign the read values to a pointcloud you created

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM