新影棚自动创建对齐坐标

This commit is contained in:
dongchangxi committed 2025-01-09 14:53:54 +08:00
1 parent f1afdd9920
commit 702683e1ac
2 files changed
+20 -27

No files matched your search

+9 -7
View File
@@ -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:
+11 -20
View File
@@ -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)}')