From ab7b940060c9d759e7bf0042eefa8ca229f36666 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 26 Sep 2019 12:17:53 +0200 Subject: [PATCH] [bin] meshroom_photogrammetry: add explicit check if no image found --- bin/meshroom_photogrammetry | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/meshroom_photogrammetry b/bin/meshroom_photogrammetry index 465b7892e1..af4c592b51 100755 --- a/bin/meshroom_photogrammetry +++ b/bin/meshroom_photogrammetry @@ -80,6 +80,8 @@ 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 @@ -87,9 +89,15 @@ if args.input: 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: