Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

Contents lists available at ScienceDirect

Journal of Quantitative Spectroscopy & Radiative Transfer


journal homepage: www.elsevier.com/locate/jqsrt

Calibration of digital compact cameras for sky quality measures


Pietro Fiorentin a,∗, Andrea Bertolo b, Stefano Cavazzani c,d, Sergio Ortolani c,d
a
Department of Industrial Engineering, University of Padova, via Gradenigo 6a, Padova, Italia
b
Regional Environmental Prevention and Protection Agency of Veneto, Via Ospedale Civile 24, Padova, Italia
c
Department of Physics and Astronomy “Galileo Galilei”, University of Padova, Vicolo dell’Osservatorio 3, Padova, Italia
d
Istituto Nazionale di Astrofisica—Osservatorio Astronomico di Padova, Vicolo dell’Osservatorio 5, Padova, Italia

a r t i c l e i n f o a b s t r a c t

Article history: This work presents the possibility of using the extremely popular compact digital cameras of smartphones
Received 29 November 2019 or action cameras to perform sky photometry. The newest generation of these devices allows to save raw
Revised 28 July 2020
images. They are not as good as digital single-lens reflex camera, in particular in terms of sensitivity,
Accepted 30 July 2020
noise and pixel depth (10 bit versus 12 bit or more), but they have the advantage of being extremely
Available online 1 August 2020
widespread on the population and relatively cheap. These economical digital compact cameras work with
Keywords: an electronic shutter, it overcomes the consumption of mechanics and allows to gather images for long
Digital camera time. The work uses a simple calibration method to transfer raw data from the proprietary RGB color
Photometry space to the standard CIE 1931 color space. It allows the measurement of sky luminance in cd m−2 with
Image luminance measuring device an expected uncertainty of about 20%. Furthermore, the colorimetric calibration allows to know the cor-
Light pollution related color temperature of a portion of the sky, it can help the identification of the kind of polluting
Night sky brightness
sources. Aiming at better clarifying the performances of calibrated digital compact cameras, a compari-
Sky imaging, Citizen science
son with a calibrated DSLR camera is presented in outdoor situations showing a good agreement both for
luminance and color temperature measurements.
© 2020 Elsevier Ltd. All rights reserved.

1. Introduction Digital still cameras are devices working in a proprietary color


space, therefore, changing towards a standard color space is not
Most of the population lives in sites contaminated by light pol- often easy even not possible exactly. On the other side, more and
lution, in these areas light pollution does not have a uniform dis- more cheap devices of good quality are present on the market and
tribution. The knowledge of the distribution of the luminance over therefore widespread, this situation suggests to use them to build
the night sky allows to quantify the extent and the severity of light a wide fine mesh network of distributed measuring systems, even
pollution defining some parameters of quality like zenithal, average over the entire world.
all-sky, median brightest, and the brightness of the darkest portion The use of widespread instruments such as the smart-
of the sky [1]. phone or the action camera greatly can increase the observation
Wide angle or fisheye cameras can provide these maps allow- grid with the consequent improve of the measurement spatial
ing a very detailed recording of the artificial sky glow [2–5]. It can resolution.
be a good tool to identify polluting sources and to analyze the ac- A new observation network can be developed, in addition to the
tion devoted to a light pollution reduction. The need to be able to SQM and satellite observation networks [6–8]. It also can allow to
compare the results obtained in different sites requires the cam- understand possible instrument bias and increase the possibility of
eras are calibrated according to a standard. It could be in terms cross calibrating the various tools, a problem currently open. The
of luminance in cd m−2 , a quantity commonly used by engineers higher resolution of this new network can allow to better identify
dealing with outdoor lighting and photometry, or brightness in the main sources of light pollution with the respective temporal
mag arcsec−2 , a quantity mainly used in astronomy. It does not the evolution [2,3].
matter what quantity we want to use, what matters is we have to The new distributed observation network also can be an ad-
agree on the same standard. ditional tool for monitoring astronomical sites also by sampling
their temporal evolution and, therefore, for preserving them. This
study is of great importance for the astronomical observations

Corresponding author. and the planning of the professional astronomical instrumentation
E-mail address: pietro.fiorentin@unipd.it (P. Fiorentin).

https://doi.org/10.1016/j.jqsrt.2020.107235
0022-4073/© 2020 Elsevier Ltd. All rights reserved.
2 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

development as well as for the observatories dedicated to the Sky Quality Camera software (version 1.9.2, Euromix Ltd, Slovenia)
outreach. see [12] as example of use.

2. Instruments used for comparison


3. Characterizing the analyzed device
In order to calibrate and use the analyzed smartphone cam-
The analyzed compact camera is the back camera of a Samsung
era as a luminance and image tristimulus meter, we compared our
Galaxy S8, the sensor is a ISOCELL S5K2L2. It is an RGB CMOS
measurements to instruments devoted to light engineering appli-
back-illuminated sensor with Samsung ISOCELL technology which
cations. We further used the latter to quantify the photometric ac-
should increase the light sensitivity and color fidelity in poor light-
curacy of the analyzed smartphone camera.
ing conditions. The sensor size is 4032×3024 corresponding to 12.2
After the calibration the measurements made with the smart-
Mpixel, the pixel size is about 1.4 μm. The focal length of the cam-
phone were compared with the output provided by an instrument
era lens is 4.20 mm, the aperture is fixed at the value f/1.7. The
dedicated to night sky measurements, i.e. an all sky camera based
analog to digital converter has a depth of 10 bit. The image file
on a DSLR camera with a calibration in terms of sky brightness
can be saved in both JPEG (Joint Photographic Experts Group) and
and color temperature. The sky brightness can be expressed either
DNG (Digital Negative) formats [13], this last was used in our ap-
in cd m−2 or in mag arcsec−2 ; the first one was used in the pre-
plication. It was not easy to find information on the performance
sented comparison.
of the considered sensor.
As for CCD detectors [14], the output of CMOS sensors presents
2.1. Reference instruments
a direct current (DC) offset and a noise superposed to the signal.
DC offset is the sum of a bias, a DC value of the output obtained
The data acquired by the smartphone camera were correlated
when the exposure time is zero, and a component linearly depend-
with luminance and spectral measurements on stable light sources.
ing on the exposure time, i.e. the dark current. The latter is a small
The measurements of the spectral radiance were collected by a
electric current that enters the sensor even when no photons are
spectro-radiometer working in the visible range. It is a Konica Mi-
reaching the device. The same useful signal can be obtained by us-
nolta CS-10 0 0a. Its spectral range spans from 380 nm to 780 nm
ing different acquiring conditions, for example with different pairs
and its spectral resolution, defined as the full width at half maxi-
exposure time-ISO speed, but the DC offset varies due to the inte-
mum (FWHM), is about 5 nm. The integral of the spectral radiance,
gration of the dark current for a different period of time, the longer
weighted by the photopic sensitivity, is the luminance which can
exposure time the higher the DC offset. Therefore, here DC offset is
be measured from 0.01 cd m−2 to 80,0 0 0 cd m−2 , with an uncer-
independent of the input signal itself, but strongly affected by the
tainty of 2% of the reading plus 1 digit, when an Illuminant A is
acquiring conditions (shutter time, temperature).
observed. Furthermore, its repeatability (1 standard deviation) is
Noise is an unwanted variable component superposed to the
0,1% of the reading plus 1 digit.
useful signal presenting a random behavior. Two main components
A stable luminance reference light source was used to analyze
can be considered in the noise. The first is readout noise, it is in-
the stability of the camera, its linearity and to assess its calibra-
dependent of signal level and sets a noise floor for the device. It is
tion for the luminance measurements. The source is the lumi-
caused by the analog converter circuits and the amplifier electron-
nance integrating sphere standard OL455 available in the labora-
ics. The second is the photon or Poisson noise, it appears under
tory from Optronic Laboratories. The emitting surface has a diam-
illumination of the sensor and its standard deviation follows the
eter of 38 mm. The realized luminance is declared by the man-
square root of the counts.
ufacturer with an uncertainty equal to 2% of the set value. The
Aside measuring the DC bias, the dark current and readout
luminance on the aperture presents a uniformity of 0.5% and its
noise, it is fundamental to evaluate the gain of the detector. For
short-term stability is 0.5%. The current in the halogen lamp in-
the analyzed camera it can be measured in terms of luminance
side the source can be varied. It was chosen so that the source
per count; we can not evaluate gain as e-/ADU like usually done
approximates the spectral emission of a blackbody at 2856 K, i.e.
for CCD detector. Gain depends on the selected ISO speed; the in-
the Illuminant A.
fluence of that quantity is presented.
A Konica Minolta luminance meter LS-100 was also used
Due to the construction of the device the only available output
to check the camera calibration. Its operating range is from
is after the analog to digital converter which has a saturation to
0.001 cd m−2 to about 30 0,0 0 0 cd m-2 . The declared error on the
zero and to the maximum count (1023).
spectral responsivity f1 ’ is 8%. The uncertainty is equal to 2% plus
2 digits of the read value, when it is lower than 1 cd m−2 , and 2%
plus 1 digit, when the measured luminance is over 1 cd m−2 . The 3.1. Bias and dark current behavior
uncertainties are defined for a source with the spectral distribution
of Illuminant A. The lowest luminance value down to 0.001 cd m−2 Multiple acquisitions (20) were recorded when the detector was
is an amount close to values we want to measure on the sky. In covered for different exposure times. The shutter time was set to
fact, typical night sky brightness ranges from about 0.2 mcd m−2 the most significant values which can be useful for the measure-
for a zenithal clear sky to about 200 mcd m−2 of urban night sky ment of the night sky luminance (from 0.5 s to 10 s). The offset
[5,9–11]. values were obtained by averaging over the 20 acquisitions and
over the 2500 pixels of a square at the center of the sensor. We
2.2. All sky camera analyze only the central part of the detector, because only this re-
gion is covered by our reference luminance source and other spot
The all sky camera is a commercial camera (Canon 70D) with a instruments available in the laboratory. For uniformity with other
fisheye lens (Sigma 4.5 mm f/2.8). The camera uses a CMOS sensor, parts of the work, this approach is considered also for the analy-
the recorded image is acquired by an analog-to-digital converter sis of the DC offset. Negligible variations, no more than then 5%,
with 14 bit, corresponding to a dynamic range of 1 to 16384 lev- appears when all the sensor is studied. Fig. 1 shows the results
els [5] in a single exposure. The data provided by the camera in of that analysis. The behavior is very similar for the three (RGB)
raw format are processed and the images are calibrated in terms channels. The error bars in the plot represent one standard devia-
of night sky luminance and correlated color temperature by the tion and account for the signal variability. The linear behavior from
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 3

Fig. 2. Values of the noise variance versus useful signal for the R (red), G (green)
Fig. 1. Values of the offset for different exposure times for the three channels of and B (blue) channels. The linear interpolation agrees with Poisson statistics.
the camera.

Table 1
Coefficients of the linear fitting formula of the Offset for shutter time Table 2
over 4 s. Coefficients of the linear fitting formula of the noise variance versus
useful signal.
channel / coeff. p1 p2 R2 r
channel / coeff. p1 p2 R2 r
R 0.79±0.13 0.08±0.99 0.9998 0.9999
G 0.77±0.19 0.13±1.47 0.9996 0.9998 R 3.34±0.06 11±8 0.9998 0.9999
B 0.78±0.20 0.05±1.54 0.9996 0.9998 G 1.49±0.03 7.2 ± 5.8 0.9998 0.9999
B 3.23±0.07 12±9.4 0.9998 0.9999
O f f set = p1 ∗ t shutter + p2.
Noise variance = p1 ∗ Signal + p2.

shutter time over 4 s is due to the linear increase of the dark cur-
rent. Superposed to the measurements the linear interpolations of the central part of the pictures. The obtained value is only once the
the data are presented in Fig. 1 for the three channels, they ac- average variance of the total noise. As briefly described above, the
count for reading obtained for shutter time equal or longer than obtained values present two main components: Poisson noise and
4 s. Table 1 presents the coefficients of the linear regression. The readout noise. Fig. 2 presents the noise variance versus the aver-
high values of the coefficients of determination (R2 ) and Pearson age values of the recorded images for the three channels and the
correlation (r) describe the fair interpolations. The low values of relative linear interpolations. They describe the linear variation of
the p2 coefficients indicate the master bias, i.e. the count value at the noise variance with the signal, according to Poisson model. The
the shortest exposure time, is very close to zero, unlike for CCD interpolation coefficients are presented in Table 2. The p2 coeffi-
sensors. Due to the small master bias, at the shortest exposure cients are estimates of the variance read out noise, corresponding
times, the signal entering the analog to digital converter has an to a shutter time equal to zero seconds.
average value close to zero and essentially composed by noise. The
converter used in this CMOS sensor deals only with non-negative
voltage, if the signal presents negative values, they are trimmed 3.3. Modeling noise distribution
to zero. It happens at exposure times shorter than 2 s, there the
points in the plot represent the averages of the positive values of Fig. 4 shows the histograms of the signal recorded when the
readout noise plus the small effect of the dark current, essentially. sensor is covered, the ISO speed is set to 800 and the shutter time
At shutter time shorter than 2 s dominates the readout noise. is 10 s. The vertical axis presents the values of the normalized ap-
To better understand the possible value of the master bias the pearing frequency. The mean value of the signal should be dom-
quantification of the read-out noise in terms of counts is required, inated by the dark current and all the values of the G channel
the issue is considered in the next section. should be just over zero. The distributions of the R and B channels
The linear fitting of the offset, including the master bias and presents lightly lower values and the voltage at the input of the
the effect of the dark current is used to correct the acquired im- A/D converter has both positive and negative values, it is caused
ages. The absolute uncertainty on the correction has its maximum by noise from conditioning electronics. The A/D converter accepts
value when the exposure time is equal to 10 s and is equal to only non-negative voltage, therefore negative values are trimmed
1 count. For exposure time in the range of 0.5–2 s it becomes to zero; consequently, R and B channels show different histograms.
about 0.5 count. This uncertainty is mainly due to the noise. A simple model of the signal behavior of channel G was con-
sidered, it is the sum of a Poisson variable and a Gaussian vari-
able with zero mean, which explains the readout noise. The Pois-
3.2. Noise
son mass function, defining the probability that the signal takes
the value k, has the following expression
The noise level was evaluated in terms of standard deviation. To
avoid zero saturation, the ten used images were obtained via flat- λk
field imaging using a lit sheet. To collect the presented data the ISO Pλ (k ) = e −λ (1)
k!
speed was set to 800 and the shutter times were 0,5 s1 s, 2 s, 4 s,
8 s, 10 s. For each shutter time, the variance was evaluated for each where λ is equal to the expected value of the signal and also to
pixel considering the ten images, then the result was averaged over its variance. The Gaussian probability distribution describing the
4 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

readout noise has the following form: NR 2 was supposed equal to 13.7, as evaluated above. The approxi-
1 mation of the measured values is very fair.
e− 2 ( σ )
1 x 2
f (x ) = √ (2) The best choice in the selection of the shutter time is to use the
σ 2π longer time allowing to deal with the night sky luminance, for not
where x is a possible value of the random variable and σ is its strongly polluted (luminance < 40 mcd m−2 ) site the best choice
standard deviation. is the longest time of 10 s.
The sum of a Poisson variable and a Gaussian variable has a The sensor presents significant noise and a reduced number of
probability density that is the convolution of the two densities. bits (10). To improve the results, it was decided to record multi-
Several models characterized by couples of values for λ and σ ple acquisitions of the same scene and to deal with their average
were considered. Then a chi-square minimization was performed values. That way allows an improvement of the measurements as
against the measurements described by the histogram of the sig- the variability of the mean decreases with the square root of the
nal from the G channel. The mean, and consequently the variance, number of acquisitions.
of the Poisson variable (λ=6.5) and the variance of the Gaussian
variable (σ 2 =13.7) were obtained, thegray curves of Fig. 4 are the 3.5. ISO speed
probability density of the two random variables of the optimized
model. The operation is more difficult for channel R and B that are In film cameras, film speed was a measure of the photographic
trimmed to zero value. From the histograms related to those chan- film’s sensitivity to light input; it was usually measured accord-
nels a behavior similar to channel G can be argued and coherent ing to the ISO system by the “ISO speed” parameter. For present
conclusions can be supposed. digital cameras it is an indication of the gain of an amplification
The black continuous curve in Fig. 4 presents the estimated chain inserted between the sensor receiving the light and the ana-
probability density, while the black dashed curve is a plot of log converter providing the numerical output [15]. The higher is
the difference between the model and the recorded data. The the ISO speed number the greater is the sensitivity to light; there-
mean squared deviation is about 1%. The reconstructed distribu- fore, high values are useful in analyzing scenes including surfaces
tion presents positive values also for negative counts, meaning the with low luminance values. It is the case when the camera is fram-
voltage was trimmed to zero also for the G channel, the proba- ing the night sky, high ISO speed values allow to use not too long
bility of value below zero is estimated equal to 7.5%. The trim- exposure times. During shorter exposures the sky is more stable, in
ming due to the A/D converter affects the evaluation of the mean particular as refer meteorological conditions like humidity and the
value. Trimming negative value of the model an average value of presence of veiling clouds. Furthermore, airglow is a faint natural
7.2 counts is obtained, close enough to the average value obtained source which may be very variable in some cases [16–19]
from the measurement equal to 7.5 counts and of Table 1 of 7.7 The aim of this paragraph is quantifying the effect of changing
counts. The values are about 15% higher than optimal value of λ. ISO values on the gain when framing a scene with specific fixed
Looking at the readout noise, its Gaussian model shows a variance luminance values. More specifically, the issue is to determine how
of 13.7 counts, close to the upper limit of the interval of coefficient much real values of ISO speeds deviate from their nominal values.
p2 in Table 2 for the G channel, but very close to the values ob- When the framed object is stable, couples of ISO speed and ex-
tained for channels R and B in the same table. Considering only the posure time should provide the same results in terms of numerical
model of the readout noise and trimming it to zero describes the output of the analog to digital converter, theoretically. But the SNR
situation after the A/D converter, when the exposure time is zero. could be different, because of the several components of noise that
The output of the A/D converter can be described by a variable affect the final SNR. The SNR is given by:
equal to zero with 50% of probability and with a normal distribu- P · Q · Tsh
tion, for positive value, covering the remaining
√ 50% of probability. SNR =  (4)
For such variable the mean value is σ / 2π . Considering the esti- P · Q · Tsh + D · Tsh + NR2
mated variance of the Gaussian variable (σ 2 =13.7), the output of with: P is the incident power, Q represents the sensor responsivity
the A/D converter at zero exposure time is 1.48, which agrees with and, in our case, it could include the effect of the A/D converter,
the value of 1.47 of Fig. 1 at exposure time equal to 2 s. It means Tsh is the integration time, D is the dark current value, NR repre-
the DC “master” bias is very close to zero, as described by the p2 sents read noise. Actually, the higher the ISO speed the higher the
coefficient of Table 1, and readout noise dominates over DC bias noise due to the amplifiers superposed to the signal presented to
and dark current below 2 s in Fig. 1. Consequently, the new val- the converter, but reducing the exposure time causes a reduction
ues of the coefficients of the linear fitting formula of the Offset of the effective noise, as presented in Fig. 3. The result in terms of
becomes p1=0.65 and p2=0. SNR is not always straightforward. To analyze the behavior of the
considered device, the observed surface had a luminance of about
3.4. Signal-to-noise ratio 3.9 cd m−2 . In that condition the analog to digital converter works
at about 2/3 of its range, far from zero and top saturation, includ-
Here the images considered in Section 3.2 are considered in ing the effect of the noise. Working with a constant integrated sig-
terms of signal-to-noise ratio (SNR). The RGB signals were cor- nal makes the analog to digital converter operating in the same
rected for the effects of the bias and the dark current, then the working point. Different couples of nominal values of ISO speed
signal-to-noise ratio was evaluated. It is presented for the three and exposure time were considered. The values are chosen so that
channels in Fig. 5 versus shutter time, dots show the measured their product (P) is constant if possible, the actual values are pre-
values. Continuous lines are estimated values according to the fol- sented in Table 3.
lowing equation The recorded images should be equal, a part from the noise. It
Nc is not true for all the couples because the product values corre-
SNR =  (3) sponding the couples related to ISO speed 160, 320 and 800 are
Nc + D · Tsh + NR2
lightly different from the value at the lower ISO speed 50. The dif-
where NC is the number of useful counts, D is the dark current ex- ference depends on the available exposure times, a correction can
pressed in counts per second, Tsh is the shutter time and NR 2 is be applied. Its effect in terms of uncertainty can be neglected, the
the variance of the readout noise. For these estimates the values exposure time can be supposed accurate at least a few per thou-
of Table 1 were used to evaluate the dark current contribution and sand, being based on a quartz clock.
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 5

Table 3
Selected couples of ISO speed (column 1) and exposure time (column 2), their product normalized to the
value corresponding to the lower ISO speed equal to 50 (column 3), the standard deviations of the noise on
the acquired images (mean of the counts over the three channels) (column 4) and the signal-to-noise ratio
(column 5).

NominalISO speed (•) Exposure time (s) P/P50ISO (•) Noise standard deviation (count) SNR(•)

50 1 1.00 2.3 202


100 0.5 1.00 3.2 147
160 0.3 0.96 3.8 118
200 1/4 1.00 4.7 98
320 1/6 1.07 6.2 80
400 1/8 1.00 6.8 69
500 1/10 1.00 7.6 62
800 1/15 1.07 9.7 51

Fig. 3. Values of the standard deviation of the noise for different exposure time Fig. 5. Signal-to-noise ratio for the R, G, B channels: dots show the measured val-
for the R (red), G (green) and B (blue) channels, the continuous lines represent the ues; lines represent the results of the model according Eq. (3).
square root of the signal.

Fig. 6. Comparison of the effect of the ISO speed on the image output, the counts
Fig. 4. Histograms of the R, G, B signals recorded when the sensor is covered, ISO are normalized to the count obtained when using ISO speed equal to 50.
speed is set to 800 and shutter time is 10 s, the continuous black curve is a model
of the probability density of the G channel, the dashed black curve is the difference
between the model and the G histogram.
malized count over the 10 recorded images. Theoretically the mean
values should be equal, as the same working point of the sen-
sor is used. Even considering the error bars, a dispersion is ap-
The average of 10 images was evaluated for each couple, then parent in Fig. 6. It means the actual ISO speeds significantly devi-
the mean value in the central part was considered averaging over ate from their nominal values. The maximum departure happens
a square of 50 pixel x 50 pixel, as stated above, for the three R, at ISO speeds equal to 100 and 160 and is equal to about 1%. It is
G, and B channels. These values for every couples are presented worth of noting the value for ISO speed equal to 800 because that
in Fig. 6 normalized to the value for ISO speed equal to 50. Half value is very important for night sky measurements. In that case
the amplitude of the vertical bars represents the standard devia- the deviation is about 0.5% for the green and the blue channels, a
tion of the mean values and therefore the dispersion of the nor- bit more than 1% for the red channel.
6 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

As shown in Table 3, at ISO speeds equal to 160, 320 and 800, a Table 4
Coefficients of the linear fitting formula of the characteristic counts (C)
little variation of the working point happens, it is equal to 4% and
versus luminance (L) of Fig. 7a, ISO speed is 100 and shutter time is 10 s.
7%, respectively. Therefore, variations of the related counts should
not account for a correction of the exposure time only. Luckily, as channel / coeff. p1 (cd−1 m2 ) p2 R2 r
it will be analyzed later, the camera shows a good linear behavior R 2557±40 −5.6 ± 6.2 0.9997 0.9998
in its response to photon-energy/luminance variation at two thirds G 3227±67 −12±10 0.9995 0.9997
of the range. B 1493±61 −0.7 ± 12 0.9975 0.9987

As a consequence, the compensation of the gain error is neg- C = p1 ∗ L + p2.


ligible and the variations of the working point do not introduce
significant errors in the evaluation of the linearity of the real ISO Table 5
speed scale. However, the results on the effect of the deviation of Coefficients of the linear fitting formula of the characteristic counts (C)
the real ISO speed values from nominal ones were used to correct versus luminance (L) of Fig. 7b (reduced luminance range), ISO speed is
100 and shutter time is 10 s.
the camera response.
channel / coeff. p1 (cd−1 m2 ) p2 R2 r
3.6. Linearity in luminance evaluation R 2539±167 −4.0 ± 7.3 0.9995 0.9998
G 3225±283 −10±12 0.9992 0.9996
In the next section the color space transformation and the con- B 1545±194 −6.0 ± 8.4 0.9983 0.9991

sequent absolute calibration, in terms of luminance and correlated C = p1 ∗ L + p2.


color temperature, is presented. It is valid within its approxima-
tions there discussed at the working point where it is realized. Its
effect can be extended over all the dynamic range of the camera posure time for the assessment of the linearity was set to 10 s, a
without any further action only if the camera’s behavior is linear. possible value used when looking at the night sky.
Otherwise an additional error appears in evaluating the luminance Fig. 7a shows the raw output of the RGB channels when the
and the chromaticity of the analyzed light, if further actions are source luminance varies from about 5 mcd m−2 to about 1 cd m−2 ,
not undertaken to compensate the lack of linearity. The linearity these values are not so far from 0.75–14 mcd m−2 for a zenithal
of the response of the sensor in terms of counts is considered here clear sky in suburban area and 20–200 mcd m−2 of urban night
in the following versus source luminance. The evaluated linearity sky [5]. It is apparent that the channels have different gains and
errors will be used to correct the output of the RGB channels of saturate at different values of the source luminance: the first ones
each acquisition. are the green and red channels, due to the high power at the
The linearity of the camera sensor was checked by varying the highest wavelengths of the considered light. Fig. 7b is a zoom of
luminance of the reference luminance source and using a fixed ex- Fig. 7a with luminance within 100 mcd m−2 , an interval of values
posure time. It allows to scan the different position in the scale of of night sky luminance. When using ISO speed equal to 800, the
the sensor and the analog to digital converter. The choice of the same values of counts are obtained when the luminance is below
shutter time allows the use of luminance values which can be well 12.5 mcd m−2 . A useful output of about 10 counts will correspond
evaluated by the spectrometer and by the luminance meter. Two to a luminance value of about 0.6 mcd m−2 , it could be the bright-
different analysis were carried on starting from two different max- ness of a rural clear night sky with no moon. In both images the
imum luminance values. The higher one allows to take advantage dashed lines connect the measured data suggesting the channels’
from the linearity of the integration time of the spectrometer. The behaviors.
lower one is closer to night sky luminance values. Usually one value of the gain, in our case counts over lumi-
During the acquisition the ISO speed was set to 100, which is nance, is evaluated and used in the range of interest. Two attempts
here considered as reference value. Since the ISO speed used when were done considering the full and reduced ranges of Fig. 7a and
observing the sky is higher, for the analyzed camera it is 800, the b. The values obtained by these interpolations are superposed to
results should be scaled by a factor equal to the ISO speeds ratio. the measures and represented by continuous lines, the coefficients
As an alternative, a constant light source could be used and the of the linear fitting formulas are presented in Tables 4 and 5. A
variation of the energy placed on the sensor could be obtained by significant discrepancy is observed for all channels, the maximum
changing the camera exposure time. That approach can be easily difference is about 20 counts for the full range and about 4 counts
employed when specific photometric or spectrometric instruments limiting the luminance range at 100 mcd m−2 . They are not ac-
are not available; only a stable light source is required. As a coun- ceptable values when measuring low night sky brightness.
terpart, this approach requires the difference between the set and A local correction is required. Different values of gain can be
the real exposure time is negligible. For the adopted choice with evaluated considering the ratio of each read count and the related
a constant exposure time, no extra hypotheses have to be done on luminance value; theoretically they should have the same value,
the analyzed camera and the quality of the result only depends on but it is not true. Their values for the three (RGB) channels are pre-
the behavior of the reference instrument, which in our case has a sented in Fig. 8 versus the average counts, only the cases when all
negligible linearity error. channels are not saturated are shown. These series of gain values,
The results are obtained analyzing at least 25 images for each one for each of the three channels, were normalized to their maxi-
luminance value. They were averaged obtaining the matrices with mum values aiming to have a clearer representation of the camera
the mean and the standard deviation values, for each channel. The behavior.
count associated to a defined luminance value is obtained as the The most important channel is the green one, it contributes
average value of the counts in the same area considered by the more to the luminance evaluation. Its gain differs less than 10%
spot luminance meter and the spectrometer. from the maximum value in the extent from about one tenth of
Aiming at improving the confidence in the results, two differ- its dynamic range up to the saturation. The same happens for the
ent instruments are used as calibrator of the luminance scale, the blue channel, the red channel seems to show a better behavior.
luminance meter Konica Minolta LS-100 for measurement in low When the output of the channels is lower than 10 counts, i.e. at
light conditions, and the Konica Minolta CS-10 0 0, to grant a bet- 1% of the full scale (1023counts), the error could be 50%. The bars
ter linearity behavior. When the luminance meter Konica Minolta in Fig. 7 correspond to one standard deviation of the luminance
LS-100 is used as reference to measure the framed source, the ex- measurements along the horizontal axis. Also, in Fig. 8 the vertical
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 7

Fig. 7. Linearity of the red, green and blue channels for low light conditions, the luminance meter Konica Minolta LS-100 was used as a calibrator for the luminance scale.
Continuous lines interpolate the measurements, dashed lines connect the measured data suggesting the channels’ behaviors.

Fig. 8. Ratio between read count and related luminance value, for the red (R), green Fig. 9. Linearity of the red, green and blue channels. In this case the spectrometer
(G) and blue (B) channels, in low light conditions. Values are normalized to their Konica Minolta CS-10 0 0a was used as reference. Continuous lines interpolate the
maximum. The luminance meter Konica Minolta LS-100 was used as a calibrator measurements, dashed lines connect the measured data suggesting the channels’
for the luminance measurements. behaviors.

bars around the normalized gain represent its standard deviation, minance of the source and the integration time. During the acqui-
it includes the effect of the noise in the acquired images and the sitions, this quantity is kept quite constant, it varies only by 5%
contribution of the uncertainty on the luminance value itself. This with respect to its mean value, in the worst case, confirming the
last part is the most important in our case. Given a read count, a stability of the working point of the spectrometer. Neglecting the
normalized gain can be obtained from plots in Fig. 8. By dividing uncertainty on the integration time with respect to the repeatabil-
the read count by the normalized gain, a corrected count value can ity, that last is the only possible cause of uncertainty in the linear-
be obtained and most of the non-linearity of the sensor character- ity evaluation.
istic is compensated. The lowest analyzed value of the luminance was about
Aiming at reducing the uncertainty in the correction action, the 50 cd m−2 , it was measured with the longest integration time
luminance was measured with another instrument, the spectrome- of the spectrometer. Lower values did not allow to assure the
ter Konica Minolta CS-10 0 0a. The selection of the integration time stability of the working point. The highest luminance value of
of the spectrometer was in auto mode. This choice allows a good about 25 kcd m−2 caused the saturation of all channels of the
signal/noise ratio and to operate towards the full scale of the spec- smartphone camera. To deal with the chosen luminance values
trometer. Varying the integration time of the spectrometer to ac- the ISO speed was set to 100 and the exposure time was set
count the different luminance values allows the instrument to op- to 1/40 0 0 s.
erate approximately in the same working point, it happens in par- The results are presented in Fig. 9 in terms of counts versus
ticular for its input amplifiers and its analog to digital converter. the source luminance. The dashed lines connect the measured data
The spectral distribution of the power along the analyzed wave- suggesting the channels’ behaviors. The gain value was evaluated
length range does not vary, therefore the total received energy on by interpolating all data. The interpolating line is superposed to
the spectrometer detector is proportional to the product of the lu- the measures and represented by continuous line. The coefficients
8 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

Table 6
Coefficients of the linear fitting formula of the characteristic counts (C) versus luminance (L) of Fig. 9,
ISO speed is 100 and shutter time is 1/4000 s. The last column presents the p1 values scaled to an
exposure time of 10 s.

channel / coeff. p1 (cd−1 m2 ) p2 R2 r p1 (cd−1 m2 ) scaled

R (65.2 ± 1.6)•10−3 −1.5 ± 8.6 0.9987 0.9994 2608


G (82.4 ± 1.5)•10−3 −0.6 ± 8.5 0.9992 0.996 3296
B (41.4 ± 0.6)•10−3 −4.5 ± 5.8 0.9994 0.997 1657

C = p1 ∗ L + p2.

linearity. Therefore, dividing the read count by the normalized gain


allows correcting that count value and compensating most of the
non-linearity of the sensor. A linear fitting of normalized gain be-
tween the measured points is used to correct acquired images. The
absolute uncertainty on the correction has its maximum value at
the bottom of the characteristic and is equal to about 6% for the
green channel and about 14% for the blue channel, according to
Fig. 10. The uncertainty becomes of the order of some percent for
counts over 10% of the range of the RGB channels. This uncertainty
is mainly due to the noise.

3.7. Vignetting compensation

Both the transformation from the proprietary RGB color space


and the correction of linearity were performed on the bases of
data referred to the central pixels of the smartphone camera. Ob-
serving the images of the LCD PC monitor framed during the cal-
Fig. 10. Ratio between read count and related luminance value, for the red, green
and blue channels. In this case the spectrometer Konica Minolta CS-10 0 0a was used ibration was apparent the phenomenon of reduced peripheral im-
as reference. age luminance known as vignetting effect [20]. For the considered
camera, in a point 20° off from the optical axis, the error is about
40% of the read value. Aiming at using the smartphone camera as
an instrument, a correction of that error is required. A complete
of the linear fitting formulas are presented in Table 6; the gain procedure would require to scan all lighting directions observing a
values are close to the values obtained at low light conditions of reference source with a known stable luminance and build a cor-
Tables 4 and 5. Considering the 95% confidence bounds, the coeffi- rection matrix, it is presented in [21]. A fastest approach is here
cients provided by the different fittings are completely compatible. considered and an analytical function obtained by trial and error is
Also for this gain evaluation, a significant discrepancy between in- used to compensate the radial decrease in luminance. Owing to the
terpolated values and measures is observed, the maximum differ- strong approximation, the correction, even if significantly reducing
ence is again about 20 counts. It is not acceptable when low level the error in luminance evaluation, introduces an uncertainty which
luminance is considered. Again, a local correction is required. is estimated about 6% in terms of one standard deviation. No sig-
Fig. 10 shows the values of gain evaluated considering the ratio nificant misalignment between the axis of the optics and the cam-
of each read count and the related luminance value for the case era sensor was observed.
when the spectrometer Konica Minolta CS-10 0 0a was used as ref-
erence; each gain is normalized to the maximum for each chan- 4. Calibration procedure
nel (RGB). Deviation from unitary value indicates a linearity error.
Smaller gain errors are here present than in Fig. 8, it suggests a Still cameras were often used to collect information on sur-
better linearity for the smartphone camera in the second test con- face properties, both in terms of luminance/brightness [22] and
ditions. Here the errors are less than 10% of the maximum value of reflectance coefficient, spectral reflectance and color coordinates
the gain, for the green channel. [23-26]. Luminance measurements require an absolute calibration,
The error bars in Figs. 9 and 10 correspond to one standard de- while color identification is a relative evaluation with respect to
viation and account for the repeatability of the spectrometer and illumination. Furthermore, when the color appearance from a hu-
the noise in the acquired images. The two evaluations consider ap- man observer is of interest, adaptation has to be considered, usu-
proximately the same count interval and therefore the same en- ally performed by digital cameras through white balancing. On the
ergy received by the sensor. The two approaches shall provide contrary, white balancing should be disabled, or in any case must
compatible results. It becomes apparent if the uncertainty intervals have no effect, when an absolute evaluation of the light shall be
represented in Figs. 8 and 10 are defined by two standard devia- done.
tions, considering a confidence interval equal to 96%. A significant improvement happened when raw images became
Since the first results are strongly based on the absolute cali- available as output of still digital cameras. Before, images were
bration of the luminance meter, while the second ones do not de- provided by the cameras after a lot of elaboration useful for a good
pend on the spectrometer absolute calibration, it means that the appreciation of the picture. The processing, sometime non-linear,
reference luminance meter LS-100 could present a significant devi- makes difficult to recover from the images the information on the
ation from linearity at the lowest end of its measuring range, even light impinging on the sensor. Raw output allows to reach the sen-
though working according to its specifications. sor output, after the analog to digital converter, as close as possible
The difference between the normalized gain presented in to the considered light. Unfortunately, since the RGB spaces used in
Figs. 8 and 10 and unity represents the relative error due to non- different cameras are proprietary, so they are also the raw formats.
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 9

In any case raw formats allow broadening the use of still cameras
as light measuring tools in many fields, included night sky quality
measurement [4,5,27-29].
Different techniques were used to transfer the information from
the RGB proprietary space to a standard colorimetric space obtain-
ing a camera calibration. Most of the approaches are based on an
analysis of the specific cameras under use [22-27,30,31]; particu-
larly interesting for citizen science it is the construction of pub-
lic database on which a calibration of consumer cameras could be
based on [32]. As the spectral responses of the RGB filters placed
in front of the sensor usually are not a linear combination of the
trichromatic functions [33], the transformations able to obtain the
best results are not linear and often devoted only to color eval-
uation [24-26,34,35]. Using those techniques also for luminance
measurement is not straightforward, therefore in this work a linear
Fig. 11. Instrument set up used for the color calibration.
combination of the camera output is directly applied.

4.1. Decoding raw images measurement, ISO speed was set to 100, the white balancing is set
to automatic as it does not affect the values of the RGB matrix.
As stated above the images provided by the analyzed smart- From the spectral radiance measures the tristimulus values Xi ,
phone are coded in DNG format; it is a raw image format, there- Yi and Zi i = r,g,b of each patches were evaluated. The RGB coor-
fore it contains all the information collected by the camera. It was dinates were estimated from the average of the 20 images of each
extracted by the use of the code dcraw by Dave Coffin [36] which colors and by averaging the values within the same portion con-
allows to translate the image in the PGM (Portable Gray Map) for- sidered by the spectrometer, it allows to reduce the variability due
mat and provide an easy read and transfer to other formats. The to the noise, further. The luminance values of the red, green and
selected options in the conversion allow the result is the totally blue patches were about 69 cd m−2 , 185 cd m−2 , 44 cd m−2 , re-
raw data with no interpolation and no color scaling, the RGB val- spectively.
ues are written in 16-bit linear samples, all flipping (up-down or The matrix M required for the transform from the proprietary
left-right) of the image matrix is disabled, each output pixel corre- RGB space to the absolute CIE XYZ space shall satisfy Eq. (5):
sponds to one raw pixel. The R, G and B values of each pixel were    
separated for an easy use in a NxMx3 matrix which is elaborated Rr Rg Rb Xr Xg Xb
in Matlab. N and M are half the numbers of rows and columns of M Gr Gg Gb = Yr Yg Yb (5)
the sensor respectively. To maintain the original resolution of the Br Bg Bb Zr Zg Zb
sensor the R, G, and B values should be interpolated, here the four The nine matrix elements were obtained by solving the system.
pixels of the Bayer pattern are condensed in a single pixel, it al- It can be directly used to convert the RGB values of each pixel of
lows to manage a lighter data amount, with a negligible loss of an acquired image in the XYZ values according to Eq. (6).
information.    
R X
M G = Y (6)
4.2. Transform from proprietary to standard color space
B Z
For sake of simplicity this work considers the linear transforma- The definition of the matrix M identifies the absolute calibra-
tion between the proprietary RGB color space of the DNG format tion of the images acquired by the smartphone camera.
to the absolute CIE 1931 XYZ color space [33]. In the last space, The X, Y and Z values can be converted in the L, x and y val-
Y is proportional to the luminance by a factor Km =683 lm W−1 , ues of the CIE Lxy color space [32]. The equations required for the
or the luminance itself if the factor Km is directly included in the change of coordinates are:
evaluation of X, Y and Z.
X
The simplest way to obtain the 3 × 3 transform matrix from x= (7)
the RGB values of the acquired image to the corresponding approx- (X + Y + Z )
imated XYZ coordinates is to analyze 3 independent colors, they Y
y= (8)
were a saturated red (r), a saturated green (g) and a saturated blue (X + Y + Z )
(b) provided by an LCD PC monitor. The color patches were imaged
with the camera and analyzed by the spectrometer. First the color L=Y (9)
was measured by the spectrometer, then 20 images were acquired
L is the luminance value and the x and y values express the
by the camera, lastly the spectral measurement was taken again
chromaticity of each pixel. To consider only the chromaticity the L,
to assess the source stability. From the measured spectra the tris-
x and y values were transformed in the color space CIE 1960 UCS
timulus XYZ values were evaluated, their variations are less than
which is more perceptually uniform than Lxy:
0.6‰, which is considered a negligible value when compared with
the other causes of variability. An image with centering markers 4x
u= (10)
was used to align both the spectrometer and the camera. It allows (−2x + 12y + 3)
to analyze the same portion of the patch from the same observ-
6y
ing direction by the two instruments. Fig. 11 shows a setup of the v= (11)
instruments for this acquisition.
(−2x + 12y + 3)
To reduce the causes of variability, the images from the camera From the values of u and v the color temperature associated to
were acquired in manual mode: the focus was set to manual, the each framed point can be evaluated [33].
exposure time was fixed for each condition, the value was the one The adopted transformation from the proprietary RGB space to
suggested by the camera exposure meter in auto mode and spot the standard CIE XYZ space provides only an approximation of the
10 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

Table 7
Luminance values in the selected points of Fig. 12.

Point number 1 2 3 4 5 6 7 8 9 10 11 12 13

Smartphone (mcd m−2 ) 1.89 1.36 1.29 1.29 1.37 1.43 1.60 1.68 1.87 1.86 1.67 1.57 1.39
DSLR camera (mcd m−2 ) 1,67 1.61 1.54 1.57 1.55 1.66 1.82 2.05 2.22 2.24 2.11 1.92 1.73
Difference (%) 13 −15 −16 −18 −12 −14 −12 −18 −16 −17 −21 −18 −19

Fig. 12. Maps of the luminance values of the sky measured by the smartphone (a) and by the DSLR camera (b) in the first site.

tristimulus values. Previous experiences suggest the error in the For the first site the ISO speed of the smartphone camera was
approximation is of the order of 5% [37], in particular for color set to 800 and its exposure time was 2 s. To allow an average oper-
with coordinates not very far from the Planckian locus. This is ation over the framed scene to reduce the noise effect, the number
the case of polluted night sky colors, in those sites “white” out- of elaborated images is 20. The ISO speed for the calibrated DSLR
door and street lights are the main causes of night sky brightness camera was 1600 and the exposure time was 30 s. Only one pic-
[38] as example. An analysis of a detail evaluation of the uncer- ture was considered in that case and no average was applied. After
tainty introduced by that simple approximation requires consider- the averaging on the smartphone pictures the equivalent exposure
ing different light sources with independent spectral distribution; time is 40 s, similar to the time used for the DSLR camera.
this activity is not part of the presented work, but it will be carried The second analyzed situation considers the sky over Zselic
out in the future. This study will allow also to evaluate the spec- Park in Hungary. For the smartphone, the ISO speed was again
tral mismatch, the color coordinate error and the uncertainty on equal to 800, but the exposure time was 10 s to improve the
the correlated color temperature estimated from the approximated signal-to-noise ratio. The ISO speed for the calibrated DSLR cam-
values of the tristimulus. era was 1600 and its exposure time was 60 s. The sky was
darker than in the first case and the SQM measures were about
5. Sky measurements 21.7 magSQM arcsec−2 , corresponding to a natural starlit night sky.

The camera of the calibrated smartphone was used to analyze 5.1. Luminance of the night sky
the night sky in two situations. In the first site the shots were done
from the breakwater dam at the entrance to the port of Chioggia a Fig. 12 shows the two maps of the luminance values measured
fishing town in the north of the Adriatic Sea, near Venice in Italy. in the first site. In both cases the luminance maps are obtained af-
The site could be interesting from light pollution point of view as ter a moving mean over the framed picture. In particular for the
it borders the Padana Plain to the west and with the sea to the est. results obtained by the camera of the smartphone, a moving mean
While the Padana Plain is a very anthropical area full of light pol- over the matrices containing the values of the tristimulus X, Y and
luting sources, the light pollution coming from the sea is extremely Z was applied; the square window was 10 pixels wide. That av-
reduced. erage operation further reduces the effect of the noise. The lumi-
The sky images were collected at the same time by the smart- nance values obtained by the two devices are presented in Table 7
phone camera and a DSLR camera Cannon 70D calibrated for mea- for some selected points, point 1 is zenith, the other points are 20°
surement of the night sky luminance, recently used for photomet- away from zenith.
ric quantification [3]. Both cameras should be pointing to zenith, A good agreement can be observed, the difference between the
furthermore, they should be rotated so that the lower part of the two measurements is always not larger than about 20% of the mea-
photographs faces south. The images from the DSLR camera were sured value.
elaborated by the Sky Quality Camera software (version 1.9.2, Eu- An evaluation of the effect of the noise in a real situation can
romix Ltd, Slovenia) with a calibration carried out by the manufac- be obtained from Fig. 13, where a vertical section of Fig. 12a is
turer of the software [see 12 as example of use]. shown. The presented portion passes through the zenith. The noise
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 11

Fig. 13. Luminance value of the sky, section of Fig. 12a passing through zenith. Fig. 14. Relative difference of the luminance values provided by the two instru-
ments versus the azimuth angle (black line); dashed line indicates the mean value
and red line is a sinusoidal interpolation.

was supposed uniform over the framed portion of the sky, there-
fore it is better estimated in the flattest portion of the plot, near
to pixel 10 0 0. The standard deviation of the noise is 0.05 mcd m−2
and its maximum value is 0,096 mcd m−2 . Those values corre- obtained by the smartphone are about 16% less than the measure-
spond to about 2.7% and 5% of the luminance value measured at ments from the DSLR camera. The difference corresponds to less
the zenith. The spikes below pixel 200, at about 750, 950 and 1400 than 2 counts of the smartphone camera. It shows a difference in
correspond to stars. calibration of the gains in the two systems and may be due also
Considering the uncertainty of the spectrometer used in the to different compensation of the vignetting effect. The sinusoidal
calibration, the calibration procedure itself, the correction of vi- behavior is approximately symmetric with respect to the axes of
gnetting, the correction of the camera non-linearity, the correction the image, it could be attributed to non-radial vignetting with an
of the non-linearity of the ISO speed and the noise already present amplitude of about 3%, which is not compensated.
in the elaborated pictures, an overall estimate of the uncertainty Fig. 15 shows the two maps of the luminance values measured
on the sky luminance in terms of standard deviation can be as- in the second site. In Fig. 15b it is apparent part of the sky was
sumed about 16% of the luminance itself, for this measuring case. covered by trees. Furthermore, owing to the short time to prepare
It justifies the difference between the measures of the two instru- the setup, the smartphone was not well pointed to zenith and was
ments. not adjusted so that the lower part of the photographs faces south.
A trend seams to be present in the relative difference of the lu- It was preferred to present the results without any centering and
minance values provided by the two instruments in the points 20° rotation corrections in Fig. 15a to reduce at minimum the effect of
from zenith, it is presented in Fig. 14 by the black line. The red si- artifacts.
nusoidal interpolation highlights the trend versus the azimuth an- Owing to the presence of the Milky Way in the sky, in this case
gle. A mean difference is present, on average, the measurements the analyzed points are zenith and 12 points around zenith at 80°

Fig. 15. Maps of the luminance values of the sky measured by the smartphone (a) and by the DSLR camera (b) in the second site.
12 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

Table 8
Luminance values in the selected points of Fig. 15.

Point number 1 2 3 4 5 6 7 8 9 10 11 12 13

Smartphone (mcd m−2 ) 0.23 0.30 0.36 0.32 0.32 0.28 0.29 0.21 0.25 0.23 0.27 0.28 0.34
DSLR camera (mcd m−2 ) 0.21 0.21 0.20 0.20 0.20 0.20 0.21 0.22 0.22 0.23 0.23 0.23 0.22
Difference (%) 14 45 67 53 46 22 37 −2 15 1 31 30 57

Table 9
Values of the color temperature in the selected points of Fig. 17.

Point number 1 2 3 4 5 6 7 8 9 10 11 12 13

Smartphone (K) 4252 4188 4173 4232 4237 4335 4329 4324 4266 4172 4142 4175 4186
DSLR camera (K) 3809 3850 3890 3793 3994 3975 3835 3822 3781 3703 3768 3732 3828
Difference (%) 12 9 7 12 12 9 13 13 13 13 10 12 10

magV arcsec−2 to make a comparison with the SQM measures, ap-


proximating magSQM with magV .
The equation usually [5] employed to convert the brightness
in magnitude over squared arcsecond (mV ) in luminance value in
cd m−2 (L) is:
L = 10.8 · 104 · 10−0.4·mV , (12)
By using the inverse transform the brightness is
21.54 magV arcsec−2 from the smartphone measures and
21.78 magV arcsec−2 from the DSLR camera values, in very
good agreement with SQM values.

5.2. Correlated color temperature of the night sky

As described above, the color temperature is obtained from the


(x,y) values and then (u,v) coordinates expressing the chromatic-
ity. Both them are obtained by a normalization operation, which
is particularly critical at the low levels of the sky luminance. In
Fig. 16. Luminance value of the sky, section of Fig. 15a passing through zenith.
fact, the presence of noise introduces a strong variability on those
coordinates and on the consequent evaluation of the color temper-
ature. A stronger averaging action was applied only for this issue,
the square window was 100 pixels wide. Luckily the color temper-
of elevation. Point 1 is zenith and 2 in Fig. 15a is at elevation equal ature varies slowly across the sky, therefore the heavier action does
80° and azimuth equal 0°, towards North. The values of the lumi- not counterfeit the results and only reduces the artificial variability
nance in the selected grid are presented in Table 8 for the two due to the acquisition noise.
instruments, together with the relative difference. Fig. 17 shows the values of the color temperature for each pixel
The values of luminance are very low, typical of a natural star- for the first site. The image corresponds to the same shot of Fig. 12.
lit night sky, the situation is considered close to the lower limit To allow a better comparison of the results provided by the two
for the use of the smartphone camera for night sky measurements. devices, Table 9 presents the values of the color temperature esti-
The difference of the values provided by the two instruments be- mated in the same selected points for the luminance evaluation.
comes important reaching also the value of 67%. The trend on the For the evaluation of the color temperature a very good agree-
difference seams be due to a partial over compensation of the vi- ment can be observed too, in fact the difference between the
gnetting losses at the edge of the image. The results present the two measurements is always not larger than 13% of the measured
opposite sign with respect to the first case. Ad hoc measurements value, which corresponds to about 520 K. An approximately con-
of the vignetting of both the instruments are foreseen in the fu- stant relative difference is observed versus the azimuth angle.
ture. To have a clearer idea of the difficulties in the measurement Fig. 18 shows the values of the color temperature for each pixel
with the smartphone camera, a horizontal section of Fig. 15a in for the second site and Table 10 presents the values in the point of
correspondence of zenith is presented in Fig. 16. Averaging over the chosen grid. The image corresponds to the same shot of Fig. 15.
multiple acquisition reduces the effective noise, its standard devi- Comparing the results obtained for the two sites, a larger
ation is 0.032 mcd m−2 and its maximum value is 0,09 mcd m−2 ; spread of the difference between the measures from the two in-
these values correspond to 14% and 40% of the luminance at zenith, struments is obtained, with respect to the first site. For the second
respectively. The spikes at about pixel 530 corresponds to a star. site, it assumes also negative values and the amplitude reaches its
Considering all the calibration process and the uncertainties re- maximum close to 30%, which corresponds to an absolute differ-
lated to each step, an overall estimate of the luminance standard ence up to about 1400 K. The difficulty in determining the sky
uncertainty in this limit situation is about 26%, that justifies the chromaticity becomes very hard, in fact it is highly affected by
difference of the values from the two instruments at the zenith, noise. It is interesting to consider the average value of the color
but only partially in the other considered points. The mean values temperature over all the points of the grids: 4236 K from the
of the luminance on the area covered by the grid points can also smartphone and 4296 K from the DSLR camera, the two values
be compared, they are 0.26 mcd m−2 and 0.21 mcd m−2 , respec- present a relative difference about 20%.
tively for the smartphone and the DSLR camera, the two values An estimate of the uncertainty on the evaluation the corre-
well agree with a difference about 20%. They can be converted in lated color temperature requires a deeper and devoted analysis of
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 13

Table 10
Values of the color temperature in the selected points of Fig. 18.

Point number 1 2 3 4 5 6 7 8 9 10 11 12 13

Smartphone (K) 3560 2944 3081 3309 3825 3926 4125 4116 3362 3138 3017 2882 2960
DSLR camera (K) 4311 4445 4211 4209 4407 4089 4460 4464 4109 4338 4140 4185 4329
Difference (%) −17 −34 −27 −21 −13 −4 −8 −8 −18 −28 −27 −31 −32

Fig. 17. Maps of the color temperature values (a) measured by the smartphone, (b) measured by the DSLR camera in the first site.

Fig. 18. Maps of the color temperature values (a) measured by the smartphone, (b) measured by the DSLR camera in the second site.

the device. It requires the observation of light sources with differ- surements and citizen science activities. Even with apparent limits
ent color temperature and different spectral distribution and over- in terms of number of bits, sensitivity and noise amplitude, the
comes the purpose of this presented work. camera of the studied smartphone can be considered a useful in-
strument for the analysis of the night sky.
The paper presents the measurement results in two sites, the
7. Conclusion first is not particularly polluted, the second is a dark place. Clearly,
they are only two examples and other site tests in not so dark
The widespread distribution of smartphones suggests they can places can help to determine the feasibility and stability of the use
be a useful tool for continuous and distributed sky quality mea- of smartphones cameras for sky luminance measurements. New
14 P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235

measurements are foreseen in future in polluted or semi-polluted color temperature and colorimetric coordinates will allow to check
locations. the behavior of the camera in the actual condition of interest.
The results in terms of luminance present an uncertainty of
about 20% of the measured value when it is around 1 mcd m−2 . Declaration of Competing Interest
The measurement of lower values requires exposure time longer
than some tens of seconds even using the higher camera sensitiv- The authors declare that they have no known competing finan-
ity. The comparison between the two instruments in the dark site cial interests or personal relationships that could have appeared to
shows the worst agreement highlighting the limits of the smart- influence the work reported in this paper.
phone camera. The increased discrepancy means that measure-
ments with a reduced accuracy can be found with respect to the
Supplementary materials
ones obtained in the brighter location. The measurement of the
correlated color temperature is more critical owing to the signif-
Supplementary material associated with this article can be
icant value of the noise in the collected images.
found, in the online version, at doi:10.1016/j.jqsrt.2020.107235.
The comparison with the results obtained by a DSLR camera
shows the information which can be collected by that simple and
References
not particularly expensive device is reliable.
For citizen science an open problem refers to calibration, it is [1] Duriscoe DM. Photometric indicators of visual night sky quality derived from
a requirement to compare data recorded by different devices and all-sky brightness maps. J Quant Spectros Rad Transf 2016;181:33–45.
to have an absolute knowledge of the framed portion of the sky. [2] Jechow A, Ribas SJ, Domingo RC, Hölker F, Kolláth Z, Kyba CC. Tracking the
dynamics of skyglow with differential photometry using a digital camera with
That need is particularly strong because different models of con- fisheye lens. J Quant Spectros Rad Transf 2018;209:212–23.
sumer cameras use sensors with different response along the vis- [3] Jechow A, Hölker F, Kolláth Z, Gessner MO, Kyba CC. Evaluating the summer
ible wavelength range, even sometime similarities can be found night sky brightness at a research field site on Lake Stechlin in northeastern
Germany. J Quant Spectros Rad Transf 2016;181:24–32.
[32]. On the other hand, up to now the calibration is usually made
[4] Jechow A, Kolláth Z, Lerner A, Hänel A, Shashar N, Hölker F, et al. Measur-
in laboratories. it is a significant effort, in particular in terms of ing Light Pollution with Fisheye Lens Imagery from A Moving Boat–A Proof of
availability of reference instruments, and cannot be performed eas- Concept. Int J Sustain Light 2017;19(1):15–25.
[5] Hänel A, Posch T, Ribas SJ, Aubé M, Duriscoe D, Jechow A, et al. Measuring
ily by amateurs and private citizens. In any case relative sky mea-
night sky brightness: methods and challenges. J Quant Spectros Rad Transf
surements could be useful too, they allow to track both relative 2018;205:278–90.
luminance and color variations of the night sky and to recognize [6] Falchi F, Cinzano P, Duriscoe D, Kyba CC, Elvidge CD, Baugh K, et al. The new
changing in the technology of the polluting sources. world atlas of artificial night sky brightness. Sci Adv 2016;2(6):e1600377.
[7] Bertolo A, Binotto R, Ortolani S, Sapienza S. Measurements of Night Sky Bright-
The results obtained in this work are strongly based on the ness in the Veneto Region of Italy: sky Quality Meter Network Results and Di-
availability of the recorded images in DNG format; it is not con- iferential Photometry by Digital Single Lens Reflex. J Imaging 2019;5:56.
sidered a limit of the approach, in fact even if up to now not all [8] Cavazzani S, Ortolani S, Bertolo A, Binotto R, Fiorentin P, Carraro G, et al. Sky
Quality Meter and satellite correlation for night cloud-cover analysis at astro-
consumer cameras support RAW imagery, in future using a RAW nomical sites. Mon Not R Astron Soc April 2020;493(2):2463–71. doi:10.1093/
format should become a standard, making easy the almost di- mnras/staa416.
rect access to information at the sensor stage, which is propor- [9] Puschnig J, Posch T, Uttenthaler S. Night sky photometry and spectroscopy
performed at the Vienna University Observatory. J Quant Spectros Rad Transf
tional to the light coming from the framed objects, in particular 2014;139:64–75.
the sky. [10] Kyba CC, Tong KP, Bennie J, Birriel I, Birriel JJ, Cool A, et al. Worldwide varia-
In [32] a procedure for a calibration is proposed by using the tions in artificial skyglow. Sci Rep 2015;5:8409.
[11] Pun CSJ, So CW, Leung WY, Wong CF. Contributions of artificial lighting
SPECTACLE database containing the data calibration of commercial
sources on light pollution in Hong Kong measured through a night sky bright-
cameras. A comparison of our calibration with the results obtained ness monitoring network. J Quant Spectros Rad Transf 2014;139:90–108.
following that way could be extremely interesting and will be a [12] Jechow A, Kyba CCM, Hölker F. Beyond All-Sky: assessing Ecological Light
Pollution Using Multi-Spectral Full-Sphere Fisheye Lens Imaging. J Imaging
future activity. Wide database like SPECTACLE will be highly useful
2019;5:46.
for the calibration of commercial cameras and is still an open ac- [13] Digital Negative (DNG) Specification, Adobe Inc., Version 1.5.0.0May 2019.
tivity. Allowing an easy calibration of cheap cameras could help to [14] Howell SB. Handbook of CCD Astronomy. Cambridge, UK: University Press;
improve the measurements of sky brightness increasing the spa- 2006.
[15] BS ISO. Photography - Digital still cameras - Determination of exposure index,
tial resolution all over the world and making possible the cross ISO speed ratings, standard output sensitivity, and recommended exposure in-
comparison with various tools already used for night sky quality dex. Br Standards Inst 2019;12232:2019.
measures. [16] Meinel IAB. OH emission bands in the spectrum of the night sky. Astrophys J
1950;111:555.
The measures of the correlated color temperature are strictly [17] Meinel AB. OH Emission Bands in the Spectrum of the Night Sky. II. Astrophys
correlated to the used technology of the sources employed in out- J 1950;112:120.
door lighting. A good knowledge of that quantity can allow to fol- [18] Peterson AW. Airglow events visible to the naked eye. Appl Opt
1979;18(20):3390–3.
low their variations and to identify better the more important pol- [19] Yue J, Nakamura T, She CY, Weber M, Lyons W, Li T. Seasonal and local time
luting sources. variability of ripples from airglow imager observations in US and Japan. An-
Aiming at having a good confidence on the measurements of nales Geophysicae (09927689) 2010;28(7).
[20] Ray. Sidney, applied photographic optics. Routledge; 2002.
the color temperature and to estimate the measurement uncer-
[21] Fiorentin P, Iacomussi P, Rossi G. Characterization and Calibration of a CCD De-
tainty on its values, the cameras analyzed in this work will be tector for Light Engineering, IEEE Trans Instrum Meas 54(1):171–177
used in the laboratory to observe light sources with different color [22] Wüller D, Gabele H. (2007, February). The usage of digital cameras as lumi-
nance meters. In Digital Photography III (Vol. 6502, p. 65020U). International
temperature and different technology. That activity also will allow
Society for Optics and Photonics.
to evaluate the sensitivity of the luminance measures to different [23] Imai FH, Berns RS. Spectral estimation using trichromatic digital cameras. In:
spectral distribution of the received light. Proceedings of the international symposium on multispectral imaging and
It is particularly difficult to have in laboratories low luminance color reproduction for digital archives, 42. Japan: Chiba University Chiba; 1999.
p. 1–8. October.
sources covering the wide field of view of the cameras used in [24] Valous NA, Mendoza F, Sun DW, Allen P. Colour calibration of a laboratory
night sky measurements, therefore a future activity will consist in computer vision system for quality evaluation of pre-sliced hams. Meat Sci
direct measurements of the night sky. The same portion of the sky 2009;81(1):132–41.
[25] Manninen H, Paakki M, Hopia A, Franzen R. Measuring the green color
will be contemporary analyzed by the smartphone camera and a of vegetables from digital images using image analysis. LWT-Food Sci Tech
spectrometer. The comparison of the results in terms of luminance, 2015;63(2):1184–90.
P. Fiorentin, A. Bertolo and S. Cavazzani et al. / Journal of Quantitative Spectroscopy & Radiative Transfer 255 (2020) 107235 15

[26] de Oliveira EM, Leme DS, Barbosa BHG, Rodarte MP, Pereira RGFA. A computer [32] Burggraaff O, Schmidt N, Zamorano J, Pauly K, Pascual S, Tapia C, et al. Stan-
vision system for coffee beans classification based on computational intelli- dardized spectral and radiometric calibration of consumer cameras. Opt Ex-
gence techniques. J Food Eng 2016;171:22–7. press 2019;27(14):19075–101.
[27] Kolláth Z, Dömény A. Night sky quality monitoring in existing and planned [33] Wyszecki G, Stiles WS. Color science. New York: Wiley; 1982.
dark sky parks by digital cameras. arXiv preprint 2017. [34] Jackman P, Sun DW, ElMasry G. Robust colour calibration of an imaging system
[28] Duriscoe DM. Photometric indicators of visual night sky quality derived from using a colour space transform and advanced regression modelling. Meat Sci
all-sky brightness maps. J Quant Spectros Rad Transf 2016;181:33–45. 2012;91(4):402–7.
[29] Park W, Pak S, Shim H, Le HAN, Im M, Chang S, et al. Photometric transforma- [35] Wu D, Sun DW. Colour measurements by computer vision for food quality con-
tion from RGB Bayer filter system to Johnson–Cousins BVR filter system. Adv trol–A review. Trends Food Sci Technol 2013;29(1):5–20.
Space Res 2016;57(1):509–18. [36] Coffin, D. (2011). Decoding raw digital photos in Linux. Internet: https://www.
[30] Lebourgeois V, Bégué A, Labbé S, Mallavan B, Prévot L, Roux B. Can commer- dechifro.org/dcraw/, (accessed November 26, 2019).
cial digital cameras be used as multispectral sensors? A crop monitoring test. [37] Baldo G. Conversione dell’uscita di una fotocamera digitale dallo spazio colore
Sensors 20 08;8(11):730 0–22. RGB proprietario allo spazio colore standard CIE 1931 XYZ, master thesis in
[31] Jiang J, Liu D, Gu J, Süsstrunk S. What is the space of spectral sensitivity func- electrical engineering. Italy: University of Padova; 2016.
tions for digital color cameras?. In: 2013 IEEE workshop on applications of [38] Spoelstra H. New device for monitoring the colors of the night. J Quant Spec-
computer vision (WACV). IEEE; 2013. p. 168–79. January. tros Rad Transf 2014;139:82–9.

You might also like