# Estimating Carrot Gross Primary Production Using UAV-Based Multispectral Imagery
## 2 Materials and Methods
### Multispectral Imagery  
Multispectral imagery of the farm was acquired with a Sequoia Parrot multispectral camera mounted on the gimbal of an aerial platform DJI Phantom 3 Advanced quadcopter drone, flying at a height of 30 m above the field. The camera acquires four spectral bands in the green (530-570 nm), red (640-680 nm), red-edge (730-740 nm), and NIR (770-810 nm) bands, plus an RGB image to help the registration process. The images have a resolution of 1.2 megapixels and a radiometric resolution of 16 bits. This camera has a light sensor that records solar irradiance data for each spectral band and which was used for sunshine calibration. A campaign of image acquisition was conducted on the field on 11 dates in 2021, namely 7 September 2021, 23 September 2021, 30 September 2021, 8 October 2021,15 October 2021, 22 October 2021, 1 November 2021, 10 November 2021, 15 November 2021, 23 December 2021, and 27 December 2021, starting with the emergence of the crop until its senescence. Due to atmospheric conditions some flights had to be canceled, resulting in a non-uniform distribution of the flight dates. Besides the images taken with the UAV over the farm, an extra image of a Spectralon reference panel placed on the ground was acquired with the multispectral camera to calibrate radiance images to reflectance images. No atmospheric correction is necessary, since UAV data is far less influenced by atmospheric effects. Before reflectance calibration, a radiometric and geometric correction of the four spectral bands was performed in Python using the specialized code for the Sequoia camera found on GitHub [40]. After radiometric and geometric corrections, the MicaSense software also allowed us to perform sunshine calibration by dividing the radiance of the soil by the radiance of the sun. The conversion to reflectance is performed using the following equation:  
\[\rho(x,y,\lambda)=\frac{I(x,y,\lambda)\rho_{S}(\lambda)}{Is(\lambda)} \tag{3}\]  
where \(\rho(x,y,\lambda)\) is the reflectance image at pixel coordinates \(x,y\) and waveband \(\lambda\), \(I(x,y,\lambda)\) is the raw intensity image at pixel coordinates \(x,y\), and waveband \(\lambda\), \(\rho_{S}(\lambda)\) is the known reflectance of the Spectralon panel at \(\lambda\) wavelength (0.99 at visible and _NIR_ ranges), and \(Is(\lambda)\) is the mean intensity of the Spectralon panel at waveband \(\lambda\)[41].  
Once the images of the drone are calibrated, an orthophoto mosaic is constructed for each band using six ground control points in AgiSoft software. The four orthophoto mosaics corresponding to each spectral band are reprojected to have the same size, with a pixel size of 3.11 \(\times\) 3.11 cm (about 1.22 in). Using the shapefile delimiting the footprint of the EC, a clip of each orthophoto mosaic is made, containing the region of the crop covered by the EC footprint, which provides a first mask to delimit the region to compute the VIs. A second mask is made to differentiate plants from the soil, so that the VIs are computed on vegetation pixels only. We use the NDVI to differentiate plants from the soil by setting a threshold of NDVI \(>\) 0.3 to detect plants, based on [42] and prior experience. The intersection of the two masks is used to compute the VIs, within the EC footprint.