How hwiyoung/orthophoto_maps works
Project type and purpose
• This is a Python-based command-line mapping tool (“Orthophoto_Maps”) that ingests drone imagery (and sensor metadata) and produces geo-referenced orthophotos (GeoTIFF).
• It implements a processing pipeline: georeferencing (camera pose estimation), DEM processing, and geodata generation (image rectification & pixel resampling).
File structure
• Top-level scripts:
• main_dg.py – the entry point for “direct georeferencing.”
• Orthophoto.py / OrthophotoThermal.py / Orthophoto_LBA.py – specialized workflows (thermal, local bundle adjustment).
• module/ – houses core algorithmic components:
• BackprojectionResample.py, Boundary.py, EoData.py, ExifData.py, LocalBA.py, system_calibration.py, etc.
• Data/ – sample input data (drone images + sensor .txt files).
• tests/ – unit and integration tests, plus test imagery, exiftool binary, and 3D models for DEM.
• environment.yaml – Conda environment spec (Python 3.8, GIS and numeric libraries).
README for additional insights
• Steps enumerated:
1) Georeferencing (camera pose & 3D points)
2) DEM processing (flat plane vs. sparse point cloud)
3) Geodata generation (rectify + resample)
• Future work hints at additional modules (ray tracing, config management, GSD calculation).
a. Main components (blocks)
• Configuration Manager – parses user settings (input/output paths, sensor width, system calibration).
• Data Ingestion – loads raw images, reads EXIF/sensor data (ExifData module).
• Georeferencing Engine – computes camera pose & sparse 3D coordinates (EoData, Boundary, system_calibration modules).
• DEM Processor – generates ground plane or imports sparse point cloud (LocalBA if available).
• Orthophoto Generator –
– Rectification sub-module (BackprojectionResample)
– Pixel resampling sub-module
• Thermal Handler (OrthophotoThermal) – optional parallel path for thermal image processing.
• Output Writer – writes GeoTIFF per image to disk.
• Testing Suite – external to main pipeline, validates each module using test datasets and exiftool/exiv2.
b. Relationships and interactions
• Data flows from Configuration → Data Ingestion → Georeferencing → DEM Processor → Orthophoto Generator → Output Writer.
• Thermal path branches after Data Ingestion (if thermal workflow selected).
• LocalBA (bundle adjustment) can be invoked between Georeferencing and DEM Processor.
• Testing Suite invokes modules in isolation using mock data.
c. Architectural patterns / design principles
• Pipeline architecture: each stage takes standardized inputs & produces outputs for the next.
• Modular separation: all core algorithms live in module/; top-level scripts orchestrate.
• Dependency inversion: Common interfaces for EXIF reading, reprojection, and resampling.
• Extensibility points: thermal branch, future ray-tracing module, config manager enhancements.
d. Key technologies & libraries
• Python 3.8 (Anaconda)
• numpy, scipy (numerics)
• GDAL / rasterio (GeoTIFF I/O)
• exiftool / exiv2 (metadata extraction)
• pytest (testing)