Command line mode
Since version 2.3, CloudCompare can be used in "command line" mode.
By default, this mode only opens a small console window, applies the requested actions, and eventually saves the result in a file in the same directory(ies) as the input file(s). Commands are applied in the order they are written (like a state machine).
Available options (version 2.10.alpha)
Command | Description |
---|---|
-SILENT
|
enables silent mode (no console will appear)
Warning: must be first if required. |
-O {filename}
|
opens a file
If the file format is ASCII, optional settings are:
For all formats, optional settings are (version 2.5.6 and above):
Note: file type is automatically guessed from its extension. |
-OCTREE_NORMALS {radius}
|
Computes the normals for all loaded clouds with the specified radius.
Notes:
|
-COMPUTE_NORMALS
|
forces CC to compute normals at loading time (which is generally more robust) when importing files containing structured clouds (i.e. PTX, FARO and DP file for now). Normals are not computed by default.
Note: must be placed before the '-O' option. |
-CLEAR_NORMALS
|
Removes all normals from the loaded entities. |
-ORIENT_NORMS_MST {number of neighbors}
|
(Re)orient the normals of the loaded clouds with a Minimum Spanning Tree.
Note: Clouds without normals are simply ignored. |
-MERGE_CLOUDS
|
merges all loaded/generated clouds as one unique cloud.
Note: result is automatically saved by default (see the AUTO_SAVE command to change this). |
-MERGE_MESHES
|
merges all loaded/generated meshes as one unique mesh.
Note: result is automatically saved by default (see the AUTO_SAVE command to change this). This option is available since version 2.9. |
-SS {algorithm} {parameter}
|
applies a subsampling {algorithm} on the currently opened/generated cloud(s).
{algorithm} can be RANDOM, SPATIAL or OCTREE. Expected parameter is:
Notes:
|
-EXTRACT_CC {octree level} {minimum number of points per component}
|
extracts the connected components from the currently opened/generated cloud(s).
{octree level} should be between 1 and 21. Notes:
|
-SAMPLE_MESH {method} {parameter}
|
samples points on the loaded mesh(es).
For each mesh, a cloud will be generated (and will be added to the current loaded cloud set - i.e. further processing can be applied to this cloud). {method} can be POINTS or DENSITY. Expected parameter is:
Notes:
|
-EXTRACT_VERTICES {method} {parameter}
|
Extract the vertices of all loaded meshes as standalone point clouds.
Notes:
|
-C2C_DIST
|
computes cloud-to-cloud distances on the two first loaded/generated clouds (1st = compared / 2nd = reference).
Optional settings are:
Notes:
|
-C2M_DIST
|
computes Cloud-to-Mesh distances between the first loaded/generated cloud (compared) and the first loaded mesh (reference).
Optional settings are:
Notes:
|
-RASTERIZE -GRID_STEP {value}
|
Rasterizes the loaded clouds by projecting them inside a regular grid.
Optional settings are:
Notes:
|
-VOLUME -GRID_STEP {grid step}
|
2.5D estimation of the volume between two point clouds (the first is the ceiling, the second is the ground by default).
This tool outputs two files:
Optional settings are:
Notes:
|
-STAT_TEST {distrib} {distrib parameters} {p-value} {neighbors count}
|
applies a local statistical test based on the active scalar field all the of loaded/generated clouds.
{distrib} can be GAUSS or WEIBULL. Expected distribution parameters are:
Note: result is automatically saved by default (see the AUTO_SAVE command to change this). |
-COORD_TO_SF {dimension: X, Y or Z}
|
exports the specified coordinate (dimension) to a scalar field.
Note: creates a new scalar field (or overwrite any existing one with the same name) and sets it active. |
-FILTER_SF {minVal} {maxVal}
|
filters all the loaded/generated clouds based on their active scalar field values.
A new cloud is created each time with only the points falling in the [minVal maxVal] interval. Notes:
You can use special words in place of numbers that CC will replace by the actual SF values:
|
-DENSITY {sphere radius}
|
computes the density (inside a sphere around each point) on the currently opened/generated cloud(s).
Optional setting:
Notes:
|
-APPROX_DENSITY
|
computes approximate density on the currently opened/generated cloud(s).
Optional setting:
Notes:
|
-ROUGH {kernel size}
|
computes the roughness with a given kernel size on the currently opened/generated cloud(s).
Notes:
|
-CURV {type} {kernel size}
|
computes local curvature with a given kernel size on the currently opened/generated cloud(s).
{type} can be MEAN or GAUSS. Notes:
|
-SF_GRAD {euclidian}
|
computes the gradient of the active scalar field (or the first one if none is active) on the currently opened/generated cloud(s).
The {euclidian} option specifies whether the scalar field is 'euclidian' (TRUE) - typically like a distance field - or not (FALSE). Notes:
|
-BEST_FIT_PLANE
|
computes the best fitting plane on all loaded clouds.
Optional settings are:
Notes:
|
-APPLY_TRANS {filename}
|
applies a 4x4 transformation matrix on the loaded entities (clouds or meshes). The matrix is read from a simple text file with the matrix rows on each line (4 values per lines, 4 lines).
Notes:
|
-MATCH_CENTERS
|
makes all the (bounding-box) centers of the loaded entities match. All the entities will move relatively to the first one (clouds are always considered first if clouds and meshes are loaded).
Note: result is automatically saved by default (see the AUTO_SAVE command to change this). |
-DELAUNAY
|
Triangulates the loaded clouds with 2.5D Delaunay triangulation. The triangulation is done in the (XY) plane by default.
Optional settings are:
Notes:
|
-ICP
|
Iterative Closest Point registration procedure.
Optional settings are:
Notes:
|
-CROP {Xmin:Ymin:Zmin:Xmax:Ymax:Zmax}
|
Crops all loaded clouds inside or outside a given box.
Optional settings are:
Notes:
|
-CROP2D {ortho_dim} {n:number of vertices} X1 Y1 X2 Y2 ... Xn Yn
|
Crops all loaded clouds inside or outisde a given 2D polyline. Cropping is done in a plane defined by its orthogonal dimension: X, Y or Z (i.e. coordinates along this dimension will be ignored).
Optional settings are:
Note:
|
-CROSS_SECTION {XML parameters file}
|
Extracts one or multiple sections from the clouds or meshes.
Either the loaded clouds and/or meshes (see the -O option) can be used otherwise CC can load one or several files from a specified folder (use the 'FilePath' key). See [1] for an example of XML parameter file. Note:
|
-SOR {number of neighbors} {sigma multiplier}
|
applies the SOR (Statistical Outlier Removal) filter on the loaded cloud(s).
For each cloud, a new one will be generated (and will replace the origin cloud). Notes:
|
-SF_ARITHMETIC {SF index} {operation}
|
applies operations on a given scalar field of the loaded cloud/mesh.
SF2 = operation(SF) The scalar-field index starts from 0. The user can use the keyword 'LAST' to designate the last scalar field. Supported operations are:
Notes:
|
-SF_OP {SF index} {operation} {value}
|
applies an arithmetic operation on a given scalar field of the loaded cloud/mesh and with a given scalar value.
SF = SF (+,-,*,/) VALUE The scalar-field index starts from 0. The user can use the keyword 'LAST' to designate the last scalar field. Supported operations are:
Notes:
|
-CBANDING {dim} {freq}
|
Applies color banding to all loaded entities (clouds and meshes). The user must specify the dimension (dim = X, Y or Z) and the frequency (in Hz, as an integer).
Note:
|
-SF_COLOR_SCALE {filename}
|
Loads a color scale from a XML file (generated with the Color Scales Manager). The loaded color scale is then applied to the active scalar field.
Note:
|
-SF_CONVERT_TO_RGB {TRUE/FALSE}
|
Converts the active scalar field to RGB colors. The user must explicitly specify whether the previously existing colors (if any) should be mixed with the new ones (TRUE) or overwritten (FALSE).
Note:
|
-C_EXPORT_FMT {format}
|
Specifies the default output format for clouds. Format can be one of the following: ASC, BIN, PLY, LAS, E57, VTK, PCD, SOI, PN, PV.
Optional settings are:
WARNING: the ADD_HEADER and ADD_PTS_COUNT options are broken in the 2.6.2 version. Use the latest 2.6.3 beta version instead. |
-M_EXPORT_FMT {format}
|
Specifies the default output format for meshes. Format can be one of the following: BIN, OBJ, PLY, STL, VTK, MA, FBX.
Optional settings are:
|
-FBX_EXPORT_FMT {format}
|
Specifies the default output format for FBX meshes. Must be specified in addition to M_EXPORT_FMT if FBX format is chosen. Format can be one of the following: FBX_binary, FBX_ascii, FBX_encrypted, FBX_6.0_binary, FBX_6.0_ascii, FBX_6.0_encrypted.
Note: if the input format is not supported by the current implementation, a list of available formats will be output in the console. |
-PLY_EXPORT_FMT {format}
|
Specifies the default output format for PLY files. Format can be one of the following: ASCII, BINARY_BE (big endian) or BINARY_LE (little endian).
Note: default output format is binary (LE/BE depending on the current OS) |
-NO_TIMESTAMP
|
to prevent CC from generating an automatic suffix (timestamp) for output file name (warning: this make the name of an output file predictable but if the file already exists it will be overwritten). |
-BUNDLER_IMPORT {filename}
|
imports a Snavely's Bundler file.
Bundler import through the command line is mainly meant to generate ortho-rectified versions of input images directly on disk. Optional settings are:
Note: see below for more details. |
-DROP_GLOBAL_SHIFT
|
Removes the Global Shift information from all loaded entities. |
-SET_ACTIVE_SF {index}
|
Sets the active scalar field index (for all loaded clouds).
Note:
|
-REMOVE_ALL_SFS
|
Removes all scalar fields (from all loaded clouds or meshes).
Note:
|
-REMOVE_SCAN_GRIDS
|
Removes all scan grids (from all loaded clouds or meshes).
Note:
|
-AUTO_SAVE {ON/OFF}
|
Enables (ON) or disables (OFF) automatic backup of clouds and meshes at each step (you'll have to manually call -SAVE_CLOUDS or -SAVE_MESHES at the right time/position in your command). |
-SAVE_CLOUDS
|
Saves all currently loaded clouds (note that this is not necessary by default as all modified or newly generated cloud are automatically saved).
Optional settings are:
|
-SAVE_MESHES
|
Saves all currently loaded meshes (note that this is not necessary by default as all modified or newly generated meshes are automatically saved).
Optional settings are:
|
-CLEAR
|
closes all currently loaded entities. |
-CLEAR_CLOUDS
|
closes all currently loaded clouds. |
-CLEAR_MESHES
|
closes all currently loaded meshes. |
-POP_CLOUDS
|
removes the last loaded cloud. |
-POP_MESHES
|
removes the last loaded mesh. |
-LOG_FILE {filename}
|
logs all command output messages in a given file. |
Example 1
CloudCompare -O myhugecloud.bin -SS SPATIAL 0.1
This will open file myhugecloud.bin then apply spatial subsampling with a 0.1 step (e.g. in meters). The output file will be myhugecloud_SPATIAL_SUBSAMPLED_YYYY-MM-DD_HHhMM.bin.
Example 2
CloudCompare -O myhugecloud1.bin -SS SPATIAL 0.1 -O 'myhugecloud2.bin' -SS RANDOM 1000000 -CLEAR_ALL -O 'myhugecloud3.bin' -SS OCTREE 9
This will open file myhugecloud1.bin then apply spatial subsampling with a 0.1 step (e.g. in meters).
Then it will open file myhugecloud2.bin and apply to both files random subsampling (1 000 000 points each).
Then it will close the two first files.
Eventually it will open file myhugecloud3.bin and apply octree based subsampling (level 9).
The output files will be: myhugecloud1_SPATIAL_SUBSAMPLED_YYYY-MM-DD_HHhMM.bin, myhugecloud1_RANDOM_SUBSAMPLED_YYYY-MM-DD_HHhMM.bin, myhugecloud2_RANDOM_SUBSAMPLED_YYYY-MM-DD_HHhMM.bin and myhugecloud3_OCTREE_level_9_SUBSAMPLED_YYYY-MM-DD_HHhMM.bin
Cloud-to-cloud distance
CloudCompare -o cloud1.bin -o cloud2.asc -c2c_dist -split_xyz -model HF SPHERE 50.0
CC will load cloud1.bin and cloud2.asc, then compute the distance from cloud1 (compared) relatively to cloud2 (reference) with a height function (quadric) computed on all the neighbors falling in a sphere of radius 50.0 around each point of cloud1. On output a file cloud1_C2C_DIST_YYYY-MM-DD_HHhMM.bin will be generated (with the resulting distances as first scalar field and the 3 components of the corresponding displacement vector along X, Y and Z as additional scalar fields).
Note: this cloud stays in memory and can be processed further (with -FILTER_SF for instance).
Cloud-to-mesh distance
CloudCompare -o cloud1.bin -o mesh.obj -c2m_dist
CC will load cloud1.bin and mesh.obj, then compute the distance from cloud1 (compared) relatively to mesh (reference). On output a file cloud1_C2M_DIST_YYYY-MM-DD_HHhMM.bin will be generated (with the resulting distances as scalar field).
Note: this cloud stays in memory and can be processed further (with -FILTER_SF for instance).
Bundler import
CloudCompare -BUNDLER_IMPORT bundle.out -COLOR_DTM 1000000
This will generate all ortho-rectified versions of the images declared in 'bundle.out', as well as the colored vertices of a pseudo-DTM constructed from the keypoints.
(Mesh) format conversion
CloudCompare -M_EXPORT_FMT FBX -FBX_EXPORT_FMT FBX_Binary -O Foot.ply -NO_TIMESTAMP -SAVE_MESHES
This will open the file named 'Foot.ply' then save it in FBX binary format (same base filename, without any decoration: i.e. Foot.fbx)