# Investigating 2-D and 3-D Proximal Remote Sensing Techniques for Vineyard Yield Estimation
## 2 Materials and Methods
### Data Analysis
#### 2.3.2 RGB-D (Kinect) Imagery  
Due to the two image data types captured--mesh vs. point cloud--RGB-D imagery was processed differently for experiment one and two (mesh: bunch-level), and experiment three (point cloud: plant-level). Data processing for experiments one and two progressed as follows:  
1. Each mesh was manually cleaned and sectioned to remove any background, using the _Cross-Section_ tool in CloudCompare [28].
2. The cleaned mesh was reconstructed in MeshLab [29], using the _Screened Poisson Surface Reconstruction_[30] method--see Figure 7. Additional cleaning of the mesh was completed ad hoc in MeshLab [29].
3. Volume (cm\({}^{3}\)) of the mesh was calculated in CloudCompare [28].  
_Screened Poisson Surface Reconstruction_[30] allows the back of the mesh, which was 'open' (Figure 7a), to be reconstructed. It becomes 'watertight', as seen in Figure 7b.  
Figure 6: (**a**) Represents the original RGB image, with (**b**) illustrating the segmented binary image at bunch-level. (**c**) An RGB image of an east-facing vine, with (**d**) the segmented binary image at plant-level.  
Figure 7: (**a**) Example of mesh prior to reconstruction, and (**b**) the same mesh after Poisson reconstruction.  
The nature of the point-cloud data requires different processing steps to that of the mesh data. This effect was attributed mainly to the necessity of closing the points of the point cloud, thereby producing a 'watertight mesh' for volume extraction.  
The point cloud datasets from experiment three were processed as follows:  
1. Point clouds were imported into CloudCompare [28], and subsequently cleaned and sectioned to individual vines, focusing on the bunch zone.
2. Bunches were segmented from the point cloud using their colour properties. CloudCompare's [28]_Filter Points by Value_ tool incorporates user-defined thresholds, manipulating the RGB colour space of the point cloud. Threshold values were determined on a random sample (25%) of the LR dataset.
3. A custom-built script in R statistical software [31] was used for calculating the segmented point cloud's volume, representing the vine's bunches.  
Figure 8 illustrates the raw point cloud (Figure 8a) captured by the Kinect sensor, with the segmented point cloud (Figure 8b) displaying the bunches.  
The custom script in R statistical software [31] incorporated the _alphashape3d_ package v1.3 [32] to compute the 3-D shape for volume calculation purposes. The _alphashape3d_[32] package includes the _\(\alpha\)-shape_ algorithm [33] to recover the geometric structure of the 3-D point cloud for volume calculation. The _\(\alpha\)-shape_ algorithm [33] requires a specific alpha value for computation; hence, the alpha value directly influences the total volume calculated. To adjust an alpha value for our experimental conditions, various levels of alpha were tested on 25% of the dataset and linearly regressed against the reference values. Similar investigative experiments were conducted by [PERSON] et al. [34] and [PERSON] et al. [35] to determine experiment-specific alpha values.  
The process described above for experiment three was repeated for both sides of the vine, resulting in two volume measurements per vine. A single volume value per vine was obtained via the _Total Bunch Volume per Vine_ (\(TBVV\)) calculation:  
\[TBVV=(Ve+Vw)/2 \tag{2}\]  
where _Ve_ was the volume of the vine's east-facing side, and _Vw_ was the volume of the west-facing side. The resultant \(TBVV\) was in cm\({}^{3}\) per vine.