04 — Methods / Tutorial

Extracting Features from
Drone Imagery in QGIS

Compute vegetation indices and plant height from orthoimages and DSMs, then pull out a value per polygon

Orthoimages and DSMs (Digital Surface Models) from a drone hold a lot of information about a crop's condition. If you compute features such as vegetation indices and plant height from them, and pull out a single value for each field polygon, you can compare and analyze growth plot by plot. This page walks through the whole flow in the free GIS software QGIS, from opening the data, to computing features, to summarizing them per polygon and exporting to CSV, step by step.

What you need (all free)

01 Open the data

You load data into QGIS from the "Data Source Manager" (the icon at the top-left of the toolbar, or Ctrl+L). Switch tabs depending on the type of data you are opening.

Open the Data Source Manager
Use "Open Data Source Manager" on the toolbar to load each kind of data.

Open the orthoimage and DSM (raster)

On the "Raster" tab, choose the .tif orthoimage or DSM and click "Add." If the image appears on the map, it loaded successfully.

Adding the orthoimage from the Raster tab
Add the orthoimage or DSM from the "Raster" tab.
Checking the loaded orthoimage on the map
The image appears on the map when it loads.

Open the polygons

From the "Vector" tab, add the plot polygons (.shp or .gpkg). They appear layered over the orthoimage.

Adding polygons from the Vector tab
Load the field plot polygons from the "Vector" tab.

Open a CSV or ground control points (GCP)

A CSV that carries coordinates (such as ground control points) is opened from the "Delimited Text" tab. Set the encoding to UTF-8, the delimiter to comma, and check "First record has field names" and "Detect field types." If it has coordinates, choose "Point coordinates" under Geometry Definition and specify the X and Y (and Z, if any) fields.

Choosing a CSV on the Delimited Text tab
Choose the CSV file on the "Delimited Text" tab.
Setting encoding and delimiter
Check the encoding, delimiter, and field-name settings.
Specifying the point coordinate fields
Choose "Point coordinates" and set the X and Y fields.
Checking the loaded points on the map
The points appear on the map when they load.

If the coordinate reference system (CRS) of the points does not match, right-click the layer and set it (for example, "Layer CRS → Set Project CRS from Layer," such as EPSG:32653). If the points are too small to see, adjust their size and color in Properties → "Symbology."

Setting the coordinate reference system
Match the coordinate reference system (CRS) if needed.
Adjusting the symbology of the points
Adjust the point size and color in Symbology for clarity.

For a CSV that has attributes only, with no coordinates (a table of variety names, replication numbers, and so on), choose "No geometry (attribute only table)" under Geometry Definition. You will join it to the polygons in the next step.

02 Join attributes to the polygons

When plot attributes (variety, replication, and so on) live in a separate CSV, join them to the polygons using a shared column (for example, fid). Right-click the polygon layer and open "Properties → Joins," then click "+". Set the attribute CSV as the "Join layer," set the shared column as both the "Join field" and "Target field," check only the attributes you need, and click "OK."

Joining CSV attributes to the polygon with Table Joins
Use "Properties → Joins" to attach attributes via a shared column.
03 Check the joined attributes on the map

Once joined, confirm that the attributes are linked to the right polygons. Open the polygon's attribute table and you will see the joined columns (such as variety) added. Using "Select by Expression," you can enter a condition like Variety = 'Koshi' to highlight only the matching plots on the map.

Checking the join in the attribute table
Check that the joined columns appear in the attribute table.
Using Select by Expression to check plots
"Select by Expression" highlights the plots that match a condition.

With labels, you can display the variety name or number directly on each plot. Check on the map that the plots are laid out the way you intend.

Showing attributes as labels on the map
Labels place the variety name and other values on each plot.
Checking the plot layout on the map
Confirm the plot layout visually on the map.
04 Getting around the map

A few basics make the work much smoother. Drag to pan, use the mouse wheel to zoom, and toggle the checkboxes in the "Layers" panel to show or hide layers. Layers higher in the list are drawn in front, so reorder them to control what overlaps what.

Toggling layers in the Layers panel
Show, hide, and reorder layers in the Layers panel.
Zooming and panning the map
Zoom and pan to check how the image and polygons line up.
05 Compute features (vegetation indices and plant height)

Compute features with the "Raster Calculator" ("Processing → Toolbox → Raster analysis → Raster calculator"). In the expression field, write a formula that combines the bands you want. For the simple ratio (SR) index, for example, divide the near-infrared (NIR) band by the red (Red) band.

"(NIR band)@1" / "(Red band)@1"
Computing a vegetation index in the Raster Calculator
In the Raster Calculator, combine bands to compute a vegetation index (e.g., SR = NIR / Red).

For plant height, subtract a ground-only DSM (baseline) from the DSM taken when the crop is grown.

"(growth-stage DSM)@1" - "(ground DSM)@1"
Computing plant height from the difference of two DSMs
The difference between two DSMs gives plant height.

If the result looks too dark to read, adjust the display minimum and maximum (Min / Max) in Properties → "Symbology" to make the distribution easier to see.

Adjusting the display Min and Max in Symbology
Adjust Min / Max in "Symbology" to make the distribution clearer.
06 Extract a value per polygon (zonal statistics)

Now reduce each feature to a single number per plot. Open "Processing → Toolbox → Raster analysis → Zonal statistics," set the plot polygons as the input layer and the feature image as the raster layer. Check "Mean" among the statistics and run it, and you get the mean of the pixels inside each polygon, plot by plot.

You can save the output as CSV. Leave "Open output file after running algorithm" unchecked so you do not pile up extra layers, which makes the next join easier. Repeat the same step for each feature: vegetation index, plant height, texture, and so on.

07 Join the extracted features and export

Join the CSV from zonal statistics to the polygons with the same "Joins" as in Step 2, and each plot lines up in one table with "variety, replication, vegetation index, plant height, ...". Finally, right-click the polygon and choose "Export → Save Features As," set the format to CSV, and write it out.

Exporting as CSV with Save Features As
Use "Export → Save Features As" and choose CSV as the format.

You can leave "Add saved file to map" unchecked. Open the exported CSV in Excel and resave it as .xlsx, and it is ready for statistical analysis and plotting.


At this point you have turned drone imagery into a single table of features, one row per plot. Analyze that table and you can compare growth across varieties and treatments in numbers. Start with a single feature to learn the flow, then add more as you go: vegetation indices, plant height, texture, and beyond.