Ames Stereo Pipeline (ASP) Documentation

repository·master·Indexed 20 days ago

https://github.com/neogeographytoolkit/stereopipeline

An open-source suite of automated geodesy and stereogrammetry tools designed to process stereo images from satellites, rovers, and aerial cameras. ASP produces cartographic products such as digital terrain models (DTMs), ortho-projected images, and 3D models. The toolkit includes utilities for multispectral band extraction, water index computation (NDWI, RNDVI, OSI), and binary land-water mask generation.

Tokens
318.2K
Snippets
770
Records
1.1K
Agent score
70%

What's inside Ames Stereo Pipeline

  1. Overview of the rig_calibrator tool

    master

    The rig_calibrator program is used to calibrate multi-sensor rigs. It takes image and/or depth+image datasets and finds the relationships among rig sensors, the pose of each camera image, and refines sensor intrinsics.

    Key capabilities include:

    • Modeling transforms between depth and image coordinate systems for sensors with depth components.
    • Registering camera poses and sensor relationships to real-world coordinates via user-selected control points.
    • Optimizing sensor intrinsics (focal length, optical center, distortion) while keeping rig transforms or camera poses fixed, or vice versa.
    • Modeling known time offsets between sensor clocks.
    • Using a preexisting mesh as a constraint for surface reconstruction.
    • Generating textured meshes for visual inspection of alignment quality.
  2. Overview of Ames Stereo Pipeline (ASP) capabilities

    master

    The NASA Ames Stereo Pipeline (ASP) is an automated suite of geodesy and stereogrammetry tools for processing images from satellites, robotic rovers, aerial cameras, and historical imagery. It supports workflows both with and without accurate camera pose information.

    Core Functionalities:

    • 3D Terrain Creation: Stereo reconstruction and building Digital Terrain Models (DTMs).
    • Point Cloud & Geometry: Alignment of point clouds, structure-from-motion (SfM), shape-from-shading (SfS), and bundle adjustment.
    • Camera & Rig Calibration: Solving for jitter, rig calibration, and refining camera intrinsics.
    • GCP Generation: Generating Ground Control Points (GCPs) from DEMs or via specific tools.
    • GUI: A versatile GUI shell for interactive use.

    Primary Data Products:

    • Digital Terrain Models (DTMs) and ortho-projected images.
    • 3D models and textured meshes.
    • Bundle-adjusted networks of cameras and control networks.
  3. Use stereo_tile for tile processing or DEM mosaicking

    master

    The stereo_tile program is an auxiliary tool used by stereo_dist. It serves two primary purposes:

    1. Tile Processing: It runs the full stereo pipeline stages (from preprocessing through DEM creation) on a single tile, writing the results to a tile-specific subdirectory.
    2. DEM Mosaicking: It can run dem_mosaic on a single block of DEMs as part of the final mosaic step in a distributed workflow.

    When used for tile processing, you must provide a --tile-index and an input --dem file.

  4. Supported camera models in Ames Stereo Pipeline

    master

    Ames Stereo Pipeline (ASP) supports three primary categories of camera models for stereo processing:

    1. Pinhole models: A generic pinhole camera model that supports various lens distortion models corresponding to common calibration methods.
    2. Panoramic Camera Model: A more complex model designed for panoramic (optical bar) cameras.
    3. CSM Frame model: A specific model type that includes several different lens distortion implementations.

    Intrinsic and extrinsic camera parameters, including the specific lens distortion model, can be refined during the bundle adjustment process.

  5. Understand the output files generated by parallel_stereo

    master

    The parallel_stereo program generates various intermediate files throughout its processing stages (preprocessing, correlation, blending, refinement, filtering, and triangulation). These files are useful for debugging and inspecting the stereo process.

    Files are stored either at the specified output prefix location or within subdirectories corresponding to individual tiles created by parallel_stereo.

  6. What is dem2gcp and when to use it

    master

    The dem2gcp program generates Ground Control Points (GCPs) by measuring the misregistration or warping between two Digital Elevation Models (DEMs). This is used to correct inaccuracies in camera extrinsics or intrinsics (including lens distortion).

    How it works:

    1. It calculates dense disparity between an ASP-produced (warped/misregistered) DEM and a correct reference DEM.
    2. It uses interest point matches between raw images and the calculated disparity to find ground points on the warped DEM.
    3. It maps these positions to the reference DEM to create GCPs.

    Downstream usage: The resulting GCPs can be used with bundle_adjust (with intrinsics optimization) or the jitter solver to correct camera models.

  7. What is mapprojection and when to use it

    master

    Stereo correlation can fail if images have very different perspectives, steep terrain, clouds, or deep shadows. This leads to large disparity search ranges and noisy 3D results.

    Mapprojection mitigates this by projecting the left and right images onto a pre-existing, low-resolution, smooth terrain model. This makes the images more similar, improving correlation success. In this mode, ASP uses the existing model as an initial guess and improves upon it rather than creating a model from scratch.

  8. Overview of the `sfs` tool

    master

    The sfs (Shape-from-Shading) tool in ASP improves the level of detail in Digital Elevation Models (DEMs) created by ASP or other sources. It takes one or more images, camera models, and an initial DEM (at roughly the same resolution as the images) as input and returns a refined DEM.

    Key features include:

    • Support for any ASP-supported cameras (Earth and other planets).
    • Modeling of position-dependent albedo, camera exposure values, atmospheric haze, shadows, and DEM occlusions.
    • Support for various reflectance models: regular Lambertian, Lunar-Lambertian, and Hapke.
    • Ability to specify Sun information via the --sun-angles option (though ISIS and CSM cameras can often provide this automatically from camera files).

    For large-scale processing, use parallel_sfs, which parallelizes the workload by splitting the input DEM into tiles with padding, running sfs on each, and blending the results.

    sfs --sun-angles <sun_info> -i <input_dem> <camera_files> -o <output_dir>
  9. What is sparse_disp and when to use it

    master

    The sparse_disp program creates a low-resolution initial disparity (D_sub.tif) from full-resolution stereo images by computing disparity at a sparse set of pixels.

    Use Cases:

    • Difficult Terrain: It is specifically designed for terrain like snow or ice where the default seed approach (which uses subsampled images) might appear blank.
    • Speed: It provides a faster alternative to full dense correlation when a sparse set of correspondences is sufficient.
    • Standalone Sub-pixel Matching: It can be run as a standalone tool to produce sub-pixel matches with uncertainty on a uniform coarse grid at full resolution.
  10. What is multi_stereo and how does it work?

    master

    The multi_stereo program is a high-level pipeline that automates the creation of a 3D mesh from a sequence of images and camera poses. It performs the following workflow:

    1. stereo: Runs parallel_stereo to perform pairwise stereo between each image/camera and the subsequent one in the list. This produces point clouds in .tif format.
    2. pc_filter: Runs pc_filter on the produced point clouds to filter out 'blunders' (errors) based on geometric criteria. It outputs filtered point clouds in .tif and .pcd formats, and individual textured meshes in .obj format for inspection.
    3. mesh_gen: Uses voxblox_mesh to fuse the filtered .pcd point clouds into a final fused mesh in .ply format.

    Key Concept: Convergence Angles For successful stereo matching, it is critical to choose image pairs with a convergence angle of approximately 5-10 degrees. Angles that are too small lead to unreliable depth, while angles that are too large can cause stereo correlation errors due to significant scene changes between views.

    multi_stereo \
      --rig_config rig_out/rig_config.txt \
      --camera_poses rig_out/cameras.txt \
      --first_step stereo \
      --last_step mesh_gen \
      --out_dir stereo_out
  11. What is bundle adjustment and when should I use it?

    master

    Bundle adjustment is an optional optimization process used to correct errors in satellite position and orientation. It simultaneously adjusts camera properties and 3D object locations to minimize the reprojection error (the difference between estimated back-projected pixel locations and actual measured locations).

    Why use it:

    • Corrects Systematic Errors: Prevents errors in the overall position and slope of the Digital Elevation Model (DEM).
    • Prevents Distortions: Avoids "taco-shaped" or twisted DEMs caused by camera misalignment.
    • Improves Matcher Performance: In cases of severe misalignment (e.g., old mission data like Voyager or Apollo), bundle adjustment helps the internal interest point matcher and auto search range detection work correctly.
    • Consistency: Ensures observations of a single ground feature across multiple images are self-consistent.
    • Co-registration: It is the correct way to co-register DEMs with existing datasets and geodetic control networks.

    When to use it:

    • It is highly recommended for scientific analysis and publication.
    • It should be performed as an optional step after image capture but before running the parallel_stereo command.
    • It can incorporate Ground Control Points (GCPs) to improve internal consistency or align the DEM to existing products.