Skip to content

Commit

Permalink
Merge pull request #11 from beelabhmc/fix/abspath-in-stitch
Browse files Browse the repository at this point in the history
support for relative paths in stitch.py
  • Loading branch information
aryarm authored Sep 25, 2020
2 parents 5245b90 + 59d6353 commit 6501cec
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def BuildMosaic(chunk, BlendingMode):
fill_holes=True)

def StandardWorkflow(doc, chunk, out, **kwargs):
doc.save(args.out)
doc.save(out)
chunk = doc.chunk

# Skip the chunk if it is the DEM chunk we created
Expand All @@ -188,14 +188,14 @@ def StandardWorkflow(doc, chunk, out, **kwargs):
if chunk.dense_cloud is None:
BuildDenseCloud(chunk, kwargs['Quality'], kwargs['FilterMode'])
# Must save before classification. Otherwise it fails.
doc.save(args.out)
doc.save(out)
chunk = doc.chunk
ClassifyGround(chunk, kwargs['Max_Angle'], kwargs['Cell_Size'])
doc.save(args.out)
doc.save(out)
chunk = doc.chunk
if chunk.model is None:
BuildModel(chunk)
doc.save(args.out)
doc.save(out)
chunk = doc.chunk

if chunk.elevation is None:
Expand All @@ -205,16 +205,16 @@ def StandardWorkflow(doc, chunk, out, **kwargs):
# Therefore, we need to duplicate the chunk to create DEM
new_chunk = chunk.copy(items=[PhotoScan.DataSource.DenseCloudData])
new_chunk.label = chunk.label + '_DEM'
doc.save(args.out)
doc.save(out)
BuildDEM(new_chunk)
doc.save(args.out)
doc.save(out)

# Change the active chunk back
doc.chunk = chunk

if chunk.orthomosaic is None:
BuildMosaic(chunk, kwargs['BlendingMode'])
doc.save(args.out)
doc.save(out)

def GetResolution(chunk):
if 'dense_cloud/resolution' in chunk.dense_cloud.meta:
Expand Down Expand Up @@ -345,15 +345,15 @@ def create_doc(images_path, ext=None):
# Loop for all initial chunks
for chunk in chunk_list:
doc.chunk = chunk

# Align Photo only if it is not done yet
if chunk.point_cloud is None:
AlignPhoto(chunk, Accuracy, Key_Limit, Tie_Limit)
ReduceError_RU(chunk)
ReduceError_PA(chunk)
# Do the rest when there's tie point
ReduceError_RE(chunk)
StandardWorkflow(doc, chunk, args.out,
StandardWorkflow(doc, chunk, str(Path(args.out).resolve()),
Quality=Quality, FilterMode=FilterMode,
Max_Angle=Max_Angle, Cell_Size=Cell_Size,
BlendingMode=BlendingMode)
Expand Down

0 comments on commit 6501cec

Please sign in to comment.