新影棚自动创建对齐坐标
This commit is contained in:
1 parent
f1afdd9920
commit
702683e1ac
2 files changed
+20
-27
No files matched your search
@@ -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)
|
# tools_to_xmps.create_rate_xmps(pid)
|
||||||
isRate = True
|
# isRate = True
|
||||||
else:
|
# else:
|
||||||
sys.exit(0)
|
# sys.exit(0)
|
||||||
|
tools_to_xmps.create_rate_xmps(pid)
|
||||||
|
isRate = True
|
||||||
|
|
||||||
#旋转图片
|
#旋转图片
|
||||||
if isRate == False:
|
if isRate == False:
|
||||||
|
|||||||
@@ -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,28 +147,18 @@ 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"]} \
|
|
||||||
# -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)}')
|
|
||||||
|
|
||||||
|
|
||||||
upload_or_not = input('是否上传oss?(y/n)')
|
if alignNums == 26:
|
||||||
if upload_or_not == 'y':
|
|
||||||
upload_xmp(pid)
|
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)}')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} xmps_new_studio_rate文件生成完成,共费时{libs.diff_time(start_time)}')
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user