kopia lustrzana https://github.com/OpenDroneMap/ODM
Plug rs_correct
rodzic
f3f0d21b2a
commit
e80b89a055
|
@ -119,7 +119,7 @@ SETUP_EXTERNAL_PROJECT(GFlags ${ODM_GFlags_Version} ${ODM_BUILD_GFlags})
|
|||
# ---------------------------------------------------------------------------------------------
|
||||
# Ceres Solver
|
||||
#
|
||||
set(ODM_Ceres_Version 1.10.0)
|
||||
set(ODM_Ceres_Version 2.0.0)
|
||||
option(ODM_BUILD_Ceres "Force to build Ceres library" OFF)
|
||||
|
||||
SETUP_EXTERNAL_PROJECT(Ceres ${ODM_Ceres_Version} ${ODM_BUILD_Ceres})
|
||||
|
|
|
@ -40,15 +40,19 @@ class OSFMContext:
|
|||
|
||||
return io.file_exists(tracks_file) and io.file_exists(reconstruction_file)
|
||||
|
||||
def reconstruct(self, rerun=False):
|
||||
def create_tracks(self, rerun=False):
|
||||
tracks_file = os.path.join(self.opensfm_project_path, 'tracks.csv')
|
||||
reconstruction_file = os.path.join(self.opensfm_project_path, 'reconstruction.json')
|
||||
rs_file = self.path('rs_done.txt')
|
||||
|
||||
if not io.file_exists(tracks_file) or rerun:
|
||||
self.run('create_tracks')
|
||||
else:
|
||||
log.ODM_WARNING('Found a valid OpenSfM tracks file in: %s' % tracks_file)
|
||||
|
||||
def reconstruct(self, rolling_shutter_correct=False, rerun=False):
|
||||
# TODO: FIX calls from split-merge
|
||||
|
||||
reconstruction_file = os.path.join(self.opensfm_project_path, 'reconstruction.json')
|
||||
if not io.file_exists(reconstruction_file) or rerun:
|
||||
self.run('reconstruct')
|
||||
self.check_merge_partial_reconstructions()
|
||||
|
@ -64,6 +68,15 @@ class OSFMContext:
|
|||
"You could also try to increase the --min-num-features parameter."
|
||||
"The program will now exit.")
|
||||
|
||||
if rolling_shutter_correct:
|
||||
rs_file = self.path('rs_done.txt')
|
||||
|
||||
if not io.file_exists(rs_file) or rerun:
|
||||
self.run('rs_correct --output reconstruction.json --output-tracks tracks.csv')
|
||||
self.touch(rs_file)
|
||||
else:
|
||||
log.ODM_WARNING("Rolling shutter correction already applied")
|
||||
|
||||
def check_merge_partial_reconstructions(self):
|
||||
if self.reconstructed():
|
||||
data = DataSet(self.opensfm_project_path)
|
||||
|
|
|
@ -446,6 +446,7 @@ class ReconstructionTask(Task):
|
|||
log.ODM_INFO("Local Reconstruction %s" % octx.name())
|
||||
log.ODM_INFO("==================================")
|
||||
octx.feature_matching(self.params['rerun'])
|
||||
octx.create_tracks(self.params['rerun'])
|
||||
octx.reconstruct(self.params['rerun'])
|
||||
|
||||
def process_remote(self, done):
|
||||
|
|
|
@ -11,6 +11,8 @@ RS_DATABASE = {
|
|||
'dji fc330': 33, # Phantom 4
|
||||
'dji fc6310': 33, # Phantom 4 Professional
|
||||
|
||||
'dji fc7203': 20, # Mavic Mini v1
|
||||
|
||||
'dji fc350': 30, # Inspire 1
|
||||
|
||||
'gopro hero4 black': 30 # GoPro Hero 4 Black
|
||||
|
|
|
@ -34,7 +34,8 @@ class ODMOpenSfMStage(types.ODM_Stage):
|
|||
self.update_progress(20)
|
||||
octx.feature_matching(self.rerun())
|
||||
self.update_progress(30)
|
||||
octx.reconstruct(self.rerun())
|
||||
octx.create_tracks(self.rerun())
|
||||
octx.reconstruct(args.rolling_shutter, self.rerun())
|
||||
octx.extract_cameras(tree.path("cameras.json"), self.rerun())
|
||||
self.update_progress(70)
|
||||
|
||||
|
|
|
@ -103,7 +103,9 @@ class ODMSplitStage(types.ODM_Stage):
|
|||
if local_workflow:
|
||||
for sp in submodel_paths:
|
||||
log.ODM_INFO("Reconstructing %s" % sp)
|
||||
OSFMContext(sp).reconstruct(self.rerun())
|
||||
local_sp_octx = OSFMContext(sp)
|
||||
local_sp_octx.create_tracks(self.rerun())
|
||||
local_sp_octx.reconstruct(self.rerun())
|
||||
else:
|
||||
lre = LocalRemoteExecutor(args.sm_cluster, self.rerun())
|
||||
lre.set_projects([os.path.abspath(os.path.join(p, "..")) for p in submodel_paths])
|
||||
|
|
Ładowanie…
Reference in New Issue