Browse Source

新影棚自动创建对齐坐标

master
dongchangxi 12 months ago
parent
commit
702683e1ac
  1. 12
      new_studio_to_reg/get_new_studio_reg_info.py
  2. 31
      new_studio_to_reg/tools_to_xmps.py

12
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)}") print(f"影棚号:{psid} , {config.oss_bucket.object_exists(filename)}")
isRate = False isRate = False
if not config.oss_bucket.object_exists(filename): if not config.oss_bucket.object_exists(filename):
#提示是否进行 xmps_new_studio_rate 文件夹的创建 # #提示是否进行 xmps_new_studio_rate 文件夹的创建
yes_or_not = input('当前该影棚没有对应的对齐坐标,是否创建?(y/n)') # yes_or_not = input('当前该影棚没有对应的对齐坐标,是否创建?(y/n)')
if yes_or_not == 'y': # 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) tools_to_xmps.create_rate_xmps(pid)
isRate = True isRate = True
else:
sys.exit(0)
#旋转图片 #旋转图片
if isRate == False: if isRate == False:

31
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 \ -addFolder "{os.path.join(config.workdir, pid, "photo2")}" -selectAllImages \
-align -align -align -align -align \ -align -align -align -align -align \
{exportxmp} \ {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' -save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit'
print(cmd) print(cmd)
cmd = shlex.split(cmd) cmd = shlex.split(cmd)
@ -146,26 +147,16 @@ def create_rate_xmps(pid):
# TODO:加入report相机位姿质量评估 # TODO:加入report相机位姿质量评估
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo1相机位姿完成,共费时{libs.diff_time(start_time)}') 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'): alignNums = 0
# shutil.copy(os.path.join(photo1_path, xmp), os.path.join(photo2_path, xmp.replace('_1.xmp', '_8.xmp'))) for file in os.listdir(os.path.join(config.workdir, pid, 'xmps_reg')):
if file.endswith('.jpg'):
# psid = libs.getPSid(pid) alignNums += 1
# cmd = f'{config.rcbin} {config.r2["init"]} -setInstanceName {pid} \
# -load "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" {config.r["setTextureFalse"]} \ if alignNums == 26:
# -addFolder "{os.path.join(config.workdir, pid, "photo2")}" -selectAllImages \ upload_xmp(pid)
# -detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \ else:
# {libs.get_defineDistances(psid)} -update -align -align {config.r2["setRegion"]} \ upload_or_not = input(f'当前照片数量为{photos2_count},对齐数量为{alignNums},是否上传oss?(y/n)')
# {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)}')
upload_or_not = input('是否上传oss?(y/n)')
if upload_or_not == 'y': if upload_or_not == 'y':
upload_xmp(pid) upload_xmp(pid)

Loading…
Cancel
Save