不限制只能读取jpg

This commit is contained in:
龙澳 2025-01-04 10:12:08 +08:00
parent ffcd4ef8d5
commit 502d64c208
2 changed files with 15 additions and 16 deletions

View File

@ -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="重建模式",

View File

@ -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)