From 9f446691418842e7707d94f02741f11d9d7580c7 Mon Sep 17 00:00:00 2001 From: Pau Gargallo Date: Sun, 6 Sep 2015 16:03:55 +0200 Subject: [PATCH 1/2] Create image_list.txt with original filenames for odm_texturing --- run.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 11722a91..356ee891 100755 --- a/run.py +++ b/run.py @@ -689,7 +689,13 @@ def odm_texturing(): except: pass - run("\"" + BIN_PATH + "/odm_texturing\" -bundleFile " + jobOptions["jobDir"] + "/pmvs/bundle.rd.out -imagesPath " + jobOptions["srcDir"] + "/ -imagesListPath " + jobOptions["jobDir"] + "/pmvs/list.rd.txt -inputModelPath " + jobOptions["jobDir"] + "-results/odm_mesh-0000.ply -outputFolder " + jobOptions["jobDir"] + "-results/odm_texturing/ -textureResolution " + str(args.odm_texturing_textureResolution) + " -bundleResizedTo " + str(jobOptions["resizeTo"]) + " -textureWithSize " + str(args.odm_texturing_textureWithSize) + " -logFile " + jobOptions["jobDir"] + "/odm_texturing/odm_texturing_log.txt") + # Create list of original image files + with open(jobOptions['jobDir'] + "/odm_texturing/image_list.txt", "w") as fout: + for fileObject in objects: + if fileObject["isOk"]: + fout.write("./" + fileObject["src"] + "\n") + + run("\"" + BIN_PATH + "/odm_texturing\" -bundleFile " + jobOptions["jobDir"] + "/pmvs/bundle.rd.out -imagesPath " + jobOptions["srcDir"] + "/ -imagesListPath " + jobOptions["jobDir"] + "/odm_texturing/image_list.txt -inputModelPath " + jobOptions["jobDir"] + "-results/odm_mesh-0000.ply -outputFolder " + jobOptions["jobDir"] + "-results/odm_texturing/ -textureResolution " + str(args.odm_texturing_textureResolution) + " -bundleResizedTo " + str(jobOptions["resizeTo"]) + " -textureWithSize " + str(args.odm_texturing_textureWithSize) + " -logFile " + jobOptions["jobDir"] + "/odm_texturing/odm_texturing_log.txt") def odm_georeferencing(): From 8061f2f51d5ccdde45191bcaaf6fc5c31d2b7ae1 Mon Sep 17 00:00:00 2001 From: Pau Gargallo Date: Sun, 6 Sep 2015 22:32:46 +0200 Subject: [PATCH 2/2] Use only reconstructed images for texturing --- run.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/run.py b/run.py index 356ee891..1dcf7ef1 100755 --- a/run.py +++ b/run.py @@ -690,12 +690,18 @@ def odm_texturing(): pass # Create list of original image files - with open(jobOptions['jobDir'] + "/odm_texturing/image_list.txt", "w") as fout: - for fileObject in objects: - if fileObject["isOk"]: - fout.write("./" + fileObject["src"] + "\n") + pmvs_list = jobOptions["jobDir"] + "/pmvs/list.rd.txt" + texturing_list = jobOptions['jobDir'] + "/odm_texturing/image_list.txt" + with open(pmvs_list) as fin: + with open(texturing_list, "w") as fout: + for line in fin: + base = line.rstrip('\n')[2:-4] + for fileObject in objects: + if fileObject["base"] == base: + fout.write("./{}\n".format(fileObject["src"])) + break - run("\"" + BIN_PATH + "/odm_texturing\" -bundleFile " + jobOptions["jobDir"] + "/pmvs/bundle.rd.out -imagesPath " + jobOptions["srcDir"] + "/ -imagesListPath " + jobOptions["jobDir"] + "/odm_texturing/image_list.txt -inputModelPath " + jobOptions["jobDir"] + "-results/odm_mesh-0000.ply -outputFolder " + jobOptions["jobDir"] + "-results/odm_texturing/ -textureResolution " + str(args.odm_texturing_textureResolution) + " -bundleResizedTo " + str(jobOptions["resizeTo"]) + " -textureWithSize " + str(args.odm_texturing_textureWithSize) + " -logFile " + jobOptions["jobDir"] + "/odm_texturing/odm_texturing_log.txt") + run("\"" + BIN_PATH + "/odm_texturing\" -bundleFile " + jobOptions["jobDir"] + "/pmvs/bundle.rd.out -imagesPath " + jobOptions["srcDir"] + "/ -imagesListPath " + texturing_list + " -inputModelPath " + jobOptions["jobDir"] + "-results/odm_mesh-0000.ply -outputFolder " + jobOptions["jobDir"] + "-results/odm_texturing/ -textureResolution " + str(args.odm_texturing_textureResolution) + " -bundleResizedTo " + str(jobOptions["resizeTo"]) + " -textureWithSize " + str(args.odm_texturing_textureWithSize) + " -logFile " + jobOptions["jobDir"] + "/odm_texturing/odm_texturing_log.txt") def odm_georeferencing():