Skip to content

Mapping

Our mapping system is designed to create panoramic aerial maps from a stream of images captured during missions. Most of the mapping work comes directly from OpenCV's Stitcher class. Mapping currently operates after all airdrops have been completed, typically during the manual landing phase of the mission.

Two-Pass Incremental Processing Architecture

We employ a two-pass approach designed to handle large volumes of images while managing memory constraints and processing efficiency.

Pass 1: Incremental Chunk Processing

1. Image Discovery and Sorting

  • The system continuously scans a designated input directory for new aerial images
  • Automatically sorts images by filename to ensure chronological processing order
  • Tracks previously processed images to avoid reprocessing the same data

2. Image Preprocessing Pipeline

  • Custom Cropping: Removes artifacts from camera processing (specifically a 20-pixel green bar from camera output)
  • Resizing: Downscales images while preserving aspect ratios to optimize processing speed and memory usage

3. Chunking Strategy with Overlap

  • Divides the new images into smaller, manageable chunks (typically 5 images per chunk) with overlap between consecutive chunks (typically 2 images overlap)
  • This overlap ensures seamless transitions between chunk boundaries in the final panorama

4. Individual Chunk Stitching

  • Each chunk is processed independently via OpenCV's Stitcher class with some preprocessing
  • We utilize feature detection and matching to align overlapping areas between images and apply geometric transformations to create seamless panoramic segments

Pass 2: Final Panorama Assembly

5. Chunk Discovery and Loading

  • Scans the timestamped output directory for all previously created chunk files from the first pass.
  • Loads only the stitched chunk images (not original raw images)
  • Significantly reduces memory requirements as chunks are already optimized panoramic segments

6. Global Panorama Stitching

  • Treats each chunk as a "super-image" and applies stitching algorithms across chunks
  • Performs final geometric alignment and blending across chunk boundaries
  • Creates the complete panoramic map from all processed chunks

Memory Optimization Strategy

Since our flight computer is an Nvidia Jetson Nano, we implemented several memory optimization techniques to help with the processing:

  • Streaming Processing: Never loads all images simultaneously
  • Immediate Disposal: Frees memory as soon as data is no longer needed
  • Disk-Based Intermediate Storage: Uses storage instead of RAM for intermediate results
  • Chunked Loading: Only loads the necessary data for the current processing step

Incremental Processing Benefits

The two-pass approach provides us with several advantages:

  • Scalability: Can handle an unlimited number of input images
  • Resilience: Partial results are preserved if processing is interrupted
  • Efficiency: Optimal use of available computational resources
  • Real-time Capability: Can process new images as they arrive during flight