Skip to content

Repository files navigation

Leaf Analyzer logo

Leaf Analyzer is an open-source GUI tool for automated measurement of leaf traits—area, dimensions, perimeter, count, green index, and percent damage (e.g., herbivory/disease). The application is implemented in MATLAB and distributed as a standalone program (no MATLAB license required). Installers are available for Windows, Linux, and macOS.

A detailed description is available in our article in Plant Phenomics: Leaf Analyzer: A Fully Automated and Open-Source Tool for High-Throughput Leaf Trait Measurement.

If you have any issues using the software, please feel free to raise them in the Issues page or report them to tao.hu@anu.edu.au.

Latest updates

2026/05/19 -- 🔥🔥 Leaf Analyzer online pattern overlay tool is available, for images taken without our pattern, see Sec. 1.4(https://techlauncher-leafanalyzer.github.io/AprilTag-Overlay-Tool/).

2026/05/05 -- 🔥🔥 Leaf Analyzer online pattern generator is available, click to customize your own pattern.

2026/02/13 -- 🔥🔥 Leaf Analyzer v2.6.0: New Green Leaf Index (GLI) Trait Measurement + Per-Leaf Exports to Spreadsheet.

2025/12/12 -- 🔥🔥 Leaf Analyzer v2.5.0: First public release

Example applications


(a)

(b)

(c)

(d)

(e)
Figure 1. Destructive leaf morphological trait measurement: (a) Original RGB image; (b) Per-leaf area; (c) Per-leaf perimeter; (d) Per-leaf dimensions; (e) Per-leaf green index.

(a)

(b)

(c)

(d)

(e)
Figure 2. Non-destructive leaf morphological trait measurement for Arabidopsis grown in pots (see Sec. 2.4 for more details): (a) Original RGB image of Arabidopsis grown in a tray; (b) Leaf segmentation results; (c) Original RGB image of Arabidopsis grown in a pot; (d) Watershed leaf segmentation; (e) Per-leaf area.

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

(i)

(j)

(k)

(l)

(m)

(n)

(o)

(p)

(q)

(r)

(s)

(t)
Figure 3. Non-destructive leaf area measurement in action. First row (a-e): original images captured with a pattern board. Second row(m-o): leaf segmentation results corresponding to first row images. Third row(k-o): original images taken with a pattern board (with plastic cover). Fourth row(p-t): leaf segmentation results corresponding to third row images.

Leaf Analyzer UI
Figure 4. More applications of Leaf Analyzer. (a-b): Petri dish plant leaf area measurement. (c-d): Petri dish seed germination monitoring, (e-f): 48-well plate hydroponic plant leaf area measurement. (g-h): nondestructive leaf area and dimensions measurement. (i-j): Silhouette leaf area measurement. (k-l): Seed counting. (m): An example root phenotyping pipeline using Leaf Analyzer.

Leaf Analyzer UI
Figure 5. Leaf Analyzer UI.

1. Getting started

1.1. Downloading and installing Leaf Analyzer

Download the latest release from Releases and install the software according to the instructions:

Operation SystemInstallationLaunching
WindowsDouble click: LeafAnalyzerInstaller2.5_Windows.exeOpen via Start Menu → Leaf Analyzer (or the desktop shortcut, if created).
Linuxsudo ./ LeafAnalyzerInstaller2.5_Linux.install➢ cd /usr/Leaf_Analyzer/application
➢ ./run_Leaf_Analyzer.sh /usr/local/MATLAB/MATLAB_Runtime/R2025a/
Mac OSFirst unzip LeafAnalyzerInstaller2.5_Mac.zip, and then Control-click the unzipped file (LeafAnalyzerInstaller2.5_Mac.app) → Open Open via Applications → APPN → Leaf Analyzer (or Spotlight).
If your processor is ARM64 (common for devices manufactured after 2020), open a terminal, and run:
arch -x86_64 open /Applications/APPN/LeafAnalyzer/application/LeafAnalyzer.app

1.2. Test Leaf Analyzer with images

Leaf Analyzer requires images captured with the Leaf Analyzer calibration pattern. For quick testing, use the datasets in Datasets.

To try your own images, first capture them with the pattern (see next section). See Capture images with the Leaf Analyzer pattern

1.3. Capture images with the Leaf Analyzer pattern

The Patterns folder contains PDF pattern files (A4–A1). They were generated in Inkscape for high precision. You can also customize your own pattern to a suitable size using our online pattern generator (Please make sure to print the generated PDF file at 100% scale for accuracy). At the top of each PDF (to the right of the logo), you’ll see labels like 120×120–15 mm, which follow the format pattern width × pattern heightAprilTag side length. Enter these values directly in Settings → Pattern (Fig. 6b).

  • Print PDFs at 100% scale on a standard office printer.
  • Check the pattern dimensions with a ruler after it's printed.
  • In Leaf Analyzer, enter the exact pattern dimensions in Settings → Pattern.

Note: 1). Leaves must be placed within the Region of Interest (Fig. 6a). Any objects beyond the cut-off line will be disregarded. 2). If you add text labels to the image, place them only in the reserved text region (Fig. 6a). The text must also be within 3 cm of the top border of the ROI. Currently, the text recognition model supports digits (0–9), letters (a–z, A–Z), and three special characters: dash(-), underscore(_), and dot(.).

Leaf Analyzer pattern details Pattern dimensions setting

Figure 6. (a) Pattern specifications. (b) Pattern tab on the Settings panel.

1.4 If your images were taken without the Leaf Analyzer pattern

If your images don’t include the Leaf Analyzer calibration pattern but have a white (or light) background and an independent scale reference (e.g., a ruler), you can follow the steps:

  • Overlay the Leaf Analyzer pattern onto the image using our online tool (https://techlauncher-leafanalyzer.github.io/AprilTag-Overlay-Tool/).
  • Run Leaf Analyzer to measure traits in pixels. (Settings → Output → Dimension unit → pixel.)
  • Convert to metric units using a known-length object in the image (by multiplying a constant factor in the output spreadsheet file).

Tip: The scale factor of area-based traits is the square of the factor for length-based traits.

1.5. Video Tutorials

Leaf morphological trait measurement demo Youtube link or Youku link

Leaf damage assessment demo Youtube link or Youku link

2. Tweak default settings (if needed)

The default settings work in most cases. In the scenarios below, you may wish to adjust them.

2.1 Adjust the min leaf area threshold

Leaf Analyzer applies a minimum leaf area threshold to speed up processing and suppress background noise (e.g., dirt). By default, this threshold is 5% of the largest leaf area in the image. If some small leaves are not segmented because they are much smaller than the largest leaf (Fig. 7b), lower the threshold to include them (e.g., 1%; Fig. 7c).

Where: Settings → Advanced → Min leaf area.

Tweak_min_area_RGB Tweak_min_area_RGB - original results Tweak_min_area_RGB - updated results Set min area threshold

Figure 7. (a) Original RGB image with large size variation among leaves. (b) Two very small leaves are missed with the default Min leaf area threshold. (c) All leaves are segmented after lowering the threshold to 1%. (d) Location of the Min leaf area control in the Settings panel.

2.2 Toggle Fill holes

By default, Leaf Analyzer performs hole filling during post-processing to improve object completeness. This could end up with undesired results (Fig. 8b). If so, disable the option to preserve internal holes (Fig. 8c).

Where: Settings → Advanced → Fill holes (check/uncheck).

Fill_holes_RGB Fill_holes - original results Fill holes - updated results Fill holes button

Figure 8. (a) Leaf with holes/punches. (b) With Fill holes enabled (default), holes are filled. (c) Unchecking Fill holes preserves them, yielding the desired segmentation. (d) Location of the Fill holes toggle in the Settings panel.

2.3 Incorporate additional features for segmentation

The proposed LBS feature works well for leaf segmentation in most cases. However, in some challenging situations, more features may need to be added to improve the segmentation. For example, when leaves have strong reflection, you may need to incorporate texture features; when dark leaves are imaged under uneven lighting, you can add the Dark Green Color Index (DGCI) feature.

Where: Settings → Clustering → check/uncheck additional features.


(a)

(b)

(c)

(d)

(e)
Figure 9. Dark leaves under uneven lighting — (a) input image; (b) LBS segmentation binary mask with loss of peripheral leaf area; (c) LBS+DGCI segmentation binary mask; (d) LBS+DGCI+LoG segmentation binary mask, with further enhanced boundary completeness; red boxes indicate segmentation errors. (e) Location of the additional features in the Settings panel.

2.4 Enable Perspective correction

Perspective correction is off by default. If images were captured at a skewed angle (not normal to the pattern plane), enabling this option can improve geometric accuracy (Fig. 10c).

Where: Settings → Advanced → Perspective correction.

Fill_holes_RGB Fill_holes - original results Fill holes - updated results Fill holes button

Figure 10. (a) Image captured at an oblique angle. (b) Segmentation using default settings (perspective correction off). (c) Segmentation with Perspective correction enabled. (d) Location of the Perspective correction control in the Settings panel.

2.4 Switch to Thresholding method for segmentation

The default automatic Clustering method assumes that the ROI contains only the objects of interest against a white or light background. If the ROI includes unwanted objects or non-background colors (e.g., soil, pots/containers, or other clutter), you should switch to the Thresholding method, which applies HSV-based thresholding. The default thresholds are tuned for green colors, so if your leaves are green, this method should work out of the box (Fig. 11). If leaves are touching and you need per-leaf traits, enable Watershed in the settings and adjust the watershed minima threshold if needed (Fig. 11c).

Where: Settings → Advanced → Watershed.

Arabidopsis grown in pot Thresholding Settings Settings - watershed Arabidopsis per leaf area

Figure 11. (a) RGB image of Arabidopsis grown in a pot. (b) Location of the thresholding settings in the Settings panel. (c) Draw a polygon region of interest. (d) Per-channel histogram of the drawn region of interest.

If the default HSV thresholds do not work well, you can manually adjust the three channels (Hue, Saturation, Value) (Fig. 11). To estimate suitable value ranges for your object of interest, click Select Region (Fig. 11b) and draw a polygon region (Fig. 11c) to display the HSV histograms for the selected area (Fig. 11d). These histograms can guide threshold tuning for more accurate segmentation. You can also click Save Settings to store your thresholds for future use; next time, simply click Load Settings to restore the saved thresholds.

Note: If the leaves and the Leaf Analyzer pattern are not on the same plane (e.g., a potted plant as in Fig. 11a), trait measurements should be calibrated by multiplying a constant factor C. The calibration steps are simple (see Appendix A of our paper for details):

  1. Place a planar calibration target (e.g., a colored geometric shape) with known true area A_ref on the same plane as the plant.
  2. Measure its area in Leaf Analyzer to obtain A_I,ref.
  3. Compute the calibration constant:
    C = A_ref / A_I,ref

Once C is known, calibrate subsequent measurements as follows:

  • Length-based traits (e.g., length, width, perimeter):
    L_C = L_I * sqrt(C)
    where L_I is the value reported by Leaf Analyzer and L_C is the calibrated value.

  • Area-based traits (e.g., leaf area):
    A_C = A_I * C
    where A_I is the value reported by Leaf Analyzer and A_C is the calibrated value.

If the relative displacement and orientation between the camera and the plant are kept fixed (e.g., using a tripod and a consistent setup), then C remains constant and the calibration only needs to be performed once.

Citation

If you find Leaf Analyzer useful in your research, please star ⭐ this repository and consider citing 📝:

@article{LeafAnalyzer,
title = {Leaf Analyzer: A fully automated and open-source tool for high-throughput leaf trait measurement},
journal = {Plant Phenomics},
volume = {8},
number = {1},
pages = {100145},
year = {2026},
issn = {2643-6515},
doi = {https://doi.org/10.1016/j.plaphe.2025.100145},
url = {https://www.sciencedirect.com/science/article/pii/S2643651525001517},
author = {Tao Hu and Richard Poire and Danielle Way}
}  

Or

Tao Hu, Richard Poire, Danielle Way, Leaf Analyzer: A fully automated and open-source tool for high-throughput leaf trait measurement, Plant Phenomics, Volume 8, Issue 1, 2026, 100145, ISSN 2643-6515, https://doi.org/10.1016/j.plaphe.2025.100145. (https://www.sciencedirect.com/science/article/pii/S2643651525001517)

About

Leaf Analyzer - an automatic leaf trait measurement tool

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages