-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
162 lines (137 loc) · 13.8 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# This is an example yaml configuration for a metashape run
#### Project-level parameters:
# Project to load. If not a blank string, this will open an existing project at the path specified. If a blank string, creates a new empty project.
# Even if opening an existing project, all processing on it is saved as a new project (path and name specified below). The original project file is not modified.
load_project: ""
# The path to the directory of flight photos
# If there are multiple photo folders, set path to the folder that contains all the photo folders,
# or provide a list of paths via the YAML list syntax (e.g., ["/path/to/photo/folder1", "/path/to/photo/folder2"])
# If there are no photos to add (e.g., this is an existing project that already has photos in it, set to an empty string ("")
photo_path: "/data/images"
# The path to a secondary directory of flight photos, which are only aligned to the project *after*
# all the other processing is done. This is useful if you want to use secondary photos for multiview
# analyses (e.g., species ID) without affecting the photogrammetry. Note that the secondary photos
# are processed in the same way as the primary (e.g., same resolution, same procedure regarding
# separate calibration per path) and that align_photos:reset_alignment must be False and
# align_photos:keep_keypoints must be True. If there are no secondary photos to add, set to an empty
# string ("").
photo_path_secondary: ""
# Path for exports (e.g., points, DSM, orthomosaic) and processing log. Will be created if does not exist.
output_path: "/data/output"
# Path to save Metashape project file (.psx). Will be created if does not exist
project_path: "/data/project"
# The identifier for the run. Will be used in naming output files. Recommended to include a photoset name and processing parameter set name.
# Optionally, set it to an empty string ("") to use the config file name (minus extension) as the run name
run_name: "test_run"
# CRS EPSG code that project outputs should be in (projection should be in meter units and intended for the project area)
project_crs: "EPSG::26912" # 26910 is UTM 10N
# Enable metashape "fine-level task subdivision" which reduces memory use by breaking processing into independent chunks that are run in series.
# Assuming there's enough memory, it seems to run 10-20% faster by disabling subdividing. But large projects can run out memory and fail if subdivide is not enabled.
subdivide_task: True
# Should CUDA GPU driver be used? Alternative is OpenCL. Metashape uses CUDA by default but we have observed it can cause crashes on HPC infrastructure.
use_cuda: True
# What value to use for the Metashape tweak "depth_max_gpu_multiplier"? May help to mitigate GPU errors per: https://www.agisoft.com/forum/index.php?topic=11771.0, but doesn't appear to do anything per our testing. Metashape default is 2.
gpu_multiplier: 2
#### Processing parameters:
## Steps can be run or skipped using the 'enabled' parameter. If enabled == False, everything else in the step is irrelevant.
## The metashape functions powering each of these steps are listed in the comments in parentheses.
## Refer to Metashape documentation for full parameter definitions: https://www.agisoft.com/pdf/metashape_python_api_1_5_0.pdf
## Parameter names here generally follow the parameter names of the Metashape functions.
# Should the photos at the path(s) listed above be added to the project? Can disable if, for
# example, you only want to add GCPs (or do additional processing) to an existing project.
addPhotos: # (Metashape: addPhotos)
enabled: True # This applies to the main photos specified in photo_path above. Secondary photos are always added and aligned if a path (or paths) is provided.
separate_calibration_per_path: False # If True, each photo path (i.e. each element in the list supplied to 'photo_path' above) will be calibrated independently. Regardless whether True or False, separate camera *models* are calibrated separately; if True, identical camera *models* are calibrated separately if they are provided as separate paths. This addresses the case where two different instances of the same camera model are used in the same project. Note that when True, the logic for assigning separate calibration to each path assumes that the same camera is used for all photos in the path.
multispectral: False # Is this a multispectral photo set? If RGB, set to False.
use_rtk: True # Whether to use image EXIF RTK flags to make image geospatial accuracy more precise. If enabled but photos don't have RTK data, will treat them as regular photos and use the nofix accuracy.
fix_accuracy: 3 # Accuracy to set for photos that have a RTK fix, in units of the CRS
nofix_accuracy: 25 # Accuracy to set for photos that have no fix, in units of the CRS
calibrateReflectance: # (Metahsape: calibrateReflectance)
enabled: False
panel_filename: "RP04-1923118-OB.csv" # The calibration file must be in the "calibration" folder in the top-level project photos directory. See example panel calibration file in the calibration directory of project repo.
use_reflectance_panels: True
use_sun_sensor: True
alignPhotos: # (Metashape: matchPhotos, alignCameras)
enabled: True
downscale: 16 # How much to coarsen the photos when searching for tie points. Higher number for blurrier photos or when there are small surfaces that may move between photos (such as leaves). Accepts numbers 2^x (and zero) (https://www.agisoft.com/forum/index.php?topic=11697.0).
adaptive_fitting: True # Should the camera lens model be fit at the same time as aligning photos?
keep_keypoints: True # Should keypoints from matching photos be stored in the project? Required if you later want to add more photos and align them to the previously aligned photos without redoing the original alignment.
reset_alignment: False # When running an alignment, if any of the photos were already aligned, should we keep that alignment? Or reset it so we align everything anew?
generic_preselection: True # When matching photos, use a much-coarsened version of each photo to narrow down the potential neighbors to pair? Works well if the photos have high altitude above the surface and high overlap (e.g. a 120m nadir 90/90 overlap mission), but doesn't work well for low-altitude and/or highly oblique photos (e.g. a 80m 25deg pitch 80/80 overlap mission)
reference_preselection: True # When matching photos, use the camera location data to narrow down the potential neighbors to pair?
reference_preselection_mode: Metashape.ReferencePreselectionSource # When matching photos, use the camera location data to narrow down the potential neighbors to pair?
# To use GCPs, a 'gcps' folder must exist in the root of the photo folder provided in photo_path
# above (or the first folder, if a list is passed). The contents of the 'gcps' folder are created by
# the prep_gcps.R script. See readme: https://github.com/ucdavis/metashape
addGCPs:
enabled: False
gcp_crs: "EPSG::26910" # CRS EPSG code of GCP coordinates. 26910 (UTM 10 N) is the CRS of the sample RGB photoset.
marker_location_accuracy: 0.1 # Accuracy of GCPs real-world coordinates, in meters.
marker_projection_accuracy: 8 # Accuracy of the identified locations of the GCPs within the images, in pixels.
optimize_w_gcps_only: True # Optimize alignment using GCPs only: required for GCP locations to take precedence over photo GPS data. Disabling it makes GCPs essentially irrelevant.
filterPointsUSGS:
enabled: False
rec_thresh_percent: 20
rec_thresh_absolute: 15
proj_thresh_percent: 30
proj_thresh_absolute: 2
reproj_thresh_percent: 5
reproj_thresh_absolute: 0.3
optimizeCameras: # (Metashape: optimizeCameras)
enabled: False
adaptive_fitting: True # Should the camera lens model be fit at the same time as optimizing photos?
export: True # Export the camera locations, now updated from the initial alignment
# Should an xml file specifying estimated camera locations (transform matrices) be exported? If
# enabled, it is exported once after all alignment-related steps (e.g., align, fliter points,
# optimize cameras) -- even if these steps are disabled -- and then again after aligning the
# secondary set of locations (if performed), overwriting the first file
exportCameras: # (Metashape: exportCameras)
enabled: True
buildDepthMaps: # (Metashape: buildDepthMaps)
enabled: True
downscale: 16 # How much to coarsen the photos when searching for matches to build the point cloud. For large photosets, values < 4 likely take prohibitively long. Accepts numbers 2^x (https://www.agisoft.com/forum/index.php?topic=11697.0).
filter_mode: Metashape.ModerateFiltering # How to filter the depth map. Options are NoFiltering, MildFiltering, ModerateFiltering, AggressiveFiltering. Aggressive filtering removes detail and makes worse DEMs (at least for forest). NoFiltering takes very long. In trials, it never completed.
reuse_depth: False # Purpose unknown.
max_neighbors: 60 # Maximum number of neighboring photos to use for estimating depth map. Higher numbers may increase accuracy but dramatically increase processing time.
buildPointCloud: # (Metashape: buildPointCloud, (optionally) classifyGroundPoints, and exportPoints)
enabled: True
keep_depth: True # If False, removes depth maps from project data after building point cloud
max_neighbors: 60 # Maximum number of neighboring photos to use for estimating point cloud. Higher numbers may increase accuracy but dramatically increase processing time.
classify_ground_points: True # Should ground points be classified as a part of this step? Must be enabled (either here or in buildDem, below) if a digital terrain model (DTM) is needed either for orthomosaic or DTM export. Enabling here is an alternative to enabling as a component of buildDem (below). It depends on which stage you want the classification to be done at. If you already have a point cloud but it's unclassified, then don't do it as part of this stage as it would require computing the point cloud again.
export: True # Whether to export point cloud file.
classes: "ALL" # Point classes to export. Must be a list. Or can set to "ALL" to use all points. An example of a specific class is: Metashape.PointClass.Ground
remove_after_export: False # Remove point cloud from project after export of all dependencies (DEMs) to reduce the metashape project file size
classifyGroundPoints: # (Metashape: classifyGroundPoints) # classify points, IF SPECIFIED as a component of buildPointCloud (above) or buildDem (below). Must be enabled (in either location) if a digital terrain model (DTM) is needed either for orthomosaic or DTM export. Definitions here: https://www.agisoft.com/forum/index.php?topic=9328.0
max_angle: 15.0
max_distance: 1.0
cell_size: 50.0
buildModel:
enabled: False
face_count: "Metashape.MediumFaceCount" # How many faces to use, Metashape.LowFaceCount, MediumFaceCount, HighFaceCount, CustomFaceCount
face_count_custom: 100000 # Only used if custom number of faces set (above).
export_local: True # Export the model in local coordinates
export_transform: False # Export the transform matrix for local model coords -> global coords
export_georeferenced: True # Export the georeferenced model. If there's no georeferencing it will be the same as local
export_extension: "ply" # Can be any supported 3D model extension
buildDem: # (Metashape: buildDem, (optionally) classifyGroundPoints, exportRaster)
enabled: True
classify_ground_points: False # Should ground points be classified as part of this step? Note that an alternative is to calculate them as a part of buildPointCloud (above)
surface: ["DSM-ptcloud"] # Options: "DTM-ptcloud", "DSM-ptcloud", and/or "DSM-mesh". Type of DEM to export and data to build it from (digital terrain model or digital surface model, and from point cloud or mesh)
resolution: 0 # DSM resolution. Only affects DSM built using the mesh (other DSM types are set by Metashape and not customizable). Note that this also sets the resolution of the orthomosaic built from this DSM, which is 1/4 of the DSM resolution. If using a mesh-derived DSM, and you also desire an orthomosaic with maximal detail, set the DEM resolution to 4x your GSD. Set to 0 to use Metashape-determined default.
export: True # Whether to export DEM(s)
tiff_big: True # Use BigTIFF format? Required for larger projects with large DEMs
tiff_tiled: False # Use tiled TIFF? This is related to internal file architecture.
nodata: -32767 # Value used to represent nodata.
tiff_overviews: True # Include coarse-scale raster data in file for quick display in GIS.
buildOrthomosaic: # (Metashape: buildOrthomosaic, exportRaster)
enabled: False
surface: ["DSM-ptcloud"] # Options: "DTM-ptcloud", "DSM-ptcloud", "DSM-mesh", and/or "Mesh". The surface to build the orthomosaic onto. DTM and DSM refer to elevation models built by Metashape and must be configured to be computed via buildDem, above. Mesh refers to using the mesh model directly rather than first computing a DEM.
blending: Metashape.MosaicBlending # Photo blending mode. Options include AverageBlending, MosaicBlending, MinBlending, MaxBlending, DisabledBlending
fill_holes: True # Fill holes in orthomosaic where no photo data exist by interpolating?
refine_seamlines: True # Use smart algorithm to identify photo seamlines where they will least distort.
export: True # Whether to export orthomosaic(s)
tiff_big: True # Use BigTIFF format? Required for larger projects with large DEMs
tiff_tiled: True # Use tiled TIFF? This is related to internal file architecture. Tiled may be (semi-)equivalent to COG.
nodata: -32767 # Value used to represent nodata.
tiff_overviews: True # Include coarse-scale raster data in file for quick display in GIS.
remove_after_export: True # Remove orthomosaic from project after export to reduce the metashape project file size