配置手工lock锁定相机坐标
This commit is contained in:
1 parent
937ce3fab4
commit
fc21c26f39
2 files changed
+34
-14
No files matched your search
+26
-14
@@ -30,7 +30,7 @@ def upload_xmp(pid):
|
||||
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} xmp文件上传完成,共费时{time.time() - start_time}秒')
|
||||
|
||||
def main(pid):
|
||||
def main(pid, lock=False):
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 开始计算相机位姿...')
|
||||
start_time = time.time()
|
||||
libs.down_from_oss(config.oss_bucket, config.workdir, pid)
|
||||
@@ -49,12 +49,17 @@ def main(pid):
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
if lock:
|
||||
exportxmp = ' -exportXMP "D:\\make2\\config\\exportXMP.config.lock.xml" '
|
||||
else:
|
||||
exportxmp = ' -exportXMP "D:\\make2\\config\\exportXMP.config.xml" '
|
||||
|
||||
cmd = f'{config.rcbin} {config.r2["init"]} -setInstanceName {pid} \
|
||||
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" \
|
||||
-addFolder "{os.path.join(config.workdir, pid, "photo1")}" -selectAllImages \
|
||||
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
||||
-align -align \
|
||||
-exportXMP "D:\\make2\\config\\exportXMP.config.xml" \
|
||||
{exportxmp} \
|
||||
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit'
|
||||
print(cmd)
|
||||
cmd = shlex.split(cmd)
|
||||
@@ -74,7 +79,7 @@ def main(pid):
|
||||
-addFolder "{os.path.join(config.workdir, pid, "photo2")}" -selectAllImages \
|
||||
-detectMarkers "D:\\make2\\config\\detectMarkers.config.xml" \
|
||||
{libs.get_defineDistances(config.ps_floor_sticker.get(psid, config.ps_floor_sticker["default"]))} -align -align -update {config.r2["setRegion"]} \
|
||||
-exportXMP "D:\\make2\\config\\exportXMP.config.xml" \
|
||||
{exportxmp} \
|
||||
-exportReconstructionRegion "{os.path.join(config.workdir, pid, f"{pid}.rcbox")}" \
|
||||
-save "{os.path.join(config.workdir, pid, f"{pid}.rcproj")}" -quit'
|
||||
print(cmd)
|
||||
@@ -83,23 +88,30 @@ def main(pid):
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} photo2相机位姿完成,共费时{libs.diff_time(start_time)}')
|
||||
|
||||
# TODO:加入report相机位姿质量评估
|
||||
upload_or_not = input('是否上传oss?(y/n)')
|
||||
if upload_or_not == 'y':
|
||||
upload_xmp(pid)
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} xmp文件上传完成,共费时{libs.diff_time(start_time)}')
|
||||
if not lock:
|
||||
upload_or_not = input('是否上传oss?(y/n)')
|
||||
if upload_or_not == 'y':
|
||||
upload_xmp(pid)
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} xmp文件上传完成,共费时{libs.diff_time(start_time)}')
|
||||
|
||||
delete_or_not = input('是否删除本地文件?(y/n)')
|
||||
if delete_or_not == 'y':
|
||||
shutil.rmtree(os.path.join(config.workdir, pid))
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 本地文件已删除')
|
||||
else:
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 本地文件未删除')
|
||||
delete_or_not = input('是否删除本地文件?(y/n)')
|
||||
if delete_or_not == 'y':
|
||||
shutil.rmtree(os.path.join(config.workdir, pid))
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 本地文件已删除')
|
||||
else:
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} 本地文件未删除')
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 2:
|
||||
pids = sys.argv[1].split(',')
|
||||
for pid in pids:
|
||||
main(pid)
|
||||
elif len(sys.argv) == 3:
|
||||
pids = sys.argv[1].split(',')
|
||||
for pid in pids:
|
||||
main(pid)
|
||||
if sys.argv[2] == 'lock':
|
||||
main(pid, lock=True)
|
||||
else:
|
||||
print(f'useage: python {sys.argv[0]} pid1,pid2,pid3')
|
||||
print(f'useage: python {sys.argv[0]} pid1,pid2,pid3 [lock]')
|
||||
sys.exit(1)
|
||||
Reference in new issue
Block a user