🌳 Rethinking DBH Estimation in the TREEO App: From Underestimation to Precision

Tree monitoring using the TREEO App

The TREEO App uses a smartphone Android camera and a TREEO calibration card to measure Diameter at Breast Height (DBH), a critical metric in forestry. However, we discovered that the existing algorithm systematically underestimates DBH, prompting a thorough examination of the assumptions, geometry, and implementation behind the scenes. This blog post guides you through that journey, explaining how we approached the problem and where we are heading.

Why DBH Matters
DBH is the standard method for estimating tree volume, biomass, and carbon sequestration potential measured 1.37m above ground. In the TREEO ecosystem, it plays a key role in data collection and verification for sustainable forestry projects and carbon finance.

The Problem: Underestimated DBH
Despite good intentions, the current DBH algorithm had critical shortcomings:

  • It assumed a fixed camera angle (81.5°), which was fine when we started TREEO in 2021, as cameras had a standard lens. Still, today it doesn’t match real-world variation across Android devices with multiple kinds of cameras.
  • It hardcoded a camera-to-card distance of 30 cm was a good rough distance estimate, but it is unnecessary, as we can calculate the real distance, and it is reducing adaptability to different users.
  • In the C-Code (not visible to users), the Tree width was mislabeled in units (mm treated as cm), leading to likely misinterpretation for developers.

This motivated a full revision grounded in mathematical accuracy and camera geometry.

Assumptions for Measurement
To ensure consistency, the algorithm assumes:

  •  A TREEO card (ISO/IEC7810 ID-1 size:  85.6 x 53.98 mm) is visible and touching the tree.
  • The image is taken in portrait orientation.
  • The Card is fully visible in the image, and the TREEO logo is recognizable.
  •  The Camera resolution and angle are obtainable via Android APIs.
  • The trees are (almost) circular in cr   oss-section at DBH

Geometry Behind the Improved Algorithm
To calculate real-world dimensions from 2D camera input, we rely on trigonometry and similar triangles. Two new geometrical approaches were tested and validated:

📐 Trigonometric View-Angle Approach
This approach is based on the relationship between the field of view of the camera and the observed size of the TREEO card and tree in the image. It uses:

1. The camera’s horizontal field of view (β)
2. The pixel dimensions of both the TREEO card and the tree
3. Trigonometric relationships (tan, sin, cos) to calculate:

  • The distance from the camera to the card (y)
  • The tree’s real radius and diameter using a tangent-derived equation
Geometry

It models the scene as a projection of 3D real-world geometry onto a 2D image plane. It solves for the actual diameter by deriving a quadratic equation based on angle and distance.

🔺 Tangent-Triangle Geometric Approach
This method uses classic Euclidean geometry by constructing a triangle between:

  • The camera lens,
  • The edges of the visible tree, and
  • The TREEO card at the base of the tree

It computes the tree diameter by:

  • First, find the tangent distance from the camera to the tree’s edge
  • Then, using the geometry of an isosceles triangle to calculate the diameter via triangle surface area and the excircle radius

This method still uses β, image pixel measurements, and trigonometric relations, but it focuses more on triangle geometry and symmetry than projection math.

📐 Result: Despite different derivations, both approaches were mathematically equivalent, as shown through simplification and variable substitution.

Implementation in Code
The final code logic was implemented in C++ and compiled into image files that can be integrated to work with a native Android application using OpenCV.

Real-World Testing with 700+ Measurements
To ensure the updated DBH estimation algorithm performs reliably in real-world conditions, we conducted several test iterations across diverse regions and tree species.

More than 704 measurements were analyzed from multiple data collection efforts, including:

  • Field surveys in Germany, Uganda (Kasese), and forest plots in Asia and Africa
  • Audit campaigns like the CSI measurement series
  • Controlled tests using images processed through the TREEO App
  • Manual DBH comparisons using measuring tape and verified field protocols

This extensive field validation gives us the confidence to say the improved algorithm is not just theoretically sound, but also tested under practical field conditions.

We will deploy the new DBH algorithm for “some power” users first to collect real-world data. Please let us know if you want to join this. If this is successful, the TREEO App will feature it for everyone, too. 

Results & Takeaways

  • Improved Accuracy: The new formula removes hardcoded assumptions and allows device-specific calibration.
  • Mathematical Transparency: All variables are derived from first principles.
  • Code Simplicity: Implementation is straightforward to debug or evolve.
TAKE ACTION

Join us in cooling the planet!