Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Quick Start - Running Demos with Your Data
# Quick Start - TIG Image Processing & Terrain Reconstruction

TIG provides ~550 VICAR image processing commands. This guide focuses on the flagship terrain reconstruction workflow, but you can use TIG for general image processing, format conversion, enhancement, and analysis.

## Option 1: Original Demo (Temporary Container)

Expand Down Expand Up @@ -40,7 +42,7 @@ docker stop tig-mesh-demo && docker rm tig-mesh-demo

## Option 2: Native Toolkit Demo (Persistent Container)

Native-looking commands for interactive development. Container stays running.
Native-looking commands for interactive development and full VICAR access. Container stays running, providing access to all ~550 VICAR commands beyond just mesh generation.

### One-time Setup

Expand Down Expand Up @@ -229,13 +231,28 @@ cd /path/to/tig
cd vicar-native-toolkit
direnv allow

# 2. Work interactively
# 2. Work interactively with VICAR commands
cd workspace

# Generate test images
gen out=test.img nl=100 ns=100

# View image metadata
label test.img

# Image processing examples
stretch inp=test.img out=stretched.img
filter inp=test.img out=filtered.img
geom inp=test.img out=rotated.img rotate=45

# Terrain processing
marsmesh inp=pointcloud.xyz out=custom.obj

# Convert VICAR to standard formats
vicario inp=test.img out=test.png

# 3. Container stays running for next session
# Access all ~550 VICAR commands the same way
```

---
Expand Down Expand Up @@ -266,7 +283,14 @@ ls -lh terrain.obj

## Next Steps

### Terrain Reconstruction
- Read full documentation: `docs/demos/mesh-generation.md`
- Explore VICAR commands: `toolkit-shell` then `ls /usr/local/bin`
- Customize processing: Edit marsmesh/marsxyz parameters in demo scripts
- Integrate into pipelines: Use as reference for your own scripts

### General Image Processing
- Explore VICAR commands: `toolkit-shell` then `ls /usr/local/bin` (see ~550 commands)
- Image enhancement: Try `stretch`, `filter`, `hist` commands
- Format conversion: Use `vicario` for VICAR ↔ PNG/JPEG/TIFF
- Geometric operations: Experiment with `geom`, `rotate`, `size`
- Learn VICAR: See vicar-native-toolkit documentation for command usage
62 changes: 50 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
# Terrain Intelligence Generator (TIG)

Open source stereo terrain reconstruction pipeline using NASA's VICAR image processing system.
Open source VICAR image processing environment for planetary science and stereo terrain reconstruction.

## Overview

TIG provides a Docker-based execution environment for generating 3D terrain meshes from stereo camera images. Built on VICAR (Video Image Communication and Retrieval), NASA JPL's image processing system used across planetary missions. The vicar-native-toolkit provides a helper/wrapper script to interact with the TIG container.
TIG provides a containerized VICAR execution environment with ~550 image processing commands spanning enhancement, filtering, geometric transformation, format conversion, and multi-mission calibration. Built on VICAR (Video Image Communication and Retrieval), NASA JPL's general-purpose image processing system used across planetary missions since the 1960s. While TIG's flagship capability is stereo terrain reconstruction, it provides comprehensive image processing tools for planetary science workflows. The vicar-native-toolkit provides native-like CLI access to all VICAR commands.

## Features

### Terrain Reconstruction (Flagship Capability)
- **Stereo Correlation**: Generate disparity maps from stereo image pairs (marscorr, marscor3)
- **3D Point Clouds**: Convert disparity to XYZ coordinates (marsxyz)
- **Mesh Generation**: Create textured 3D surface meshes in OBJ / OpenInventor formats (marsmesh)
- **Image Conversion**: Convert VICAR images to PNG / JPEG / TIFF (vicario)
- **VISOR Calibration**: Integrates with VISOR (VICAR Institutional Stereo Observation Repository) containing M20 and many other open source mission calibrations
- **Open Source**: Community-accessible VICAR-based terrain processing
- **Terrain Analysis**: Orthoprojection, mosaicking, localization (marsmap, marsmos, marsautoloco)

### Image Processing (~550 Commands)
- **Enhancement**: Contrast stretching, filtering, dynamic range adjustment (stretch, filter)
- **Geometric Operations**: Transformations, rotation, resizing, registration (geom, rotate, size)
- **Format Conversion**: VICAR to/from PNG, JPEG, TIFF (vicario)
- **Analysis**: Histograms, statistics, pixel inspection (hist, list, label)
- **Mathematical Operations**: Image arithmetic, band math (f2)

### Multi-Mission Support
- **VISOR Integration**: 1,461 calibration files for M20, MSL, MER, Phoenix missions
- **Camera Models**: CAHVORE format support with automatic calibration lookup
- **Sample Data**: 249 sample files including stereo pairs and pre-computed XYZ

### Development Tools
- **Native Toolkit**: ~550 command wrappers for native-like CLI usage
- **Fast Execution**: Long-running container with minimal latency (~50-100ms)
- **Cross-Platform**: Linux, macOS (including Apple Silicon via emulation)

## Quick Start

Expand Down Expand Up @@ -68,21 +84,27 @@ meshlab workspace/terrain.obj

### VICAR Native Toolkit

A helper/wrapper script that provides native-like CLI usage for VICAR commands inside the TIG Docker execution environment. Features:
A wrapper system that provides native-like CLI usage for all ~550 VICAR commands inside the TIG Docker execution environment. Features:
- ✨ **One-command setup** via `make bootstrap`
- 🚀 **Fast activation** (~1 second, symlink-based wrappers)
- 🔧 **Auto-discovers** ~550 VICAR commands
- 🔧 **Auto-discovers** all ~550 VICAR commands
- 🐳 **Custom image support** via `IMAGE=` variable
- 📊 **VISOR calibration mounting** for terrain processing
- 🌐 **Full VICAR access** - not just terrain tools, but all image processing commands

📁 `vicar-native-toolkit/`
📖 [Toolkit README](vicar-native-toolkit/README.md) | [Quick Reference](vicar-native-toolkit/docs/QUICKREF.md)

### Terrain Intelligence Generator
An optimized VICAR execution environment, packaged as a Docker image with the VICAR toolset and VISOR calibration integration for stereo processing and mesh generation.
A containerized VICAR execution environment, packaged as a Docker image with the complete VICAR toolset (~550 commands), VISOR calibration integration, and optimized runtime for both interactive and batch processing workflows.
- 📁 `terrain-intelligence-generator/docker/`
- 📖 [Getting Started](docs/getting-started.md)

**Image Variants:**
- **`tig:opensource`** (~2GB) - Complete VICAR system with 976 commands
- **`tig:geocal`** (~3-4GB) - VICAR + GeoCal geometric calibration & bundle adjustment
- 📖 [GeoCal Integration Guide](docs/geocal-integration.md)

### VISOR (VICAR Institutional Stereo Observation Repository)
Open source repository containing camera calibration files for multiple missions including M20 (Mars 2020), MER, MSL, and others. TIG integrates with VISOR for accurate stereo processing.

Expand All @@ -101,13 +123,29 @@ Example workflows for stereo mesh generation.

## Key Tools

### Terrain Reconstruction Pipeline
| Tool | Purpose | Input | Output |
|------|---------|-------|--------|
| `marscorr` | Initial stereo correlation | Stereo pair | Disparity map |
| `marscor3` | Disparity refinement | Disparity + images | Refined disparity |
| `marsxyz` | 3D point generation | Disparity + images | XYZ point cloud |
| `marsmesh` | Surface triangulation | XYZ + texture | 3D mesh (OBJ) |
| `vicario` | Format conversion | VICAR image | PNG/JPEG/TIFF |
| `marsmap` | Orthoprojection | Images + geometry | Map-projected images |

### Image Processing Commands (~550 Available)
| Tool | Purpose | Category |
|------|---------|----------|
| `vicario` | VICAR ↔ PNG/JPEG/TIFF | Format conversion |
| `gen` | Generate test images | Development |
| `stretch` | Contrast adjustment | Enhancement |
| `filter` | Spatial filtering | Enhancement |
| `geom` | Geometric transformation | Geometric |
| `hist` | Histogram analysis | Analysis |
| `label` | VICAR metadata viewer | Metadata |
| `list` | Pixel value display | Analysis |
| `f2` | Image arithmetic | Mathematical |

*TIG provides ~550 total VICAR commands. Above shows representative examples.*

## Requirements

Expand Down Expand Up @@ -136,18 +174,18 @@ tig/
## Contributing

Contributions welcome! This project uses:
- **VICAR**: JPL's MIPL image processing system
- **VICAR**: JPL's MIPL general-purpose image processing system (~550 commands)
- **Docker**: Containerized VICAR execution environment
- **VISOR**: Open source calibration repository for multiple missions
- **Open Source**: Community-driven terrain processing tools
- **Open Source**: Community-driven planetary image processing and terrain reconstruction tools

## License

Apache License 2.0 (see LICENSE file)

## About VICAR

VICAR (Video Image Communication and Retrieval) is a general-purpose image processing system developed by NASA JPL's Multimission Image Processing Laboratory (MIPL). Used for processing images from Mars rovers, lunar missions, and deep space probes since the 1960s.
VICAR (Video Image Communication and Retrieval) is a general-purpose image processing system developed by NASA JPL's Multimission Image Processing Laboratory (MIPL). Used for processing images from Mars rovers, lunar missions, and deep space probes since the 1960s. VICAR provides comprehensive image processing capabilities including enhancement, filtering, geometric transformation, radiometric calibration, stereo reconstruction, and format conversion. TIG makes this powerful system accessible through modern containerization.

## Acknowledgments

Expand Down
11 changes: 5 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# TIG Documentation

Documentation for the **Terrain Intelligence Generator (TIG)** — Mars 2020 stereo
terrain reconstruction using VICAR MARS tools.
Documentation for the **Terrain Intelligence Generator (TIG)** — a containerized VICAR image processing environment with ~550 commands for planetary image analysis, enhancement, transformation, and stereo terrain reconstruction.

New here? Start with **[Getting Started](getting-started.md)**.

## Contents

### Getting Started
- **[Getting Started](getting-started.md)** — Prerequisites, installation, and your first mesh-generation demo.
- **[Getting Started](getting-started.md)** — Prerequisites, installation, and your first demo.

### Demos
- **[Mesh Generation](demos/mesh-generation.md)** — Mars 2020 NavCam stereo terrain reconstruction walkthrough.
- **[Mesh Generation](demos/mesh-generation.md)** — Mars 2020 NavCam stereo terrain reconstruction walkthrough (flagship capability).
- **[Demo Commands](demos/commands.md)** — Complete VICAR pipeline using direct Docker commands.
- **[Downloading VISOR Data](demos/downloading-visor-data.md)** — Obtaining calibration and sample data from VICAR releases.

### Architecture
- **[Components](architecture/components.md)** — Overview of the TIG system components.
- **[Components](architecture/components.md)** — Overview of the TIG system components and VICAR capabilities.

### Reference
- **[Vicario](reference/vicario.md)** — Java VicarIO library for VICAR image-format conversion.

## Related

- **[Project README](../README.md)** — Top-level project overview.
- **[vicar-native-toolkit](../vicar-native-toolkit/README.md)** — Native-like command execution for VICAR tools.
- **[vicar-native-toolkit](../vicar-native-toolkit/README.md)** — Native-like command execution for all ~550 VICAR tools.
- **[Quick Reference](../vicar-native-toolkit/docs/QUICKREF.md)** — Toolkit command cheat sheet.
77 changes: 52 additions & 25 deletions docs/architecture/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TIG Architecture

Overview of the Terrain Intelligence Generator system components.
Overview of the Terrain Intelligence Generator system components and VICAR image processing environment.

## System Components

Expand All @@ -10,30 +10,37 @@ Overview of the Terrain Intelligence Generator system components.
├─────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ VICAR │ │ MARS Tools │ │ Vicario │ │
│ │ Programs │ │ │ │ (Java JAR) │ │
│ │ (~540) │ │ marscorr │ │ │ │
│ │ │ │ marscor3 │ │ Image │ │
│ │ gen │ │ marsxyz │ │ Converter │ │
│ │ label │ │ marsmesh │ │ │ │
│ │ list │ │ marsmap │ │ VICAR→PNG │ │
│ │ Commands │ │ (~74) │ │ (Java JAR) │ │
│ │ (~550) │ │ │ │ │ │
│ │ │ │ marscorr │ │ Image │ │
│ │ gen │ │ marscor3 │ │ Converter │ │
│ │ label │ │ marsxyz │ │ │ │
│ │ stretch │ │ marsmesh │ │ VICAR→PNG │ │
│ │ filter │ │ marsmap │ │ PNG→VICAR │ │
│ │ geom │ │ marsmos │ │ │ │
│ │ hist │ │ + 68 more │ │ │ │
│ │ + ~540 │ │ │ │ │ │
│ └─────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ M2020 Calibration Data │ │
│ │ - Camera models (NavCam, Mastcam-Z) │ │
│ │ Multi-Mission Calibration Data (VISOR) │ │
│ │ - M20, MSL, MER, Phoenix camera models │ │
│ │ - Flat field corrections │ │
│ │ - Geometric distortion models │ │
│ │ - 1,461 calibration files │ │
│ │ - 249 sample data files │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
Input Images Processing Output Meshes
(VICAR .VIC) (Workspace) (OBJ, PNG, XYZ)
Input Images Processing Output Files
(VICAR .VIC) (Workspace) (OBJ, PNG, VICAR, etc.)
```
```

## Processing Pipeline

### Full Correlation Pipeline
### Full Stereo Terrain Reconstruction Pipeline (Flagship Capability)

```
Stereo Pair (L/R .VIC)
Expand Down Expand Up @@ -68,13 +75,20 @@ XYZ Point Cloud (.IMG)

## Core Tools

### VICAR Programs
- **Base**: Full VICAR image processing suite (~540 CLI wrappers on `PATH`)
### VICAR Commands (~550 Available)
- **Base**: Full VICAR image processing suite for planetary science
- **Categories**:
- **Image Generation**: gen, copy
- **Enhancement**: stretch, filter, histogram equalization
- **Geometric**: geom, rotate, size, registration
- **Analysis**: hist, list, label, statistics
- **Mathematical**: f2 (image arithmetic), band operations
- **Multispectral**: band manipulation, transformations
- **Location**: `/usr/local/bin/` (wrappers) → `/usr/local/vicar/dev/`
- **Runtime**: TAE (Terminal Application Executive)

### MARS Tools
Specialized Mars terrain processing:
### MARS Terrain Tools (~74 Commands)
Specialized Mars terrain processing suite:

| Tool | Function | Input | Output |
|------|----------|-------|--------|
Expand All @@ -83,14 +97,18 @@ Specialized Mars terrain processing:
| marsxyz | 3D triangulation | Disparity + images | XYZ point cloud |
| marsmesh | Surface meshing | XYZ + texture | OBJ mesh |
| marsmap | Orthoprojection | XYZ | Map projection |
| marsmos | Mosaicking | Multiple images | Panorama |
| marsautotie | Tie point detection | Image pair | Tie points |
| marsrfilt | Rover filtering | XYZ | Filtered XYZ |

### Vicario (Java)
- **Purpose**: VICAR format conversion
- **Purpose**: VICAR format conversion (VICAR ↔ standard formats)
- **Technology**: Java 11 + Java Advanced Imaging
- **Features**:
- Dynamic range rescaling (16-bit → 8-bit)
- Format support: PNG, JPEG, TIFF
- Format support: PNG, JPEG, TIFF (read and write)
- Proper VICAR label parsing
- Bidirectional conversion

## Data Flow

Expand Down Expand Up @@ -127,7 +145,7 @@ Specialized Mars terrain processing:

## Calibration Data

### M2020 Calibration Structure
### Multi-Mission Calibration Structure (VISOR Integration)

```
mars_calibration_m20/
Expand All @@ -136,11 +154,20 @@ mars_calibration_m20/
│ ├── M20_SN_0102.cahvore # NavCam Right
│ ├── ZL*.cahvore # Mastcam-Z Left
│ └── ZR*.cahvore # Mastcam-Z Right

mars_calibration_msl/
mars_calibration_mer/
mars_calibration_phoenix/
├── camera_models/
├── flat_fields/
│ └── *.parms # Flat field corrections
└── param_files/
├── M20_camera_mapping.xml
└── MSL_camera_mapping.xml
├── MSL_camera_mapping.xml
└── MER_camera_mapping.xml

Total: 1,461 calibration files across all missions
249 sample data files
```

### Camera Models
Expand All @@ -157,18 +184,18 @@ Base Layer: Oracle Linux 8
Builder Stage: downloads pre-built VICAR + external library releases
Runtime Layer: VICAR binaries + MARS tools + Java + vicario.jar + calibration
Runtime Layer: VICAR binaries (~550 commands) + MARS tools (~74) + Java + vicario.jar + multi-mission calibration
Command Wrappers: ~540 CLI wrappers generated under /usr/local/bin
Command Wrappers: ~550 CLI wrappers generated under /usr/local/bin
Entry Point: Shell with VICAR environment
```

### Volume Mounts

- `/workspace` - Input/output files
- `/usr/local/vicar/mars_calib` - M2020 calibration (read-only)
- `/usr/local/vicar/visor_data` - Sample data (optional)
- `/workspace` - Input/output files (VICAR images, meshes, point clouds, processed data)
- `/usr/local/vicar/mars_calib` - Multi-mission calibration data (M20, MSL, MER, Phoenix) (read-only)
- `/usr/local/vicar/visor_data` - Sample data files (optional)

### Environment Variables

Expand Down
Loading
Loading