RASPBERRY PI 3 MULTISPECTRAL LOW-COST SENSOR FOR UAV BASED REMOTE SENSING. CASE STUDY IN SOUTH-WEST NIGER

The technology of UAV (Unmanned Aerial Vehicles) is rapidly improving and UAV-integrated sensors have kept up with it, providing more efficient and effective solutions. One of the most sought-after characteristics of on-board sensors is the low costing associated to good quality of the collected data. This paper proposes a very low-cost multiband sensor developed on a Raspberry device and two Raspberry Pi 3 cameras that can be used in photogrammetry from drone applications. The UAV-integrated radiometric sensor and its performance were tested in in two villages of South-west Niger for the detection of temporary surface water bodies (or Ephemeral water bodies): zones of seasonal stagnant water within villages threatening the viability and people’s health. The Raspberry Pi 3 cameras employed were a regular RGB Pi camera 2 (Red, Green, Blue) and a NoIR Pi 3 camera v2 (regular RGB without IR filter) with 8MPX resolution. The cameras were geometrically calibrated and radiometrically tested before the survey in the field. The results of the photogrammetry elaborations were 4 orthophotos (a RGB and NoIRGB orthophoto for each village). The Normalized Difference Water Index (NDWI) was calculated. The index allowed the localization and the contouring of the temporary surface water bodies present in the villages. The data were checked against the data collected with a Sony (ILCE5100). Very high correspondence between the different data was detected. Raspberry-based sensors demonstrated to be a valid tool for the data collection in critical areas. * Corresponding author


INTRODUCTION
The usage of Unmanned Aerial Vehicles (UAVs) has gaining approval in scientific community for different applications related to the acquisition of information. UAVs have become common tools in a wide range of applications (D' Oleire-Oltmanns et al., 2012). The UAVs advantages UAVs are unquestionable: they can fly at low altitudes and reach remote areas and thet can be equipped with a multitude of sensors (Giordan et al., 2017), such as optical and hyperspectral camera, Laser, SAR, IMU, GPS, etc (D'Oleire-Oltmanns et al., 2012;Hruska et al., 2012;Skoglar et al., 2012); These characteristics make UAVs reliable data collectors, especially in areas where dangers to personnel exist, as an example in post-hazard areas in which structures have collapsed or explosions have occurred. Furthermore, UAVs can capture very high resolution imagery and oblique imagery . Nowadays UAV technologies are consolidate in several fields. In agriculture are used for precision farming, to assess the phytosanitary conditions of crops and the phenology of cultures (Candiago et al., 2015). Similarly, in forestry UAVs are employed in forest health assessment, but also in volumes estimations, forest-fires monitoring and trees classifications Pla et al., 2017;Banu et al., 2016). Environment monitoring activities benefit of UAVs too, for example in landslides and erosion monitoring (D'Oleire-Oltmanns et al., 2012;Piras et al., 2017), water assessment, coastline and volcano monitoring (Gonçalves and Henriques, 2015), or natural resources and infrastructure documentations (Angeli et al., 2019;Giordan et al., 2017). In disciplines like archaeology and architecture UAVs are employed in 3D surveying and mapping (Chiabrando et al., 2010). Thanks to their ability of acquire data regardless the criticism of study area, UAVs are widely employed in rescues, post-hazard monitoring (Calantropio et al., 2018) and emergency activities (Nex and Remondino, 2014). The spreading application of UAVs is attributable to the versatility of the technology ant the possibility of being equipped of many different sensors with the limit of the size and the weight. Beside the fundamental navigation sensors, the most common sensors are cameras, multi spectral sensors (Baluja et al., 2012;Berni et al., 2009.;Kelcey and Lucieer, 2012) and Lidar (Chisholm et al., 2013;Tulldahl et al., 2015;Wallace et al., 2012). Regarding the radiometric information, using a simple near InfraRed and visible data grants the possibility to apply several radiometric index, performing meaningful analysis in most of the applications. One of the most soughtafter characteristics of on-board sensors are the low-costing (Aden et al., 2014;Kingston and Beard, 2004), the customizability, and the lightweight. In the last few years, several low-cost multiband sensors have entered into the market, providing to UAV-users several solutions. Beside these, inexpensive alternatives to commercial radiometric sensors exist. Particularly, some devices can be self-assembled and programmed, such as Raspberry device. This contribution analyses a RGBNoIR camera based on Raspberry Pi 3 system for photogrammetry from UAV purposes. The tests and the calibrations carried on in laboratory and in the field are presented.

THE RASPBERRY SENSOR
Raspberry Pi 3 is a personal computer board with Linux operating system installed on it. Users must integrate any hardware, including screen and mouse. Raspberry Pi can be applied to electronic structures and programming network work (Jindarat and Wuttidittachotti, 2015). It is cheap to encourage young people for learning programming and experimenting (Agrawal and Singhal, 2015). Although initially developed to increase interest in software engineering, it has soon became accepted as a programmable control unit in many different applications (Sobota et al., 2013). Raspberry Pi can connect to numerous external accessories (Foundation Raspberry, 2019), including cameras. On the market are available camera modules for Raspberry, among others, there are sensors that are able to collect InfraRed light. The Raspberry device analysed in this contribution ( Figure 1) is composed by 1) a central Raspberry Pi 3 board; 2) a 3.5 inches touch screen; 3) a multiplexer chip 4) a Raspberry Pi 3 V.2 camera 5) a Raspberry Pi 3 V.2 NoIR camera 6) a 5v power bank. Table 1 describes the main characteristic of the components. The size of the device is 85mmx56mmx32mm, the final weight (battery included) 300 grams and costed around 100€. A Python code was specifically created using Raspberry Pi camera library to shoot and save pictures automatically from both cameras at a given frequency. The two cameras did not work simultaneously, but with 0,1 second delay between each other, which was considered negligible for our applications. Moreover, to store the pictures taken at 1Hz frequency, the resolution of the data was reduced to 5 MP. The Raspberry Pi 3 cameras v2 employed were a regular RGB Pi 3 camera v2 (Red, Green, Blue) and a NoIR Pi 3 camera v2 (NoIR-RGB). Camera calibration is fundamental for any metric reconstruction from images (Nex and Remondino, 2014). Thus, before the application in the field, the NoIR camera module was tested in laboratory. Pagnutti et al. (2017) realized an in-depth study on the Raspberry Pi 3 v2 RGB camera. Considering the already existing study regarding the RGB Raspberry sensor, this contribution is focused on the NoIR Camera Module calibration. Were performed a geometric calibration of the sensor. The dark frame was assessed and radiometric tests was realized. Once the tested in laboratory, the Raspberry device was used in the field during a UAV campaign in Niger.

GEOMETRIC CALIBRATION
The sensor was geometrically calibrated using a known size chessboard. 20 pictures were taken from different angulations. The distortion of the camera was then estimated using MATLAB camera calibration tool (MATLAB, Computer Vision Toolbox TM ). The results are shown in Table 2. Radial distortion of the lens is expressed by K1 and K2 coefficients (MATLAB, Computer Vision Toolbox TM ). The radial distortion coefficient k3 is 0. Tangential distortion of the lens is expressed as p1 and p2 coefficients (MATLAB, Computer Vision Toolbox TM ). The estimated focal length is expressed in millimetres. The principal point (i.e. the optical centre of the camera) is in pixels. The mean reprojection error is an extrinsic parameter that represent the average Euclidean distance between reprojected and detected points and is expressed in pixel (MATLAB, Computer Vision Toolbox TM ). Table 2, for each parameter show the σ (standard error) value on x and y components that represents the uncertainty of the estimated parameters. The errors have the same unit of measure on the corresponding parameter and are expressed for both x and y components. σ can be used to calculate the confidence intervals.
x y x-error y-error Radial distortion 0.

Dark frame knowledge
The dark frame assessment was performed in constant conditions of temperature (indoor, 21°C). The sensor was covered with a black stopper and 50 pictures were captured ad different ISO (100, 200, 300, 400, 500 and 600) and constant exposure of 5ms. It was notice that the first 4 pictures acquired were overexposed, thus discarded. The DNs of each band were spatially averaged. The results are three matrices (NoIR channel dark frame; green channel dark frame; blue channel dark frame) for each ISO setting. As expected, dark frame is ISO dependant: its values increase for higher ISO (Figure 3). Table 3 reports the histogram of DN distributions for the dark frame assessment for ISO 100 and ISO 600.

Spectral response
Pagnutti et al. (2017) realize a study on the Raspberry Pi 3 v2 camera identifying the spectral resolution of its bands ( Figure   2). A far as we know, there are no studies on the spectral response of the Raspberry NoIR. The producer does not reveal information in its regard, but that the NoIR camera is a "standard" Raspberry PI camera without the IR filter (RaspberryFoundation, 2019). This means that the camera is able to detect InfraRed light, but is unknown which part of the electromagnetic spectrum. A clue regarding the radiometric resolution of the sensor derives from the work of Hobbs et al. (Hobbs et al., 2016). They created a spectrometer using a Raspberry Pi NoIR and it is sensible between 415 nm and 775 nm. This includes part of the Near-InfraRed spectrum. In order to better define the spectral resolution of the device, NoIR data were checked against the one of a hyperspectral camera, Sonap Rikola. 10 pictures of a calibration target and a plant were captured with the Raspberry and the hyperspectral sensor at the same time (Figure 4). The data were spatially averaged and dark frame subtracted. The hyperspectral camera is not able to detect values below 500nm (blue) of the spectrum, consequentially the blue band of the Raspberry was not taken into consideration. 13 bands between 640 nm and 900 nm were acquired (amplitude of bands of 20nm). The spectral signatures of sample pixels from the scene were extracted. The reflectance values of the green channel of Raspberry (i.e. 550mn) were subtracted to the one of the hyperspectral, showing a constant difference for the sample pixels (  The values of the NoIR channel of Raspberry were subtracted to the ones of each hyperspectral band between the 640nm and 900nm. Then the differences were compared to evaluate constant distances between the spectral values. Apparently, there is no correlations with any band of the hyperspectral. In both Green and NoIR band, the reflectance values of black panel are very close. The remaining panels show small differences for the bands of 680nm and 700nm, although the values on the white panel are very close. There are no significant results from the comparison. Table 5 shows the comparison between the spectral signatures ( Figure 5).  Table 5. Difference between the Band NoIR of the raspberry NoIR and the one of the hyperspectral bands between 640nm and 880nm ion the 5 sample points selected for the comparison.

SENSOR APPLICATION IN THE FIELD
The sensor was used to acquire data in the field in Niger ( Figure  6), within the framework of ANADIA 2 project 1 .The project needed high resolution imagery of two villages along the Sirba River (South-west Niger) to detect water stagnations. Thus, it was organized a UAV campaign to collect high resolution RGB imagery and near infrared information. The Drone used was property and self-constructed by the local enterprise Drone Africa Service. It was used a fixed-wing UAV with two cameras: the Raspberry-based device and a commercial Sony camera (ILCE-5100). This camera is an RGB sensor and it has 24.3 MP resolution. Only one camera per flight was mounted on the UAV. This was done to avoid over weight and because the final results need to have comparable spatial resolution (i.e. different heights of flight). The project required spatial resolution below 10 cm to obtain significant information regarding the temporary surface water bodies. The height of Raspberry cameras flight was 120 meter above the ground and the one with the Sony was at 270 m. 300 hectares were surveyed with each camera. Table 6 summarizes the characteristic of the flights. A RTK survey in master-rover 1 ANADIA 2 (Adaptation to climate change, disaster prevention and agricultural development for food security) is a project founded by the Italian Agency for Development Cooperation. It aims to create a flood early warning system and nine flood risk reduction plans at village level of which 4 in the Sirba river basin. The risk reduction plans take into consideration, beside the flood risk, also the health risk provoked by the presence TSWB within the village that can be hotspot of insects and threat human health. modality was carried out with two GNSS receivers to support the geo-reference of the models. Figure 7: Detail of the surveyed areas. On the left Larba Birno, and on the right Tourey.
The correct coordinates were estimated with PPP (Precise Point Positioning) technique since the surveyed area is characterized by lack of geodetic infrastructure. The PPP-estimation had 6 cm precisions. The up component, was converted from ellipsoidal heights to orthometric heights using EGM08 model (Pavlis et al., 2012). In Tourey were measured 20 points, while in Larba Birno were measured 16 points. The PPP-estimation had 6 cm average precision. The Raspberry device collected a total amount of 3397 pictures. The pictures were dark-subtracted and calibrated on the white markers considered as maximum reflectance, in this way the radiometric information of the two cameras was correlated. Then, they were geometrically calibrated. The bands of the Raspberry RGB and Raspberry NoIR were aligned using QGIS software (version 2.18) based on the points measured in RTK.  Table 7. RMSE value of the control points in centimetres

FIELD RESULTS ELABORATION AND VALIDATION
The goal of the field application was to detect the presence of stagnant water in the villages, thus an index based on the radiometric information that allows the identification of water bodies was used. The Normalized Difference Water Index (NDWI) by McFeeters detects the presence of water by subtracting the NIR information to the green one (equation 1) (McFeeters, 2013).

NDWI = (Green-NIR)/(Green+NIR) (1)
The pixel were distributed in classes based on the index value (Table 9). Only class 6 and 7 were considered as water bodies.
A further analysis was realized on the raspberry-based data.  Table 9. Pixels distribution (percentage) of the NDWI raster within the identified classification. Column one shows the name of the class, column two the interval of values describing the class (low value ≤ DN < higher value), in column three are reported the percentage of cover of each class The results obtained from the NDWI were visually check against the data collected with the SONY ILCE camera. The index allowed the localization and the contouring of the temporary surface water bodies present in the villages, detecting also high turbidity water bodies. Figure show and example of Temporary surface water body detected using the NoIR channel.

CONCLUSION
The findings of this study suggest that Raspberry Pi-based sensors are appealing and affordable multiband (NoIR-RGB) alternatives to commercial radiometric sensors. The sensor demonstrates to be able to provide good results and being a valid tool for the data collection in critical environment. In this particular case, it did not overheated, despite the high temperatures. In this application, the drone did not power the sensor and there was no interaction between the UAV navigation system and the sensor system. The possibility of coding and personally designing the device adds further potentialities, as example the connection of the sensor with the UAV system. The coding broaden the application prospects of this low-cost sensor, making it adaptable to several unmanned vehicles. Nevertheless, the unknown radiometric resolution is a very strong limit to the employment of the sensor in scientific fields. From this first study and from the literature, we can presume that the NoIR camera is sensible to the InfraRed light, most probably to the Near InfraRed light. This is partially confirmed by the validation of the data collected in the field, which provide reasonable results. However, the sensor was not spectral calibrated and the validation method proposed in this paper does not lead to rigorous calibration. The results of this study therefore need to be interpreted with caution. In this particular application, it was not necessary a multi-temporal analysis, thus the congruence of data within the Raspberry cameras was considered sufficient for our goal. In case of multi-temporal analysis, the same radiometric tests would probably lead to erroneous results (unless data are collected in same environment conditions). The impossibility of compare data of different time makes the sensor less effective.
Sony ILCE NDWI Figure 8. Example of temporary surface water bodies from the village of Larba Birno. Above: the Sony ILCE RGB information at 3 cm of resolution. Below: the NDWI data, which derives from the NoIR camera acquisition the resolution is 6cm.
Beside the radiometric-and spectral-related doubts, many other variables should be investigated. Different pre-set shoot modalities (that were not used in this work) exist in Raspberry Pi 2 cameras coding libraries, which should be take into account in future studies. Additional work can be done to improve the Python code to automatically remove noise (dark frame) and geometrically calibrate the pictures. Moreover, the Pi NoIR camera is match with a blue filter by the constructor that can be apply on the optic. Several questions remain to be answered, but surely, the main one is what is the spectral resolution of the Raspberry NoIR camera? Considerably more work will need to be done to determine sensibility-range of the sensor. In this direction, more research is planned to absolute calibrate the sensor.