# Smartphones as a Light Measurement Tool: Case of Study
## 4 Analysis of Sensors in Mobile Devices
### Mobile Camera  
Since most smartphones are equipped with digital cameras, the functionality of this tool has been extended beyond taking pictures. Nowadays, these devices are used in areas such as telemedicine [33], microscopy [34], biology [35] or fluorescent imaging [36], among others.  
For instance, if we pay attention to the field of photography, it is possible to see some relationships between photographs and illuminance factors. Nowadays, it is normal to see photographers measuring light characteristics with external luxmeters to adjust their shutter speed and depth of field to get best picture quality [12]. This relationship is present in the photographs' characteristics to the point that it is possible to measure the illuminance through the camera values at the time of taking a picture, as well as the characteristics of the colors of the picture taken. Thus, by using the camera and photographs characteristics, it is possible to calculate the luminance of the scene.  
For this purpose, an Android application that is able to obtain the luminance of a picture has been developed. This application allows for obtaining the picture directly from the gallery or from the digital camera. Once the image to process has been acquired, the next step is to process the image to evaluate it. The first stage for performing this task of evaluating the luminance of a picture consists of adapting the spectral luminous efficiency of the human eye for photopic vision through the CIE XYZ (Commission Internationale de l'Eclairage) and (\(\lambda\)) curve. Hence, this value is able to make a direct statement about the luminance of colors [27]. It is possible to evaluate the individual luminance of the tints through the main color wheel palette with constant saturation and lightness levels converted to grayscale. As in a photograph, the images obtained are in RGB (Red Green Blue) colors, and they must be converted into greyscale images to ease the computational burden using the formula of a weighted sum of Red, Green and Blue components, as is shown in Equation (1) [37; 38]:  
\[\text{Luminance}=(0.299\times\text{R}+0.587\times\text{G}+0.114\times\text{B}). \tag{1}\]  
This way, the three dimensions of color can be translated into one, where white is represented with the highest value, and black with the lowest.  
Figure 1 shows a chart with the process done by the application to obtain the luminance of a scenario.  
One of the main drawbacks detected while measuring the illumininance on a concrete surface with a digital camera is that the illuminance measured will take into account the distance of the device from the surface where the measure is taken. To solve this problem, it is necessary to use a sort of filter close to the device to ensure that the measurement is performed at this point. To perform the study, a Luxi device (Extrasensory Devices, Palo Alto, CA, USA) [39] was used. This device is shown in Figure 2. This device is a diffusion dome attachment for a smartphone's front-facing camera.  
Another issue detected is the camera parameters, where values as such ISO, shutter speed or F-Stop can change the values obtained in the same lighting conditions. For that reason, and in order to evaluate its use in lighting measurement, it is necessary to take these parameters into account.