The footprints_to_shapes.py script automates the creation of a footprint shape layer in the active Metashape chunk. For every aligned regular camera, it calculates a four-vertex polygon (footprint) based on the sensor corners and projects them onto the available surface (Elevation, Model, Point Cloud, or Tie Points).
Key Features:
- Automatic Layer Creation: Creates a new shape group labeled
Footprints with a specific color (30, 239, 30). - Surface Detection: Automatically selects the best available surface for projection:
chunk.elevation > chunk.model > chunk.point_cloud > chunk.tie_points. - Calibration Validation: Checks sensor calibration stability at the corners. If calibration is unstable, it crops the footprint to a stable region.
- Metadata: Each generated shape is labeled with the camera's label and includes a
Photo attribute containing the camera label.
Compatibility:
This script requires Metashape Pro version 2.3.
# To use this script, run it within Metashape Pro.
# It adds a menu item to the Metashape interface:
# Scripts/Create footprint shape layer