kopia lustrzana https://github.com/OpenDroneMap/ODM
Renamed --compute-cutline
rodzic
5a06291ac3
commit
80c6670a35
|
@ -253,15 +253,6 @@ def config():
|
||||||
'Use 0 to disable cropping. '
|
'Use 0 to disable cropping. '
|
||||||
'Default: %(default)s'))
|
'Default: %(default)s'))
|
||||||
|
|
||||||
parser.add_argument('--compute-cutline',
|
|
||||||
action='store_true',
|
|
||||||
default=False,
|
|
||||||
help='Generates a polygon around the cropping area '
|
|
||||||
'that cuts the orthophoto around the edges of features. This polygon '
|
|
||||||
'can be useful for stitching seamless mosaics with multiple overlapping orthophotos. '
|
|
||||||
'Default: '
|
|
||||||
'%(default)s')
|
|
||||||
|
|
||||||
parser.add_argument('--pc-classify',
|
parser.add_argument('--pc-classify',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -434,6 +425,17 @@ def config():
|
||||||
'100 decimates ~99%% of the points. Useful for speeding up '
|
'100 decimates ~99%% of the points. Useful for speeding up '
|
||||||
'generation.\nDefault=%(default)s')
|
'generation.\nDefault=%(default)s')
|
||||||
|
|
||||||
|
parser.add_argument('--dem-euclidean-map',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help='Computes an euclidean raster map for each DEM. '
|
||||||
|
'The map reports the distance from each cell to the nearest '
|
||||||
|
'NODATA value (before any nearest neighbor hole filling takes place). '
|
||||||
|
'This can be useful to isolate the areas that have been filled with '
|
||||||
|
'nearest neighbor interpolation. '
|
||||||
|
'Default: '
|
||||||
|
'%(default)s')
|
||||||
|
|
||||||
parser.add_argument('--orthophoto-resolution',
|
parser.add_argument('--orthophoto-resolution',
|
||||||
metavar='<float > 0.0>',
|
metavar='<float > 0.0>',
|
||||||
default=5,
|
default=5,
|
||||||
|
@ -466,6 +468,15 @@ def config():
|
||||||
'https://www.gdal.org/frmt_gtiff.html for more info. '
|
'https://www.gdal.org/frmt_gtiff.html for more info. '
|
||||||
'\nDefault: %(default)s')
|
'\nDefault: %(default)s')
|
||||||
|
|
||||||
|
parser.add_argument('--orthophoto-cutline',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help='Generates a polygon around the cropping area '
|
||||||
|
'that cuts the orthophoto around the edges of features. This polygon '
|
||||||
|
'can be useful for stitching seamless mosaics with multiple overlapping orthophotos. '
|
||||||
|
'Default: '
|
||||||
|
'%(default)s')
|
||||||
|
|
||||||
parser.add_argument('--build-overviews',
|
parser.add_argument('--build-overviews',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -537,8 +548,8 @@ def config():
|
||||||
log.ODM_WARNING('--skip-3dmodel is set, but so is --use-3dmesh. --use_3dmesh will be ignored.')
|
log.ODM_WARNING('--skip-3dmodel is set, but so is --use-3dmesh. --use_3dmesh will be ignored.')
|
||||||
args.use_3dmesh = False
|
args.use_3dmesh = False
|
||||||
|
|
||||||
if args.compute_cutline and not args.crop:
|
if args.orthophoto_cutline and not args.crop:
|
||||||
log.ODM_WARNING("--compute-cutline is set, but --crop is not. --crop will be set to 0.01")
|
log.ODM_WARNING("--orthophoto-cutline is set, but --crop is not. --crop will be set to 0.01")
|
||||||
args.crop = 0.01
|
args.crop = 0.01
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
|
@ -193,7 +193,7 @@ def get_submodel_argv(args, submodels_path, submodel_name):
|
||||||
i = 1
|
i = 1
|
||||||
project_path_found = False
|
project_path_found = False
|
||||||
project_name_added = False
|
project_name_added = False
|
||||||
compute_cutline_found = False
|
orthophoto_cutline_found = False
|
||||||
|
|
||||||
# TODO: what about GCP paths?
|
# TODO: what about GCP paths?
|
||||||
|
|
||||||
|
@ -214,9 +214,9 @@ def get_submodel_argv(args, submodels_path, submodel_name):
|
||||||
result.append(submodels_path)
|
result.append(submodels_path)
|
||||||
project_path_found = True
|
project_path_found = True
|
||||||
i += 2
|
i += 2
|
||||||
elif arg == '--compute-cutline':
|
elif arg == '--orthophoto-cutline':
|
||||||
result.append(arg)
|
result.append(arg)
|
||||||
compute_cutline_found = True
|
orthophoto_cutline_found = True
|
||||||
i += 1
|
i += 1
|
||||||
elif arg == '--split':
|
elif arg == '--split':
|
||||||
i += 2
|
i += 2
|
||||||
|
@ -237,8 +237,8 @@ def get_submodel_argv(args, submodels_path, submodel_name):
|
||||||
if not project_name_added:
|
if not project_name_added:
|
||||||
result.append(submodel_name)
|
result.append(submodel_name)
|
||||||
|
|
||||||
if not compute_cutline_found:
|
if not orthophoto_cutline_found:
|
||||||
result.append("--compute-cutline")
|
result.append("--orthophoto-cutline")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ class ODMOrthoPhotoStage(types.ODM_Stage):
|
||||||
|
|
||||||
# Cutline computation, before cropping
|
# Cutline computation, before cropping
|
||||||
# We want to use the full orthophoto, not the cropped one.
|
# We want to use the full orthophoto, not the cropped one.
|
||||||
if args.compute_cutline:
|
if args.orthophoto_cutline:
|
||||||
compute_cutline(tree.odm_orthophoto_tif,
|
compute_cutline(tree.odm_orthophoto_tif,
|
||||||
bounds_file_path,
|
bounds_file_path,
|
||||||
os.path.join(tree.odm_orthophoto, "cutline.gpkg"),
|
os.path.join(tree.odm_orthophoto, "cutline.gpkg"),
|
||||||
|
|
Ładowanie…
Reference in New Issue