How can I remove the underline dimension when exporting pcd Format file?

Feel free to ask any question here
Post Reply
zawa
Posts: 1
Joined: Tue Feb 08, 2022 9:49 pm

How can I remove the underline dimension when exporting pcd Format file?

Post by zawa »

Hi guys! I am a new learner of cloudcompare, recently I am using the cloudcompare to convert the pts format
point Cloud to a pcd Format point cloud. Then I used notepod++ to open the pcd file and had a Brief check, I found there was always a underline Parameter between scalar_field and X, I repeated many times for the export, but still dont konw why ist happened. Have someone know what is the meaning of the underline, and how can I remove such a parameter in my exported pcd file?
Attachments
IMG_20220208_225857.jpg
IMG_20220208_225857.jpg (406.81 KiB) Viewed 802 times
daniel
Site Admin
Posts: 7711
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How can I remove the underline dimension when exporting pcd Format file?

Post by daniel »

That's strange indeed.

I looked at the code and used the debugger to understand what happens:
pcl_debug.jpg
pcl_debug.jpg (116.8 KiB) Viewed 779 times
It shows that the various scalar fields and coordinates are almost properly defined in the PCL cloud... but the offsets are huge. While each field is 4 bytes long, the 'offset' between each is almost always a multiple of 16! (apart for x, y and z which come as a group). After digging a little bit, I found that it's because the PCL plugin was aligning all the field on 16 bytes by default... Probably to speed up things when doing computations? But this padding is huge and takes a lot of memory... I'm not a PCL expert so I don't know exactly why it was done like that. But the memory consumption is huge due to that.

Anyway, when the cloud is passed to the PCL library to be saved to a PCD file, the library adds 'fake fields' to maintain these huge offset values... instead of compacting the data! Even the files were much bigger than they should.

I'll test what the consequences of removing this 16bytes alignment are. And if everything works, I'll update the beta release ASAP.
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7711
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How can I remove the underline dimension when exporting pcd Format file?

Post by daniel »

P.S.: it seems that internally, this is how PCL defines standard fields (with 16bytes alignments?!). Still, I find it huge and inefficient...
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7711
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How can I remove the underline dimension when exporting pcd Format file?

Post by daniel »

Ok, I updated the online 2.12.beta version. You can test it.
Daniel, CloudCompare admin
Post Reply