The use of computer vision to estimate tree diameter and circumference in homogeneous and production forests using a non-contact method

Abstract Tree diameter and circumference measurements are important metrics that should be monitored periodically and which can be used to determine rates of plant growth, timber production (wood), rubber tapping time, and to estimate the nutrient content of the soil in agroforestry especially for rubber and Albizia sp. trees. In this study, we evaluated the use of optical sensors, including a smartphone camera, which were analyzed by an image processing technology to estimate tree circumference of homogeneous and production forests especially rubber and Albizia forest plantations, through a real-time tree diameter measurement approach. Camera measurements were carried out for the diameter at breast height (DBH) and a certain distance of each tree (with the diameter of tree range of ∼6–50 cm). The results show that the use of smartphone camera measurements is highly correlated with manual measurements obtained using a tree caliper or meter tape in estimating tree circumference with coefficient of determination (R 2) and RMSE of 0.95 and 7.9 cm, respectively. Thus, this tool can be employed as an alternative method for measuring tree diameter and circumference.


Introduction
Nowadays, industries requiring wood-based materials have specified their needs of certain tree diameter sizes. Thus, farmers can be competitive in addressing such needs. The way to increase the competitiveness of farmers in improving the quality of forest products is through good forest management. Forest management and tree plantations require accurate information about the state of the land, as well as its potential and growth. It is well known that good forest management can increase forest productivity, and the value of social capital (Lee et al. 2017), and agroforestry (plantation with homogeneous species) is no exception to this. Forest inventory is needed to support forest management planning. One aspect of forest inventory is tree diameter measuring and mapping administered on an ongoing basis. Accurate surveys, mapping, and forest resources assessments are essential steps for efficient forest management (Tewari 2016).
In Indonesia, the use of technology for forest inventory activities is still limited. Therefore, this particular area is in an urgent need of innovations to improve forest management's efficiency and effectiveness, especially the use of technology for surveyors to support field activities. This involves digitizing the methods used to determine the diameter of the tree and its spatial location.
Determining tree diameter and tree height to monitor plant growth is a method of conducting an inventory and recording of tree properties to improve competitiveness. Each tree undergoes two different forms of growth: vertical (height) and horizontal (diameter). Several studies (Iizuka et al. 2017;€ Ozçelik et al. 2018) show that tree properties can be used to determine plant age; thus, such properties can be used as a reference for plant maintenance. Diameter is an important dimension in estimating tree potential and growth. Diameter data is needed to calculate the value of the base area of height and determine tree volume. Information concerning tree diameter data can also be used for fertilizer estimation (Onuwaje & Uzu 1982;Ponder 1998). To determine tree diameter, farmers still often employ the manual method using a caliper and measuring tape.
Moreover, tree coordinates recording is still done independently and manually by survey workers; thus obtaining systematic data logging of tree allometry and coordinates can be time-consuming. Despite the lengthy process, stakeholders often insist on continuing to employ these workers to survey and monitor trees as a means of empowering them. However, there is a need to increase accuracy and to minimize errors made by surveyors when recording plant diameter which can be challenging when done manually. For instance, determining tree height can be difficult in real-time, and this can be performed via an approach of determining the diameter of a plant using advanced technology such as unmanned aerial vehicles (UAV) (Iizuka et al. 2017). However, the use of UAV requires relatively expensive maintenance. On the other hand, one the potential low-cost tool that can be exploited is the smartphone. This device is generally accepted to have such conveniences as integrated sensors, including cameras, GPS, gyroscope, etc. To achieve proper identification, computer vision (CV) technology can be incorporated. CV technology uses a camera and computer instead of human eye to identify, track, and measure targets for further image processing and has been widely used throughout agricultural automation (Tian et al. 2020).
A previous study has provided a solution in automated digitization of tree rings and their spatial coordinates, incorporating a smartphone and additional external sensors such as ultrasound sensors (Putra 2019). Another group employed a digital camera for detecting tree rings (Fabija nska et al. 2017). The current study is a continuation of previous work related to the measurement of the tree circumference. In this study, we developed a non-contact tree circumference monitoring system by utilizing a smartphone camera incorporated with CV technology as an alternative low-cost tool. We describe the methods and performance of the system in estimating tree circumference. We hypothesize that utilizing advanced technology, such as computer vision, can accelerate and increase the effectiveness and efficiency in measuring tree diameter and circumference within plantation areas.

Study area
This study was conducted in the agroforestry plantation area belonging to Jember University (À8. 1617393, 113.7093914), and several areas belonging to State-Owned Enterprise (PTPN XII). Tree species were sampled, namely: rubber (Hevea brasiliensis) and silk (Albizia chinensis). We focused on these homogeneous forests as production forests, which are usually planted by smallholders and State-Owned Enterprise (PTPN XII). Characteristics of each species tend to be the same throughout Indonesia due to national regulation for agroforestry management. According to the regulation of the Director-General of Forestry and Business Development (No. P.04/VI-BUHT/2012), the cropping pattern of homogeneous plants is at least 400 trees/ha or can be adjusted based on the needs. In this condition, CV technology can be used even though the canopy conditions are very dense ( Figure 1). Besides, sensor technology like CCD or CMOS is developing rapidly; hence, the camera's quality is getting better, including the camera ability in auto-configuration toward uncertain light intensities. However, in this study, we focused on the development of the measurement system for these homogeneous forests. Thus, a variety of tree diameter is required.

Data collection
The most widely used parameter in agroforestry management especially in estimating forest productivity is the tree diameter. Tree species that are used for timber products usually are usually measured by applying the parameter of tree diameter. In practice, the tree circumference parameter is still used as a reference in determining the rubber tapping time and cutting the trees. For rubber tapping, the circumference of the rubber tree should have at least 50 cm at a height of 1 m from the ground (Wauters et al. 2008). However, the early stage for rubber tapping can cause substandard growth of the rubber tree.
The current study which is an extension of the previous study (Putra 2019) focused on the optical sensors used to detect and estimate the tree diameter. Each tree diameter was measured at $4.5 feet above the ground or diameter at breast height (DBH) using two experimental methods. Data were collected for a total of 90 trees (taken from two different species, namely: rubber and silk trees), of which 60 were used for calibration, and a set of 30 was used for validation. The diameters and circumference of trees ranged between $6-50 cm and $18-150 cm, respectively. The actual values of the diameter and circumference of the trees were collected separately. The collected data were used to see the accuracy of measurements using a camera to estimate tree diameter and circumference. For diameter, both actual and predicted values of each tree diameter were taken once from the same direction. Calibration and validation data are depicted in Figure 2.
Experiment 1 utilized manual measurement by using tape, and experiment 2 employed measurement via smartphone camera (using auto-focus and autoconfiguration) with the indicated platform and stick. The images were captured in the day time between $09.00-16.00 h. A specific distance (1 meter) between the camera and each tree was used as a reference during measurement. In addition, this custom platform was made using aluminum and handy to use. This distance is ideal for measuring the agroforestry tree, such as Albizia and rubber tree. The high gap between a tree and a camera during measurement can cause background removal complications in the CV process. Illustration of the capturing method and image obtained is shown in Figure 3.

Image processing
Images were captured using a smartphone camera at an original size of 500 Â 375 pixels (Figure 3), which was cropped to a size of 310 Â 120 pixels ( Figure  4(a,b)). Cropping of the image is employed to simplify and accelerate the segmentation process. The sizes of captured and cropped images were notated as x Â y and x 0 Â y 0 , respectively. The cropping process of the captured image was based on the particular image coordinate, where each image was cropped at the same coordinate.
The use of several methods of segmentation including Otsu's method, adaptive thresholding, K-means, HSV, and vegetation indices, was outlined in a previous study (Marques et al. 2019). Image segmentation based on the HSV approach for identification of the trunk was used in this study; to segment the trunk and its background, the best-fitted HSV was applied to cropped images, and the evaluation of different tree rings was based on the various sloping tree conditions.
To estimate tree diameter, we used an approach with a flat-area calculation. The area measuring principles of parallelograms (Figure 4(c)) and rectangles (Figure 4(d)) were used during analysis of the image for estimating tree diameter. Thus x'' represents the value of estimated diameter (Figure 4(c-d)). However, since the ratio of the diameter and circumference of the samples were relatively constant, thus the circumference (predicted) obtained using camera was calculated from p Â D, where p is 3.14, and D is the estimated diameter obtained by CV.

Statistics
Correlation analysis was used to fairly compare the collected data based on experiments 1 and 2. The performance of the linear regression model was examined by comparing the coefficient of determination (R 2 ), the root means square error (RMSE), and the significance level of 0.05 using jupyter notebook. Experiment 1 was performed for determining observed values, while experiment 2 was performed for obtaining predicted values. RMSE was analyzed using the formula Equation (1): where Pred and Obs are the predicted and observed values, respectively, and n is the number of samples.

Regression models for estimating tree diameter
In this study, the tree diameter and circumference were estimated by using CV technology. The regression model was developed for evaluating the relationships between the predicted tree diameter and the actual tree diameter. Herein, the image processing results were compared with manual measurement results through linear regression. The results of linear regression y ¼ a 0 þa 1 x (Table 1) demonstrate that both predicted value of tree diameter and circumference obtained by image processing are highly correlated with both actual tree diameter and circumference, with an R 2 of greater than 95% ( Figure 5). The linear regression model provides the best prediction of tree diameter and tree circumference, of which application for predicting these measurements was validated in the previous studies (Kan et al. 2008;Putra 2019).
The CV-mediated approach and the developed models were proven to be useful, time saving for surveyors, and labor costs saving for the company in monitoring timber quality. However, these models were substandard if applied to the particular tree species in agroforestry such as rubber tree due to the high  value of RMSE. This was affected by a single shot measurement of the tree diameter using a camera that cannot describe the average diameter. According to Rodr ıguez et al. (2015) both minimum and maximum value of tree diameter measurements can be averaged and used as a reference to describe the diameter of a tree, especially for the tree with geometric shapes that tend to be an ellipse. A ratio between the tree diameter and circumference is one of the parameters used for estimating timber quality. An inconsistent ratio between the diameter and circumference of a tree at different ages indicates the low timber quality.

Evaluation of linear models for tree diameter and circumference
To test the model performance, a validation step was conducted. In this stage, a calibration data model was evaluated by testing a set of validation data by comparing the predicted value with the actual value. The data showed that these validated models in estimating tree circumference using tree diameter (predicted) resulted in a strong relationship with R 2 and RMSE values of 0.95 and 7.9 cm, respectively ( Figure 6). However, the resulting RMSE was still too large to predict the tree circumference using the tree diameter parameter. In fact, according to another previously developed model for Albizia sp. trees (Riyanto & Pamungkas 2010), the tree circumference at breast height increases at the rate of >1 cm/month, which can occur within the range of 1 to 24 months. However, at the age of more than 24 months, the growth of tree circumference is <1 cm/month. This was consistent with another study (Matsushita et al. 2015) indicating that the rate of increase in the diameter of a tree will slow down when it reaches its optimum age of growth. Thus, an RMSE level of $7.9 cm still needs to be reduced.  The approach to estimate tree ring diameter (Fabija nska & Danek 2018), tree circumference (Ali et al. 2008), tree height (Miller et al. 2015), canopy cover (Yu et al. 2017), and other parameters (Payne et al. 2013;Qureshi et al. 2017) has been performed using CV technology and was subsequently validated. On the other hand, the biometrician uses tree diameter rather than tree circumference. However, in agroforestry, especially rubber trees, the determination of tapping time should be done by determining the circumference (Chandrasekhar et al. 2005).
The difference in the size of the estimated tree circumference as determined by measuring the circumference using a measuring tape still resulted in a significant gap. The irregular growth of tree trunks and sloping trees against the soil can cause bias in estimating tree circumferences by the use of tree diameter measurements. In addition, the number and distribution of collected samples need to be considered in the data interpretation and model development. In this study, data interpretation was limited at DBH range of $6-50 cm and focused on homogeneous forests such as rubber and Albizia which have regular planting patterns. For the measurement of the Larger DBH size of this study, it requires different custom platform with a larger reference distance between the tree and the camera.
In terms of technical aspects, segmentation of the tree and its background using traditional CV requires some efforts, especially in the different environmental conditions such as different light intensities. Since the lights conditions in the field are almost similar, especially in homogeneous forest trees such as rubber and Albizia, the segmentation process using CV can be more manageable. Adjustment of light parameters can be done in the preset of camera or post-processing of images using CV. Furthermore, different segmentation methods in traditional CV can lead to different results (Marques et al. 2019). However, the intensity of light entering through the tree canopy gap did not significantly affect tree trunks measurements using CV.
On the other hand, the two parameters, tree circumference and tree diameter, are utterly crucial in developing the system by utilizing the traditional CV technology and must be considered as parameters for estimating tree growth and yield. For further study, these segmentation methods in traditional CV can be compared with deep learning for CV to achieve an optimal approach for identifying tree diameter and circumference.

Conclusion
Improving the effectiveness and efficiency of resources (e.g., time and labor) during periodic recording and monitoring of tree diameter and circumference, is important for forest management. In this study, the tree diameter and circumference were estimated by using CV technology. A particular distance between a tree and the camera is the key point and used as a reference for each tree measurement.
Measurements conducted by using a camera show an acceptable accuracy with a coefficient of determination of 95%. The RMSE of predicted tree circumference reached 7.9 cm. However, this method is applicable only to trees with relatively round shapes and cannot be used for trees with obviously elliptical shapes. Several aspects affecting measurement errors, especially for homogeneous and production forests via the use of CV, include the presence of sloping trees, irregular geometric forms of tree shape, and segmentation methods of CV.
This can be used as an alternative method within tree allometry measurements to support decision making. Our future work aims to encompass the optimization of segmentation methods by using deep learning, and the development of a mobile application to be considered for use by smallholders/field-surveyors.