GSD image scale factor always 2**-N

pull/1556/head
Piero Toffanin 2022-11-27 16:43:24 -05:00
rodzic 5a129b6ef5
commit f7f94f4ff1
2 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -51,15 +51,19 @@ def image_scale_factor(target_resolution, reconstruction_json, gsd_error_estimat
:param reconstruction_json path to OpenSfM's reconstruction.json
:param gsd_error_estimate percentage of estimated error in the GSD calculation to set an upper bound on resolution.
:return A down-scale (<= 1) value to apply to images to achieve the target resolution by comparing the current GSD of the reconstruction.
If a GSD cannot be computed, it just returns 1. Returned scale values are never higher than 1.
If a GSD cannot be computed, it just returns 1. Returned scale values are never higher than 1 and are always obtained by dividing by 2 (e.g. 0.5, 0.25, etc.)
"""
gsd = opensfm_reconstruction_average_gsd(reconstruction_json, use_all_shots=has_gcp)
if gsd is not None and target_resolution > 0:
gsd = gsd * (1 + gsd_error_estimate)
return min(1, gsd / target_resolution)
isf = min(1.0, abs(gsd) / target_resolution)
ret = 0.5
while ret >= isf:
ret /= 2.0
return ret * 2.0
else:
return 1
return 1.0
def cap_resolution(resolution, reconstruction_json, gsd_error_estimate = 0.1, gsd_scaling = 1.0, ignore_gsd=False,

Wyświetl plik

@ -128,8 +128,7 @@ class ODMOpenMVSStage(types.ODM_Stage):
f.write("Optimize = 0\n")
config = [
"--sub-scene-area 6000",
# "--sub-scene-area 660000",
"--sub-scene-area 660000",
"--max-threads %s" % args.max_concurrency,
'-w "%s"' % depthmaps_dir,
"-v 0",