A desktop application for georeferencing aerial/drone images using Ground Control Points (GCPs)
Features โข Installation โข Usage โข Examples โข FAQ
- Overview
- Features
- Installation
- Quick Start
- Detailed Usage
- Technical Details
- Use Cases
- Tips & Best Practices
- Troubleshooting
- Roadmap
- Contributing
- License
Transform non-georeferenced images (historical aerial photos, drone imagery, or scanned maps) into georeferenced GeoTIFF files compatible with GIS software like QGIS and ArcGIS.
Georeferencing assigns real-world coordinates to an image, enabling spatial analysis and overlay with other geographic data.
- โ KML/KMZ Support - Load boundary files directly from Google Earth
- โ Automatic Satellite Download - Fetches reference imagery from Google Maps
- โ Side-by-Side Interface - Interactive point selection on dual canvases
- โ Flexible Transformation - Perspective (4 points) or Homography (4+ points with RANSAC)
- โ GeoTIFF Export - Properly georeferenced output with WGS84 coordinate system
- โ Multi-Format Support - JPG, PNG, TIFF input images
Python 3.8 or highergit clone https://github.com/yourusername/georeferencing-tool.git
cd georeferencing-toolpip install -r requirements.txtpip install pillow numpy opencv-python rasterio requestsIf tkinter is not available:
brew install python-tk@3.11- KML/KMZ file: Create a boundary polygon in Google Earth
- Input image: Your aerial/drone photo (JPG, PNG, or TIFF)
python app.py| Step | Action | Description |
|---|---|---|
| 1 | Load KML/KMZ | Automatically downloads satellite reference image |
| 2 | Load Image | Select your input image to georeference |
| 3 | Mark Points | Click matching points on both images (min. 4 pairs) |
| 4 | Apply | Export georeferenced GeoTIFF |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [1. Select KML/KMZ] [2. Select Image] [Clear] [Apply] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โ Input Image โ Satellite Image โ
โ (Your Photo) โ (Reference) โ
โ โ โ
โ Points: 4 โ Points: 4 โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Status: Ready to georeference (4 point pairs) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Good GCP locations:
- ๐ข Building corners
- ๐ฃ๏ธ Road intersections
- ๐ Bridge endpoints
- โฒ Permanent landmarks
Point distribution:
โโโโโโโโโโโโโโโโโโโ
โ 1 2 โ โ Cover all corners
โ โ
โ โ
โ โ
โ 4 3 โ
โโโโโโโโโโโโโโโโโโโ
Note: Currently manual workflow only. Keyboard shortcuts coming soon!
| Component | CRS | Details |
|---|---|---|
| Output | WGS84 (EPSG:4326) | Standard GPS coordinates |
| Satellite Tiles | Google Maps | Zoom level 17 (ยฑ4.77m/pixel) |
graph LR
A[Input Image] --> B[GCP Selection]
C[Satellite Image] --> B
B --> D[Homography Matrix]
D --> E[Image Warping]
E --> F[GeoTIFF Export]
- 4 points:
cv2.getPerspectiveTransform()- Direct perspective transformation - 5+ points:
cv2.findHomography()with RANSAC - Robust outlier rejection
- Load and normalize images
- Collect GCP pairs from user clicks
- Convert display coordinates to image coordinates
- Calculate transformation matrix
- Warp input image to match satellite geometry
- Export with geospatial metadata
| Use Case | Description | Example |
|---|---|---|
| ๐บ๏ธ Historical Maps | Digitize and georeference old paper maps | City plans from 1940s |
| ๐ Drone Imagery | Align photos without GPS metadata | Agricultural surveys |
| ๐ธ Aerial Photos | Rectify oblique aerial photographs | Urban planning analysis |
| ๐ฐ๏ธ Time-Series | Prepare multi-temporal datasets | Land use change detection |
| ๐๏ธ Heritage | Archive historical aerial imagery | Cultural heritage preservation |
- Use 6-10 GCPs for optimal accuracy
- Distribute points evenly across the entire image
- Choose permanent features that exist in both images
- Verify correspondence before applying transformation
- Save intermediate results during complex projects
- Don't cluster all points in one area
- Don't use temporary features (cars, people)
- Don't rush the point selection process
- Don't use too few points (<4)
- Don't ignore point distribution warnings
Number of Points โ Accuracy:
4 points โ Basic alignment
6-8 points โ Good accuracy โญ
10+ points โ Excellent precision โญโญโญโ Satellite image not loading
Possible causes:
- No internet connection
- Invalid KML coordinates
- Area too large (>10kmยฒ)
Solutions:
1. Check internet connectivity
2. Verify KML file in Google Earth
3. Reduce area of interest
4. Try different zoom levelโ Poor georeferencing results
Possible causes:
- Insufficient GCP points
- Uneven point distribution
- Incorrect point correspondence
Solutions:
1. Add more GCPs (8-12 recommended)
2. Distribute points to all corners
3. Clear and restart point selection
4. Verify each point pair carefullyโ Application crashes on Mac
Solution:
# Install tkinter
brew install python-tk@3.11
# Verify installation
python3 -m tkinterโ "ModuleNotFoundError: rasterio"
Solution:
# Install GDAL first (macOS)
brew install gdal
# Then install rasterio
pip install rasterio- Manual GCP selection
- KML/KMZ support
- Satellite image download
- GeoTIFF export
- Deep learning-based point matching (SuperGlue)
- ROI selection tool
- Manual refinement interface
- Batch processing
- Multi-temporal registration (60+ year gap)
- Quality assessment metrics
- Point cloud support
- Web-based interface
Contributions are welcome! Please feel free to submit a Pull Request.
# Clone repository
git clone https://github.com/mahdiBahramshahi/Python-Georefrencer-app.git
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
---
## ๐จโ๐ป Author
**Mahdi Bahramshahi**
- GitHub: [@mahdibahramshahi](https://github.com/mahdiBahramshahi)
- LinkedIn: (https://www.linkedin.com/in/mahdi-bahramshahi/)
---
## ๐ Acknowledgments
- Google Maps API for satellite imagery
- OpenCV community for computer vision tools
- Rasterio for geospatial raster processing
---
## ๐ Support
- ๐ง Email: bahramshahimahdi92@gmail.com
---
<div align="center">
### โญ Star this repository if you find it helpful!
Made with โค๏ธ for the GIS community
</div>