# Hyperspectral Imaging to Evaluate the Effect of Irrigation Water Salinity in Lettuce
## 2 Materials and Methods
### Hyperspectral Images  
Hyperspectral images from the adaxial surfaces of 40 selected leaves were taken with a hyperspectral vision system, consisting of an EMCCD Luca-R camera (Andor(tm) Technology, Belfast,  
Figure 1: Red-Green-Blue (RGB) image of one leaf per saline treatment. Apparently, no visible symptoms of stress can be observed. Northern Ireland) coupled to a VIS-NIR spectrometer (Headwall Photonics Hyperspec-VNIR(tm), Fitchburg, MA, USA) working in the range of 400-1000 nm. A total of 189 wavelengths were considered along this range, thus obtaining a spectral resolution of 3.2 nm. The spectrometer of the camera was equipped with a progressive line-by-line scan spectrograph with a slit of 25 \(\upmu\)m. The spatial resolutions in the line direction and in the scan direction were 0.26 mm/pixel and 0.1 mm/pixel, respectively. A halogen lamp was used for illumination. Headwall Hyperspec(tm) software (Hyperspec III, Headwall Photonics(tm), Fitchburg, MA, USA) was used to control the equipment. Samples were scanned by acquiring the entire surface of the leaf (scan length = 100 mm) creating a hypercube dataset. Relative reflectance hyperspectral images were simultaneously computed by the software of the camera. White reference (barium sulfate) and dark current signal (acquired with the objective of the camera covered by a black tap) were acquired before each batch of images. Each line of the image was then corrected pixel by pixel by subtracting the dark current and dividing the result by the white reference minus the dark current. Data Preprocessing and Processing. Computation of Models  
The 40 hyperspectral images of lettuce leaves were randomly divided in two different groups: a calibration set with seven leaves per treatment (28 leaves in total) for generating the models, and a validation set with the three remaining leaves of each treatment (12 leaves in total) for testing the models. Figure 2 shows schematically the procedures carries out for the computation and validation of the models developed. For each hyperspectral image, the pixels from the green surface of the leaves, eliminating the mid-rib pixels, were considered. The corresponding spectra (a minimum of 32,000 in the smaller leaf) were used to calculate the mean spectrum of each leaf. The differences on the spectral signature of the spectra was faced analyzing the raw reflectance spectra, the normalized spectra by Standard Normal Variate scaling (SNV) and their corresponding first derivatives, which allow to identify better the displacement left-right of certain bands of the spectrum, such as the red edge area [25; 26]. The first derivative of the leaves mean spectra was computed by means of the Savitzky-Golay (SG) algorithm [27]. In the present work, a polynomial of order three was fitted to each spectrum considering 21 wavelengths width to smooth spectra, and then the first derivative function was applied. Figure 2: Scheme of the methodology followed for the computation and validation of both models developed. For the calibration set, containing the 28 mean spectra, two different preprocessing were applied in order to remove the additive and the multiplicative effect such as it has been previously reported on spinach leaves by [28]. Savitzky-Golay smoothing and differentiation algorithm (SG) was applied to the spectra: a polynomial of order three was fitted considering 21 wavelengths width and the second derivative function was applied to the smoothed spectra (D2). After SG algorithm, the multiplicative effect was corrected by SNV scaling [29]. SNV subtracts to each wavelength of the spectrum (\(\lambda\)i) the mean value of this spectrum (\(\lambda\)m), and it divides this result by the standard deviation of this spectrum (STD). Therefore resulting spectra have a standard deviation equal to one and a mean equal to zero. For the set of 28 preprocessed (SG D2 SNV) spectra, a principal component analysis (PCA) was performed in order to obtain an initial model.