kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #1800 from pierotofy/smcamera
Merge cameras.json in split-mergepull/1801/head v3.5.4
commit
e05e1be200
|
@ -49,7 +49,7 @@ jobs:
|
|||
run: |
|
||||
python configure.py dist --code-sign-cert-path $env:CODE_SIGN_CERT_PATH
|
||||
- name: Upload Setup File
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Setup
|
||||
path: dist\*.exe
|
||||
|
|
|
@ -81,7 +81,7 @@ jobs:
|
|||
run: |
|
||||
python configure.py dist
|
||||
- name: Upload Setup File
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Setup
|
||||
path: dist\*.exe
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
3.5.3
|
||||
3.5.4
|
||||
|
|
|
@ -148,3 +148,16 @@ def merge_geojson_shots(geojson_shots_files, output_geojson_file):
|
|||
|
||||
with open(output_geojson_file, "w") as f:
|
||||
f.write(json.dumps(result))
|
||||
|
||||
def merge_cameras(cameras_json_files, output_cameras_file):
|
||||
result = {}
|
||||
for cameras_file in cameras_json_files:
|
||||
with open(cameras_file, "r") as f:
|
||||
cameras = json.loads(f.read())
|
||||
|
||||
for cam_id in cameras:
|
||||
if not cam_id in result:
|
||||
result[cam_id] = cameras[cam_id]
|
||||
|
||||
with open(output_cameras_file, "w") as f:
|
||||
f.write(json.dumps(result))
|
||||
|
|
|
@ -15,7 +15,7 @@ from opensfm.large import metadataset
|
|||
from opendm.cropper import Cropper
|
||||
from opendm.concurrency import get_max_memory
|
||||
from opendm.remote import LocalRemoteExecutor
|
||||
from opendm.shots import merge_geojson_shots
|
||||
from opendm.shots import merge_geojson_shots, merge_cameras
|
||||
from opendm import point_cloud
|
||||
from opendm.utils import double_quote
|
||||
from opendm.tiles.tiler import generate_dem_tiles
|
||||
|
@ -337,6 +337,15 @@ class ODMMergeStage(types.ODM_Stage):
|
|||
else:
|
||||
log.ODM_WARNING("Found merged shots.geojson in %s" % tree.odm_report)
|
||||
|
||||
# Merge cameras
|
||||
cameras_json = tree.path("cameras.json")
|
||||
if not io.file_exists(cameras_json) or self.rerun():
|
||||
cameras_json_files = get_submodel_paths(tree.submodels_path, "cameras.json")
|
||||
log.ODM_INFO("Merging %s cameras.json files" % len(cameras_json_files))
|
||||
merge_cameras(cameras_json_files, cameras_json)
|
||||
else:
|
||||
log.ODM_WARNING("Found merged cameras.json in %s" % tree.root_path)
|
||||
|
||||
# Stop the pipeline short by skipping to the postprocess stage.
|
||||
# Afterwards, we're done.
|
||||
self.next_stage = self.last_stage()
|
||||
|
|
Ładowanie…
Reference in New Issue