## 3 Data and Methods
### DEM Generation with the Ames Stereo Pipeline
#### 3.2.2 Stereo-Correlation Algorithms and Parameters
Many computer vision applications of SGM or MGM involve searching in 1D along epipolar lines from the rectified images. However, the ASP implements a 2D disparity search, which is more computationally expensive, but also more flexible and helps find matches in map-projected images when the alignment along the image y-axis (rows of pixels) is imperfect. In initial tests using both the MGM and BM algorithms, we used a small clip of the full PAN SPOT6 images and processed them iteratively by changing parameters suggested in the ASP documentation, and in the online ASP forum: [[https://groups.google.com/g/ames-stereo-pipeline-support](https://groups.google.com/g/ames-stereo-pipeline-support)]([https://groups.google.com/g/ames-stereo-pipeline-support](https://groups.google.com/g/ames-stereo-pipeline-support)), last accessed 28 September 2022. The resulting DEMs were checked by visual inspection of the hillshade image and through differencing DEM and dGNSS heights measured within the study area (cf. Figure S2 for dGNSS coverage). We found that the Bayes EM sub-pixel refinement approach had the best results (least hillshade artifacts, lowest differences compared to dGNSS) and used this in all further runs. We also varied some key parameters associated with filtering matches for the MGM algorithm (median-filter, texture-smooth-size, texture-smooth-scale) but found minimal differences in the outputs even doubling or halving the defaults due to the high radiometric resolution of the SPOT6 imagery (12-bit), which leads to high texture. Overall, during initial testing, we found the largest difference in results from the size of the CK and SK and the cost function (NCC or ternary census) used. For the cost functions, the BM approach is limited to the NCC method, but we saw improvement in the MGMresults when the NCC was exchanged for the ternary census. Additionally, in the ASP, the maximum allowable size of the MGM CK is 9 \(\times\) 9 pixels when using the ternary census cost function [25]. These tests and limitations led us to a detailed investigation of six final DEMs generated with the parameters listed in Table 1. Our SK sizes were selected to follow the conventions of the defaults, which are +10 pixels for BM and approximately double for MGM. Varying the SK \(\pm\)2-5 around these values did not change results appreciably. Thus far, we refer only to the correlation of image pairs (e.g., SPOT6 A and C scenes). The ASP can also accept three or more images (e.g., SPOT6 A, B, and C scenes) and carry out correlation using the chosen algorithm from the first image kept as reference to all other images. However, when using three or more images, the triangulation step takes a multi-view stereo approach, which provides worse results compared to pairwise stereo due to averaging of triangulated points from different image pairs in common locations [35]. [PERSON] et al. [35] found that stereo quality is lowest along overlapping image boundaries, but these effects may be reduced with large-swath SPOT imagery. We report on the differences between pairwise runs (e.g., SPOT6 AB pair versus AC pair) in Section 4.