可视化修改
This commit is contained in:
parent
bb2567aa86
commit
37ce5c746f
@ -47,7 +47,7 @@ class ImagePreprocessor:
|
||||
self.config = config
|
||||
self.logger = setup_logger(config.output_dir)
|
||||
self.gps_points = []
|
||||
self.command_runner = CommandRunner(config.output_dir)
|
||||
self.command_runner = CommandRunner(config.output_dir, mode=config.mode)
|
||||
|
||||
def extract_gps(self) -> pd.DataFrame:
|
||||
"""提取GPS数据"""
|
||||
@ -177,6 +177,7 @@ class ImagePreprocessor:
|
||||
filtered_points_df["lon"],
|
||||
filtered_points_df["lat"],
|
||||
color="red",
|
||||
marker="x",
|
||||
label="Filtered Points",
|
||||
alpha=0.6,
|
||||
)
|
||||
@ -206,7 +207,6 @@ class ImagePreprocessor:
|
||||
self.command_runner.run_grid_commands(
|
||||
grid_points,
|
||||
self.config.enable_grid_division,
|
||||
self.mode
|
||||
)
|
||||
# TODO 拼图
|
||||
except Exception as e:
|
||||
@ -217,8 +217,8 @@ class ImagePreprocessor:
|
||||
if __name__ == "__main__":
|
||||
# 创建配置
|
||||
config = PreprocessConfig(
|
||||
image_dir=r"E:\datasets\UAV\1815\images",
|
||||
output_dir=r"test",
|
||||
image_dir=r"E:\datasets\UAV\283\project\images",
|
||||
output_dir=r"E:\studio2\ODM_pro\test",
|
||||
|
||||
cluster_eps=0.01,
|
||||
cluster_min_samples=5,
|
||||
@ -230,13 +230,15 @@ if __name__ == "__main__":
|
||||
filter_dense_distance_threshold=10,
|
||||
filter_time_threshold=timedelta(minutes=5),
|
||||
|
||||
grid_overlap=0.05,
|
||||
grid_overlap=0.03,
|
||||
grid_size=500,
|
||||
|
||||
enable_filter=True,
|
||||
enable_grid_division=True,
|
||||
enable_visualization=True,
|
||||
enable_copy_images=True,
|
||||
|
||||
mode="快拼模式",
|
||||
)
|
||||
|
||||
# 创建处理器并执行
|
||||
|
@ -10,7 +10,7 @@ from preprocess.odm_monitor import ODMProcessMonitor
|
||||
class CommandRunner:
|
||||
"""执行网格处理命令的类"""
|
||||
|
||||
def __init__(self, output_dir: str, max_retries: int = 3):
|
||||
def __init__(self, output_dir: str, max_retries: int = 3, mode: str = "快拼模式"):
|
||||
"""
|
||||
初始化命令执行器
|
||||
i
|
||||
@ -21,7 +21,8 @@ i
|
||||
self.output_dir = output_dir
|
||||
self.max_retries = max_retries
|
||||
self.logger = logging.getLogger('UAV_Preprocess.CommandRunner')
|
||||
self.monitor = ODMProcessMonitor(max_retries=max_retries)
|
||||
self.monitor = ODMProcessMonitor(max_retries=max_retries, mode=mode)
|
||||
self.mode = mode
|
||||
|
||||
def _run_command(self, grid_idx: int):
|
||||
"""
|
||||
|
@ -8,17 +8,19 @@ from typing import Optional, Tuple
|
||||
class ODMProcessMonitor:
|
||||
"""ODM进程监控器"""
|
||||
|
||||
def __init__(self, max_retries: int = 3, check_interval: int = 300):
|
||||
def __init__(self, max_retries: int = 3, check_interval: int = 300, mode: str = "快拼模式"):
|
||||
"""
|
||||
初始化监控器
|
||||
|
||||
Args:
|
||||
max_retries: 最大重试次数
|
||||
check_interval: 检查间隔(秒)
|
||||
mode: 模式
|
||||
"""
|
||||
self.max_retries = max_retries
|
||||
self.check_interval = check_interval
|
||||
self.logger = logging.getLogger('UAV_Preprocess.ODMMonitor')
|
||||
self.mode = mode
|
||||
|
||||
def _is_process_running(self, pid: int) -> bool:
|
||||
"""检查进程是否在运行"""
|
||||
@ -45,7 +47,6 @@ class ODMProcessMonitor:
|
||||
command: ODM命令
|
||||
grid_dir: 网格目录
|
||||
grid_idx: 网格索引
|
||||
|
||||
Returns:
|
||||
Tuple[bool, str]: (是否成功, 错误信息)
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user