From f1afdd992006d8e84ffabf889a927200dd00404f Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Thu, 9 Jan 2025 14:29:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=81=E5=BD=B1=E6=A3=9A=E7=9A=84=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=81=9A=E5=9D=90=E6=A0=87=EF=BC=8C=E5=81=9A=E5=A5=BD?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- old_to_new_build/tools_to_xmps.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/old_to_new_build/tools_to_xmps.py b/old_to_new_build/tools_to_xmps.py index 3d1ccca..073efcd 100644 --- a/old_to_new_build/tools_to_xmps.py +++ b/old_to_new_build/tools_to_xmps.py @@ -165,16 +165,26 @@ def create_rate_xmps(pid): {libs.get_defineDistances(psid)} -update -align -align {config.r2["setRegion"]} \ {exportxmp} \ -exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \ - -save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}"' + -exportRegistration "D://{pid}/xmps_reg/{pid}_registration.out" "D://make2/config/registration_export_config.xml" \ + -save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit' print(cmd) cmd = shlex.split(cmd) res = subprocess.run(cmd) print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo2相机位姿完成,共费时{libs.diff_time(start_time)}') + #从 D://{pid}/xmps_reg/ 中获取对齐数量 + xmpAligns = 0 + for file in os.listdir(os.path.join(config.workdir, pid, 'xmps_reg')): + if file.endswith('.jpg'): + xmpAligns += 1 - upload_or_not = input('是否上传oss?(y/n)') - if upload_or_not == 'y': + #判断对齐数量是否和 照片总数一样 + if xmpAligns == (photos1_count+photos2_count): upload_xmp(pid) + else: + upload_or_not = input(f'当前照片总数{photos1_count+photos2_count},对齐数量{xmpAligns},没有全部对齐,是否上传oss?(y/n)') + if upload_or_not == 'y': + upload_xmp(pid) print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} rate_xmps文件生成完成,共费时{libs.diff_time(start_time)}')