修复bug

This commit is contained in:
龙澳 2025-01-13 10:52:41 +08:00
parent 382a269831
commit 0e8fb34e7a
5 changed files with 17 additions and 11 deletions

View File

@ -16,7 +16,4 @@ conda install -c conda-forge open3d
## TODO
- command_runner中rerun需要更新
- grid要动态分割大小
- 任务队列
- 目前obj转osgb的软件windows没有装上linux成功了,后续需要做一个docker镜像

View File

@ -11,7 +11,7 @@ def parse_args():
# 可选参数
parser.add_argument('--mode', default='重建模式', choices=['快拼模式', '三维模式', '重建模式'], help='处理模式')
parser.add_argument('--grid_size', type=float, default=1000, help='网格大小(米)')
parser.add_argument('--grid_size', type=float, default=800, help='网格大小(米)')
parser.add_argument('--grid_overlap', type=float, default=0.05, help='网格重叠率')
parser.add_argument('--produce_dem', action='store_true', help='是否生成DEM')

View File

@ -68,7 +68,6 @@ class ImagePreprocessor:
config.output_dir, mode=config.mode)
self.visualizer = FilterVisualizer(config.output_dir)
# TODO 给出警告!
def _clean_output_dir(self):
"""清理输出目录"""
try:

View File

@ -128,6 +128,17 @@ class MergeTif:
f"网格 ({grid_id[0]},{grid_id[1]}) 的{product_name}不存在: {grid_tif}")
continue
# 如果文件大于600MB则不使用original文件
file_size_mb = os.path.getsize(grid_tif) / (1024 * 1024) # 转换为MB
if file_size_mb > 600:
grid_tif = os.path.join(
self.output_dir,
f"grid_{grid_id[0]}_{grid_id[1]}",
"project",
product_path,
"odm_orthophoto.tif"
)
if input_tif1 is None:
input_tif1 = grid_tif
self.logger.info(f"设置第一个输入{product_name}: {input_tif1}")

View File

@ -39,8 +39,8 @@ class ODMProcessMonitor:
elif self.mode == "三维模式":
# 检查点云和实景三维
if not all([
os.path.exists(os.path.join(project_dir, 'odm_georeferencing')),
os.path.exists(os.path.join(project_dir, 'odm_texturing'))
os.path.exists(os.path.join(project_dir, 'odm_georeferencing', 'odm_georeferenced_model.laz')),
os.path.exists(os.path.join(project_dir, 'odm_texturing', 'odm_textured_model_geo.obj'))
]):
self.logger.error("点云或实景三维文件夹未生成")
return False
@ -50,9 +50,8 @@ class ODMProcessMonitor:
elif self.mode == "重建模式":
# 检查所有产品
if not all([
os.path.exists(os.path.join(project_dir, 'odm_orthophoto')),
os.path.exists(os.path.join(project_dir, 'odm_georeferencing')),
os.path.exists(os.path.join(project_dir, 'odm_texturing'))
os.path.exists(os.path.join(project_dir, 'odm_georeferencing', 'odm_georeferenced_model.laz')),
os.path.exists(os.path.join(project_dir, 'odm_texturing', 'odm_textured_model_geo.obj'))
]):
self.logger.error("部分必要的文件夹未生成")
return False
@ -65,6 +64,7 @@ class ODMProcessMonitor:
return True
# TODO 正射影像怎么检查最好
def _check_orthophoto(self, project_dir: str) -> bool:
"""检查正射影像的质量"""
ortho_path = os.path.join(project_dir, 'odm_orthophoto', 'odm_orthophoto.original.tif')
@ -197,7 +197,6 @@ class ODMProcessMonitor:
else:
error_msg = "Docker运行失败需要人工排查错误"
break
# TODO 处理时间组删除,删多了的情况
else:
self.logger.info("docker run指令执行成功")
if "ODM app finished" in last_lines: