Converting a CIR Image to an NDVI Image

by

Randy R. Price

K-State Extension and Research

Should you obtain a CIR image and would like to convert it to and NDVI, here are the general steps involved:

1)  The NDVI ratio (eq. 1) is the difference between the NIR and red wavelength values divided by the sum of the NIR and red wavelength values. This equation is applied to each pixel in the image[1]. The most common software is ERDAS®, which cost several thousand of dollars to purchase. Other software that can perform this transformation are Mutlispec® (Maclars laboratory, Purdue University - Free), Briv32 (Tetracam, Inc., website -Free), and Arcview®. You can also program this procedure into VisualBasic.NET or C++, etc. (but this can be tedious and time consuming). An example of this procedure is shown in Figure 1-A (upper area) which shows the variance in a grass field and the more intense pinkish color indicates where more lush, higher biomass grass is growing. The corresponding NDVI image is shown in Figure 1-B[2].

NDVI = (NIR - red) / (NIR + red) eq. 1

Figure 1: Grass field (top left -A), corresponding classified image (lower left - A), and corresponding NDVI image (B).

If you do perform the calculation yourself, remember the following:

  1. The ratio must be calculated for each pixel in the image and then written back to either a second image (usually monochrome) or the original image (in one of the RGB spots)
  2. When performing the NDVI calculation, the ratio returns a real number between -1 and 1 (such as 0.89, etc.). This number must be rescaled to correctly store and display on a computer. Most computers only use integers for saving and displaying that have a value between 0 and 255 (to indicate the different intensities). The NDVI value must be rescaled to fit this range. Depending upon the software, this process can be done by adding 2 (to make the range positive) and then multiplying by 127 (to rescale for the 0 to 255 range). Various other schemes may be employed.

2)  After you get an NDVI image, it must be geo-referenced (adding coordinates) to correctly position it in your site specific farming software (Fig. 3). Several different procedures are available for this. The most common is by locating three control points in the image (trees, intersections, fence lines, etc.) and inputting the GPS coordinates that go with these points. The software then stretches and rotates the image to fit the coordinates (Fig. 2). The process seems quite simple for a few photos, but can be very time consuming and tedious for multiple photos. Even in the best situations, the pixels can still be 5 to 10 feet off from the correct GPS points (but this may still be good enough in crop scouting applications).

Figure 2: Example of stretching and rotating a field using control points (Done with the Calibrate program in Farmworks®; Photo from Google Earth).

Figure 3: Geo-rectified NDVI image in site specific software (Farmworks®). Results will vary depending upon type of software package and format of image.

When picking GPS coordinates note the following:

  1. Pick objects that are big enough to be seen. Many things that look big on the ground (cars, towers, propane tanks, etc.) aren’t very identifiable in the image. Usually, roads, intersections, corners of fields, etc, work the best.
  2. Typically three or four good “control” points are needed.
  3. In a large field (> 200 acres), you may not be able to get the whole image in a single frame, so break the field up into two halves, or four quarters, with boundary attributes on each side (slight inconsistencies will occur when re-assembled, but you will still get it in the site specific software).
  4. The GPS control points need to be located at different areas around the image (not all in one spot – the software uses triangulation to reposition the image).
  5. A GPS with WAAS capability is typically good enough for GPS points on large fields, but you may wish to use ones with Omnistar® or better ratings (to get as close as possible). Note that absolute accuracy is needed here, so a WAAS guidance unit with 6–8 inch accuracy may still be more then 5 ft. off in absolute accuracy.
  6. Avoid tree lines since they tend to block the GPS satellites causing higher than normal errors in the GPS unit.

3)  NDVI can also be determined by a second method using the histogram function in typical imaging software found on most computers. In this procedure, an area is selected for analysis (Fig. 4) or the whole image, a histogram is created, and then the mean values from the histogram are used to supply the red and NIR values in equation 1. Note, this method can be use on large single features in the image, or certain areas where you want to neglect certain features such as background effects, etc. - see Fig. 4 - where the boxes only include values for the plants and not between the rows where soil is showing. Figure 5 shows a graph of nitrate application versus NDVI values using this method, and a nitrate prescription could be made from combining this data with an NDVI map of the whole field.

Figure 4: CIR image small plot test. Boxes indicate where histogram values where taken to eliminate soil background interference.

Figure 5: Resulting NDVI value versus nitrate levels using the histogram function

1

[1] Although the process seems easy, it is actually quite difficult to find software that will do this calculation for you. Most regular photo software does not have the capability to do mathematical operations, and even if it does, it is hard to rescale the NDVI image for proper display and saving of the file.

[2] The lower images in Figure 4 show another remote sensing technique called “classifying”, where computer software is trained to find different shades of color in the CIR image. This method can also be used to identify good and bad areas in the field as shown in Figure 4-A (lower).