A clean, modular Python project for UAV mapping simulation:
- Split a large map into deterministic tiles.
- Stitch tiles into a global bird's-eye-view (BEV) map.
- Partition the stitched map into exploration regions with pixel and metric bounding boxes.
The code is ROS-agnostic and designed for future integration with ROS2 message adapters.
uav_mapping_project/
├── main.py
├── config.py
├── splitter/
│ ├── image_splitter.py
│ └── test_splitter.py
├── stitcher/
│ ├── base_stitcher.py
│ ├── global_map.py
│ ├── grid_stitcher.py
│ └── test_stitcher.py
├── partition/
│ ├── base_partition.py
│ ├── region.py
│ ├── grid_partition.py
│ └── test_partition.py
├── utils/
│ ├── io_utils.py
│ └── visualization.py
└── data/
- Python 3.10+
numpyopencv-pythonmatplotlib
Install dependencies:
python -m pip install numpy opencv-python matplotlibRun commands from repository root (BEV_Stitcher).
python -m uav_mapping_project.splitter.test_splitterOutputs:
uav_mapping_project/data/source_map.pnguav_mapping_project/data/split_grid_preview.pnguav_mapping_project/data/tiles/tile_x{col}_y{row}.png
python -m uav_mapping_project.stitcher.test_stitcherOutputs:
uav_mapping_project/data/stitched_map.png
Console also prints map resolution (meters/pixel) and origin.
python -m uav_mapping_project.partition.test_partitionOutputs:
uav_mapping_project/data/partition_overlay.png
Console prints each region in:
- pixel coordinates:
bbox_pixel - metric coordinates:
bbox_meter
python -m uav_mapping_project.mainThis executes split → stitch → partition in sequence and writes results under uav_mapping_project/data/.
Edit uav_mapping_project/config.py to customize:
- tile size and overlap
- synthetic map size
- number of partition regions
- camera/UAV parameters (
altitude,fx,fy,cx,cy, image size) - default map origin and fallback resolution
GlobalMapincludes:imageresolution(meters per pixel)origin(world coordinate for top-left)
- Partition output
Regionincludes bothbbox_pixelandbbox_meter. - No ROS imports are used; conversion to ROS2 messages can be added in a separate adapter layer.