# Geometric Characterization of Vines from 3D Point Clouds Obtained with Laser Scanner Systems
## 2 Materials and Methods
### Algorithms for Volume Calculation
#### 2.5.4 Volume Calculation with the VCTS Algorithm  
The L\({}_{1}\)-medial skeleton is an algorithm that generates a curved skeletal representation of scanned objects as 3D point clouds. This curved skeleton defines a simplified inner abstraction of the 3D shape of the object, which facilitates analysis of that shape. This skeleton consists of nodes and segments linked together, as shown in Figure 10. A line string is formed by all segments whose nodes are up to two segments long. The nodes belonging to three (or more) segments define the end of a line string and the beginning of two different line strings. Although this algorithm is not conditioned by previous assumptions of the geometric shape of the object, we start from the premise that the vine trunk can be modelled as the sum of the volumes enclosed by the cylinders defined by each segment of the skeleton or by the cylinders defined by each line string. Knowing the skeleton and its segments, all the points of the cloud are clustered according to the segment to which they belong. This clustering is based on the proximity of the point to the segment as the minimum (orthogonal) distance between them. In the first case, the height of each cylinder is taken as the length of each segment. For the estimation of the radius, the parameters of the mean and median centralization of the minimum distances that exist between each point and its segment were used. In the second case, the height of the cylinder is considered to be the sum of the lengths of the segments that comprise it, and the radius as the mean and median of the minimum distances between the points and the segments. These four volume estimation strategies have been called \"VCTS segment mean\", \"VCTS segment median\", \"VCTS line string mean\", and \"VCTS line string median\". These strategies are designed to solve the problem that, for a segment, each point provides a different radius, which can be due to real changes or noise in the point cloud. The success of the algorithm depends on defining a suitable strategy to estimate a single radius value that represents the segment of the object. \begin{table}
\begin{tabular}{c c c} \hline
**Name** & **Description** & **Possible values** \\ \hline Class to use & LiDAR class [53] to use & \(-1\) to \(31\)\({}^{1}\) \\ Color weight & Weight of color variable & 0.000 to 1.000 \\ Normal weight & Weight of normal variable & 0.000 to 1.000 \\ Spatial weight & Weight of spatial variable & 0.000 to 1.000 \\ Seed resolution & Seed linear resolution (meters) & 0.0200 to 2.0000 \\ Voxel resolution & Voxel linear resolution (meters) & 0.0010 to 1.0000 \\ \hline \end{tabular} \({}^{1}\) –\(1\) for all classes.  
\end{table} 
Table 6: List of the editable parameters of the convex hull cluster. Figure 10: (**a**) An MMS point cloud imported in the L\({}_{1}\)-medial skeleton viewer. (**b**) Skeleton results (grey points are the input point cloud, green points are the nodes, and red lines are segments). To this point, it is necessary to highlight that in the extremes of the vines, the skeleton strategy can fail, because there are few points near the base for the presence of soil, stones, vegetation, and the upper section due to the obfuscation caused by the aperture of the arms. Again, it is necessary to find a strategy to estimate the dimensions of the cylinders at the extremes of the figure. The problems that arise in the clustering of points and the assignation of each segment or string are solved in the following ways:  
* The extreme points that are not assigned to any segment or line string (because they are not enclosed between planar sections fixed by nodes and segments) are added to the nearest segment or line string in each case, and extend until they reach the same conditions of belonging as the rest of the points assigned to this segment or line string. This, by default, avoids errors when quantifying the total volume of the vine.