Data Science Basic Crop Analysis with UAV Imagery and Micasense Altum

JP Uncategorized

https://github.com/dronemapper-io/CropAnalysis

A jupyter notebook with crop analysis algorithms utilizing digital elevation models, dtm and multi-spectral imagery (R-G-B-NIR-Rededge-Thermal) from a MicaSense Altum sensor processed with DroneMapper Remote Expert.

Due to limitations on git file sizes, you will need to download the GeoTIFF data for this project from the following url: https://dronemapper.com/software/DroneMapper_CropAnalysis_Data.zip. Once that has been completed, extract the TIF files into the notebook data directory matching the structure below.

Included Data

  • data/DrnMppr-DEM-AOI.tif – 32bit georeferenced digital elevation model
  • data/DrnMppr-ORT-AOI.tif – 16bit georeferenced orthomosaic (Red-Green-Blue-NIR-Rededge-Thermal)
  • data/DrnMppr-DTM-AOI.tif – 32bit georeferenced dtm
  • data/plant_count.shp – plant count AOI
  • data/plots_1.shp – plot 1 AOI
  • data/plots_2.shp – plot 2 AOI
  • output/*.csv – output csv of dataframes

Algorithms

  • plot volume/biomass
  • plot canopy height
  • plot ndvi zonal statistics
  • plot thermals
  • plant count

Notes

These basic algorithms are intended to get you started and interested in multi-spectral processing and analysis.

The orthomosaic, digital elevation model, and dtm were clipped to an AOI using GlobalMapper. The shapefile plots were also generated using GlobalMapper grid tool. We highly recommend GlobalMapper for GIS work!

We cloned the MicaSense imageprocessing repository and created the Batch Processing DroneMapper.ipynb notebook which allows you to quickly align and stack a Altum or RedEdge dataset creating the correct TIF files with EXIF/GPS metadata preserved. These stacked TIF files are then directly loaded into DroneMapper Remote Expert for processing.

This notebook assumes the user has basic knowledge of setting up their python environment, importing libraries and working inside jupyter.

Do More!

Implement additional algorithms like NDRE or alternative methods for plant counts. Submit a pull request to the repo!

Load Digital Elevation Model and Orthomosaic

Orthomosaic-DigitalElevationModel

Load Plot 1 AOI and Generate NDVI

ndvi_zonal_statistics

Generate NDVI Zonal Statistics For Each Plot

 ndvi_zonal_statistics_plots
geometryLAYERMAP_NAMENAMEminmaxmeancountstdmedian
0POLYGON Z ((289583.708 5130289.226 0.000, 2895…Coverage/QuadUser Created Features20.1884610.8730920.43855944440.0789210.436500
1POLYGON Z ((289588.705 5130289.052 0.000, 2895…Coverage/QuadUser Created Features30.1932140.8879710.44528244400.0910900.425304
2POLYGON Z ((289593.702 5130288.877 0.000, 2895…Coverage/QuadUser Created Features40.2322220.8901470.55286444400.1124400.519746
3POLYGON Z ((289598.699 5130288.703 0.000, 2896…Coverage/QuadUser Created Features50.0908250.8650830.53029544440.1105700.515392
4POLYGON Z ((289603.696 5130288.528 0.000, 2896…Coverage/QuadUser Created Features60.1046970.9224500.53666044420.1327310.495813

Load Plot 2 AOI & Compute DEM Canopy Mean Height For Each Plot

 canopy_height_dem
geometryLAYERMAP_NAMENAMEminmaxmeancountstdmedian
0POLYGON Z ((289707.875 5130279.812 1182.502, 2…Coverage/QuadUser Created Features – Coverage/Quad1360.129120363.381683361.14129433181.091593360.441467
1POLYGON Z ((289712.189 5130279.586 1190.569, 2…Coverage/QuadUser Created Features – Coverage/Quad2360.131866363.382446361.71029733161.215926361.927017
2POLYGON Z ((289716.503 5130279.360 1183.212, 2…Coverage/QuadUser Created Features – Coverage/Quad3360.117279363.384766361.13859233101.122890360.425781
3POLYGON Z ((289720.817 5130279.134 1182.668, 2…Coverage/QuadUser Created Features – Coverage/Quad4360.110443363.387207361.91543633221.258644362.585251
4POLYGON Z ((289725.131 5130278.908 1182.782, 2…Coverage/QuadUser Created Features – Coverage/Quad5360.006683363.377991361.55850133201.305164360.546524

Compute Thermal Mean For Each Plot

The thermal band (5) in the processed orthomosaic shows stitching artifacts which could likely be improved using more accurate pre-processing alignment and de-distortion algorithms. You can find more information about these functions in the MicaSense imageprocessing github repository. See notes at the top of this notebook.

 
geometryLAYERMAP_NAMENAMEminmaxmeancountstdmedian
0POLYGON Z ((289707.875 5130279.812 1182.502, 2…Coverage/QuadUser Created Features – Coverage/Quad130008.030431.030196.6286923318120.98205830193.0
1POLYGON Z ((289712.189 5130279.586 1190.569, 2…Coverage/QuadUser Created Features – Coverage/Quad230068.030560.030333.1927023316123.85609330332.0
2POLYGON Z ((289716.503 5130279.360 1183.212, 2…Coverage/QuadUser Created Features – Coverage/Quad329792.030645.030266.0302113310170.83120730275.5
3POLYGON Z ((289720.817 5130279.134 1182.668, 2…Coverage/QuadUser Created Features – Coverage/Quad429790.030700.030386.1372673322201.26691930391.0
4POLYGON Z ((289725.131 5130278.908 1182.782, 2…Coverage/QuadUser Created Features – Coverage/Quad529618.030691.030209.9045183320292.29939230262.0

Load Plot 1 AOI & Compute Volume/Biomass For Each Plot

biomass
geometryLAYERMAP_NAMENAMEminmaxmeancountsumvolume_m3area_m2
0POLYGON Z ((289583.708 5130289.226 0.000, 2895…Coverage/QuadUser Created Features2-0.1534733.5255431.53252444446810.53848376.65036850.0
1POLYGON Z ((289588.705 5130289.052 0.000, 2895…Coverage/QuadUser Created Features3-0.0944823.5752261.64666444407311.18869082.28502150.0
2POLYGON Z ((289593.702 5130288.877 0.000, 2895…Coverage/QuadUser Created Features4-0.0706483.9924931.88459644408367.60827694.17467650.0
3POLYGON Z ((289598.699 5130288.703 0.000, 2896…Coverage/QuadUser Created Features50.0329284.5759892.969443444413196.202637148.51891550.0
4POLYGON Z ((289603.696 5130288.528 0.000, 2896…Coverage/QuadUser Created Features60.0741885.1054083.155879444214018.412506157.77261750.0

Load Plant Count AOI & Count Plants

plant_count
plant_count
Plant count: 310
UTMXUTMY
0289622.4111715130240.899705
1289621.8497055130244.325966
2289622.1015695130248.858655
3289621.8650865130253.863387
4289621.4362805130258.158493

Thanks! Keep an eye out for future notebooks and algorithms.