From 7f64316056957ac5290c8c8739c1df6aff14cac7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Jan 2025 15:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E7=BB=84?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=87=BD=E6=95=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filter/time_group_overlap_filter.py | 9 +++++++-- odm_preprocess.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/filter/time_group_overlap_filter.py b/filter/time_group_overlap_filter.py index 6f0048c..72e932b 100644 --- a/filter/time_group_overlap_filter.py +++ b/filter/time_group_overlap_filter.py @@ -86,8 +86,13 @@ class TimeGroupOverlapFilter: if box1.intersects(box2): intersection_area = box1.intersection(box2).area smaller_area = min(box1.area, box2.area) - return intersection_area / smaller_area - return 0 + if smaller_area == 0: + overlap_ratio = 1 + else: + overlap_ratio = intersection_area / smaller_area + else: + overlap_ratio = 0 + return overlap_ratio def filter_overlapping_groups(self, gps_points, time_threshold=timedelta(minutes=5)): """过滤重叠的时间组""" diff --git a/odm_preprocess.py b/odm_preprocess.py index d249011..9bad923 100644 --- a/odm_preprocess.py +++ b/odm_preprocess.py @@ -272,8 +272,8 @@ class ImagePreprocessor: if __name__ == "__main__": # 创建配置 config = PreprocessConfig( - image_dir=r"/home/cug/datasets/1009/project/images", - output_dir=r"/home/cug/ODM_output/1009", + image_dir=r"/home/cug/datasets/error3/project/images", + output_dir=r"/home/cug/ODM_output/error3", cluster_eps=0.01, cluster_min_samples=5,