Saturday, March 19, 2011

Canopy Closure from Digital Photos Using ImageJ

When working with interdisciplinary teams, I find the topic of canopy closure coming up continually. Many typical forest inventories summarize forest attributes in terms of trees per unit area, volume, basal area or even stand density index. Ecosystem managers with backgrounds outside of forestry tend to find these measures difficult to envision, so I find myself being asked how a forest looks in terms of percent canopy closure. Several types of densiometers exist but I have found most of them inconsistent, expensive, or require an excessively large sample in order to produce viable results.

Recently, I decided to try using a digital camera mounted horizontally on a folding tripod and then interpreting the forest canopy from open sky in the photo in order to estimate canopy closure. Several researchers have used this method already with varying success, but most of them made use of expensive software such as ERDAS Imagine in order to process the images. While doing some tinkering in Linux, I came across a handy image processing program called ImageJ. ImageJ is public domain and can be enhanced by creating macros and/or java plugins. Information on ImageJ can be found on wikipedia here: http://en.wikipedia.org/wiki/ImageJ

Although I have been experimenting with it in Linux (mainly Ubuntu and Linux Mint) where it can be downloaded using the software manager or synaptic package handler, it can also be downloaded for other platforms here. I'll describe a simple method for deriving canopy closure using Imagej in this post that does not require any plugins or special software beyond the basic ImageJ public domain software. I did not have thousands of photos to process, so this process worked for me. If you do have lots of photos to process, you may want to find or write a plugin in order to automate the process. To search for pugins you could try here. I did not spend a lot of time hunting for plugins and do not really know if anything exists that would have suited my purposes. Below are step by step instructions for what I did. I'm always open to suggestions on how this could be done better, so feel free to comment.

Step by Step Instructions:

1. Once you download and install ImageJ, just open the software and then use it to open a photo like the one below.


2. Next go to the "Process" menu, select "Binary", then select "Make Binary"



This will take a color or grayscale photo and covert it to a binary black and white image
allowing the software to easily distinguish pixels representing the canopy from those representing the sky.



3. Next from the "Analyze" menu select "Histogram".



4. From here, you can select to save the histogram as an excel spreadsheet.



The resulting spreadsheet seems to be tab delimted, even though it gets saved as an .xls file. Make sure you note which color denotes closed canopy (in this case black, value 255), and which denotes open sky (in this case white, value 0). If the sky is very blue or cloudy, sometimes the canopy gets interpreted as white and the sky comes out black. I just denoted canopy as "closed" in my spreadsheet and sky as "open".

5. In the spreadsheet I divided the number of "closed" pixels by total pixels and multiplied by 100 in order to get percent canopy closure for each photo. These results can then be averaged for all of the photos in a stand, etc.

Using ImageJ for interpreting digital photos in order to calculate canopy closure is relatively easy. I am hoping to use results from these types of samples in order to calibrate and test some of the canopy closure models out there that can make estimates using more conventional inventory data, speeding up data collection. Hope this is helpful to someone else out there! ImageJ seems to have a lot of potential and it's free!

5 comments:

  1. Interesting use of ImageJ. It is very convenient because its free.

    ReplyDelete
  2. Interesting use of ImageJ. It is very convenient because its free.

    ReplyDelete
  3. This is really interesting! Do you foresee any issues with the photo not being hemispherical? Most of the canopy closure analyses I've seen use hemispherical photos... Thanks for the post!

    ReplyDelete
  4. Hej,
    thanks for an easy way of doing canopy cover analyses! Do you know a way to implement the cardinal direction (I know for all my pictures where north is)? Thanks for the help!

    ReplyDelete
  5. You can simplify this. After making it binary, just hit M, to measure the binary image. The results table gives you a "mean" and a "max". Divide the mean by the max to get the proportion open sky. Subtract this from 1 to get the proportion canopy cover. So Cover=1-(mean/max).

    You don't need to bother with histograms.

    ReplyDelete