
Camera optimization is performed between each iteration to improve the camera lens model using the newly filtered subset of higher-quality sparse point matches. The third filter, Reprojection Error (Re), is applied in an iterative fashion such that only a fraction (default is 10%) of the total sparse points is selected and deleted within an iteration. Once the required percentage of sparse points is selected, the points are deleted and camera optimization is performed. The default is for each filter to select 50% of the sparse points, but this percentage can be changed by the user.

Although initial target filter values can be supplied by the user, the final filter values will be determined by the value required to select a pre-defined percentage of the sparse points. After initial image alignment, two filters (Reconstruction Uncertainty, and Projection Accuracy ) are applied sequentially to a point cloud with camera optimization performed after each filter. The script allows users to align imagery and apply different gradual selection filters to reduce errors in sparse point clouds. Legacy versions of this script which implement a previous version (version 1.0) of the workflow are available in the legacy_scripts directory within this repository. The error reduction technique and sparse point cloud gradual selection filter values were developed with the goal of maintaining the accuracies of traditional photogrammetric processes with newer techniques supported by structure from motion (SfM) based software.

The workflow involves the application of gradual selection filters to reduce errors in sparse point clouds, and improve camera lens models and camera position estimates. Geological Survey Open-File Report 2021-1039 (Over et al., 2021). The current version of the script (version 2.0) approximates the workflow described in U.S. This repository contains python scripts which automate image alignment and sparse point cloud error reduction in the Agisoft Metashape/Photoscan structure from motion photogrammetry software package using the Agisoft Metashape Python API.
