From 702683e1ac0e05f0ceb9b681af16ad88ff39e987 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Thu, 9 Jan 2025 14:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BD=B1=E6=A3=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AF=B9=E9=BD=90=E5=9D=90=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- new_studio_to_reg/get_new_studio_reg_info.py | 16 +++++----- new_studio_to_reg/tools_to_xmps.py | 31 +++++++------------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/new_studio_to_reg/get_new_studio_reg_info.py b/new_studio_to_reg/get_new_studio_reg_info.py index 2a6676d..08e6b63 100644 --- a/new_studio_to_reg/get_new_studio_reg_info.py +++ b/new_studio_to_reg/get_new_studio_reg_info.py @@ -62,13 +62,15 @@ def get_photo2_align_info(pid): print(f"影棚号:{psid} , {config.oss_bucket.object_exists(filename)}") isRate = False if not config.oss_bucket.object_exists(filename): - #提示是否进行 xmps_new_studio_rate 文件夹的创建 - yes_or_not = input('当前该影棚没有对应的对齐坐标,是否创建?(y/n)') - if yes_or_not == 'y': - tools_to_xmps.create_rate_xmps(pid) - isRate = True - else: - sys.exit(0) + # #提示是否进行 xmps_new_studio_rate 文件夹的创建 + # yes_or_not = input('当前该影棚没有对应的对齐坐标,是否创建?(y/n)') + # if yes_or_not == 'y': + # tools_to_xmps.create_rate_xmps(pid) + # isRate = True + # else: + # sys.exit(0) + tools_to_xmps.create_rate_xmps(pid) + isRate = True #旋转图片 if isRate == False: diff --git a/new_studio_to_reg/tools_to_xmps.py b/new_studio_to_reg/tools_to_xmps.py index 31abba8..7b9045e 100644 --- a/new_studio_to_reg/tools_to_xmps.py +++ b/new_studio_to_reg/tools_to_xmps.py @@ -139,6 +139,7 @@ def create_rate_xmps(pid): -addFolder "{os.path.join(config.workdir, pid, "photo2")}" -selectAllImages \ -align -align -align -align -align \ {exportxmp} \ + -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) @@ -146,28 +147,18 @@ def create_rate_xmps(pid): # TODO:加入report相机位姿质量评估 print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo1相机位姿完成,共费时{libs.diff_time(start_time)}') - # for xmp in os.listdir(photo1_path): - # if xmp.endswith('.xmp'): - # shutil.copy(os.path.join(photo1_path, xmp), os.path.join(photo2_path, xmp.replace('_1.xmp', '_8.xmp'))) - - # psid = libs.getPSid(pid) - # cmd = f'{config.rcbin} {config.r2["init"]} -setInstanceName {pid} \ - # -load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" {config.r["setTextureFalse"]} \ - # -addFolder "{os.path.join(config.workdir, pid, "photo2")}" -selectAllImages \ - # -detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \ - # {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")}"' - # 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)}') - + #判断是否对齐了所有的相机 + alignNums = 0 + for file in os.listdir(os.path.join(config.workdir, pid, 'xmps_reg')): + if file.endswith('.jpg'): + alignNums += 1 - upload_or_not = input('是否上传oss?(y/n)') - if upload_or_not == 'y': + if alignNums == 26: upload_xmp(pid) + else: + upload_or_not = input(f'当前照片数量为{photos2_count},对齐数量为{alignNums},是否上传oss?(y/n)') + if upload_or_not == 'y': + upload_xmp(pid) print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} xmps_new_studio_rate文件生成完成,共费时{libs.diff_time(start_time)}')