Using Color to Classify Vegetation
This post will describe how we can use aerial imagery to classify vegetation for analysis. This workflow isn’t exclusive to imagery collected by drone, it will also work for imagery collected by airplane or satellite. In my prior posts I have discussed several advantages of using drones to collect aerial imagery, including higher resolution images, and the ability to easily refly a site for updated imagery on a continual basis.
Classifying vegetation from aerial imagery requires GIS software. I have done this workflow with both ESRI’s ArcGIS Pro and QGIS. If you don’t have a license for ArcGIS, I recommend downloading the open source QGIS (https://qgis.org/) and experimenting with imagery from the Earth Explorer (https://earthexplorer.usgs.gov/). NAIP imagery is released every two years and is a good place to start. These image files are huge, so you will need a couple GB of disk space available.
What is GIS?
GIS or Geographical Information Systems, is a way of processing and storing information or data which has a physical location. A city or county may have a database with every streetlight cataloged with important information about that infrastructure including when it was installed, what type of lightbulb is used, when the bulb was last replaced, and its physical location in the world. Rather than use a street address, these databases use latitude and longitude coordinates which can be extremely precise. Say that city or county is in the process of converting these streetlights from sodium bulbs to LED lamps. As each bulb is replaced that attribute is updated in the database. Later, a city council member asks which neighborhoods have had their streetlights updated and which haven’t. GIS software is then used to create a map highlighting the neighborhoods which have the new LED bulbs.
GIS is useful for answering questions we have about a set of data.
How does aerial imagery help us answer questions? In its essence, a photo contains information stored as color. Each pixel of an image has a specific color, defined as a quantity of red, a quantity of green, and a quantity of blue.
We can use this understanding of color to help us classify the objects in a photograph by color. In a landscape, objects that are green are likely plants, and will have a higher ratio of green to the red and blue in their RGB value. Soil will have higher proportion of red, while water will have higher proportion of blue. Using that information, we can use our GIS software to calculate the proportion of green in a pixel. The formula is Green / (Red + Green + Blue). Our software will create a new raster (image file) with the new value stored in each pixel. I have stylized the image below to show where green objects are within the marked parcel, the darker the green in this image, the more green it was in the original. If we assume that most green in an image is vegetation, we can use that information to answer questions we might have about the vegetation. For example, in the parcel below, the majority of the vegetation is Black Oak and Cedar. Make a quick estimate, what percentage of the parcel is vegetation as seen from the sky?
As this image shows various shades of green depending on how green the original pixel was, we need to create a threshold where we say, yes this is vegetation, or no this is not. Through trial and error I picked a value (.34 for this image) with results which looked right to me and generated this next image.
Using the raster statistics tool, this process tells us that on the day I photographed this parcel, using the index for vegetation that I created, this parcel was 63% vegetation. Given that this parcel has no lawn and only a small amount of vegetation was vegetables and herbs in the NE corner, I would estimate that at least 60% of this parcel is forested with Black Oak and Cedar. In future posts I will explore using more advanced tools to classify specific species using the color values as recorded by a drone camera. As always, feel free to share questions or comments using the contact form.