Vine Volume Estimation from UAV Photogrammetry and Imagery Processing

: The application of geomatics to the agroforestry field is acquiring greater prominence in recent times in a world that is increasingly digital and aware of sustainability and food security. The use of geomatics tools for 3D documentation and visualisation is becoming essential in so-called precision agriculture. This article describes the methodology used to obtain the wood volume of a set of vines in the town of Tarazona de la Mancha (Albacete, Spain)


Introduction
Agriculture is facing new challenges in a digital environment where its sustainable development and food security must be guaranteed.One of the challenges, both for its environmental and economic effects, is framed in the knowledge and quantification of carbon flow in order to enhance the role of agriculture as a CO 2 sink [1].
The importance of documenting agricultural and forestry crops accurately, quickly and at low cost, as well as their geospatial processing and 3D visualisation, gives a leading role to geomatics.In this sense, geomatics techniques have been progressively incorporated in the agroforestry field for the acquisition, processing, management and visualisation of geoinformation, contributing to so-called precision agriculture [2,3].
This article describes the geomatics work carried out to determine the volume of wood in a vineyard crop in a wine-growing area of La Mancha in the municipality of Tarazona de la Mancha, Albacete.The difficulties that have been resolved in the different phases of the data processing and the results obtained from the cubing carried out will be described and shown.The estimation of the volume of wood from the vines will serve as an input parameter for the estimation of CO 2 fixation, in a later phase, to solve the agroforestry challenge referred to in the wine-growing area.

Materials and Methods
The vineyard was chosen because it plays a very important role in Castilla-La Mancha, as not only the largest vineyard in the country, but also in the world, with a surface area of more than 465,000 hectares, which represents practically 50% of the total vineyard are for wine-making in Spain [4].Figure 1 shows the vineyard chosen as a case study in the southwest of the town of Tarazona de la Mancha, in the province of Albacete, with an area of just over 1.3 hectares and 24 rows of vines.
The geomatics tasks of documenting and characterising the strains consisted of carrying out a photogrammetric flight with an RGB camera on board a UAV, processing it in Agisoft Metashape and obtaining 2D homographs of each of the strains, among other geomatics products, using a QGIS add-on.Based on these homographs, which provide a front view of each of the vines (Figure 2), algorithms for computational geometry and image processing have been implemented in Python in order to obtain a cubage of the trunk and arm wood of the vines.These algorithms have been developed with Python language and with the OpenCV library specialised in artificial vision and computational geometry [5]. Figure 3 shows the workflow for the treatment of the homographies until a cubic value for the trunk and arm can be obtained.As detailed in the results and in the discussion, the shadows make the segmentation of these homographs difficult, which is why it is necessary to treat them properly before obtaining the outline of each of the strains in order to proceed with the cubing.This treatment for the shadows consists of the application of the Green-Red Vegetation Index (GRVI): similar to NDVI but with RGB-banded images [6].Morphological filters and map algebra have been applied.The cubing of the stocks has been implemented based on the hypothesis that both the trunk and the arm of the stock are assimilated to differential sections of a cylinder of revolution, with each of the two parts assimilated separately.Based on these homographs, which provide a front view of each of the vines (Figure 2), algorithms for computational geometry and image processing have been implemented in Python in order to obtain a cubage of the trunk and arm wood of the vines.These algorithms have been developed with Python language and with the OpenCV library specialised in artificial vision and computational geometry [5].Based on these homographs, which provide a front view of each of the vines (Figure 2), algorithms for computational geometry and image processing have been implemented in Python in order to obtain a cubage of the trunk and arm wood of the vines.These algorithms have been developed with Python language and with the OpenCV library specialised in artificial vision and computational geometry [5]. Figure 3 shows the workflow for the treatment of the homographies until a cubic value for the trunk and arm can be obtained.As detailed in the results and in the discussion, the shadows make the segmentation of these homographs difficult, which is why it is necessary to treat them properly before obtaining the outline of each of the strains in order to proceed with the cubing.This treatment for the shadows consists of the application of the Green-Red Vegetation Index (GRVI): GRVI = (green − red)/(green + red), similar to NDVI but with RGB-banded images [6].Morphological filters and map algebra have been applied.The cubing of the stocks has been implemented based on the hypothesis that both the trunk and the arm of the stock are assimilated to differential sections of a cylinder of revolution, with each of the two parts assimilated separately.Figure 3 shows the workflow for the treatment of the homographies until a cubic value for the trunk and arm can be obtained.As detailed in the results and in the discussion, the shadows make the segmentation of these homographs difficult, which is why it is necessary to treat them properly before obtaining the outline of each of the strains in order to proceed with the cubing.This treatment for the shadows consists of the application of the Green-Red Vegetation Index (GRVI): GRVI = (green − red)/(green + red), (1) similar to NDVI but with RGB-banded images [6].Morphological filters and map algebra have been applied.The cubing of the stocks has been implemented based on the hypothesis that both the trunk and the arm of the stock are assimilated to differential sections of a cylinder of revolution, with each of the two parts assimilated separately.Based on these homographs, which provide a front view of each of the vines (Figure 2), algorithms for computational geometry and image processing have been implemented in Python in order to obtain a cubage of the trunk and arm wood of the vines.These algorithms have been developed with Python language and with the OpenCV library specialised in artificial vision and computational geometry [5]. Figure 3 shows the workflow for the treatment of the homographies until a cubic value for the trunk and arm can be obtained.As detailed in the results and in the discussion, the shadows make the segmentation of these homographs difficult, which is why it is necessary to treat them properly before obtaining the outline of each of the strains in order to proceed with the cubing.This treatment for the shadows consists of the application of the Green-Red Vegetation Index (GRVI): GRVI = (green − red)/(green + red), (1) similar to NDVI but with RGB-banded images [6].Morphological filters and map algebra have been applied.The cubing of the stocks has been implemented based on the hypothesis that both the trunk and the arm of the stock are assimilated to differential sections of a cylinder of revolution, with each of the two parts assimilated separately.

Results and Discussion
Following the workflow, Figure 4 shows an example of the results obtained in the image processing of the 2D homographs for the calculation of the GRVI index, the binarisation, the map algebra operation and the contour detection with the applied morphological filters.

Results and Discussion
Following the workflow, Figure 4 shows an example of the results obtained in the image processing of the 2D homographs for the calculation of the GRVI index, the binarisation, the map algebra operation and the contour detection with the applied morphological filters.It is worth highlighting the complexity of the treatment of the shadows, due to which it was necessary to take into account whether the shadow was in front or behind the strain of interest for the application of the GRVI index and the map algebra operation.Similarly, the application of several morphological filters and the contour detection of the OpenCV library has made it possible to obtain an optimal segmentation of the strains, differentiating in each homography as to which pixels belong to the arm and trunk of the strain and which do not.
Based on this segmentation, we proceeded to calculate or estimate the volume of wood for the and the arm separately.For both, it has been established that the differential sections of cylinders of revolution formed by each row or column of pixels segmented as a stock represent the most similar geometric figure, differing only in the axis of revolution.For the trunk, the axis is vertical, and for the arm it is horizontal.
A preliminary wood volume of 5.4 cubic decimetres has been obtained for the trunk of the example stock, taking into account the different trunk diameters.With an average radius of 4.94 centimetres, the volume of the trunk becomes 4.9 cubic decimetres.It is worth highlighting the complexity of the treatment of the shadows, due to which it was necessary to take into account whether the shadow was in front or behind the strain of interest for the application of the GRVI index and the map algebra operation.Similarly, the application of several morphological filters and the contour detection of the OpenCV library has made it possible to obtain an optimal segmentation of the strains, differentiating in each homography as to which pixels belong to the arm and trunk of the strain and which do not.
Based on this segmentation, we proceeded to calculate or estimate the volume of wood for the trunk and the arm separately.For both, it has been established that the differential sections of cylinders of revolution formed by each row or column of pixels segmented as a stock represent the most similar geometric figure, differing only in the axis of revolution.For the trunk, the axis is vertical, and for the arm it is horizontal.
A preliminary wood volume of 5.4 cubic decimetres has been obtained for the trunk of the example stock, taking into account the different trunk diameters.With an average radius of 4.94 centimetres, the volume of the trunk becomes 4.9 cubic decimetres.

Conclusions
This article has demonstrated the usefulness of geomatics techniques applied to the wine-growing field in relation to the segmentation and estimation (preliminary, for the time being) of the wood volume of the vines.Photogrammetry and image processing is establishing itself as a discipline with great contributions to precision agriculture.
In the next phases of the study, the aim is to compare the value of the cubic volume calculated using computational techniques with manual measurements and traditional calculations.In the same way, we intend to take a laser scan of these vines that will allow us to obtain a ground truth to validate the results obtained by aerial photogrammetry.Once the volumetric results have been validated, they can be used in the near future as reference data.

Figure 1 .
Figure 1.Location of La Mancha vineyards as a case study.

Figure 2 .
Figure 2. (a) Original image of a strain obtained in the photogrammetric flight; (b) 2D homography of the same strain.

Figure 1 .
Figure 1.Location of La Mancha vineyards as a case study.

Figure 1 .
Figure 1.Location of La Mancha vineyards as a case study.

Figure 2 .
Figure 2. (a) Original image of a strain obtained in the photogrammetric flight; (b) 2D homography of the same strain.

Figure 2 .
Figure 2. (a) Original image of a strain obtained in the photogrammetric flight; (b) 2D homography of the same strain.

Figure 1 .
Figure 1.Location of La Mancha vineyards as a case study.

Figure 2 .
Figure 2. (a) Original image of a strain obtained in the photogrammetric flight; (b) 2D homography of the same strain.

Figure 4 .
Figure 4. (a) Application of the GRVI index; (b) binarisation process; (c) map algebra; (d) contour of the vine on the homography after applying morphological filters.

Figure 4 .
Figure 4. (a) Application of the GRVI index; (b) binarisation process; (c) map algebra; (d) contour of the vine on the homography after applying morphological filters.