Skip to content

Commit

Permalink
[bin] meshroom_photogrammetry: add explicit check if no image found
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Sep 26, 2019
1 parent 9a473ad commit ab7b940
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/meshroom_photogrammetry
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,24 @@ views, intrinsics = [], []
# Build image files list from inputImages arguments
images = []

hasSearchedForImages = False

if args.input:
if len(args.input) == 1 and os.path.isfile(args.input[0]) and os.path.splitext(args.input[0])[-1] in ('.json', '.sfm'):
# args.input is a sfmData file: setup pre-calibrated views and intrinsics
from meshroom.nodes.aliceVision.CameraInit import readSfMData
views, intrinsics = readSfMData(args.input[0])
else:
images += multiview.findImageFiles(args.input, recursive=False)
hasSearchedForImages = True

if args.inputRecursive:
images += multiview.findImageFiles(args.inputRecursive, recursive=True)
hasSearchedForImages = True

if hasSearchedForImages and not images:
print("No image found")
exit(-1)

# initialize photogrammetry pipeline
if args.pipeline:
Expand Down

0 comments on commit ab7b940

Please sign in to comment.