Reconstruction Commands

The commands below can be used to set and modify the reconstruction region, and run the reconstruction.

Command Name Required Parameter Optional Parameter Description
resetGround Set the ground plane back to its original orientation and position.
setGroundPlaneFromReconstructionRegion Automatically center a model using a reconstruction region into the middle of the grid, adjusting both rotation and transformation.
setReconstructionRegionAuto Set a reconstruction region automatically.
setReconstructionRegion box.rcbox Import a reconstruction region from the box.rcbox file.
setReconstructionRegionOnCPs controlPoint
controlPoint
controlPoint
controlPoint|heightValue
Set a reconstruction region on existing control points. Three control points define the base of the region and the height of the region is defined by the frouth control point or by entering the height value. See the example below.
scaleReconstructionRegion scaleX
scaleY
scaleZ
origin|center absolute|factor Scale the reconstruction region in each axis (scaleX, scaleY, and scaleZ). Scale parameters can be treated either as absolute values (absolute) or scale factors (factor) from the center of the region (center) or its origin (origin) defined by the first control point when using setReconstructionRegionOnCPs command. Default values are "absolute" and "center". See the examples below.
moveReconstructionRegion moveX
moveY
moveZ
Move the reconstruction region along the region's axes. The values are in the coordinate system’s units. See the examples below.
rotateReconstructionRegion rotateX
rotateY
rotateZ
Rotate reconstruction region around its axes. All values are in degrees. See the examples below.
offsetReconstructionRegion offsetX
offsetY
offsetZ
Offset the reconstruction region on its axes by the values of its dimensions.
exportReconstructionRegion box.rcbox Export a reconstruction region to the box.rcbox file.
calculatePreviewModel Calculate 3D mesh in the preview quality.
calculateNormalModel Calculate 3D mesh in the normal quality.
calculateHighModel Calculate 3D mesh in the highest quality.
continueModelCalculation If model calculation was paused, or if there was a crash, it is possible to continue calculation using this command.

Reconstruction Examples

The examples which follow show how to run model calculations from the command line.

We will begin with a simple script that shows the first two reconstruction-region commands in function.

RealityCapture.exe -addFolder %MyPath%\Images\ -align -setReconstructionRegionAuto -exportReconstructionRegion %MyPath%\myBox.rcbox -quit

After basic alignment, it will set a reconstruction region automatically and export it to a file.
If you want to import a custom reconstruction region, you can first export it from the application by clicking on Reconstruction / Export / Reconstruction Region and then alter the values and parameters inside the .rcbox file.
The script below will open an aligned project, select the largest component, import a reconstruction region and calculate models in a preview, normal and high detail.

RealityCapture.exe -load %MyPath%\AlignedProject.rcproj -selectMaximalComponent -setReconstructionRegion %MyPath%\myBox.rcbox -calculatePreviewModel -calculateNormalModel -calculateHighModel -save %MyPath%\NewProject.rcproj -quit

TIP: In batch scripting you can break the line with ^ sign and continue the command sequence on the next line so that the CLI processes it as one line. We will demonstrate it on this example:

RealityCapture.exe -load %MyPath%\AlignedProject.rcproj^
-selectMaximalComponent -setReconstructionRegion %MyPath%\myBox.rcbox^
-calculatePreviewModel^
-calculateNormalModel^
-calculateHighModel^
-save %MyPath%\NewProject.rcproj -quit

The multiline script should do the same as the one-line script, but it is more legible and separated into logical parts.

Set Reconstruction Region on Control Points

You can use command -setReconstructionRegionOnCPs to set a reconstruction region with control points.
It is necessary to have at least three control points set to use this command. These three points will define the base plane of the reconstruction region (first two control points define the width of the region and the third one defines the length). The height of the reconstruction region can be set either by fourth control point or entering the height value (in the coordinate system’s units). This value can be negative.

Example:

RealityCapture.exe -delegateTo * -setReconRegionOnCPs CP1 CP2 CP3 50

This example will create a reconstruction region on control points CP1, CP2, and CP3 with the height 50 in the coordinate system’s units.
The order of the control points in the command defines the reconstruction region’s axes. The axes always define a right-handed system which has the origin in the first defined control point and X axis starts in the origin and goes through the second control point.

Scale the reconstruction region

Reconstruction region can be scaled on its axes based on the absolute values or multiplying factors using the command -scaleReconstructionRegion. It is also possible to choose from where it will be scaled: origin and center. The default settings for this command are set to scale the reconstruction region from the center of the region and based on the absolute values.

Example:

RealityCapture.exe -delegateTo * -scaleReconstructionRegion 1.1 1.1 1.2 center factor

This example will scale reconstruction region from the center based on the defined factors. Axes X and Y will be multiplied by the factor 1.1 and Z axis will be multiplied by the factor 1.2.

Move the reconstruction region

To move the reconstruction region the command -moveReconstructionRegion can be used.

Example:

RealityCapture.exe -delegateTo * -moveReconstructionRegion 10 10 10

When used, this example will move reconstruction region by 10 units (defined by the coordinate system) on all axes.

Rotate the reconstruction region

Rotation of the reconstruction region is executed with the command -rotateReconstructionRegion. Defined parameters needed are all in degrees.

Example:

RealityCapture.exe -delegateTo * -rotateReconstructionRegion 45 45 45

This example will rotate reconstruction region by 45 degrees on all axes, which also will be rotated.

NOTE: All commands altering lengths of reconstruction region sides are in the coordinate system’s units (scaling with the factor is an exception). With non-georeferenced projects the behavior is undefined (you can scale the coordinate system manually with distance constraints).

Offset the reconstruction region

Offset the reconstruction region with the command -offsetReconstructionRegion by the length of its sides. The parameters are relative values that serve as multiplicators.

Example:

RealityCapture.exe -delegateTo * -offsetReconstructionRegion 1 2 0.5

This example will offset the reconstruction region on the X axis by one length of its depth, on the Y axis by two lengths of its width, and on the Z axis by half of the height length. These values are applied to the reconstruction region's XYZ axes.

Precomputation of Depth Maps

To speed up the model computation process using more computers, you can precompute depth maps with the PrecomputeDepthmaps setting:

RealityCapture.exe -set "PrecomputeDepthmaps=true"

NOTE: It is necessary to set the value back to the default false for the usual performance of the preview/normal/high commands after you have finished your job.

This approach is useful when you wish to maximize GPU/CPU utilization and if you have many assets to compute, which are of almost the same size, for example numerous full-body scans. You can build two machines. One with multiple powerful GPUs but normal CPU, and the second with normal GPU but powerful CPU. Then you will need RealityCapture CLI on both machines. Having this setup, you may keep running these two pipelines in parallel:


TIP: We do not recommend sharing the cache on a network drive. We do recommend to have the cache on an SSD local drive on both computers and copy the content between them.

Continue Model Calculation

When there is an unfinished model due to a crash or model calculation was paused, it is possible to continue its calculation using the command -continueModelCalculation. To be able to use this command after a crash, auto save mode must be activated beforehand.
Command scans for unfinished models in your project, and once it encounters one it continues its calculation. Models are searched in the order from the last component to the first one, and within them from the last model to the first model.

Example (when paused):

RealityCapture.exe -load project.rcproj -continueModelCalculation

When pausing a calculation, it is possible to choose not to pause it temporarily. This will leave model in a partially computed state. This example will continue the calculation of that model if the loaded project was saved before closing.

Example (after a crash):

RealityCapture.exe -load project.rcproj recoverAutosave -continueModelCalculation

As mentioned above, auto save mode must be enabled to be able to use this command. When it is enabled, it is possible to use an optional parameter with the command -load, which is recoverAutosave. This parameter will enable RealityCapture to scan for the unfinished model.

Project and Image Commands

Manage the current project, the application itself and add images via CLI

Commands Outside Command Prompt

Using CLI with an .rccmd file

Delegation of Commands

On delegating commands into an opened instance of RealityCapture

Alignment Commands

Commands for alignment and component handling

Continue

Further model processing via the command line

Settings' Commands

Application settings and behaviour

Error Handling Commands

Commands for handling potential errors

See also: