## 3 Yield Calibration  
The objective of the yield calibration stage is the development of a procedure designed to obtain the relationship between grape-cluster image analysis parameters (measured directly in pixels) and grape-cluster weight (measured in grams). The calibration parameters selected in this paper are the area of the cluster of grapes and the volume of the cluster of grapes, but if available, other parameters, such as the number of grapes in the images, can be used as calibration parameters [28, 30, 31]. These calibration parameters will enable the automatic estimate of the vineyard yield based on the analysis of the images obtained from the vineyard. The typical hypotheses adopted in this calibration procedure are:  
* There is a relationship between the weight, size and volume of the cluster of grapes [4, 10, 28, 30, 31].
* The obtained relationship between the weight and size of the cluster of grapes is valid during a measurement experiment.
* The grape variety analyzed in this paper is of high quality and low cluster density.
* The distance between the grapes and the image acquisition system is constant during the entire process [28, 32].  
Similarly to the calibration procedure proposed in [28], the proposal for yield calibration has been performed off-line in laboratory conditions in order to guarantee enough weight and cluster size variability, but a practical development of this proposal will require the development of a detailed on-line application procedure. The yield calibration procedure is based on the following steps: (1) a set of representative clusters of grapes were manually harvested and selected for the calibration; (2) the weight of each cluster of grapes is manually measured; (3) each cluster of grapes is hung in front of a white background in order to obtain a reference image with the image acquisition device; (4) the image of the cluster of grapes is automatically segmented by applying the Otsu method [33] combined with the application of morphological operators (10 erosions and dilations) in order to remove noisy pixels from the images (Figure 2a); and (5) the segmented image is used to estimate the area and volume of the cluster of grapes expressed in pixels. The total area of the cluster of grapes is computed as the number of white pixels in the segmented image (Figure 2a). This area estimate summarizes the effect of all of the existing grapes in a cluster. Alternatively, the proposal is to compute the volume of the clusters. For example, in [28], the volume of the clusters is estimated by using a 3D ellipsoidal model, but in this paper, the proposal is to estimate the volume of the grapes by interpreting the area of the grapes as the volume of a solid of revolution (expressed in pixels or square pixels). This volume estimate is computed similarly as a solid of revolution (Figure 2b), where the cylinder of each row is obtained around the column center of the object. For example, if \(k\) is a row of the segmented image and _s(k)_ and _e(k)_ the first and last image column of the pixels classified as a cluster of grapes, then this partial volume slice will be computed as _x((e(k) - s(k))/2)_.  
Figures 3 and 4 show the calibration results obtained with 29 representative clusters of grapes. Figure 3 shows the relationship between the areas of the cluster of grapes (expressed in pixels) and its weight (in grams); the coefficient of correlation was 0.9557. Alternatively, Figure 4 shows the linear relationship between the volume of the cluster of grapes (expressed in pixels) and its weight (ingrams); the coefficient of correlation was 0.9635. In [31], similar results have been achieved in a less controlled environment.  
Figure 4: Relationship between the weight and volume of the cluster of grapes analyzed.  
Figure 3: Relationship between the weight and area of the cluster of grapes analyzed.  
Figure 2: (**a**) Example segmented image of a cluster of grapes; (**b**) Representation of the solid of revolution of the cluster of grapes estimated from the segmented image.