Measurement errors in the use of smartphones as low-cost forestry hypsometers

Various applications currently available for Android allow the estimation of tree heights by using the 3D accelerometer on smartphones. Some make the estimation using the image on the screen, while in others, by pointing with the edges of the terminal. The present study establishes the measurement errors obtained with HTC Desire and Samsung Galaxy Note compared to those from Blume Leiss and Vertex IV. Six series of 12 measurements each were made with each hypsometer (for heights of 6 m, 8 m, 10 m and 12 m). A Kruskall Wallis test is applied to the relative errors to determine whether there are significant differences between the devices. The results indicate that the errors of the uncalibrated smartphones significantly exceed those of traditional forestry apparatus. However, calibration is a very easy procedure that can be done by means of a linear regression line between real angles (obtained with a Digital Angle Finder or with a series of measurements taken independently of the experiment), and the angles of the accelerometer. With this adjustment, the smartphones achieve adequate quality levels although the bias was not totally eliminated. The relative errors when pointing with the edges of the terminal show no significant differences compared to Blume Leiss. Applications that use the screen image give better results (no significant differences were detected with Vertex). There is currently no application that offers calibration of the linear regression slope, which is an essential requirement for ensuring the accuracy of height measurements obtained with smartphones.


Introduction
The main variables provided by forest inventories are diameter at breast height and height.These data are used both for National Forest Inventories and in research projects into ecology and forest management in order to obtain volumes, size of the structure and amount of biomass (Kitahara et al. 2010).
Recently a series of smartphone applications have appeared on the market which enable the measurement of tree heights.These measurements are based on the data provided by the 3D accelerometer, which indicates the inclination of the device with regard to three axes.The present work follows the nomenclature used in Lee and Cho (2011), with three orthogonal axes that intersect in the centre of the device, parallel to the shorter edge of the screen (axis X), to the longer edge of the screen (axis Y), and perpendicular to the screen (axis Z).
There are two kinds of applications that use the smartphone as a hypsometer.One kind uses the image projected on the screen by the camera lens.These applications calculate the height based on rotations around the Y axis if the screen is placed in landscape format, or around the X axis if placed in portrait mode.This is the case of Smart Tools in its Height mode (Smart Tools co.2012) and Measure Height (Deskis OU 2012).The other kind is aimed at the tree using the lines on the smartphone case, and measures the rotations around the Z axis.Smart Tools in Slope mode (Smart Tools co.2012) and aHypsometer Lite (Taakkumn 2012) are applications of this type.
A different type of estimation of tree heights with smartphones can be made from images taken with a camera and subsequently processed to correct the obliquity (Zhang and Huang 2009;Han 2013).
There are very few studies on the accuracy of the tree height data obtained with smartphones.Itoh et al. (2010) analysed the accuracy of the iPhone by comparing the heights obtained with TruPulse 200 with the heights obtained with a laser telemeter.In this case the application used is based on the rotation of the Z axis when aiming with the upper edge of the iPhone.
To establish the quality of the measurements in forest inventories, the most commonly used criteria are those of the Forest Inventory and Analysis program (FIA) of the USDA Forest Service (Pollard et al. 2006), which contains a list of maximum permitted errors for the different tree (total height, diameter at breast height, crown diameter, etc.) and forest stand variables.These quality criteria for forest measurements have been used in various studies (Roesch 2002;Pollard et al. 2006;Kitahara et al. 2009;Kitahara et al. 2010).There are other quality criteria used in national inventories, but their application is limited to a more localised scope.
Given the current proliferation in the use of high-performance smartphones, it is well worth assessing their potential as tools for forest measurement.The aim of the present study is to establish the accuracy of smartphones as low-cost hypsometers in the measurement of tree heights at previously measured distances, in comparison with two of the most widely-used tools in the forestry sector, Blume-Leiss and Vertex.

Hypsometers used
The reference forestry hypsometers were a Blume-Leiss BL-8 and a Vertex IV (Haglof).In both cases, as with the measurements taken with the smartphones, the measurements were done by the same experienced staff (two measurers) in order to avoid problems associated to inexperience (Kitahara et al. 2009;Kitahara et al. 2010) or to repetitions made by different operators (Skovsgaard et al. 1998).In all cases, the hypsometers were used without the support of a tripod.
Height measurements in smartphones are made using data collected by the built-in internal 3D accelerometer.This sensor detects changes in linear acceleration along three axes and makes it possible to determine the inclination of the terminal (this is the sensor used by applications that automatically rotate the screen).Some smartphones also incorporate a gyroscope that allows detection of the angular velocity along three axes.
The smartphone terminals analysed were a Desire (HTC Desire, Bravo) and a Note (Samsung Galaxy Note, GT-N7000).The features of their sensors were obtained by means of the Elixir 2 application (Barta 2012).
HTC Desire has a three-axis accelerometer BMA 150 (Bosch Sensortec GmbH) with a resolution of 0.153 m•s -2 .It does not have a gyroscope.
If the quality of the smartphone measurements is acceptable, the distance measurements for actual use can be made with a measuring tape (€10) or a laser telemeter (€100).In either case, the cost is lower than with traditional hypsometers (€700 for Blume Leiss or €1500 for Vertex).

Applications used
The Smart Tools software (version 1.5.0) was used in both terminals, since with the same application it is possible to take the measurements on the lengthways screen using the Height tool (with rotations on the Y axis), or on the edges of the smartphone case using the Slope tool (Z axis).The edge used to aim the Slope tool was the side of the screen, due to the fact that the edge of the HTC Desire case has a slightly curved design, and its lines are not so clear.
Prior to taking the measurements, the smartphone was calibrated following the application's instructions.Current applications only enable correction of zero error, which is obtained by placing the smartphone on a perfectly level surface and setting the reading to 0 0 (the zero intercept is fixed).The calibration value was maintained throughout the tests.

Experiment
The measurers received several prior training sessions with the smartphones until they were able to repeat the measurements obtained.The experiment involved taking measurements on a building marked with targets at 4 heights, 6 m, 8 m, 10 m and 12 m.Each one was measured from a distance of 10 m, 15 m and 20 m (determined previously with a measuring tape).We selected the Department of Agroforestry Engineering building (our building job), and made marks up to the maximum height that could be reliably measured with a measuring tape (12 metres).We also took measurements at the base of the target (to determine total height) and at the observer's eye level (to control levelling).Six repetitions were taken on different days, with a different angle of sunlight, cloud cover, wind, etc.The height and distance measurements were made with a measuring tape to verify the hypsometer readings.
In order to determine whether the measurements obtained with the smartphones had admissible errors, we followed the criteria used in the Forest Inventory and Analysis program (FIA).According with FIA criterion, the limit for the "height" variable is established at a minimum of 90% of the measurements obtained for individual trees with an error of less than 10% (Pollard et al. 2006).

Calibration
During the previous tests, a systematic error was detected in the smartphone measurements, due to a deficient internal transformation between the data from the accelerometer and the angle values (Fig. 1).This deficiency was present in both smartphones, and in both cases the measurements underestimate the true values.The linearity was found to be maintained, and this could therefore be corrected using linear regression.To avoid making the fit based on the data from the experiment, independent series were carried out for the calibration.
The calibration of the Slope tool was done by placing the lower edge of the case smartphone on a previously levelled Nedo Winkeltronic 600mm Digital Angle Finder (resolution: 0.1°, accuracy: ± 0.1°).Four repetitions were made (following the criterion used by Kitahara et al. 2010), measuring the angles 0°, 20°, 25°, 30°, 35°, 40°, 45°, 50°, 55° and 60° in each repetition.Between each repetition, the smartphone was rotated 360° around each of its three axes.The linear regression slope and the value of the coefficient of determination R 2 were obtained from the data on the angles measured with the smartphone, and the angles measured with the Digital Angle Finder.
The calibration of the Height tool was done on the heights and distances in the experiment, and the measurements were taken in four repetitions (following the criterion used by Kitahara et al. 2010) made on a different day from the experiment.Between each repetition, the smartphone was rotated 360° around each of its three axes.In this case, the height measurements obtained needed to be previously transformed into angle values.The linear regression slope was drawn and the coefficient of determination R 2 was derived from these angles and the real angles measured with a tape measure.

Statistical analysis
The statistical analysis of the measurements was made using the statistical package R.For each hypsometer, the mean, median, standard deviation and the 95% confidence interval was calculated for the relative errors (Eq. 1) and for the modulus of the relative errors (Eq.2) of the six repetitions.The value of the root-mean-square error (RMSE, Eq. 3) was also calculated for the relative errors.
x 0 , x 0,i = height obtained with hypsometer x, x i = height obtained with tape measure n = 72 Before proceeding to contrast the populations, the Shapiro Wilk test was applied to analyse the normality of the data, and Bartlett's test was used to test their homoscedasticity.Wherever the requirements for the use of the analysis of variance were not met, the nonparametric Kruskal Wallis test was used to contrast the data.In this case, the multiple comparison test after Kruskal-Wallis was done with the "kruskalmc" tool in the "pgirmess" package, with a p-value of 0.05.

Results
Fig. 1 shows the results of the experiment without correction.The greater accuracy of the traditional forestry hypsometers can clearly be seen.The two smartphones reveal serious deficiencies due to their underestimation of the data, regardless of whether they calculate the heights using the Y axis (Height tool) or the Z axis (Slope tool).The greater height measurements can be seen to have more significant errors.Table 1 and Table 2 show the total results obtained in the experiment.As in Fig. 1, Table 1 confirms that the two smartphones, regardless of the method used to take the measurements, reveal greater errors prior to calibration than the traditional forestry tools.A bias can also be seen in the 95% confidence intervals for the relative errors (Table 2).These intervals are significantly displaced towards negative values in the uncalibrated smartphones.The case of HTC Desire is particularly serious, as it does not even meet the minimum requirements of the Forest Inventory and Analysis program of the USDA Forest Service (FIA).The high errors obtained in the uncalibrated smartphones are confirmed by statistical analysis.The nonparametric Kruskall Wallis test was used (which gave a p-value of < 2.2•10 -16 ) due to the heteroscedasticity indicated by Bartlett's test.The results of the multiple comparison test between devices is shown in Fig. 2. The smartphone errors are significantly higher than those of the forestry hypsometers, regardless of the terminal model or the axis used.
Fig. 3 shows the differences between the measurements according to the Z axis obtained with the Digital Angle Finder and the terminals.The proportionality of the internal error in the conver-

Discussion
It is important to highlight that the present study analyses the errors in measurement, not the speed at which the measurements are taken.This aspect has been studied in forestry hypsometers (Bozic et al. 2005;Tallant and Pelkki 2004) but not in smartphones.Although the time required to take the height measurements was similar in all the hypsometers (aiming and reading the results), the differences in their actual use is due to the previous phase of measuring the distance to the object.In the present study, owing to the fact that the measurements were taken at fixed distances previously measured with a tape, no differences in the times were detected.
The errors obtained using traditional forestry hypsometers are similar to the findings of other studies.The maximum (7.6%) and mean (2.96%) values of the modulus of the relative error of the Blume Leiss in this work are similar to the results of the study on Fagus sylvatica by Rondeux and Claustriaux (1983), which found values of between 10% and 1% respectively.
The median of the modulus of the relative errors for the Vertex was 0.8%, lower than reported by Kitahara et al. (2010).This is due to the fact that these measurements were made by inexperienced surveyors.The effects of training show that the errors in the equipment of Kitahara et al. (2010) decrease towards the value indicated in the present study.Williams et al. (1994) obtained errors with the Laser Height Finder that are similar to the rest of the hypsometers.This could be related with the early preproduction model used and with the low number of samples taken with this hypsometer.
The comparison with other analyses of errors obtained using smartphones as forestry hypsometers is limited, due to the scarcity of available studies.Itoh et al. (2010) uses an iPhone and calculates a Root Mean Square Error of 0.7 m for measurements of 10 m in height from a distance of 20 m.In the present study the value for Root Mean Square Error obtained for the same variables is 0.63 for Note and 0.86 for Desire (without calibration), very similar to the above.
The smartphone results indicate that a prior calibration is required to correctly transform the data from the accelerometer into angle or height measurements.This transformation error is not exclusive to these hypsometers (Skovsgaard et al. 1998;Lukic et al. 2005).This bias may be negligible in the normal use of a smartphone (screen turns, tilting while gaming) but it is unacceptable if we need to obtain precise measurements of slopes.It is surprising that the manufacturers have failed to correct this underestimation of the values, which is common to both the smartphones analysed, and on the two axes.Vertex is the only hypsometer that does not have this systematic error.However, the smartphones reveal highly defective source transformations, which makes them practically worthless for use in measuring the height of trees.The errors obtained with the uncalibrated measurements far exceed those of the forestry hypsometers, and in some cases do not meet the minimum required by the USDA Forest Service (Pollard et al. 2006).
The use of the Slope tool shows systematic errors towards lower values in both smartphones, even after calibration.This bias is similar to the one seen in the Blume Leiss.The reason for this error is that the calibration process was done with a Digital Angle Finder, not with the experiment height measurements.The fact that this is not a direct calibration may cause distortions to appear, as when the lower edge of the smartphone case (calibration reference) and the upper edge of the screen (height measurement reference) are assumed to be perfectly parallel.It is therefore advisable to make the calibrations using real height measurements, as was done with the Height tool.
The process of calibrating the smartphones considerably improves measurement errors.The statistical analysis indicates that with this calibration procedure the measurements are significantly equivalent to (Desire) or better than (Note) the Blume Leiss.The measurements obtained with the Vertex were observed to be the best quality (these results coincide with those of Lukic et al. 2005), but they do not present significant differences with those obtained with Height tool.The lower errors obtained in Note compared to Desire are due to the greater resolution of the accelerometer and the presence of the gyroscope.
The proportionality between the data from the accelerometer and the smartphone measurements makes it simple and effective to establish a linear regression slope.Surprisingly, although some of the applications allow the calibration of the accelerometer, as in the case of Smart Tools (Smart Tools co.2012), this is limited to setting 0, and does not allow the adjustment of the linear regression slope.It is essential to incorporate this calibration procedure into all smartphone applications intended for the estimation of angles based on measurements from the accelerometer.

Fig. 1 .
Fig. 1.Mean values of errors (6 repetitions) before calibration, for each hypsometer and height (6 m, 8 m, 10 m and 12 m).Desire = HTC Desire; Note = Samsung Galaxy Note; Height = Tool Height (Smart Tools); Slope = Tool Slope (Smart Tools).The data on the left for each hypsometer (dashed box) correspond to a distance of 10 m; those in the centre to 15 m; and those on the right to 20 m.

Fig. 3 .
Fig. 3. Differences between the smartphone readings (measured on axis Z) and those of the Digital Angle Finder (Right angle).