Skip to content

GeospatialCentroid/wheatDrone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Drone Wheat Processing

This project provides a Python toolset to stack multispectral bands from drone imagery and create Cloud Optimized GeoTIFF (COG) outputs, with the ability to spatially merge captures or save them as individual multi-band TIF files.

Project Structure

drone_wheat_processing/
├── src/                    # Source code scripts
│   ├── drone_stitcher.py   # Spatially mosaic and stack georeferenced images
│   └── batch_processor.py  # Process individual captures into multi-band stacks
├── data/                   # (Git Ignored) Store raw images & outputs here
│   ├── input/              # Place raw drone imagery (e.g., DJI folders) here
│   └── output/             # Processed outputs will be saved here
├── requirements.txt        # Project dependencies
├── .gitignore              # Ignores data/, environments, and temp files
└── README.md               # Project documentation

Setup

1. Initialize Virtual Environment

If you haven't created the virtual environment yet:

python3 -m venv drone_env

2. Activate Virtual Environment

source drone_env/bin/activate

3. Install Dependencies

pip install -r requirements.txt

Usage

Place your raw imagery in the data/input/ folder (or a subfolder inside it). The tools are located in the src/ directory.

Option A: Process into Individual Stacks (Recommended for Unreferenced DJI Images)

The batch_processor.py script imports the grouping logic to process each image capture group (e.g., 0001, 0002, 0003) into its own individual 4-band output file. This bypasses the spatial mosaic step which would fail on raw drone imagery missing CRS data.

python src/batch_processor.py <input_directory> <output_directory>

Example:

python src/batch_processor.py data/input/droneImagery/ data/output/processed_output/

Option B: Stack and Spatial Mosaic

The drone_stitcher.py script stacks the bands and attempts to spatially merge all capture groups into a single file. Note: The spatial merge requires images to be already georeferenced/processed into orthophotos.

python src/drone_stitcher.py <input_directory> <output_filename>

Example:

python src/drone_stitcher.py data/input/droneImagery/ data/output/output_mosaic.tif

Options

  • --cog: (Default: True) Export as a Cloud Optimized GeoTIFF.
  • Use --cog False if you prefer a standard GeoTIFF.

Technical Notes

  • Band Order: The output stack uses the order: Band 1: Green, Band 2: Red, Band 3: Red Edge, Band 4: NIR. The band descriptions are natively embedded as metadata in the resulting TIFs.
  • Georeferencing: The spatial merge step requires georeferenced TIF files. If files lack CRS metadata (as seen in some raw DJI captures), the drone_stitcher.py script will process individual stacks but skip the spatial mosaic step. If you are processing raw flight paths, rely on the batch_processor.py script.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages