修改检测成功代码
This commit is contained in:
parent
cd36dcb6e9
commit
382a269831
@ -25,22 +25,50 @@ class ODMProcessMonitor:
|
||||
"""检查ODM是否执行成功
|
||||
|
||||
检查项目:
|
||||
1. 必要的文件夹是否存在
|
||||
2. 正射影像是否生成且有效
|
||||
3. 正射影像文件大小是否正常
|
||||
1. 必要的文件夹和文件是否存在
|
||||
2. 产品文件是否有效
|
||||
"""
|
||||
# 检查必要文件夹
|
||||
success_markers = ['odm_orthophoto']
|
||||
if self.mode != "快拼模式":
|
||||
success_markers.extend(['odm_texturing', 'odm_georeferencing'])
|
||||
project_dir = os.path.join(grid_dir, 'project')
|
||||
|
||||
if not all(os.path.exists(os.path.join(grid_dir, 'project', marker)) for marker in success_markers):
|
||||
self.logger.error("必要的文件夹未生成")
|
||||
return False
|
||||
# 根据不同模式检查不同的产品
|
||||
if self.mode == "快拼模式":
|
||||
# 只检查正射影像
|
||||
if not self._check_orthophoto(project_dir):
|
||||
return False
|
||||
|
||||
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'))
|
||||
]):
|
||||
self.logger.error("点云或实景三维文件夹未生成")
|
||||
return False
|
||||
|
||||
# TODO: 添加点云和实景三维的质量检查
|
||||
|
||||
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'))
|
||||
]):
|
||||
self.logger.error("部分必要的文件夹未生成")
|
||||
return False
|
||||
|
||||
# 检查正射影像
|
||||
if not self._check_orthophoto(project_dir):
|
||||
return False
|
||||
|
||||
# TODO: 添加点云和实景三维的质量检查
|
||||
|
||||
return True
|
||||
|
||||
def _check_orthophoto(self, project_dir: str) -> bool:
|
||||
"""检查正射影像的质量"""
|
||||
ortho_path = os.path.join(project_dir, 'odm_orthophoto', 'odm_orthophoto.original.tif')
|
||||
|
||||
# 检查正射影像文件
|
||||
ortho_path = os.path.join(
|
||||
grid_dir, 'project', 'odm_orthophoto', 'odm_orthophoto.original.tif')
|
||||
if not os.path.exists(ortho_path):
|
||||
self.logger.error("正射影像文件未生成")
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user