A Tree Ring Measurement Method Based on Error Correction in Digital Image of Stem Analysis Disk

: Stem analysis is an essential aspect in forestry investigation and forest management, as it is a primary method to study the growth law of trees. Stem analysis requires measuring the width and number of tree rings to ensure the accurate measurement, expand applicable tree species, and reduce operation cost. This study explores the use of Open Source Computer Vision Library (Open CV) to measure the ring radius of analytic wood disk digital images, and establish a regression equation of ring radius based on image geometric distortion correction. Here, a digital camera was used to photograph the stem disks’ tree rings to obtain digital images. The images were preprocessed with Open CV to measure the disk’s annual ring radius. The error correction model based on the least-square polynomial ﬁtting method was established for digital image geometric distortion correction. Finally, a regression equation for tree ring radius based on the error correction model was established. Through the above steps, click the intersection point between the radius line and each ring to get the pixel distance from the ring to the pith, then the size of ring radius can be calculated by the regression equation of ring radius. The study’s method was used to measure the digital image of the Chinese ﬁr stem disk and compare it with the actual value. The results showed that the maximum error of this method was 0.15 cm, the average error was 0.04 cm, and the average detection accuracy reached 99.34%, which met the requirements for measuring the tree ring radius by stem disk analysis. This method is simple, accurate, and suitable for coniferous and broad-leaved species, which allows researchers to analyze tree ring radius measurement, and is of great signiﬁcance for analyzing the tree growth process.


Introduction
The tree growth model is an important method to evaluate tree growth, where stem analysis data is necessary to establish the model. We can obtain the change rules and growth process of factors such as diameter at breast height (DBH), tree height, form factor, volumes, and growth rate of the tree species. During stem analysis, the stem disk measurement is one of the primary steps, and the accurate number and spacing of tree rings are the basis to determine the growth of trees. Stem analysis is of great significance for the monitoring of forest tree growth state [1]. Annual rings are the archives of trees used to study forest yield, basal area increment, forest patch dynamics, insect outbreak, and tree growth response to climate change [2][3][4][5][6]. Tree ring width measurement mainly includes the microscope method [7], the image method [8], the ray method [9], and the tree ring analysis system based on a combination of the microscope and image methods [10]. Traditional tree ring identification methods mainly rely on manual measurement, which is laborious, inefficient, improved. Therefore, we explore to improve the measurement accuracy by establishing an error correction model to correct the geometric distortion of the image edge, and use the Open Source Computer Vision Library (Open CV) to design a set of tree ring image preprocessing algorithms and tree ring width measurement algorithm. Open CV is an open-source computer vision software, which is light and efficient [27], and can reduce the cost of measurement. In this study, based on the digital images of tree rings taken by digital cameras, an error correction model is established to correct the geometric distortion of image edge. Then, the regression equation of ring radius based on error correction is established to realize the measurement of ring radius. Finally, the image measurement system of tree ring is developed based on this research method. The method of measuring ring radius in this study is simple and easy, with high accuracy. It is suitable for coniferous tree species with a clear ring, and broad-leaved tree species with unclear early and late wood boundaries. When there is no professional ring measuring instrument or software, this method has more practical significance, and improves the overall processing level of trunk analysis data.

Data Sources
The experimental data sets of this study are self-drawn imitation data and Chinese fir stem disk data, as shown in Figure 1. be improved. Therefore, we explore to improve the measurement accuracy by establishing an error correction model to correct the geometric distortion of the image edge, and use the Open Source Computer Vision Library (Open CV) to design a set of tree ring image preprocessing algorithms and tree ring width measurement algorithm. Open CV is an open-source computer vision software, which is light and efficient [27], and can reduce the cost of measurement. In this study, based on the digital images of tree rings taken by digital cameras, an error correction model is established to correct the geometric distortion of image edge. Then, the regression equation of ring radius based on error correction is established to realize the measurement of ring radius. Finally, the image measurement system of tree ring is developed based on this research method. The method of measuring ring radius in this study is simple and easy, with high accuracy. It is suitable for coniferous tree species with a clear ring, and broad-leaved tree species with unclear early and late wood boundaries. When there is no professional ring measuring instrument or software, this method has more practical significance, and improves the overall processing level of trunk analysis data.

Data Sources
The experimental data sets of this study are self-drawn imitation data and Chinese fir stem disk data, as shown in Figure 1. Three drawn stem analysis disk samples were measured in four directions to measure the width, and the average values of the measurements in four directions were used to represent the real data set, to verify the research techniques and methods in this paper. The data are shown in Table 1. Table 1. Radius measurement dataset of self-drawn imitation stem disks. SNO is the sample number of the imitation stem disk. RNO is the number of the growth ring (the number starts at the heart of the pith). D1, D2, D3, and D4 represent four measurement directions. RV is the value of the radius of the ring. MV is the mean of the ring radius in the four directions.  Three drawn stem analysis disk samples were measured in four directions to measure the width, and the average values of the measurements in four directions were used to represent the real data set, to verify the research techniques and methods in this paper. The data are shown in Table 1. The data of Chinese fir stem disks was used as the test data set, and two stem disks were selected. Three people measured the annual ring radius data. The average value measured by three people was used to compare the accuracy with the subsequent tree ring radius identification data, to verify the practicability of the technical method in this study. The data are shown in Table 2. The four measurement directions of east, west, south, and north and the segment number are marked on the disk. A measuring direction line and a vertical line of the measuring direction were drawn on the stem analysis disk with a pencil through the pith. A ruler was placed along the measuring direction line to measure the radius line, to locate the zero in the pith. A digital camera or mobile phone was used to take images of the imitation stem analysis disk and Chinese fir stem analysis disk. The shooting diagram is shown in Figure 2, and the images were stored in JPG format. When shooting, the lens surface was kept parallel to the stem disk's surface, ensuring that the measurement path was parallel to the upper and lower edges of the viewfinder window. Scattered light provided the best lighting condition. The four measurement directions of east, west, south, and north and the segment number are marked on the disk. A measuring direction line and a vertical line of the measuring direction were drawn on the stem analysis disk with a pencil through the pith. A ruler was placed along the measuring direction line to measure the radius line, to locate the zero in the pith. A digital camera or mobile phone was used to take images of the imitation stem analysis disk and Chinese fir stem analysis disk. The shooting diagram is shown in Figure 2, and the images were stored in JPG format. When shooting, the lens surface was kept parallel to the stem disk's surface, ensuring that the measurement path was parallel to the upper and lower edges of the viewfinder window. Scattered light provided the best lighting condition.   collected images tend to have much noise. In the ring parameters measurement, ring boundary characteristics are the important basis of ring radius measurement. Therefore, it is necessary to preprocess the original image to eliminate the image's uneven background illumination and highlight the core of the pith and ring boundary. Image preprocessing steps are as follows, the detailed parameter description of the function can be found in Appendix A.

SNO
Step 1. Call the function cvtColor ( ) to gray the read image. Image grayscale processing can retain the image information of interest, reduce the size of the image effectively, and provide the save and process conveniently for the processor.
Step 2. Call the function threshold ( ) to binary the read image. It can reduce the amount of image data and highlight the contour of tree ring.
Step 3. Call the function resize ( ) to scale the tree ring image according to any specified value to improve the click accuracy of the tree ring.
The measurement path is created after image preprocessing from the pith to the bark, locating the point position of the annual ring. The user can select the measuring path with the mouse, then drag and click the corresponding tree-ring point. The system collects the pixel coordinates of the measured points and saves the results in the data table for that disk. The measurement procedure calls the function circle ( ) to obtain coordinates and display them, the detailed parameter description of the function can be found in Appendix A.

Research Methods
In this study, the measurement of the ring radius is to use the pixel coordinate capture function of the Open CV to realize the conversion between the pixel coordinate and the ring width, and indirectly realize the measurement of the ring radius. However, when the image is taken, the geometric position of the image edge will be distorted. Therefore, the geometric distortion correction model is established in this study, and then the geometric distortion correction model is introduced into the regression model of ring radius to improve the measurement accuracy of ring radius. The experimental process is shown in Figure 3. The specific steps are as follows:  The measuring scale was obtained from the pixel coordinate value and a ring radius with a true width, in accordance with the scale formula. The remaining annual ring radius of the analytic stem disk is obtained. The specific calculation principle is as follows: click  Step 1. Preprocessed the original digital image. The preprocessing process includes image graying and binary.
Step 2. Extract the pixel coordinates of annual rings, use pixel distance and actual distance to get the scale, measure the annual ring radius data of image.
Step 3. Establish the geometric distortion correction model by error value and the ring radius pixel distance.
Step 4. Establish the regression model of annual ring radius based on error correction and test its accuracy.

Calculate Ring Radius
The measuring scale was obtained from the pixel coordinate value and a ring radius with a true width, in accordance with the scale formula. The remaining annual ring radius of the analytic stem disk is obtained. The specific calculation principle is as follows: click on the digital image of pith o, the system records the coordinates of the pith core in the computer image coordinates (x o , y o ), and then click the intersection point a between any growth ring on the analytic stem disk and the measurement path, get the coordinates (x a , y a ) of the point in the computer image coordinates access to that point in computer image coordinates. Simultaneously, read the actual length R a from point o to point a on the scale. According to the two-point distance formula of computer image coordinates, the pixel distance d a between two-pixel points is obtained, and Equation (1) is used to calculate the pixel distance d a .
Click other tree rings on the digital image at the point b where they intersect with the measured path. The system obtains point b in the computer image coordinates (x b , y b ), and automatically calculates d b . The actual radius of the tree ring at point b is R b . The scale formula is shown in Equation (2).
Click the remaining tree ring points in turn on the digital image to obtain tree ring point coordinates, and then the uncorrected tree ring radius number R b can be obtained.

Measurement Error Correction
In measuring tree ring radius, many error factors affect the measured value, including geometric distortion in image and the error when clicking on the measuring point. In this study, the disk image was enlarged to pixel level in the retractable window, so the error when clicking the measuring point has little influence on the accuracy and can be ignored. The shooting of the images was performed using the small hole imaging principle; its physical property makes the light in the optical center position in a straight line, but with the distance between the light and the axis of the optical center, the refraction effect caused by the lens is more obvious. This creates a lens distortion, which is more evident at the image edge [28,29]. Therefore, on the premise of ensuring that images were taken, and tree ring data obtained by clicking are in line with standard specifications as far as possible, the influence of the pixel distance from the ring to the pith on the geometric distortion error is analyzed.
In this study, error separation technology is adopted in the process of tree ring radius measurement, the error value is not measured in advance, eliminating it during the data processing. The limited samples' measured values were stored in the computer, and the geometric distortion correction model is constructed by using the error values of sample points. That is, the error values are fitted into an error curve, according to which the measured values can be corrected. Then, the basic model and the error correction model are combined, and the prediction model of ring radius based on error correction is constructed through the correction function method. The correction function consists of the basic function and the error correction function, combined in any form. The expression is as Equation (4).
In the Equation (4), R(x) is the correction function; f(x) is the basic equation; u(x) is the error correction function composed of correction variables, which can be in various functional forms; the symbol ⊕ represents the operation mode, which can be addition, subtraction, multiplication, division, or some unstructured combination form.
The establishment of the prediction model of ring radius based on error correction mainly includes the following three steps.
Step 1: Determine the basic equation. The computer image pixel distance formula (Equation (1)) and scale formula (Equation (2)) are selected as the basic model.
Step 2: Establish the error correction function. The pixel distance to the pith will affect the error value, therefore, the error correction function u(x) is constructed with the pixel distance from the ring to the pith as the variable.
Step 3: Determine the combination form of basic function and error correction function. In this paper, the basic function and correction function are combined in an unstructured way to establish the ring radius's regression equation based on error correction.

Obtain the Uncorrected Ring Radius
The coordinates of the intersection of the radius lines from the pith and the rings of each ring were recorded through the system window to extract the ring number and ring radius. The pixel distance is converted into the actual distance by scale calculation, the ring radius of each ring in four directions was obtained, and the measured results were compared with the ring radius measured by hand for verification. The measured data are shown in Table 3. In Table 3, to compare with the actual value, the measured value is rounded to two decimal places.

Geometric Distortion Correction Model
The tree ring radius value measured by the automatic tree ring radius measurement algorithm (measured value) and the tree ring radius value measured by hand (true value) were compared and verified. The difference between the measured value and true value is the error value, the measuring error u can be represented by Equation (5). Figure 4 shows the error distribution of the distance between different tree rings and the pith in the experimental measurement, and it can be seen in the unadjusted cases. The farther the ring is from the pith, the greater the measurement error is. u = measured value − true value (5) According to the error terms' distribution trend in Figure 4, the exponential regression and polynomial regression models to fit the error terms were compared and analyzed the fitting effects of the two models. The determination coefficient R 2 was used to evaluate the fitting results of the model accuracy. The determination coefficient R 2 reflected the confidence of the model fitting. The determination coefficient R 2 is calculated by Equation (6).  According to the error terms' distribution trend in Figure 4, the exponential regression and polynomial regression models to fit the error terms were compared and analyzed the fitting effects of the two models. The determination coefficient R 2 was used to evaluate the fitting results of the model accuracy. The determination coefficient R 2 reflected the confidence of the model fitting. The determination coefficient R 2 is calculated by Equation (6).
In Equation (6), n is the number of independent variables, is the true value, is the estimated value, and p is the number of independent variables. In Equation (6), n is the number of independent variables, y i is the true value,ŷ i is the estimated value, and p is the number of independent variables.

Exponential Regression Model
The equation y = ae bx expresses the type of exponential curve, and the trend line is generated by log(y) = log(a) + bx. If y = log(y) and a = log(a), we can straighten it to y = a + bx. The pixel distance x and absolute error u(x) from the measurement point to the pith were used to establish a single-factor exponential curve regression model, as shown in Equation (7). In Equation (7), u(x) is the error value, x is the distance from the measurement point to the pith, and a and b are the correction model parameters.
The data scatter diagram after transformation is nonlinear, and the fitting effect after nonlinear regression is shown in Figure 5. According to the least square method to estimate the model coefficients, the best estimator of a and b is a = −6.10064 and b = 0.02495. The goodness of fit R 2 of this model is 0.6685, and the fitting effect is fair. Equation (8) of the exponential regression model is as follows.
After error correction with the exponential regression equation, the predicted value was compared with the real value to obtain the model residual diagram (Figure 6). The overall residual of the model fluctuates randomly around 0. In the ring close to the pith, the correction effect of the model is good, and the residual is distributed between (−0.05 cm, 0.05 cm). However, for the ring far away from the pith (the radius is more than 8 cm), the residual shows an increasing trend, indicating that the random error term may have heteroscedasticity. According to the least square method to estimate the model coefficients, the best estimator of a and b is a = −6.10064 and b = 0.02495. The goodness of fit R 2 of this model is 0.6685, and the fitting effect is fair. Equation (8) of the exponential regression model is as follows.
u(x) = 0.00224e 0.02495x (8) After error correction with the exponential regression equation, the predicted value was compared with the real value to obtain the model residual diagram (Figure 6). The overall residual of the model fluctuates randomly around 0. In the ring close to the pith, the correction effect of the model is good, and the residual is distributed between (−0.05 cm, 0.05 cm). However, for the ring far away from the pith (the radius is more than 8 cm), the residual shows an increasing trend, indicating that the random error term may have heteroscedasticity.

Polynomial Regression Model
Polynomial geometric distortion correction model is adopted. According to the aberration theory, the influence of the high-order distortion coefficient on the distortion quantity is much smaller than that of the low-order distortion coefficient, so the high-order part is usually ignored. Too many geometric distortion coefficients will lead to too much calculation, and the calculation accuracy is not significantly improved. Therefore, only the first three radial distortion coefficients are considered in the geometric distortion model. The geometric distortion model is expressed as Equation (9). In Equation (9), u(x) is the error value, x is the distance from the measuring point to the pulp core, and α 0 , α 1 , and α 2 are the parameters of the correction model. u(x) = α 0 + α 1 x + α 2 x 2 (9) timator of a and b is a = −6.10064 and b = 0.02495. The goodness of fit R 2 of this model is 0.6685, and the fitting effect is fair. Equation (8) of the exponential regression model is as follows.
After error correction with the exponential regression equation, the predicted value was compared with the real value to obtain the model residual diagram (Figure 6). The overall residual of the model fluctuates randomly around 0. In the ring close to the pith, the correction effect of the model is good, and the residual is distributed between (−0.05 cm, 0.05 cm). However, for the ring far away from the pith (the radius is more than 8 cm), the residual shows an increasing trend, indicating that the random error term may have heteroscedasticity.  Under the condition of given measurement points, the fitting order of polynomial based on the least square method is too low, and the fitting effect is not ideal. However, when the fitting order is too high, the fitting curve swings a lot, and its coefficient matrix is ill-conditioned, with reduced reliability and complicated calculation. In this study, the least-square fitting polynomial was used to establish the error correction model, and the best-estimated value of α 0 , α 1 , and α 2 was obtained as α 0 = −0.00797112, α 1 = 0.00017254, α 2 = 0.00000503. The fitting effect is shown in Figure 7.

Polynomial Regression Model
Polynomial geometric distortion correction model is adopted. According to the aberration theory, the influence of the high-order distortion coefficient on the distortion quantity is much smaller than that of the low-order distortion coefficient, so the high-order part is usually ignored. Too many geometric distortion coefficients will lead to too much calculation, and the calculation accuracy is not significantly improved. Therefore, only the first three radial distortion coefficients are considered in the geometric distortion model. The geometric distortion model is expressed as Equation (9). In Equation (9), u(x) is the error value, x is the distance from the measuring point to the pulp core, and α , α , and α are the parameters of the correction model.
Under the condition of given measurement points, the fitting order of polynomial based on the least square method is too low, and the fitting effect is not ideal. However, when the fitting order is too high, the fitting curve swings a lot, and its coefficient matrix is ill-conditioned, with reduced reliability and complicated calculation. In this study, the least-square fitting polynomial was used to establish the error correction model, and the best-estimated value of α , α , and α was obtained as α = −0.00797112, α = 0.00017254, α = 0.00000503. The fitting effect is shown in Figure 7.
The polynomial correction model was used to correct the measured values, and the predicted and the actual values were compared to obtain the model residual graph (Figure 8). The residual is significantly reduced after correction, and the overall residual fluctuates randomly around 0. The residual is uniformly distributed in the range of (−0.05 cm, 0.05 cm) as a whole, especially for the growth rings far away from the pith.  The polynomial correction model was used to correct the measured values, and the predicted and the actual values were compared to obtain the model residual graph (Figure 8). The residual is significantly reduced after correction, and the overall residual fluctuates randomly around 0. The residual is uniformly distributed in the range of (−0.05 cm, 0.05 cm) as a whole, especially for the growth rings far away from the pith. Through the above comparative study, we concluded that, compared with exponential regression model, polynomial regression model has better correction effect. However, the residual graph of polynomial regression model still has the problem of trumpet distribution, which indicates that the model may have heteroscedasticity. We tried to use weighted least square method to eliminate heteroscedasticity. The corrected residual is shown in Figure 9. Nevertheless, considering the evaluation accuracy and residual map of the model, the polynomial regression model after eliminating heteroscedasticity is used as the geometric correction model, and the regression equation of ring radius based on error correction is constructed.

Comparative Analysis of Exponential Fitting and Polynomial Fitting Results
The exponential regression model and polynomial regression model were introduced into the tree ring radius extraction equation respectively, and the regression equation of measuring pixel distance and tree ring radius was established. The equation measures the tree ring radius, and the measurement error of the two models is compared and analyzed. In the regression equation of tree ring radius, R(x) is the tree-ring radius to be solved, x is the pixel distance from the measuring point of the system to the pith, Through the above comparative study, we concluded that, compared with exponential regression model, polynomial regression model has better correction effect. However, the residual graph of polynomial regression model still has the problem of trumpet distribution, which indicates that the model may have heteroscedasticity. We tried to use weighted least square method to eliminate heteroscedasticity. The corrected residual is shown in Figure 9. Nevertheless, considering the evaluation accuracy and residual map of the model, the polynomial regression model after eliminating heteroscedasticity is used as the geometric correction model, and the regression equation of ring radius based on error correction is constructed. Through the above comparative study, we concluded that, compared with exponential regression model, polynomial regression model has better correction effect. However, the residual graph of polynomial regression model still has the problem of trumpet distribution, which indicates that the model may have heteroscedasticity. We tried to use weighted least square method to eliminate heteroscedasticity. The corrected residual is shown in Figure 9. Nevertheless, considering the evaluation accuracy and residual map of the model, the polynomial regression model after eliminating heteroscedasticity is used as the geometric correction model, and the regression equation of ring radius based on error correction is constructed.

Comparative Analysis of Exponential Fitting and Polynomial Fitting Results
The exponential regression model and polynomial regression model were introduced into the tree ring radius extraction equation respectively, and the regression equation of measuring pixel distance and tree ring radius was established. The equation measures the tree ring radius, and the measurement error of the two models is compared and analyzed. In the regression equation of tree ring radius, R(x) is the tree-ring radius to be solved, x is the pixel distance from the measuring point of the system to the pith,

Comparative Analysis of Exponential Fitting and Polynomial Fitting Results
The exponential regression model and polynomial regression model were introduced into the tree ring radius extraction equation respectively, and the regression equation of measuring pixel distance and tree ring radius was established. The equation measures the tree ring radius, and the measurement error of the two models is compared and analyzed. In the regression equation of tree ring radius, R(x) is the tree-ring radius to be solved, x is the pixel distance from the measuring point of the system to the pith, d 1 is the true value of the ring radius of a circle known, and x 1 is the pixel distance between the ring of a circle known and the pith. The exponential correction model was introduced into the tree ring radius extraction equation, and the tree ring radius regression equation based on the exponential correction model was obtained. The equation is expressed as Equation (11).
The polynomial correction model was introduced into the tree ring radius extraction equation, and the regression equation of tree ring radius based on the polynomial correction model after eliminating heteroscedasticity was obtained. The equation is expressed as Equation (12).
Two tree ring radius regression equations were used to predict the tree ring radius, and the difference between the predicted value and the true value (Table 1) was taken as the error value. The error values of the two tree ring radius regression equations were compared, and the results are shown in Figure 10. The exponential correction model was introduced into the tree ring radius extraction equation, and the tree ring radius regression equation based on the exponential correction model was obtained. The equation is expressed as Equation (11).
The polynomial correction model was introduced into the tree ring radius extraction equation, and the regression equation of tree ring radius based on the polynomial correction model after eliminating heteroscedasticity was obtained. The equation is expressed as Equation (12).
Two tree ring radius regression equations were used to predict the tree ring radius, and the difference between the predicted value and the true value (Table 1) was taken as the error value. The error values of the two tree ring radius regression equations were compared, and the results are shown in Figure 10.

Model Application Verification
To verify the availability and measurement accuracy of the tree ring radius regression equation measured by the polynomial correction model, this paper designed experiments for verification, and the obtained data are shown in Table 4. The "u1" indicates that the error value of the tree-ring radius regression equation (Equation (11)) fitted by the exponential correction model, and "u2" indicates the error value of the tree-ring radius regression equation (Equation (12)) fitted by the polynomial correction model.
Results show that an effective regression equation of tree ring radius can be established by measuring the pixel distance of the point and the tree ring radius. Error-values using the polynomial correction model regression equation are lower than the calibration model based on the exponential regression equation. The ring radius regression equation based on the polynomial correction model after eliminating heteroscedasticity for the image geometric-distortion has a better correction effect.

Model Application Verification
To verify the availability and measurement accuracy of the tree ring radius regression equation measured by the polynomial correction model, this paper designed experiments for verification, and the obtained data are shown in Table 4. Table 4. The measured data of tree ring radius of Chinese fir disk. DNO is the number of the sample of the stem analysis disk. RNO is the number of the growth ring (the number starts at the heart of the pith). D1, D2, D3, and D4 represent four measurement directions. PD is the pixel distance from this ring to the heart of the pith. MV is the measured value of the ring radius calculated by the system according to the regression equation of tree ring radius based on the polynomial type correction model. EV is the error value of the ring radius. MEV is the mean of the error value.  It can be seen from Table 4 that the tree ring radius regression equation based on the polynomial correction model adopted in this paper can effectively correct the geometric distortion generated by the digital image and achieve a more accurate measurement of the tree ring radius of the analytic stem disk. The maximum error of tree ring radius measurement results obtained by using this regression model is 0.15 cm, the average error is 0.04 cm, and the average detection accuracy reaches 99.34%, which can meet the measurement requirements of analytic tree ring radius.

Measurement Comparison with Mainstream Research Methods
Tree ring has been recognized as an essential means to study tree growth and climate change due to its accurate dating, strong continuity, high resolution, wide geographical distribution, and it is easy to obtain copies [30]. In 1980, the report and recommendations of the second International Conference on tree climate ring climatology pointed out that "many tree ring records responding to large changes in various climate parameters in most parts of the earth are better than any other alternative climate data that can be measured by year" [31]. Ring width is linked in the study of tree ring climatology and forest productivity, and its deviation directly affects the accuracy of the above measurement results.
In the past, we used images to measure ring width. Liu [32] used IMAGE1/AT image analysis system to obtain tree ring sample parameters, with a measurement accuracy of 97.7%. Xie [33] obtained a tree ring digital image with a scanner and automatically segmented it to obtain width value, the edge model of maximum mean gray difference is used to segment and calculate the ring width, and the measurement accuracy is 97.06%. Qi [34] proposed to use the FSDI method to measure the width of annual rings, the measurement process is based on Adobe Photoshop image processing function and Auto CAD precise query function, and the results show that this method's accuracy is 94.33%. Xu [35] studied a method for measuring tree ring width based on impedance meter, and established a power function model for predicting tree ring width by using the waveform characteristics of impedance data. The model's accuracy is 97%, and it needs to select living trees that grow well and have no obvious decay outside, so its application scope is limited. Ning [36] studied the semantic segmentation model of tree ring image based on the U-Net convolutional neural network, and the measurement accuracy was 97.68%. In this paper, the regression equation of ring radius based on the geometric distortion correction model is studied. When the digital image detection method is introduced into the measurement of ring radius, the measurement error caused by the edge distortion of ring image is corrected, and the prediction accuracy of the regression model of ring radius is improved to 99.34%, which makes the actual calculated data of ring radius more objective.

Analysis of Tree Species Suitable for the Model
The image detection method's introduction into the measurement of tree ring parameters can solve manual measurement problems, such as heavy workload, and artificial random error. However, the tree rings of different tree species vary greatly, bringing great difficulties to the automatic detection of tree rings. In tree ring climatology research, tree species is mainly arbor, mainly coniferous tree species with a clear ring. On the contrary, using broad-leaved trees with an unclear boundary of early and late wood is relatively less. To explore a method of measuring ring width suitable for coniferous tree species and broad-leaved tree species simultaneously and ensure high measurement accuracy is particularly important. To explore regression equation's applicability and accuracy of annual ring radius in broad-leaved tree species, we selected the analytical wood disc of Ulmus pumila L. and Zelkova serrata (Thunb.) Makino as the research objects. We took sample images of broad-leaved tree species, as shown in Figure 11.
The regression equation of ring radius of Ulmus pumila L. based on the correction model is obtained as Equation (13).
Forests 2021, 12, x FOR PEER REVIEW 17 of 20 pumila L. and Zelkova serrata (Thunb.) Makino as the research objects. We took sample images of broad-leaved tree species, as shown in Figure 11. The regression equation of ring radius of Ulmus pumila L. based on the correction model is obtained as Equation (13).
The regression equation of ring radius of Zelkova serrata (Thunb.) Makino based on the correction model is obtained as Equation (14).
The results show the regression model accuracy based on error correction is above 99%, the ring radius's overall measurement accuracy meets the requirements. The regression model of ring radius based on error correction in this study is also applicable to broad-leaved tree species, and the measurement results and goodness of fit of the model are shown in Table 5.

Conclusions
In this study, based on the analysis of disk digital image, we used Open CV to measure the ring width, and established a regression model of ring radius based on error correction, which is a new exploration in the research of ring width measurement. We concluded that: (1) in the measurement of China fir analytic wood disk, the maximum measurement error was less than 0.15 cm, the average error was 0.04 cm, and the average detection accuracy was 99.34%, meeting the ring width measurement requirements; (2)  (14).
The results show the regression model accuracy based on error correction is above 99%, the ring radius's overall measurement accuracy meets the requirements. The regression model of ring radius based on error correction in this study is also applicable to broadleaved tree species, and the measurement results and goodness of fit of the model are shown in Table 5.

Conclusions
In this study, based on the analysis of disk digital image, we used Open CV to measure the ring width, and established a regression model of ring radius based on error correction, which is a new exploration in the research of ring width measurement. We concluded that: (1) in the measurement of China fir analytic wood disk, the maximum measurement error was less than 0.15 cm, the average error was 0.04 cm, and the average detection accuracy was 99.34%, meeting the ring width measurement requirements; (2) when establishing the geometric distortion error correction model, the polynomial regression model (R 2 = 0.8649) was better than the exponential regression model (R 2 = 0.6685); (3) through the experiments in Ulmus pumila L. and Zelkova serrata (Thunb.) Makino, this method is applicable in the measurement of broad-leaved tree ring width.
Based on the above research, the stem analysis disk measurement and analysis software system were designed. The system can measure the disk digital image's tree ring width and store the measured data and the basic information of the corresponding parse wood into a database. Also, all disk data of the analytical wood can be exported to Excel according to the number of the analytical stem. The main interface of the system is shown in Figure 12.
when establishing the geometric distortion error correction model, the polynomial regression model (R 2 = 0.8649) was better than the exponential regression model (R 2 = 0.6685); (3) through the experiments in Ulmus pumila L. and Zelkova serrata (Thunb.) Makino, this method is applicable in the measurement of broad-leaved tree ring width.
Based on the above research, the stem analysis disk measurement and analysis software system were designed. The system can measure the disk digital image's tree ring width and store the measured data and the basic information of the corresponding parse wood into a database. Also, all disk data of the analytical wood can be exported to Excel according to the number of the analytical stem. The main interface of the system is shown in Figure 12.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
In the chapter of image preprocessing and pixel coordinate extraction, the functions used are as follows. The important parameters of the function are described.
1. Grayscale function cvtColor ( ): cvtColor (img, IMG, COLOR_BGR2GRAY); Parameter description: img is the original image to be grayed; IMG is the output image after graying; COLOR_BGR2GRAY converts RGB format to grayscale image.
2. Binarization function threshold ( ): threshold (img, IMG,0,255,THRESH_BINARY); Parameter description: img is the original image without binarization; IMG is the output image after binarization; 0 represents the part less than the threshold, and the pixel gray value is set to 0; 255 represents the part larger than the threshold value, and the pixel gray value is set to 255; THRESH_BINARY represents the type of binarization operation for the threshold.

Conflicts of Interest:
The authors declare no conflict of interest.