Commandline help

Feel free to ask any question here
dinki
Posts: 12
Joined: Thu May 21, 2015 12:47 pm

Commandline help

Post by dinki »

Hey guys. Can someone help me out? I'm trying to automate some processing I've been doing by hand and would like to try the commandline interface but I'm not sure how to go about it. This is the procedure that I follow manually:

1) Load line in CC accepting the suggested Global shift/scale adjustments
2) Press the SOR button Statistical Outliers Remover and select 100 for num points used for mean distance estimation and 1.00 for standard deviation multiplier threshold. Wait.
3) Set edit global shift/scale to last input
4) Save resulting cloud_k100_std1 to my new filename

Can someone tell me if this can be done on the commandline? If it cannot all be done, can at least the portion that does the SOR function be used? I can easily apply the global shift manually if needed.

Thanks for any advice as I am really new to this but find it to be a great tool
dinki
Posts: 12
Joined: Thu May 21, 2015 12:47 pm

Re: Commandline help

Post by dinki »

I managed to load the data using the -o option and the commandline argument for auto selecting the global shift (sorry, away from that machine so I don't remember exactly what I did). Unfortunately I'm still not getting the SOR options. It seems this might be a plugin? Can plugins be accessed via commandline arguments too?

I didn't say originally but I'm dealing strictly with ASCII files.

Any help is most appreciated. Thank you for your time and efforts!
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Commandline help

Post by daniel »

First, the fact that the SOR filter was not preserving the global shift information was a bug. And indeed, as SOR was part of the qPCL plugin it couldn't be called via the command line.

I fixed the bug and I integrated SOR in CloudCompare (I reimplemented the algorithm so that it does not rely on the PCL library anymore). You can now call the SOR filter with:

Code: Select all

CloudCompare -O [filename] -SOR [number of neighbors] [sigma multiplier]
And you shouldn't have to bother with the global shift anymore (it should be preserved by default)

You can test this with the latest beta version (2.6.2 beta - there's a link on the 'download' section of the website)
Daniel, CloudCompare admin
dinki
Posts: 12
Joined: Thu May 21, 2015 12:47 pm

Re: Commandline help

Post by dinki »

Thank you greatly for working on this. Here's what I used:

Code: Select all

CloudCompare.exe -C_EXPORT_FMT ASC -PREC 3 -O -GLOBAL_SHIFT AUTO  P40.txt -SOR 100 1
It did produce the desired output and this is OUTSTANDING! I cannot thank you enough!

As with almost everything, there is only one small tweak and it may be painfully obvious, but is there a way to specify the output filename? While the above works great, I do have some files with 'complicated' names that seem to be throwing things off. Some files look like this:

P40.1.a-1417556721531-splita.txt

It seems that CC is queuing in on the first '.' and dropping everything else after and appending the '_SOR_2015-08-16_12h-4_13.asc' portion. I can definitely deal with this by renaming my files so that it's easier to identify the different parts (P40.1.a-1417556721531-splita.txt,P40.1.a-1417556721531-splitb.txt, P40.1.a-1417556721531-splitc.txt, etc) by just renaming the files to only have one '.' character, but having the ability to specify an output filename would keep me from having to do this.

Thank you again for providing this solution so quickly. It will definitely help with crunching these files!!
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Commandline help

Post by daniel »

It's not possible to set the output filename, but the fact that the suffix is added after the first point is clearly a glitch. I'll try to fix it asap!
Daniel, CloudCompare admin
dinki
Posts: 12
Joined: Thu May 21, 2015 12:47 pm

Re: Commandline help

Post by dinki »

Thanks again for the help. I've managed to get quite a lot more done using the commandline options. I've reworked my filenames so the naming is not problematic anymore.
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Commandline help

Post by daniel »

Ok, anyway I have fixed this glitch. I'm currently updating the beta version (should be ready soon).
Daniel, CloudCompare admin
dinki
Posts: 12
Joined: Thu May 21, 2015 12:47 pm

Re: Commandline help

Post by dinki »

I'll download the new beta when it's ready and give it a try. Thanks again!
dinki
Posts: 12
Joined: Thu May 21, 2015 12:47 pm

Re: Commandline help

Post by dinki »

I've been using the following command line style for a while now and it works great for data in this style format of X,Y,Z,scalar,scalar:

Code: Select all

C:\Users\dsf\Desktop\CloudCompare_v2.6.2.beta_bin_x64\CloudCompare.exe -SILENT -C_EXPORT_FMT ASC -PREC 3 -O -GLOBAL_SHIFT AUTO I:\processing\102_1_a-5413474-splitb.txt -SOR 100 1
I've recently added another scalar value so that the format is now X,Y,Z,scalar,scalar,scalar. I am now prompted with the 'Open Ascii File' dialog box and have to hit 'Apply All' to continue. I'm trying to automate things so this interaction is not desirable. Can you tell me why this might be happening? I'm using CC v2.6.2.beta 64 bits on Windows.

Thanks again.
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Commandline help

Post by daniel »

If the ASCII file has 5 or more columns, then CC can't guess its organization automatically anymore (it could be X Y Z S1 S2 or X Y Nx Ny Nz or X Y R G B, etc.). This is why the dialog shows up.

To prevent this you can add a header line to your file. It's a simple comment line starting with '//' and with as many keywords as columns in your file. In your case the keywords are: X, Y, Z, and scalarXXX for each scalar field (replace by XXX by anything you want).

Code: Select all

//X Y Z Scalar1 Scalar2
...
Normally this should help CC guess the file organization.
Daniel, CloudCompare admin
Post Reply