Page 1 of 1

Does CC support PCD format with double coordinates?

Posted: Wed Dec 02, 2020 7:29 am
by nikodeemus
Hello,

I created a pcd file that stores coordinates as doubles. When opening the file in CC it says "[08:49:54] [ccGLWindow] Entity/DB has a null bounding-box! Can't zoom in..." And I can't find any points. If I save the file in another format, all points have 0,00.. coordinates. Intensities are still preserved (which are in floats!)

The format supports doubles as is said here:
https://pcl.readthedocs.io/projects/tut ... ile-format

Thanks
nikodeemus

Re: Does CC support PCD format with double coordinates?

Posted: Wed Dec 02, 2020 8:03 pm
by daniel
I know that the PCL plugin relies on the PCL library to load PCD files. However I also know that the setup of the lib is quite tricky... therefore I don't know if it's supposed to work or not!

You may want to share your file for others to test and maybe patch the plugin?

Re: Does CC support PCD format with double coordinates?

Posted: Wed Dec 02, 2020 8:35 pm
by WargodHernandez
I just checked the PCL plugin and the my_point_types.h only provides float based coordinates and normals, it does support double based scalars though.

Re: Does CC support PCD format with double coordinates?

Posted: Wed Dec 02, 2020 8:37 pm
by WargodHernandez
To be fair we should count this as a bug and either modify the PCL plugin to correctly load the doubles or at least create a warning that they aren't supported.

Re: Does CC support PCD format with double coordinates?

Posted: Thu Dec 03, 2020 8:30 am
by nikodeemus
Thanks for responses!

Happily I am able to go around this problem by converting the .pcd to .las with PDAL and the opening it with CC. :)

Here is the PCD-file with double coordinates attached:
test3.zip
(1.96 MiB) Downloaded 502 times
. Btw I used the linux version.

Yes, doubles seem to be very hard for PCL. Or it is just my beginner C++ skills.. I have just spent couple of days figuring out how I get my points out in world coordinates.

Nikodeemus

Re: Does CC support PCD format with double coordinates?

Posted: Thu Dec 03, 2020 9:11 am
by nikodeemus
I may be able to help you with this if you need. Depends, how much patience do you have :D

Re: Does CC support PCD format with double coordinates?

Posted: Thu Dec 03, 2020 6:31 pm
by WargodHernandez
I think the main reason the plugin just goes with floats is the age of the plugin it predates CloudCompare on Github, so prior to 2012. I'm not sure but maybe it predates the double version of CC, internally unless recompiled the point clouds will be floats even now. But it's not ridiculous to add double support for PCD loading.
the correct type info will need to be added to my_point_types.h and then make modifications to sm2cc.cpp specifically you would need to modify

Code: Select all

ccPointCloud* sm2ccConverter::getCloud()
to check what field size x,y,z are and to pass the size info to addXYZ that function would need to be modified to accept the size values and use the correct data type from my_point_types.h

Re: Does CC support PCD format with double coordinates?

Posted: Thu Dec 03, 2020 6:41 pm
by daniel
Actually, this plugin should just manage "Global Shift & Scale" as all the other I/O filters if it needs to load double values / large coordinates.

See https://github.com/CloudCompare/CloudCo ... r.cpp#L976 for instance.

Re: Does CC support PCD format with double coordinates?

Posted: Thu Dec 03, 2020 7:02 pm
by WargodHernandez
yeah your right, my explanation for what happens with double/large values is misleading, but the links to what needs to change to load doubles from a PCD should still be correct (the changes required to my_point_types.h and sm2cc.cpp to just get a PCL cloud loaded with double data types)