Open-access tools for canopy image processing

blog
canopy photography
Published

December 6, 2021

Digital photography is the cheapest, most flexible, but also effective tool to estimate canopy attributes light Leaf Area Index (LAI), canopy cover, and radiation regime.

The key strengths of digital canopy photography are:

In addition,

Here I reported examples of free tools to process canopy photography. For smartphone applications, I already discussed them here.

Hemispherical photography processing tools

Images obtained from a camera equipped with a fisheye lens are (and have been) traditionally the most widely used in canopy photography research. The processing of digital hemispherical images requires the following basic steps:

  1. correcting images for fisheye-lens distortion;

  2. binary classification of digital image in sky (1) and non-sky (0) pixels to calculate gap fraction (GF);

  3. subdivision of the circular image in zenith annuli and azimuth segments;

  4. application of algorithms to retrieve canopy structure from GF at each zenith and azimuth bin

_A__n example of a circular fisheye image_ acquired with the Nikon Coolpix4500 and the FC-E8 lens converter

There are many open-access solutions to perform digital hemispherical image processing.

Stand-alone solutions (freeware) for processing fisheye image include Gap Light Analyzer (GLA) developed at Fraser University . The software have a long history (Frazer et al. 1999) and it is still relatively used due to its simplicity. A main limitation of the software is that image classification (b) is performed manually, which is a rather subjective and time-consuming option.

Alternative freeware is CAN-EYE, which is a really comprehensive processing tool (not limited to upward fisheye images) developed at INRAE by Marie Weiss and Frederic Baret. The thresholding is automatic, and the software allows batch processing, which is very useful for canopy photography users. The software works in Windows operative system (OS).

Another example of freeware is CIMES, developed by Jean-Michel Walter, which is a command-line program, indeed compatible to any OS. Hemisfer is another software developed by Patrick Schleppi, it is not ‘fully’ open-access, in that the freeware version has some restrictions in terms of allowable input image size.

As alternative to software, some (open-software) image plugins have been developed for processing fisheye canopy images. An example is the Hemispherical 2.0 plugin of ImageJ compiled by Philip Beckschäfer, which calculate gap fraction and associated statistics after binarizing fisheye images.

With reference on open R libraries, there are some packages which deserves interest:

  • The ‘hemiphot’ library process circular fisheye images to get estimates of canopy and light regime. No lens-correction is performed, and the thresholding is manual.
  • The ‘caiman’ library is designed to automatically threshold fisheye images. So this package could be used in combination with hemiphot to firstly binarize and then retrieve canopy attributes.
  • The ‘hemiphoto2LAI’ implement almost all existing algorithms to retrieve LAI from gap fraction. The input are the gap fraction and zenith angle, not an image, so the above libraries could be used to get the input data.
  • The ‘Sky’ library allows to threshold fisheye images and calculate openness

N.B. its surprising that only few solutions are available in R to deal with traditional circular fisheye image. I hypothesize that image processing in R is not the best suitable place, while MATLAB has a larger set of tools and computational capabilities for image matrix analysis. An example is HPEval tool based on MATLAB, while in-built MATLAB toolbox allows fisheye lens calibration.

I have also created my own R package called hemispheR, which is described in another post here.

An open-source Python library to process circular fisheye images is the ‘CanopyGapAnalyzer’ which is designed to threshold and then calculate canopy parameters for batches of hemispherical images.

Recently I found a weird, ‘fisheyerizing’ web-tool inspired by a work by Andis (2021), which transforms panorama images, which can be created from smartphones using Google Street View, in circular fisheye images which are also processed by the web-tool. Take a look at this tool, called Canofi.

Sometimes the fisheye image is not circular, and we are referring to full-frame fisheye image (Macfarlane et al. 2007a). These kind of images have a reduced FOV such that the full zenith angle range extends to the corners of the rectangular image, increasing the image resolution. As the above scripts are not tailored to such a kind of image (which are indeed common), I created a script to threshold these images and calculate canopy attributes from them, which is available here.

An example of a full-frame hemispherical image. All the image pixels are used in this kind of fisheye images, increasing the number of pixels used for canopy analysis compared with circular hemispherical photography.

Cover photography processing tools

Cover photography (Macfarlane et al. 2007b) is narrow-lens canopy photography. The method was invented by Craig Macfarlane and has a key advantage of simplifying canopy image processing (indeed, no ‘circular’ handling of zenith rings and azimuth segments of cover images is required). But there are many other advantages, as the method is suitable for any kind of device, including smartphones and camera-traps, and it is also less sensitive to sky conditions and gamma correction than fisheye pictures.

Cover photography use a narrow lens (e.g. 50 mm) to achieve a FOV of about 30°

In terms of image processing, the key steps are

  • classify the image;
  • apply an algorithm to calculate foliage cover and effective LAI from classified GF.

This means that any kind of thresholding freeware, plugin or code can be used to process these images. For example, the ImageJ plugin ‘Auto Threshold’, which has been also translated in the R library ‘autothresholdr’, can be used to calculate gap fraction after thresholding cover images. With GF, it is possible to calculate the complement foliage cover, and derive effective LAI by assuming an extinction coefficient k from the formulas reported in Macfarlane et al. 2007b.

However, the estimation of foliage clumping, upon which LAI can be derived from effective LAI, require further step of separating gaps into large, between-crowns gaps, and small, within-crown gaps. I created an R package ‘coveR’ to process DCP images, which is described in the article here. Alternatively, there is a specific open Python library Canopy Cover (CaCo) which allows to perform separation of large and small gap in cover images (Alivernini et al. 2018). For non-practitioners of Python, a similar approach can be achieved using the ‘Analyze particles’ plugin of ImageJ, using the same method descrived in Alivernini et al. 2018.

In short, there are currently many free options to process canopy images, and smartphone APPs are likely to increment the plafond of open-source solutions for canopy photographers!