Does CC support PCD format with double coordinates?

Feel free to ask any question here
Post Reply
nikodeemus
Posts: 7
Joined: Thu Mar 26, 2020 5:34 am

Does CC support PCD format with double coordinates?

Post 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
daniel
Site Admin
Posts: 7711
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Does CC support PCD format with double coordinates?

Post 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?
Daniel, CloudCompare admin
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: Does CC support PCD format with double coordinates?

Post 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.
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: Does CC support PCD format with double coordinates?

Post 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.
nikodeemus
Posts: 7
Joined: Thu Mar 26, 2020 5:34 am

Re: Does CC support PCD format with double coordinates?

Post 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 489 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
nikodeemus
Posts: 7
Joined: Thu Mar 26, 2020 5:34 am

Re: Does CC support PCD format with double coordinates?

Post by nikodeemus »

I may be able to help you with this if you need. Depends, how much patience do you have :D
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: Does CC support PCD format with double coordinates?

Post 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
daniel
Site Admin
Posts: 7711
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Does CC support PCD format with double coordinates?

Post 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.
Daniel, CloudCompare admin
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: Does CC support PCD format with double coordinates?

Post 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)
Post Reply