From 502d64c2088105ed0382cd76b3707ffa90f2cf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E6=BE=B3?= Date: Sat, 4 Jan 2025 10:12:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E9=99=90=E5=88=B6=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E8=AF=BB=E5=8F=96jpg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odm_preprocess.py | 8 ++++---- utils/gps_extractor.py | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/odm_preprocess.py b/odm_preprocess.py index 3d42411..98969b2 100644 --- a/odm_preprocess.py +++ b/odm_preprocess.py @@ -279,8 +279,8 @@ class ImagePreprocessor: if __name__ == "__main__": # 创建配置 config = PreprocessConfig( - image_dir=r"E:\datasets\UAV\283\project\images", - output_dir=r"G:\ODM_output\283", + image_dir=r"G:\error_data\ODMTestData", + output_dir=r"G:\ODM_output\1w", cluster_eps=0.01, cluster_min_samples=5, @@ -296,8 +296,8 @@ if __name__ == "__main__": filter_dense_distance_threshold=10, filter_time_threshold=timedelta(minutes=5), - grid_size=400, - grid_overlap=0.1, + grid_size=1000, + grid_overlap=0.05, mode="重建模式", diff --git a/utils/gps_extractor.py b/utils/gps_extractor.py index 9bb2e57..e5b6859 100644 --- a/utils/gps_extractor.py +++ b/utils/gps_extractor.py @@ -76,18 +76,17 @@ class GPSExtractor: successful_extractions = 0 for image_file in os.listdir(self.image_dir): - if image_file.lower().endswith('.jpg'): - total_images += 1 - image_path = os.path.join(self.image_dir, image_file) - lat, lon, date = self.get_gps_and_date(image_path) - if lat and lon: # 仍然以GPS信息作为主要判断依据 - successful_extractions += 1 - gps_data.append({ - 'file': image_file, - 'lat': lat, - 'lon': lon, - 'date': date - }) + total_images += 1 + image_path = os.path.join(self.image_dir, image_file) + lat, lon, date = self.get_gps_and_date(image_path) + if lat and lon: # 仍然以GPS信息作为主要判断依据 + successful_extractions += 1 + gps_data.append({ + 'file': image_file, + 'lat': lat, + 'lon': lon, + 'date': date + }) self.logger.info(f"GPS坐标和拍摄日期提取完成 - 总图片数: {total_images}, 成功提取: {successful_extractions}, 失败: {total_images - successful_extractions}") return pd.DataFrame(gps_data)