Browse Source

老影棚的自动做坐标,做好自动上传

master
dongchangxi 12 months ago
parent
commit
f1afdd9920
  1. 16
      old_to_new_build/tools_to_xmps.py

16
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"]} \ {libs.get_defineDistances(psid)} -update -align -align {config.r2["setRegion"]} \
{exportxmp} \ {exportxmp} \
-exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \ -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) print(cmd)
cmd = shlex.split(cmd) cmd = shlex.split(cmd)
res = subprocess.run(cmd) res = subprocess.run(cmd)
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo2相机位姿完成,共费时{libs.diff_time(start_time)}') 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) 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)}') print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} rate_xmps文件生成完成,共费时{libs.diff_time(start_time)}')

Loading…
Cancel
Save