# Measuring Facial Illuminance with Smartphones and Mobile Devices
## 2 Materials and Methods  
### Quantification of Face Illuminance  
Environmental light levels are typically quantified using illuminance (total luminous flux incident on a surface, per unit area) [26]. Room light levels depend on the total luminous flux output of the primary light source (e.g., Sun, room lamp, etc.) as well as the reflectivity of the secondary sources (diffuser walls, floor, objects). Measured illuminance also depends upon the location and orientation of the illuminance meter. The illumination that contributes to the retinal image can be estimated by mounting a forward-viewing light meter, near the eye [22; 23]. The integration angle of such forward-viewing measurement devices should not exceed the angular area of the human visual field (approximately 20,000 square degrees). Since light captured by forward-viewing light meters would be illuminating the face, measuring light being reflected from the face is another approach to capture visually relevant environmental illuminance. Therefore, if face reflectance is known, face luminance can provide accurate measure of the visually relevant environmental illuminance. The front-facing cameras contained in mobile devices automatically capture light reflected from the face to form images of the face (\"selfies\"). We propose a method to evaluate face illuminance using images acquired by front-facing cameras. Furthermore, we compared the camera estimates of face illuminance with those derived from ambient light sensors included in the front of most mobile devices [27]. The photometric properties of light captured by each pixel in the camera can be described by three values in a YUV colour space, where Y (luma) represents the amount of light captured by each pixel in the image, which is proportional to the visually weighted energy received during the time \(t\) of exposure (image flux), and to the gain of the camera's sensor, which is expressed as ISO value \(I\). Therefore, if a part of the image of the user's face corresponding to the area around the eyes can be identified in the camera image, the mean luminance value of the face in that area \(Y_{m}\) can be calculated. If \(a_{P}\) is the area of each pixel that capture the image of that region of the user's face, the illuminance received at these pixels (\(E_{P}\)) would be:  
\[E_{P}=\frac{kY_{m}}{a_{P}It} \tag{1}\]  
where \(k\) represents a constant corresponding to transmittance losses of the device camera. The relationship between face luminance \(L_{f}\) and camera image illuminance \(E_{P}\) (Figure 1, right), is given by:  
\[L_{f}=\frac{f^{\prime 2}E_{P}}{A}=c(f/\#)^{2}E_{P} \tag{2}\]  
where \(f^{\prime}\) is the focal length of the front camera of the device, \(A\) its aperture, \(c\) is constant (\(4/\pi\)), and \(f\)/\(\#\), the \(f\) number. Knowing the face luminance, and assuming that skin can be approximated as a cosine reflector (Lambertian surface), we can calculate the face illuminance, \(E_{f}\) (Figure 1 left) as [28]:  
\[E_{f}=\frac{\pi L_{f}}{\rho} \tag{3}\]  
where \(\rho\) represents the spectral reflectance of the face. Finally, combining Equations (1)-(3) gives:  
\[E_{f}=\frac{\pi c(f/\#)^{2}kY_{m}}{\rho a_{P}It}=k\,\frac{(f/\#)^{2}Y_{m}}{It} \tag{4}\]  
where the constant \(k^{\prime}\) includes all values that are considered constant for a particular device and face combination. The remaining values in Equation (4) are usually chosen automatically by the camera's auto-exposure system based on the scene. Of all these values, the one that varies the most in response to a change in lighting conditions is the luma (grey level) of the pixels in the area in the image, which includes the face. Because the value \(k^{\prime}\) for each device and face combination is unknown, a calibration was necessary for each device/subject pairing to convert camera pixel luma values (\(Y_{m}\)) to face illuminance (\(E_{f}\)). Figure 1: Illuminance measurement geometry with mobile devices.