Skip to content

Configuration Reference

All three pipelines share the same YAML structure: io, batch, and dic_params sections. Pass the config file to any processing script with the --config flag — see CLI & Batch Processing for the full invocation commands.

Where to find your config file:

  • Both builds — starter config files are included in the distribution ZIP (config_dic4dem.yml, config_dic4optical.yml, config_dic4webcam.yml). Edit them directly before running. In the pipeline-only build they are inside slf-dic-python/; in the QGIS + CLI build they are in sample_configs/.
  • QGIS users — you can also use the 📋 Copy Run Command button in the plugin panel to generate a config from the current settings and copy the matching shell command to the clipboard.

io — Input / Output

Key Description
base_run_tag Prefix for output folder names. Run tags are auto-appended with resolution, window size, and other parameters.
dem_primary Path to the earlier (reference) DEM.
dem_secondary Path to the later (target) DEM.
output_dir Directory where all results are written. Created automatically if it does not exist.
Key Description
base_run_tag Prefix for output folder names. Run tags are auto-appended with resolution, window size, and other parameters.
img_primary Path to the earlier (reference) image (GeoTIFF).
img_secondary Path to the later (target) image (GeoTIFF).
output_dir Directory where all results are written. Created automatically if it does not exist.
Key Description
base_run_tag Prefix for output folder names. Run tags are auto-appended with resolution, window size, and other parameters.
img_primary Path to the earlier (reference) image (JPEG, PNG, or TIFF).
img_secondary Path to the later (target) image (JPEG, PNG, or TIFF).
output_dir Directory where all results are written. Created automatically if it does not exist.

batch — Resolution & Window Size

Key Description
base_dem_res Native resolution of the input DEMs in metres per pixel.
target_resolutions List of target resolutions in metres/pixel. The input is resampled to each value before DIC. E.g. [1] = 1 m/pixel; [1, 2] also runs a coarser pass at 2 m/pixel.
window_sizes List of DIC correlation window sizes in pixels. Larger windows give smoother but coarser results. E.g. [32, 64, 128].
Key Description
base_img_res Ground sampling distance of the input images in metres per pixel.
target_resolutions List of target resolutions in metres/pixel. The input is resampled to each value before DIC. E.g. [1] = 1 m/pixel; [1, 2] also runs a coarser pass at 2 m/pixel.
window_sizes List of DIC correlation window sizes in pixels. Larger windows give smoother but coarser results. E.g. [32, 64, 128].
Key Description
base_img_res Pixel scale — keep at 1.0 for non-georeferenced images. All displacements are in pixels.
target_resolutions List of downsampling factors. [1] = native resolution; [2] = half resolution. Unlike DEM/Ortho, values here are scale factors, not metres, because base_img_res = 1.
window_sizes List of DIC correlation window sizes in pixels. Larger windows give smoother but coarser results.

dic_params — Algorithm Parameters

Key Type Default Description
rescale_results bool true When true, output GeoTIFFs are at the resampled resolution; when false, outputs are upscaled back to original resolution.
export_sparse_gpkg bool true Export the raw (non-interpolated) DIC point results to a GeoPackage file. On by default (the plugin always writes it); set false only to skip it.
sparse_only bool false Stop after the HDF5 file, the sparse GeoPackage and the outlier filters. The interpolation and the GeoTIFFs are skipped.
export_hillshade bool false Also write the multidirectional hillshade of both DEMs as DIC_input_hillshade_prim/seco_*.tif (correlation input; DEM only).
export_gradient bool false Also write gradient magnitude and direction (degrees) of the correlation input as DIC_input_gradmag_* / DIC_input_gradang_* (primary and secondary).
output_components list all Which result GeoTIFFs to write, from x, y, z, dz, xy, xyz, az, dip, ee (DEM; Ortho: x, y, xy, az, ee; Camera: x, y, xy, az, ee). Velocity rasters follow the selection. HDF5 and the sparse GeoPackage are always written.
OR 0 or 1 1 1 = orientation image; 0 = hillshade as the correlation feature.
co_f 0 or 1 0 Enable (1) or disable (0) co-registration.
co_os int 2 DFT oversampling factor used during co-registration.
coreg_method "full" / "bbox" "full" Co-registration window: full = whole image; bbox = sub-window defined by coreg_bbox.
coreg_bbox [minx, miny, maxx, maxy] — Stable-ground bounding box in the input CRS. Required when coreg_method: "bbox".
os int 4 DFT oversampling factor for subpixel displacement precision. Higher = more precise but slower.
skip_factor int 4 Controls the DIC grid density: step = window_size / skip_factor. Higher values produce a denser grid.
refcode string "EPSG:2056" Desired EPSG code for the output CRS. Normally matches the input files' actual CRS. If it doesn't, processing runs in the input files' real (detected) CRS and every output GeoTIFF is reprojected (bilinear resampling) to refcode at the end — a genuine coordinate transformation, not just a relabelled file.
auto_reproject_to_utm bool true When true, inputs with a geographic CRS (degrees) are automatically reprojected to UTM before processing.
debug_mode bool false Log per-step RAM usage and array sizes.
n_workers int 1 Number of parallel threads for the correlation step. 1 = sequential (safest).
Key Type Default Description
rescale_results bool true When true, output GeoTIFFs are at the resampled resolution; when false, outputs are upscaled back to original resolution.
OR 0 or 1 0 0 = grayscale intensity; 1 = orientation image (Dematteis et al., 2021).
co_f 0 or 1 0 Enable (1) or disable (0) co-registration.
co_os int 2 DFT oversampling factor used during co-registration.
coreg_method "full" / "bbox" "full" Co-registration window: full = whole image; bbox = sub-window defined by coreg_bbox.
coreg_bbox [minx, miny, maxx, maxy] — Bounding box for co-registration in the input CRS. Only required when coreg_method: "bbox".
export_sparse_gpkg bool true Export the raw (non-interpolated) DIC point results to a GeoPackage file. On by default (the plugin always writes it); set false only to skip it.
sparse_only bool false Stop after the HDF5 file, the sparse GeoPackage and the outlier filters. The interpolation and the GeoTIFFs are skipped.
export_gradient bool false Also write gradient magnitude and direction (degrees) of the correlation input as DIC_input_gradmag_* / DIC_input_gradang_* (primary and secondary).
output_components list all Which result GeoTIFFs to write, from x, y, z, dz, xy, xyz, az, dip, ee (DEM; Ortho: x, y, xy, az, ee; Camera: x, y, xy, az, ee). Velocity rasters follow the selection. HDF5 and the sparse GeoPackage are always written.
os int 4 DFT oversampling factor for subpixel displacement precision. Higher = more precise but slower.
skip_factor int 4 Controls the DIC grid density: step = window_size / skip_factor. Higher values produce a denser grid.
refcode string "EPSG:2056" Desired EPSG code for the output CRS. Normally matches the input files' actual CRS. If it doesn't, processing runs in the input files' real (detected) CRS and every output GeoTIFF is reprojected (bilinear resampling) to refcode at the end — a genuine coordinate transformation, not just a relabelled file.
auto_reproject_to_utm bool true When true, inputs with a geographic CRS (degrees) are automatically reprojected to UTM before processing.
debug_mode bool false Log per-step RAM usage and array sizes.
n_workers int 1 Number of parallel threads for the correlation step. 1 = sequential (safest).
Key Type Default Description
rescale_results bool true When true, output images are at the downsampled resolution; when false, outputs are at the original image resolution.
align_mode "crop" / "pad" "crop" How to handle inputs of different sizes: crop to the common area, or pad the smaller image with zeros.
co_f 0 or 1 0 Enable (1) or disable (0) co-registration. Usually disabled for camera images.
co_os int 2 DFT oversampling factor used during co-registration.
coreg_method "full" / "bbox" "full" Co-registration window: full = whole image; bbox = sub-window in pixel coordinates.
export_sparse_gpkg bool true Export the raw (non-interpolated) DIC point results to a GeoPackage (pixel coordinates, no CRS). On by default.
export_gradient bool false Also write gradient magnitude and direction (degrees) of the correlation input as DIC_input_gradmag_* / DIC_input_gradang_* (primary and secondary).
output_components list all Which result GeoTIFFs to write, from x, y, z, dz, xy, xyz, az, dip, ee (DEM; Ortho: x, y, xy, az, ee; Camera: x, y, xy, az, ee). Velocity rasters follow the selection. HDF5 and the sparse GeoPackage are always written.
OR 0 or 1 0 0 = grayscale intensity; 1 = orientation image.
os int 4 DFT oversampling factor for subpixel displacement precision.
skip_factor int 4 Controls the DIC grid density: step = window_size / skip_factor.
refcode "pixel" "pixel" Fixed — do not change. Signals non-georeferenced pixel-coordinate mode.
debug_mode bool false Log per-step RAM usage and array sizes.
n_workers int 1 Number of parallel threads for the correlation step. 1 = sequential (safest).

dic_params.VectorFilter — Post-processing

The vector filter runs after DIC to remove outliers and produce final outputs.

Key Type Default Description
Enabled bool false Master switch. Set true to enable post-processing.
OutputTxt bool false Write filtered vectors to a CSV text file.
OutputGpkg bool true Write filtered vectors to a GeoPackage.
OutputPlot bool false Save a displacement vector plot as PNG.
PlotResult bool false Show an interactive plot window. Keep false for batch/headless runs.
HillshadeTif path — Path to a DEM or hillshade raster used as the plot background.
PlotWMS bool false Fetch a web map tile background for plots (requires internet).
WMSLayer string "satellite" Swisstopo layer: "satellite", "map" or "relief" (Switzerland only).
PlotHillshade bool false Render HillshadeTif as the plot background.
PlotBackgroundXYZ bool true Overlay the 2-D displacement magnitude as a colour map behind the vectors.
BlackArrows bool true true = black arrows; false = arrows coloured by magnitude.
MaxMagnitude float 10.0 Hard cap: exclude vectors above this magnitude (map units). Set null to disable.
ColorMax float 10 Colorbar upper limit on displacement plots (map units).
BackgroundAlpha float 0.6 Opacity of the displacement colour overlay (0–1).
Downsample int 10 Plot every N-th vector arrow (reduces clutter on dense grids).
ThrMin / ThrMax float -100 / 100 Amplitude range filter: exclude vectors outside [ThrMin, ThrMax]. Set to a wide range to effectively disable.
Key Type Default Description
Enabled bool false Master switch. Set true to enable post-processing.
OutputTxt bool false Write filtered vectors to a CSV text file.
OutputGpkg bool true Write filtered vectors to a GeoPackage.
OutputPlot bool false Save a displacement vector plot as PNG.
PlotResult bool false Show an interactive plot window. Keep false for batch/headless runs.
HillshadeTif path — Path to the primary orthoimage used as the plot background.
PlotWMS bool false Fetch a web map tile background for plots (requires internet).
WMSLayer string "satellite" Swisstopo layer: "satellite", "map" or "relief" (Switzerland only).
PlotHillshade bool false Render HillshadeTif as the plot background.
PlotBackgroundXYZ bool false Overlay the 2-D displacement magnitude as a colour map behind the vectors.
BlackArrows bool false true = black arrows; false = arrows coloured by magnitude.
MaxMagnitude float 50.0 Hard cap: exclude vectors above this magnitude (map units). Set null to disable.
ColorMax float 5 Colorbar upper limit on displacement plots (map units).
BackgroundAlpha float 0.8 Opacity of the displacement colour overlay (0–1).
Downsample int 10 Plot every N-th vector arrow (reduces clutter on dense grids).
ThrMin / ThrMax float -100 / 100 Amplitude range filter: exclude vectors outside [ThrMin, ThrMax]. Set to a wide range to effectively disable.
Key Type Default Description
Enabled bool false Master switch. Set true to enable post-processing.
OutputTxt bool false Write filtered vectors to a CSV text file.
OutputGpkg bool true Write filtered vectors to a GeoPackage (pixel coordinates, no CRS).
OutputPlot bool false Save a displacement vector plot as PNG.
PlotResult bool false Show an interactive plot window. Keep false for batch/headless runs.
HillshadeTif path — Path to the primary camera frame used as the plot background.
PlotWMS bool false Always false in camera mode — no CRS available for tile requests.
PlotHillshade bool true Render HillshadeTif (the camera frame) as the plot background.
PlotBackgroundXYZ bool true Overlay the 2-D displacement magnitude as a colour map behind the vectors.
BlackArrows bool true true = black arrows; false = arrows coloured by magnitude.
MaxMagnitude float null Hard cap: exclude vectors above this magnitude (pixels). null = no limit.
ColorMax float 20 Colorbar upper limit on displacement plots (pixels).
BackgroundAlpha float 0.6 Opacity of the displacement colour overlay (0–1).
Downsample int 10 Plot every N-th vector arrow (reduces clutter on dense grids).
ThrMin / ThrMax float — Amplitude range filter: exclude vectors outside [ThrMin, ThrMax]. Often omitted in camera configs.

dic_params.AIMask — AI Segmentation Mask (Camera only)

Removes semantic regions (sky, water, snow, etc.) from results using a pretrained SegFormer model.

Key Default Description
Enabled false Master switch.
ExcludeTypes ["sky", "water"] List of semantic classes to mask out. Options: sky, water, snow, land, vegetation, buildings, mountain.
Device null Inference device: null (auto-detect), "cpu", "cuda", or "mps".
MaxInputDim 2048 Internal downscale limit for large images (pixels). The image is resized before inference, then the mask is upscaled.
DilationPixels 0 Expand mask boundaries by N pixels to catch edge fringing.
DebugSegmentation false Save a false-colour segmentation PNG and log detected class IDs.
SnowBrightnessMin 200 HSV brightness threshold for snow detection (0–255). Lower catches shadowed or dirty snow.
SnowSaturationMax 40 HSV saturation threshold for snow detection (0–255). Raise for bluish or yellowish snow.

Writes an animated GIF that alternates between the two frames, with an optional DIC overlay, for a quick visual check of the result.

Key Default Description
Enabled false Master switch.
OverlayDic true Draw the displacement as a semi-transparent heat map on the frames.
OverlayAlpha 0.5 Opacity of the overlay (0–1).
OverlayCmap "YlOrRd" Matplotlib colormap of the overlay.
OverlayVmax null Upper end of the overlay colour scale; null = automatic.
FrameDuration 600 Display time per frame in milliseconds.
MaxDim 1024 The longest image side is scaled down to this many pixels.

Complete examples

These match the starter config files shipped with the distribution. Replace all paths with your own.

Only parameters that need context beyond their name and value are annotated with — see the tables above for the full reference of every key.

io:
  base_run_tag: "MyProject_DEM"
  dem_primary:  "/path/to/dem_before.tif"
  dem_secondary: "/path/to/dem_after.tif"
  output_dir:   "/path/to/output"

batch:
  base_dem_res: 1.0          # (1)!
  target_resolutions: [1]    # (2)!
  window_sizes: [64]         # (3)!

dic_params:
  rescale_results: true
  OR: 1                      # (4)!
  co_f: 0                    # (5)!
  co_os: 2
  coreg_method: "full"       # (6)!
  # coreg_bbox: [minx, miny, maxx, maxy]
  export_sparse_gpkg: true
  export_hillshade: false
  export_gradient: false
  os: 4                      # (7)!
  skip_factor: 4             # (8)!
  refcode: "EPSG:2056"       # (9)!
  auto_reproject_to_utm: true
  debug_mode: false
  n_workers: 1

  VectorFilter:
    Enabled: false           # (10)!
    OutputTxt: false
    OutputGpkg: true
    OutputPlot: false
    PlotResult: false
    HillshadeTif: "/path/to/dem_before.tif"
    PlotWMS: false
    WMSLayer: "satellite"
    PlotHillshade: false
    PlotBackgroundXYZ: true
    BlackArrows: true
    MaxMagnitude: 10.0
    ColorMax: 10
    BackgroundAlpha: 0.6
    Downsample: 10
    ThrMin: -100
    ThrMax: 100
  1. Native pixel spacing of your input DEMs in metres. Used as the reference for resampling.
  2. Resolution(s) to resample to before running DIC. Use a list like [1, 2] to run multiple passes in one batch.
  3. Correlation window size(s) in pixels. Larger windows = smoother but spatially coarser results. Typical range: 32–256. Use a list like [32, 64, 128] for a batch sweep.
  4. Correlation feature: 1 = orientation image (recommended for DEMs — invariant to illumination); 0 = hillshade.
  5. Co-registration switch: 1 = enabled, 0 = disabled. Removes systematic offsets caused by GPS error or georeferencing inconsistency before DIC.
  6. Co-registration window: "full" uses the entire image overlap (default). Switch to "bbox" and uncomment coreg_bbox if only a small stable region is available.
  7. DFT upsampling factor for subpixel displacement precision. 4 = 0.25 px precision. Higher values increase accuracy but slow down processing.
  8. Controls output grid density: step = window_size / skip_factor. skip_factor: 4 with window_size: 64 gives a point every 16 px. Higher = denser grid.
  9. Desired output CRS. Normally matches the input DEMs' actual CRS (e.g. "EPSG:32632" for UTM zone 32N). If it doesn't match, processing runs in the DEMs' real (detected) CRS and every output GeoTIFF is reprojected (bilinear resampling) to this value at the end — a genuine coordinate transformation, not just a relabelled file.
  10. Master switch for post-processing. Set true to filter outlier vectors and produce GeoPackage / PNG outputs after DIC.
io:
  base_run_tag: "MyProject_Optical"
  img_primary:  "/path/to/ortho_before.tif"
  img_secondary: "/path/to/ortho_after.tif"
  output_dir:   "/path/to/output"

batch:
  base_img_res: 10           # (1)!
  target_resolutions: [1]
  window_sizes: [32, 64]     # (2)!

dic_params:
  rescale_results: true
  OR: 0                      # (3)!
  co_f: 0
  co_os: 2
  coreg_method: "full"       # (4)!
  # coreg_bbox: [minx, miny, maxx, maxy]
  export_sparse_gpkg: true
  export_gradient: false
  os: 4
  skip_factor: 4
  refcode: "EPSG:2056"       # (5)!
  auto_reproject_to_utm: true
  debug_mode: false
  n_workers: 1

  VectorFilter:
    Enabled: false           # (6)!
    OutputTxt: false
    OutputGpkg: true
    OutputPlot: false
    PlotResult: false
    HillshadeTif: "/path/to/ortho_before.tif"
    PlotWMS: false
    WMSLayer: "satellite"
    PlotHillshade: false
    PlotBackgroundXYZ: false
    BlackArrows: false       # (7)!
    MaxMagnitude: 50.0
    ColorMax: 5
    BackgroundAlpha: 0.8
    Downsample: 10
    ThrMin: -100
    ThrMax: 100
  1. Ground sampling distance of your input orthophotos in metres/pixel.
  2. Two window sizes in one batch run — 32 captures fine detail; 64 gives a smoother, more robust result. Compare the outputs to choose.
  3. Correlation feature: 0 = grayscale intensity (default for Ortho mode). Use 1 (orientation image) for textured scenes with strong illumination variation.
  4. Whole-image co-registration. Recommended for Ortho mode when the scene has a large stable area. Switch to "bbox" and uncomment coreg_bbox if only a small stable region is available.
  5. Desired output CRS. Normally matches the input orthophotos' actual CRS (e.g. "EPSG:32632" for UTM zone 32N). If it doesn't match, processing runs in the images' real (detected) CRS and every output GeoTIFF is reprojected (bilinear resampling) to this value at the end — a genuine coordinate transformation, not just a relabelled file.
  6. Master switch for post-processing. Set true to filter outlier vectors and produce GeoPackage / PNG outputs after DIC.
  7. false = arrows coloured by magnitude. Often looks better on orthophotos than uniform black arrows.
io:
  base_run_tag: "MyProject_Webcam"
  img_primary:  "/path/to/frame_before.jpg"
  img_secondary: "/path/to/frame_after.jpg"
  output_dir:   "/path/to/output"

batch:
  base_img_res: 1.0          # (1)!
  target_resolutions: [1]
  window_sizes: [64]

dic_params:
  rescale_results: true
  align_mode: "crop"         # (2)!
  OR: 0
  co_f: 0                    # (3)!
  co_os: 2
  coreg_method: "full"
  # coreg_bbox: [col_min, row_min, col_max, row_max]
  export_sparse_gpkg: true
  export_gradient: false
  os: 4
  skip_factor: 4
  refcode: "pixel"           # (4)!
  debug_mode: false
  n_workers: 1

  AIMask:
    Enabled: false           # (5)!
    ExcludeTypes: ["sky", "water"] # (6)!
    Device: null             # (7)!
    MaxInputDim: 2048
    DilationPixels: 0
    DebugSegmentation: false
    SnowBrightnessMin: 200
    SnowSaturationMax: 40

  BlinkGif:
    Enabled: false           # (8)!
    OverlayDic: true
    OverlayAlpha: 0.5
    OverlayCmap: "YlOrRd"
    OverlayVmax: null
    FrameDuration: 600
    MaxDim: 1024

  VectorFilter:
    Enabled: false           # (9)!
    OutputTxt: false
    OutputGpkg: true
    OutputPlot: false
    PlotResult: false
    # HillshadeTif: "/path/to/frame_before.jpg"
    PlotWMS: false
    PlotHillshade: true
    PlotBackgroundXYZ: true
    BlackArrows: true
    MaxMagnitude: null       # (10)!
    ColorMax: 20
    BackgroundAlpha: 0.6
    Downsample: 10
  1. Keep at 1.0 for non-georeferenced camera images. All outputs are in pixels, not metres.
  2. How to handle frames of different sizes: "crop" to the common area (no black borders); "pad" extends the smaller frame with zeros.
  3. Co-registration is usually disabled for camera imagery — camera position is fixed and frames are already aligned.
  4. Fixed value — do not change. Signals non-georeferenced pixel-coordinate mode throughout the pipeline.
  5. AI segmentation mask using a pretrained SegFormer model. When enabled, removes semantic regions (sky, water, snow) from DIC results.
  6. Semantic classes to exclude. Options: sky, water, snow, land, vegetation, buildings, mountain.
  7. Inference device: null = auto-detect (uses MPS on Apple Silicon, CUDA on NVIDIA GPU, falls back to CPU).
  8. Generates an animated GIF that blinks between the primary frame and the DIC overlay — useful for quick visual QC.
  9. Master switch for post-processing. Set true to filter outlier vectors and produce outputs after DIC.
  10. null = no magnitude cap. Set a value (e.g. 50.0) to hard-clip vectors above that pixel displacement.

Auto-generated run tags

Output folders are named:

{base_run_tag}_RES{res}_WIN{wi}_SKF{skip}_OR{or}_COF{co_f}[_FULL|_BBOX]_COOS{co_os}_OS{os}

The co-registration method (FULL or BBOX) is only added when co_f is 1, and a decimal point in the resolution is written as an underscore (1.0 becomes 1_0).

Example: Brienz_RES1_0_WIN64_SKF4_OR0_COF1_FULL_COOS2_OS4