Notice that you can see some brownish plants which are likely quite stressed as well, but it is pretty hard to see the difference between the plants and the dirt.. For this study, we want to be able to pick out vegetation.

Unprocessed picture from the Canon550NDVI MK II camera.

Notice that the plants now have a reddish tint. This is because the plants reflect the near IR which is picked up by the camera in the red channel.

The logic behind this NDVI calculation is that plants will reflect both green and the near IR, which is in the red channel. Plants absorb blue light so the blue channel is used as the visible channel and is multiplied by 2 to compensate for the 2 plant reflective channels.

The macro then further processes the data by rescaling the NDVI values to a user set maximum and minimum. The reason for this is that if the maximum plants for this sort of picture have an NDVI of 0.50 while the rocks have a value of -0.15, most of the NDVI value in the picture will be between -0.15 and +0.50. By rescaling the ENDVI values so that -0.15 = -1.0 and +0.50 = +1.0, then we can get a better understanding about what is in the picture.

Next the macro takes the rescaled ENDVI values and maps each pixel in the picture so that the closer to +1.0, the more green the pixel and the closer to -1.0, the more blue the pixel becomes. A new image is created where each pixel is a color representation of the rescaled NDVI values where green is mapped to the vegetation and blue is matched to stuff that isn't.

Notice that now we can easily pick out the areas with plants. We can also see that the rocks are generally blue while the dirt is generally black.

Default values for rescaling the NDVI values was minimum value of -0.15 and maximum value of +0.50.

The macro measures each pixel and keeps a count of every 0.10 between -1.00 and +1.00 to summarize the picture. You could use this to calculate the total vegetation in the picture, the stress of the vegetation, the amount of rocks and the amount of dirt.a