## 1 Introduction  
Water is a limiting factor in arid zones and its optimal management is crucial to ensure appropriate production levels and the quality of crops. One of the techniques that has been studied and applied in recent years to reduce water consumption in agriculture is deficit irrigation [1; 2; 3; 4], which requires measurable crop stress parameters. Midday stem water potential (SWP) is the reference method [5]. However, its measurement is very time consuming and it is not automated yet. As soil-plant-atmosphere is considered as a continuum [6], several automatically measurable variables have been proposed to be related to the SWP, so that it can be measured in an indirect way. The crop water stress index (CWSI) [7; 8] is one of the most widely used indicators correlated with SWP and it is remotely measurable [9]. In order to obtain the CWSI, it is necessary to measure the crop canopy temperature. One of the methods to deal with this aim is the use of infrared radiometers (IR) [10; 11]. However, when installing an IR in the field no feedback is available to know the proportion of leaves in the measuring cone. Thermography techniques are an alternative tool to estimate the crop canopy temperature [12; 13; 14; 15; 16; 17]. No orientation issues arise since a graphical representation of reality is always available, so that enough information is provided to decide whether the visualized region is of interest. In either case, a similar issue arises: the necessity of discrimination between leaf and non-leaf regions in the field of vision. They are not capable of distinguishing between the leaves and other elements of the image, such as branches, trunk, sky or soil. Therefore, the measured temperature does not only correspond to that of the leaves, but to that of the average of all the elements covered by the field of vision. It has been demonstrated that the exclusion of the non-leaf image region is critical to obtain the temperature values for the calculation of the CWSI [17]. To automate this, image-segmentation techniques would need to be implemented to identify the region of interest. However, the identification of the leaves in thermal images is a complicated task, even with high-resolution thermal cameras, whose price would make the system unviable. Thus, the segmentation is posed in visible images. Subsequently, using augmented reality techniques, correspondence between the processed visible image and the thermal image would be achieved, allowing the determination of the temperature values of the leaves exclusively. In this regard, the use of different techniques of colorimetric segmentation by image processing has been classically proposed in several studies. In particular, these are segmentation techniques based on colour thresholds [18; 19], region identification [19] and watershed [19; 20], that perform image processing using the hue saturation value (HSV), hue saturation intensity (HSI) or lab colour spaces. Likewise, significant work has been done based on machine-learning techniques with good results compared to other image processing methods [21]. Specifically, deep learning provides a great advantage in image processing, since it does not require feature engineering [21] and not only the colour is involved in the segmentation algorithm, but also the spatial relationship between colours, giving rise to the notion of shapes. Currently there are numerous case studies related to the classification of images by means of machine-learning and deep-learning techniques [22; 23; 24; 25]. Nonetheless, the aim of these studies is not as much the leaves segmentation as the phenotypic classification. In contrast, the problem we pose is the segmentation of the image to identify a region of interest. Specifically, the region that we seek to separate from the background is the one that is formed by the multiple leaves of the trees in a real scenario. Problematic areas due to over- or under-lighting, or withered and pitted leaves can be found.