pcl icon indicating copy to clipboard operation
pcl copied to clipboard

Encoding point cloud as a ply format into a buffer

Open HumamHelfawi opened this issue 7 years ago • 5 comments
trafficstars

Your Environment

  • Operating System and version: Windows 10
  • Compiler: MSVC 2017
  • PCL Version: 1.8.1

Context

The IO library of PCL contains functions to save point cloud as PLY or PCD directly into file. Sometime, it is useful to get the point cloud in PLY format into buffer for sending it over network for example.

Expected Behavior

The savePLY function should has another overload to save the output into buffer instead of file.

Current Behavior

Currently, it has only one option to save it to file directly.

HumamHelfawi avatar Apr 14 '18 12:04 HumamHelfawi

In-memory PCD serialization/deserialization was contributed last year: #1986. You may take this as an example and implement the same for PLY format.

taketwo avatar Jun 18 '18 00:06 taketwo

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

stale[bot] avatar May 19 '20 17:05 stale[bot]

Hi, I have started looking at this issue. Does someone need to assign this to me or something? Some indications as to how we are expecting the functions to behave would be appreciated.

kaipomauli avatar Feb 16 '24 21:02 kaipomauli

@kaipomauli Hello, great that you want to contribute to PCL! I would suggest that we create a duplicate of the writeBinary function https://github.com/PointCloudLibrary/pcl/blob/4ab87d43432b5497b715ace7415f799da7be4a77/io/include/pcl/io/ply_io.h#L604 but with std::ostream &os instead of a file name. The implementation of that function is here: https://github.com/PointCloudLibrary/pcl/blob/4ab87d43432b5497b715ace7415f799da7be4a77/io/src/ply_io.cpp#L1199 There should be as little duplicated code as possible, so maybe the one function can open the file as a stream, then call the other function? If you have any additional questions, feel free to ask.

mvieth avatar Feb 17 '24 10:02 mvieth

Hi, I implemented a fix (waiting review) in https://github.com/PointCloudLibrary/pcl/pull/5966 not sure how to tie this issue back to the PR...

kaipomauli avatar Feb 19 '24 01:02 kaipomauli