Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


Harris Geospatial / Docs Center / Using ENVI / Crop Science / Calculate Crop Metrics with Spectral Index

Calculate Crop Metrics with Spectral Index

Calculate Crop Metrics with Spectral Index

Crop Counting and Metrics Tutorial

Use the Calculate Crop Metrics with Spectral Index tool to calculate statistics for individual crops. It creates a classification image showing the relative pattern of a selected crop metric, or a grayscale image showing actual values of a selected crop metric. For example, if the input image is a vegetation index such as NDVI, the metrics would describe the health of the crops.

A common use of the Calculate Crop Metrics with Spectral Index tool is to look at crop statistics over time to assess their health at different stages in the growing season.

This tool accepts a multispectral image as input and calculates statistics from a specified spectral index (for example, Normalized Difference Vegetation Index). It also accepts a crop file (.json) created separately using the Count Crops and Calculate Crop Metrics tools. The crop file specifies the location and radius of each crop. Once you create the crop file, you can reuse it multiple times without having to recreate it.

This tool is best used with high-resolution imagery from an unmanned aerial vehicle (UAV) or other airborne sensor.

This tool is part of ENVI Crop Science, which requires a separate license and installation. You can also write a script to calculate crop metrics using the ENVIAgCalculateCropMetrics function or ENVIAgCalculateAndRasterizeCropMetricsWithSpectralIndexTask.

See the following sections:

Before You Begin


You must run the Count Crops tool before using Calculate Crop Metrics with Spectral Index. See the Count Crops help topic for instructions on preprocessing your imagery, including steps to create a single-band image that highlights crops against a dark background. Be sure to specify an Output Crops File in the Count Crops tool.

Calculate Crop Metrics


Follow these steps to run the Calculate Crop Metrics with Spectral Index tool:

  1. From the Toolbox, select Crop Science > Calculate Crop Metrics with Spectral Index. The File Selection dialog appears.
  2. Select a multispectral input image and click OK. The Calculate Crop Metrics with Spectral Index dialog appears.
  3. Data should be in units of reflectance prior to creating spectral indices. Most UAV and airborne sensors used for precision agriculture measure reflectance in visible and near-infrared wavelengths, so no further calibration should be required. Some spectral indices (for example, Anthocyanin Reflectance Index 1 and 2) require the data to be in units of reflectance, ranging from 0 to 100 percent (scaled from 0 to 1). Use the ENVI Spectral Math tool if necessary to scale the reflectance data to this range. See the Spectral Indices topic in ENVI Help for more information.

  4. Choose an option from the Spectral Index drop-down list.
  5. Select an Input Crops file (.json) that you created using the Count Crops tool.
  6. Select the specific metric to calculate from the Output Metric drop-down list. The choices are:
    • Crop Minimum
    • Crop Maximum
    • Crop Mean (default)
    • Crop Standard Deviation
  7. Select the Create Classification Raster option to create a classification raster where crops are colored according to relative metrics.
  8. Select an output filename and location for the Output Crops Raster.
  9. Select an output filename and location for the Output Crops File. This file contains crop locations and metrics, in JSON format.
  10. Select the Display result option to display the output image when processing is complete.
  11. Click OK. ENVI adds the resulting output to the Data Manager and Layer Manager, and it displays the output in the Image window.

Interpret the Results


If you set the Create Classification Raster option to No, the output image is a grayscale representation of the crop metric values. The following image shows an example:

To see the metric value of each crop, click the Cursor Value button in the main toolbar and click on a crop. You can also set any Status Bar segment to display Raster Data Values. The Status Bar displays the metric values as you move the cursor over the crops.

If you set the Create Classification Raster option to Yes, the output image is a classification raster where crops are colored according to relative metric values. For example, a dark green polygon corresponds to a crop with a higher value than light-green, yellow, and red polygons. The following image shows an example:

Example


This example shows how to compare two classification images created in the Crop Metrics with Spectral Index tool to look for changes in strawberry crop health over a two-week period.

The example uses MicaSense RedEdge® UAV reflectance imagery with a ground sample distance of 8 centimeters per pixel (at 400 feet). Spectral bands include blue, green, red, red edge, and near-infrared. Here are the two RGB images, one week apart:

The ENVI Spectral Math tool was used to divide the pixel values by 10,000 to yield reflectance values that were scaled from 0 to 1.

A Simple Ratio spectral index was calculated for Week 1 only, to make the strawberry crops bright against a dark background. This index is unrelated to the one that will be used later in the Crop Metrics with Spectral Index tool. The Simple Ratio image is only used as input to the Count Crops tool.

With some experimentation, the following parameter values ultimately produced the most accurate results in the Count Crops tool:

Input Raster: The Simple Ratio image

Minimum Crop Diameter: 0.2 meters

Maximum Crop Diameter: 0.7 meters

Number of Increments: 6

Gaussian Smoothing Factor: 0.2

Include Edges: Yes

Allowable Crop Overlap: 100

Intensity Threshold: 0.5

Fill Raster Crops: Yes

An Output Crops File (.json) was also created. Here is the result of the Crops class overlaid on the Week 1 RGB image. The final count is 219 crops:

You only have to create a crop file (.json) once. Since it contains the locations and sizes of crops, you can reuse the crop file when processing multiple images with the Calculate Crop Metrics with Spectral Index tool.

For this example, the Calculate Crop Metrics with Spectral Index tool ran twice, once with the Week 1 RGB image and again with the Week 2 RGB image.

Here are the selections used with both images:

Spectral Index: Green Difference Vegetation Index (GDVI)

Input Crops: The crop file (.json) saved from the Count Crops tool

Output Metric: Crop Mean

Create Classification Raster: Yes

The resulting classification images show the relative health of the crops, using the GDVI as the basis for the crop metrics. The classification images overlay the original RGB images:

By comparing these images, you can see variations in crop health from week to week, relative to each image. The relative health for each image has changed, so some crops may have become more or less healthy in relation to the other crops in the image.

If you were to set the Create Classification Raster option to No, the resulting image would be a grayscale representation of the actual crop metrics. Darker circles represent less healthy crops, and lighter circles represent healthier crops. You can view the mean GDVI values by using the Cursor Value tool, or by setting any Status Bar segment to Raster Data Values (as this example shows).

As you move the cursor over a crop location, the Status Bar shows the mean GDVI value.

To see the range of GDVI values in the entire image, right-click on the crop metrics image in the Layer Manager and select Quick Stats. Look for the Min and Max values under the Basic Stats column; for example:

If you have multiple crop metric images from a longer time period, you can create a Raster Series file. This allows you to animate the images over time and to create a time series profile of metrics for crops. See the Spatiotemporal Analysis topic in ENVI Help for details.

See Also


Calculate Crop Metrics, Count Crops, Hotspot Analysis, Enhance Crops



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us