-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1802 from smathermather/euclidean_merge_contrib
Make euclidean merge available in contrib directory
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# DEM Blending | ||
|
||
Blend sets of DEMs by calculating euclidean distance to null values and weighting the combination of elevation models. Based on the split-merge tool within ODM. | ||
|
||
Requirements: | ||
* Directory full of images to blend together | ||
* NoData should be coded as a value of -9999 | ||
|
||
## Usage | ||
|
||
```BASH | ||
docker run -ti --rm -v /home/youruser/folder_with_dems:/input --entrypoint /code/contrib/dem-blend/dem-blend.py opendronemap/odm /input | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
# Authors: Piero Toffanin, Stephen Mather | ||
# License: AGPLv3 | ||
|
||
import os | ||
import glob | ||
import sys | ||
sys.path.insert(0, os.path.join("..", "..", os.path.dirname(__file__))) | ||
|
||
import argparse | ||
import multiprocessing | ||
from opendm.dem import merge | ||
|
||
parser = argparse.ArgumentParser(description='Merge and blend DEMs using OpenDroneMap\'s approach.') | ||
parser.add_argument('input_dems', | ||
type=str, | ||
help='Path to input dems (.tif)') | ||
|
||
args = parser.parse_args() | ||
|
||
if not os.path.exists(args.input_dems): | ||
print("%s does not exist" % args.input_dems) | ||
exit(1) | ||
|
||
output_dem = os.path.join(args.input_dems, 'merged_blended_dem.tif') | ||
input_dem_path = os.path.join(args.input_dems, '*.tif') | ||
input_dems = glob.glob(input_dem_path) | ||
|
||
merge.euclidean_merge_dems(input_dems | ||
,output_dem=output_dem | ||
) |