DroneZaic is an advanced mosaicking algorithm designed to process freely flown aerial imagery captured by UAVs.
requirements.txtgit clone https://github.com/dek8v5/DroneZaic.git
cd DroneZaic/code
sudo install -r requirement.txt
locate your video that you want to mosaic. Ensure your video is supported and (optionally) locate the accompanying .SRT file where GPS metadata is embedded.
dynamic sample first
The dynamic_sampling.py script extracts keyframes from UAV videos based on optical flow. It now also supports optional GPS extraction from DJI .SRT metadata for georeferenced processing.
.SRT Format)Supported formats: JPG, TIF
Input requirements: DJI .MOV file and corresponding .SRT file
python dynamic_sampling/dynamic_sampling.py -video /media/dek8v5/f/aerial_imaging/images/23r/grace/23.6/DJI_0205.MOV -save_path /home/dek8v5/Documents/cornetv2/data_ori/FINAL_CORNETV2_DATASET/1_gps_jpg_23r_06_23_205_seedling_parallel_1pass/jpeg -srt /media/dek8v5/f/aerial_imaging/images/23r/grace/23.6/DJI_0205.SRT -win 100 -scale 3 -fname 23r_06_23 -format jpg
Expected .SRT line format (based on our DJI drone): ``` bash 110 00:00:04,547 –> 00:00:04,589
#### Without GPS
``` bash
python dynamic_sampling/dynamic_sampling.py -video /media/dek8v5/f/aerial_imaging/images/23r/grace/23.6/DJI_0205.MOV -save_path /home/dek8v5/Documents/cornetv2/data_ori/FINAL_CORNETV2_DATASET/1_gps_jpg_23r_06_23_205_seedling_parallel_1pass/png -win 100 -scale 3 -fname 23r_06_23 -format png
calibration.py script performs automatic lens calibration to correct for lens distortion and gimbal misalignment. Calibration is essential for accurate frame alignment and high-quality mosaicking.The lens and gimbal parameters are unique for each drone and should ideally be derived from a checkerboard calibration process. If you haven’t already obtained these parameters, you can generate them using the automatic_calibration.py script.
python calibration.py -image_path /path/to/your/raw/frames -save_path /path/to/output_directory
To overwrite the original raw frames with their calibrated versions, set -image_path and -save_path to the same directory:
python calibration.py -image_path /path/to/raw/frames -save_path /path/to/raw/frames
example using surf:
cd surf
python surf_homography_estimation.py -image_path /path/to/your/calibrated/frames -save_path /path/to/the/working/directory -scale int (for resizing the frame dimension)
This mode saves all intermediate steps, including raw frames, calibrated frames, and an additional copy of the calibrated frames grouped into shots. It is useful for debugging, inspection, and retaining full processing history.
./maizaic_run.sh -p /path/to/project_dir -h asift -d true
# or
./maizaic_run.sh --working_path /path/to/project_dir --hm_method asift --mode_duplicate true
This mode replaces the raw frames with their calibrated versions and moves the calibrated frames into grouped shots. It is optimized for minimal storage usage and does not retain intermediate or duplicate files.
./maizaic_run.sh -p /path/to/project_dir -h asift -d false
# or
./maizaic_run.sh --working_path /path/to/project_dir --hm_method asift --mode_duplicate false
If you use DroneZaic or any part of this pipeline, please cite our work.
@article{kharismawati2025dronezaic,
author = {Dewi Endah Kharismawati and Toni Kazic},
title = {\emph{DroneZaic}: a robust end-to-end pipeline for mosaicking freely flown aerial video of agricultural fields},
journal = {The Plant Phenome Journal},
doi = {10.1002/ppj2.70033}
year = {2025}
}
@misc{kharismawati2025dronezaicdata,
author = {Dewi Endah Kharismawati and Toni Kazic},
title = {\emph{DroneZaic Dataset}: a robust end-to-end pipeline for mosaicking freely flown aerial video of agricultural fields},
publisher = {Dryad},
doi = {10.5061/dryad.r4xgxd2q7},
year = {2025}
}