Quick setup guide for TIG - a VICAR image processing environment with 546 commands. This guide demonstrates the flagship stereo terrain reconstruction workflow.
- A container runtime: Docker, Podman, nerdctl or Finch
- Python 3.9+
- 8GB RAM minimum (16GB recommended)
- M2020 stereo images (NavCam or Mastcam-Z)
On macOS the runtime is a virtual machine and the GUI tools need XQuartz, so follow Installing on macOS instead of the steps below.
pip install tig-cli
tig gen test.vic 64 64 # pulls the image on first usetig runs any VICAR tool inside the container, translating paths so files in
your current directory and home directory just work:
tig label -list inp=image.vic
tig vicario image.vic image.pngTo build the image yourself instead of using the published one, see the TIG VICAR image.
Get M2020 stereo images from PDS or use sample data:
# Sample NavCam stereo pair locations:
# Left: NLM_<SCLK>_*FDR_*.VIC
# Right: NRM_<SCLK>_*FDR_*.VIC./demo-mesh-generation-with-xyz.sh \
--stereo-left /path/to/left.VIC \
--stereo-right /path/to/right.VICProcessing time: ~10 minutes for 1280x960 images
# Check output
ls workspace/
# terrain.obj - 3D mesh (~273M)
# terrain.mtl - Material file
# texture.png - Texture (1280x960)
# pointcloud.xyz - XYZ data (~15M)
# View mesh
meshlab workspace/terrain.obj
# or
blender workspace/terrain.obj-
Stereo Correlation (marscorr + marscor3)
- Matches features between left/right images
- Generates disparity map
- ~8 minutes
-
XYZ Generation (marsxyz)
- Converts disparity to 3D coordinates
- Filters outliers
- ~1 minute
-
Mesh Creation (marsmesh)
- Triangulates point cloud
- Applies texture
- ~30 seconds
-
Format Conversion (vicario)
- Converts VICAR to PNG
- <1 second
tig reuses one container across runs. To start clean:
tig --status # what is running
tig --shutdown # remove itno additional memory availableSolution: Increase Docker memory limit to 16GB or use lower resolution images
ERROR: MARS calibration not foundSolution: Point MARS_CONFIG_PATH at your calibration directory; see
Calibration Data.
- Mesh Generation Demo - Detailed walkthrough
- Command Reference - Available VICAR tools
- Vicario Reference - Image format conversion
- tig-cli - Running any of the 546 VICAR commands, config, X11, shims
export MARS_CONFIG_PATH=/path/to/calibtig mounts it read-only at /usr/local/vicar/mars_calib; see
Calibration Data.
Skip correlation if you have XYZ files:
./demo-mesh-generation-with-xyz.sh \
--xyz pointcloud.IMG \
--texture image.IMGSee demos/mesh-generation.md for details.