Converting LAS file into PCD doesn't preserve coordinates?

Feel free to ask any question here
Shukhrat
Posts: 12
Joined: Sun Mar 31, 2019 11:11 pm

Converting LAS file into PCD doesn't preserve coordinates?

Post by Shukhrat »

Hi,
I need to save LAS files into PCD format in order to run them in PCL algorithm. However, saving as PCD format in CC is not preserving original coordinates of points, it is converting into some local coordinates. Is it possible to preserve original coordinates after converting into PCD file?

Thank you,

Kind regards,
Shukhrat
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by daniel »

I think the issue was that PCD files are using 32 bit floating point values. Hence they don't allow for storing large coordinates (without losing accuracy). This is why CC is not able to 'restore' the original coordinate system.

One option is to reject the 'Global Shift' suggested by CC when loading the LAS file (especially if it's not that big) and then save the cloud as PCD. But beware of the loss of numerical accuracy if the coordinates are huge.
Daniel, CloudCompare admin
Shukhrat
Posts: 12
Joined: Sun Mar 31, 2019 11:11 pm

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by Shukhrat »

Thanks for your quick reply Daniel.

If I reject the 'Global Shift' as you suggested, projected coordinates are not imported at all which I won't be able to save them in PCD format. But I need projected coordinates for my analysis. Coordinates look like eg. X = 696056.000 Y = 6106512.000. Is there any other option you can suggest?
Thanks
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by daniel »

What do you call 'projected coordinates'? I thought you wanted to keep the original coordinates? (which is what you should get when rejecting the Global Shift...).
Daniel, CloudCompare admin
Shukhrat
Posts: 12
Joined: Sun Mar 31, 2019 11:11 pm

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by Shukhrat »

Original point cloud has EPSG:28355. If I reject Global Shift while importing the point cloud, coordinates are changing into some local coordinates. And if I export into PCD, it doesn't restore original EPSG:28355 but saving local coordinates. I need original EPSG 28355 in output PCD file.
Thanks
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by daniel »

If you reject the Global Shift, then you really get what's inside the file... CloudCompare doesn't change anything in this case.
Daniel, CloudCompare admin
Shukhrat
Posts: 12
Joined: Sun Mar 31, 2019 11:11 pm

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by Shukhrat »

It doesn't look like that. Because, please look at the first attached image (prtscr1.jpeg), print screen from point cloud, it was taken by checking "Preserve global shift on save". As you can see it shows original (Xg, Yg, Zg) and local coordinates (XI, YI,ZI). If I export this file in PCD format, original coordinates disappear, but preserves local coordinates.

The second attached file (prtscr2.jpeg) is taken by unchecking "Preserve global shift on save". And it has no original coordinates but has local coordinates only. If I export it into PCD format, output file has only local coordinates.
Therefore I am stuck here, I need to export into PCD by preserving original coordinates. Am I missing something?
Thanks,
Attachments
prtscr1.JPG
prtscr1.JPG (77.42 KiB) Viewed 9569 times
prtscr2.JPG
prtscr2.JPG (75.14 KiB) Viewed 9569 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by daniel »

Ah ah, what I mean by rejecting the Global Shift, is actually to click "No" when the Global shift/scale dialog appears.

If you just play with the checkbox, then you accept ("Yes") the Global Shift anyway. You just change whether CC tries to restore it when saving the file or not (which is actually never possible with PCD files).
Daniel, CloudCompare admin
Shukhrat
Posts: 12
Joined: Sun Mar 31, 2019 11:11 pm

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by Shukhrat »

Ah, really sorry for misunderstanding. It worked now.
Thank you so much!
Shukhrat
Posts: 12
Joined: Sun Mar 31, 2019 11:11 pm

Re: Converting LAS file into PCD doesn't preserve coordinates?

Post by Shukhrat »

Hi Daniel,
Sorry I am back to this question again. I need this LAS to PCD conversion in order to run PCL package. I tried to import LAS file with Global Shift "No" and it is converting into PCD by preserving coordinates. However, if I open PCD file in CC, point cloud turned into some strip lines, it doesn't look like LAS file one. Please have a look images below. And outputs from PCL package with Global shift and without Global shift are totally different. With Global Shift "No", PCL output is returning poor result (prscn4), Global Shift "Yes" is perfectly what I want for output (prscn3), but no coordinates preserved. Do you know how to avoid strip lines in point cloud when importing with Global Shift "No"? Thanks so much for your help.
Global shift "Yes" (prscn2.png)
and Global Shift "No" (prscn1.png)
Attachments
prscn4.png
prscn4.png (112.11 KiB) Viewed 9366 times
prscn3.png
prscn3.png (119.23 KiB) Viewed 9366 times
prscn2.png
prscn2.png (155.19 KiB) Viewed 9366 times
prscn1.png
prscn1.png (91.96 KiB) Viewed 9366 times
Post Reply