Page 1 of 1

Data shift issue whilst exporting

Posted: Fri Sep 02, 2022 9:56 am
by eyevi
I want to apply some processes to point cloud which is in LAZ format. I have to use cloud compare command line because there are so many directories.
Here is what i want to do
  • I want to apply color scale tointensity scalar field and xml style file
  • Then i want to convert that scalar field to RGB
  • Then I want to export it (preferable was laz but since its not possible so i opted for LAS
Here is my solution which in theory works but gives weird results

Code: Select all

cc_cmd = r'C:\Program Files\CloudCompare\CloudCompare'
file_name = r'somepath\somefile.laz'
xml_styler = r'somepath\somefile.xml'

subprocess.run([cc_cmd, '-SILENT', '-O', filename,'-AUTO_SAVE', 'OFF','-SET_ACTIVE_SF','1', '-SF_COLOR_SCALE', xml_styler,'-SF_CONVERT_TO_RGB', 'FALSE', '-C_EXPORT_FMT', 'LAS', '-SAVE_CLOUDS'])
There are two main problems with it (pic below for ref)
1- It reduces the number of points
2- There is a crazy offset between input and output pointclouds
Image

What i have tried so far:
I tried refactoring each part to see where it went wrong. I thought maybe i was giving intensity index wrong so i excluded those parts as well, or setting rgb etc wrong, so i excluded those as well

Finally it boiled down to even simple export giving offset and reduced point clouds

Code: Select all

"C:\Program Files\CloudCompare\CloudCompare" -O "C:\Users\3d-digi\Desktop\cc_cmd\complete test\test1\Buildings.laz" -C_EXPORT_FMT LAS -SAVE_CLOUDS
Here are the warnings the console throws:
Image
All ScanAngleRank values were same(0)!We ignored them...
All EdgeOfFlightLine values were same(0)!We ignored them...
All ScanDirectionFlag values were same(0)!We ignored them...
All NumberOfReturnsvalues were same(0)!We ignored them...
All ReturnNumber values were same(1)!We ignored them...
The former LAS_OFFSET doesnt seem to be optimal, using minimum bbox instead


Though when i tried the whole procedure on one file manually it worked fine.
Since I have very little knowledge of working with point clouds or 3d data, i am lost, any help would be highly appreciated.
Thanks

Re: Data shift issue whilst exporting

Posted: Fri Sep 02, 2022 8:21 pm
by daniel
I think you need to use -GLOBAL_SHIFT AUTO after -O (to specify to CC what to do with large coordinates, as the command line needs directions from the user). By default, it loads large coordinates as is, and some truncation of the values may happen if the coordinates are large.

Hopefully it should fix both issues.

Re: Data shift issue whilst exporting

Posted: Mon Sep 05, 2022 7:04 am
by eyevi
Thanks for the reply and help,
it solved my issue.