RealityCapture

CLI Sample Scripts



Many features of RealityCapture can be used directly via the command line or by running a script. They are passed to the application as parameters of RealityCapture.exe and executed in a sequence.
Below you can find some sample scripts that might help you to set up scripts for your own workflows.
For the full manual regarding command-line interface, please check in-app help, section Command-line Interface.
You can find many sample datasets on which you can test these scripts here

Calculate 3D textured model

Download [26 MB]

This script consists of following processing steps:

  • load images
  • align
  • set reconstruction region automatically
  • calculate normal detail model
  • select marginal triangles
  • remove marginal triangles
  • rename selected model
  • calculate texture (and unwrap)
  • save project
  • export model
  • quit

Texture reprojection from high poly to low poly model including creating of normal and displacement maps

Download [27 MB]

This script consists of following processing steps:

  • load images
  • align
  • select a component with the most amount of cameras in it
  • automatically create a reconstruction region
  • reconstruction in normal detail
  • rename created model
  • texture created model (this will also create unwrap)
  • simplify created model to a specified number of triangles
  • rename simplified model
  • create unwrap for simplified model
  • reproject texture onto a simplified model (including creating normal and disaplacement maps)
  • select simplified model
  • export simplified model
  • save project

Delegation of commands into an open instance of RealityCapture

For more information on how to control the opened instances of RealityCapture via command line please check in-app help and search for "Delegation of commands".

Download [26 MB]

These scripts consist of following processing steps:

  • check the running instance of RealityCapture
  • load images into an open instance in batches
  • align individually-export components and XMP files
  • import components
  • calculate normal detail model, simplify, calculate texture
  • export model

Play custom sound after RealityCapture finishes the process

(just for fun)

Download [44 KB]

 

Creating orthographic projection from in a georeferenced scene

For more information on how to control the opened instances of RealityCapture via command line please check in-app help and search for "Delegation of commands".

Download [637 MB] – CLI scripts including images

These scripts consist of following processing steps:

  • load images
  • align
  • import measurements of ground control points in the images
  • import coordinates of ground control points
  • align images
  • set automatic reconstruction region
  • calculate model in normal detail
  • calculate texture
  • calculate ortho projections while loading parameters from a file
  • save the project
  • export orthographic projection
  • quit the application

Detect markers and place reconstruction region on control points

Download [4 KB]

The scripts consist of following steps:

  • open a new scene
  • add folder with images
  • detect markers with imported parameters
  • define distances
  • align
  • select a component with the most cameras
  • set reconstruction region on detected markers with a custom height
  • set ground plane to the reconstruction region
  • move reconstruction region up
  • scale reconstruction region to the absolute value from the center of the reconstruction region
  • save the project
  • quit the application

Examples of how to select images using regular expressions


Download [3 KB]

This sample will show you how to select images that meet the specific criteria defined by the regular expression. You can use this for example when selecting images from a specific folder, images that end with the number 5, etc.

In the files, you can find also an example of how to set up .rccmd file for image selection that can be used in GUI without a need to run a .bat file.

Iterative simplification in an open project


These scripts can be used to run a simplification in an already open project several times. The simplification command is delegated to an open instance of RealityCapture and executed several times. The number of iterations is defined within the script.

Download [3 KB]

The scripts consist of following steps:

  • Finding an open instance of RealityCapture (a project with a selected model is expected)
  • simplify the model by 50%
  • simplify previously created model by 50%
  • simplify previously created model by 50%

Reconstruction of the object captured from two sides using masks


In this sample you can find batch files used to mask 2 folders of images, then import all of the images with their masks and create a complete textured model.

Download [248 MB] - CLI scripts including images

The scripts consist of following steps:

  • adding the first set of images
  • detecting the markers and georeferencing the scene using ground control points
  • calculating preview mesh
  • filtering unwanted parts
  • generating masks
  • the same process repeated for the second set of images
  • importing images for both sides of the object with all the generated masks
  • aligning all images
  • calculating the mesh and creating the texture
  • exporting the model

Divide reconstruction region into columns and rows


These scripts divide the reconstruction region into smaller regions, which are defined by the chosen amount of rows and columns. This means that the reconstruction region is divided into a matrix grid, and each separated region is exported as an individual file.

Download [4 KB]

The scripts consist of following steps:

  • manually setting the number of rows and columns in the Command Prompt
  • choosing and defining overlap between divided regions in the Command Prompt
  • start processing in RealityCapture by scaling the existing reconstruction region based on the chosen amount of columns and rows
  • export the reconstruction region
  • move reconstruction region to the next column or move to the next row if all columns in the row were processed
  • repeat moving and exporting of reconstruction regions till the last column and row are finished

Repetitively check for new images in the image folder and align them with already imported images


After running this script, the folder chosen as a folder with images will constantly be checked to detect if the minimum required number of images was added to it. Once the minimum required amount is detected, images will be added to the RealityCapture instance and aligned with all previously added images.

Download [3 KB]

The scripts consist of following steps:

  • manually setting the name of the image folder in the Command Prompt
  • starting the process of checking newly added images in the image folder
  • if the amount hasn't changed, the process repeats
  • if the minimum required amount was not met, the process repeats
  • if the minimum required amount was met, images are added to RealityCapture and all images are aligned
  • process is repeated