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:
This motivated a full revision grounded in mathematical accuracy and camera geometry.
Assumptions for Measurement
To ensure consistency, the algorithm assumes:
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:
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:
It computes the tree diameter by:
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:
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
Join us in cooling the planet!