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,