A RGB channel operation for removal of the difference of atmospheric scattering and its application on total sky cloud detection

The inhomogeneous sky background presents a great challenge for accurate cloud recognition from the total sky images. A channel operation was introduced in this study to produce a new composite channel in which the difference of atmospheric scattering has been removed and a homogeneous sky background can be obtained. Following this, a new cloud detection algorithm was proposed, which combined the merits of the differencing and threshold methods and named 10 “differencing and threshold combination algorithm (DTCA)”. Firstly, the channel operation was applied to transform 3-D RGB images to the new channel, then the circumsolar saturated pixels and its circularity were used to judge whether the sun is visible or not in the image. When the sun is obscured, a single threshold can be used to identify cloud pixels, and, when the sun is visible in the image, the true clear sky background differencing algorithm is adopted to detect clouds. The qualitative assessment for eight different total sky images shows the DTCA algorithm obtained satisfactory cloud identification 15 effectiveness for thin clouds and in the circumsolar and near-horizon regions. Quantitative evaluation also shows the DTCA algorithm achieved the highest cloud recognition precision for five different types of clouds, with an average recognition error rate of 8.7%.


Introduction
The distribution of clouds in the troposphere affects the earth's radiation budget and climate change.Satellite remote sensing provides continuous monitoring for cloud cover states from outer space, and numerous algorithms have been developed to detect clouds based on different satellite sensors (Hagihara et al., 2010;Rüthrich et al., 2013).Groundbased cloud observation can provide more local cloud information and is an effective tool to validate the results of satellite-based observations.Human observations were the main method for estimating sky cloudiness in many countries for the past 100 years (Deutscher Wetterdienst, 2013), and the cloud fraction was determined by experienced meteorological observers in oktas or tenths.The cloud observation results of satellite and ground-based systems were compared by several researchers (Thorsen et al., 2011;Ma et al., 2014).A more detailed review has been given about the pros and cons of different cloud observation platforms in Tapakis and Charalambides (2013).
Hemispherical sky imaging technology offers the possibility for automatic ground-based cloud observations, and plenty of such devices have been developed (Shields et al., 1993;Long and DeLuisi, 1998;Calbó and Sabburg, 2008;Cazorla et al., 2008;Huo and Lu, 2009;Yamashita and Yoshimura, 2012;Yang et al., 2012;Klebe et al., 2014;Chauvin et al., 2015).All such imagers can provide three-channel red-green-blue (RGB) total-sky images at given interval, but colors vary significantly across instruments because of different sensor characteristics and white balance strategies.Recorded downwelling radiation at the surface is the com-Published by Copernicus Publications on behalf of the European Geosciences Union.
bined effect of molecular absorption, Rayleigh scattering, Mie scattering, and solar direct radiation, leading to white clouds and a visually blue sky phenomenon in clear sky conditions.Several cloud detection methods have been applied to total-sky images using this property.Red (R) and blue (B) are the two most important channels in traditional cloud detection algorithms, which use a variety of 2-D red and blue channel operations such as R / B, R-B, and (B−R) / (B+R).The R / B ratio was first applied to segment thin cloud, opaque cloud and clear-sky cases using two fixed thresholds for the images captured by whole-sky imager (WSI; Koehler et al., 1991).Long et al. (2006) adopted 0.6 as a single fixed threshold to identify cloud pixels from the images in the same R / B space but for whole-sky camera, and then a welldesigned clear-sky function and some adjustable parameters were set to improve the recognition accuracy of clouds for the commercial Total-Sky Imager (TSI).Unlike the R / B ratio, the R-B difference was recommended by Heinle et al. (2010) for their own instrument, and they considered R−B = 30 as an optimal fixed threshold.In order to combine the advantages of R / B ratio and R-B difference, several cloud detection algorithms were developed in the (B−R) / (B+R) space based on a single fixed threshold, adaptive threshold, and hybrid thresholds, respectively (Yamashita et al., 2004;Yang et al., 2009;Li et al., 2011).Contrasting with 2-D red and blue channels, several cloud detection methods were developed in 3-D RGB space.Sylvio et al. (2010) combined Euclidean geometric distance and a Bayesian statistics algorithm to identify cloud pixels in the whole RGB space.The multicolor criterion algorithm was proposed to recognize cloud pixels using multiple thresholds and obtained better identification accuracy than R-B difference method (Kazantzidis et al., 2012;Wacker et al., 2015).Yamashita and Yoshimura (2012) set two indices (sky index and brightness index, which were based on different RGB channel operations) and defined a threshold curve to detect clouds.Different from the aforementioned methods, a cloud detection algorithm was developed for high-latitude regions only using a 1-D saturation channel, which is obtained by converting the images from the 3-D RGB space to the 3-D intensity hue saturation space (Martins et al., 2003;Souza-Echer et al., 2006).Numerous uncertainties exist in the above methods for cloud detection in the near-horizon and circumsolar regions because of their similar color and brightness distribution with cloud regions.Long (2010) established a statistical method to correct the overestimated cloud cover in these regions.The brightness distribution in the sky regions of the total-sky images is inhomogeneous, which also increases identification errors, especially for thin clouds in conventional cloud detection methods.The differencing methods were put forward by several researchers and proposed subtracting the background information from the original image.Ghonima et al. (2012) established a clear-sky library by simulating the pixel red / blue ratio (RBR) for the total-sky images acquired on different clear days and then proposed a classification algorithm to identify cloud pixels by comparing the RBR of a cloudy image with the RBR of the clear-sky library.A least-square fitting algorithm was developed to simulate clear-sky background in the normalized R / B ratio (NRBR) space and the background was subtracted from the NRBR of the cloudy image to get cloud pixels (Chauvin et al., 2015).Yang et al. (2015) simulated the image background information using a morphological open operation and proposed the background subtraction adaptive threshold algorithm based on a 1-D green (G) channel (GBSAT) to identify cloud pixels from the cloudy images.Simulated background is not always a good representation of the real background information; Yang et al. (2016) proposed a real clear-sky background differencing (CSBD) algorithm using the green channel.This method obtained better identification results than the conventional cloud detection methods, especially in the circumsolar and near-horizon regions.However, the CSBD algorithm may misclassify dark clouds as clear-sky regions because of their low brightness values.Overall, the differencing algorithms are highly suitable for the cases of visible sun in the total-sky images.For those sun-obscured total-sky images, traditional threshold algorithms are more suitable than differencing processing because the latter may introduce detection errors in the circumsolar region.The threshold between these cases depends heavily on the image's color information and the nonuniform background, a huge challenge for the threshold methods.
This paper introduces a new RGB channel operation aiming to remove the inhomogeneous background in the totalsky images and then proposes a cloud detection method using this channel operation by combining the threshold and differencing algorithms.Section 2 describes the total-sky cloud imager (TCI) and the new channel operation.Section 3 presents the cloud detection algorithm in detail.The proposed cloud detection method is compared with several traditional algorithms using a large set of total-sky images in Sect. 4. Section 5 contains the summary and proposals for future research.

Imaging device and RGB channel operation
The total-sky images appearing in this study were captured by a TCI, which was manufactured by the State Key Laboratory of Severe Weather at the Chinese Academy of Meteorological Sciences.Like other hemispherical sky imagers, the core components of TCI are a camera and a fisheye lens.It can produce three-channel RGB total-sky images at fixed interval.For the sky imaging, the sun is a huge error source because of its strong direct radiation in the visible range.To alleviate the effects of the sun, a lot of hemispherical imagers adopt a solar tracking shielding member to block the direct solar radiation, such as WSI and TSI, while TCI adopts an automatic exposure technology, instead of a shadowband, to reduce the saturated pixels in the circumsolar region.To better preserve the original radiation information of each band, the industrial camera in the TCI adopts a linear stretch to convert the 12 bit raw data to 8 bit RGB image and does not make any white balance processing as it may change the red and blue channels' brightness values.We carried out field cloud observations using a TCI instrument in Tibetan Plateau (88.88 • E, 29.25 • N) during 2012 to 2014, which collected a total-sky image every 5 min in daytime with an effective diameter about 800 pixels after removal of ground targets.All of the total-sky images appearing in this paper are chosen from this field observation and imaging time is expressed in China standard time.
For a total-sky image, the forward scattering of aerosols and atmospheric molecules is dominant for the brightness values in the circumsolar region under clear sky conditions.As for other regions, the Mie scattering of hydrometeors is responsible for the brightness values of cloud regions, while the Rayleigh scattering of atmospheric molecules and the Mie scattering of aerosols together affect the brightness distribution of the sky region.The inhomogeneous illumination background in the total-sky image is mainly caused by the difference in atmospheric scattering angles, and to a lesser degree by the spectral dependence, particularly under low aerosol loading.Therefore, for clear-sky pixels, a simple subtraction with a proper combination of three color channels would remove the inhomogeneous background due to the difference in scattering angles.However, for cloudy pixels, cloud particles are larger than aerosols and atmospheric molecules, resulting in different spectral dependences across three color channels from clear-sky pixels.Hence, it provides a way to distinguish cloudy pixels from the clear-sky pixels.
Specifically, the proposed channel operation is designed for the removal of atmospheric scattering (RAS), which is the first step required to calculate three important channels: the dark channel, bright channel, and panchromatic channel.The dark channel refers to the channel of the minimum value of each pixel in the RGB component (He et al., 2011), while the bright channel represents the maximum value of each pixel in the RGB component.The panchromatic channel denotes the channel that is sensitive to all visible colors.The difference between the bright and dark channels represents the deviation of the atmospheric scattering of each pixel in the visible range, which can be considered as the atmospheric background.So, the new channel operation is defined as Eq. ( 1): where RAS is the new channel after channel operation, Y is the panchromatic channel, L is the bright channel, and D is the dark channel.More specifically, Y = 0.299R + 0.587G + 0.114B (Ford and Roberts, 1998), L = max {R, G, B}, and D = min {R, G, B}.For most of the TCI images, the bright channel is equal to the blue channel, and the dark channel can be replaced by the red channel.
Figure 1 illustrates the basic concept of the proposed channel operation.Figure 1a shows the original TCI image in clear sky condition, captured on 11 June 2013, and its panchromatic channel image is shown in Fig. 1b. Figure 1c denotes the B-R channel, which represents the background image of atmospheric scattering and Fig. 1d shows the ultimate RAS channel.Figure 1e denotes the brightness distributions of red, green, and blue channels along a horizontal line (red line in the Fig. 1a).The blue channel has the highest brightness values for all pixels, while the lowest brightness values almost always appear in the red channel.Figure 1f represents the horizontal brightness distributions of panchromatic, B-R, and RAS channels.It is clear that the horizontal brightness distribution of panchromatic channel varies consistently with that of B-R due to the clear-sky background brightness distribution.Hence, the brightness values of clearsky pixels in the RAS channel are very low except in the pixels between 300 and 500, which are affected mainly by the strong forward solar radiation.
Figure 2 shows an example for the removal of the difference of atmospheric scattering using the new channel operation.Figure 2a is the original TCI image with obscured sun, captured on 26 August 2012, and its panchromatic channel is shown in Fig. 2b. Figure 2c represents the background image of atmospheric scattering and Fig. 2f denotes the ultimate RAS channel, in which the sky backgrounds are homogeneous and their brightness values represent mainly aerosol scattering.Figure 2g shows the brightness distribution of panchromatic, background, and RAS channels along the red horizontal line in the Fig. 2a.It is obvious that the brightness values of clear-sky pixels are lower than the cloudy pixels in the RAS channel.The lower the aerosol concentration in the sky, the more the sky brightness values tend toward zero.We had compared the brightness distribution between R / B, (B−R) / (B+R), and green channels in our previous study (Yang et al., 2015) and showed the green channel is a better choice for cloud detection, but dark clouds may be misclassified as clear-sky and the sky background in the green channel is still inhomogeneous.To better describe the merit of RAS channel, we compared horizontal brightness distribution of the RAS channel with R / B channel (Fig. 2d) and green channel (Fig. 2e) in Fig. 2h.The brightness values of dark clouds from the pixels 350 to 400 are even lower than the sky brightness values from the pixel 700 to 750 in the green channel, which means these dark clouds may be misclassified as clear-sky region using a single threshold for the green channel.Contrarily, the brightness values of dark clouds are obviously higher than those clear-sky regions in the RAS channel, which ensures these dark clouds can be accurately identified.Overall, the RAS channel has a clearly homogeneous background and the difference between the sky and clouds is significant, making this scene highly suitable for the following cloud detection.3 Cloud detection method This section describes the total-sky cloud detection algorithm using the proposed RAS channel, named differencing and threshold combination algorithm (DTCA), which combines the advantages of the threshold and the differencing methods.An overview about the proposed DTCA algorithm is introduced first, and then the details of DTCA are described using several examples.Finally, the applications of the algorithm to the images after white balance processing or under low visibility are discussed.

Overview
The purpose of cloud detection is to separate the cloud pixels from the clear-sky background.Firstly, the TCI image is converted to RAS channel in order to remove the inhomogeneous sky background.Secondly, the position of the sun in the TCI image can be calculated using a specific sun positioning algorithm, and then the image can be combined with brightness information in the circumsolar region to determine whether the sun is covered by clouds.When the sun is obscured, a single threshold can be used to identify cloud pixels but, when the sun is visible in the image, the differencing algorithm is a better choice to detect clouds.In the DTCA algorithm, we select the CSBD as our differencing method but use the RAS channel instead of the original green channel.The distinct steps will be illustrated in detail in the following subsections.

DTCA algorithm
DTCA algorithm consists of RAS channel operation, determining whether the sun is blocked, and using single threshold or CSBD method to obtain cloud pixels.In the previous section, we have introduced how to do channel operation and get RAS channels from the 3-D RGB TCI images.The next important consideration is determining whether or not the sun is visible.One solution is to use auxiliary information, such as the results of direct solar radiation measurements (Alonso et al., 2014;Kazantzidis et al., 2012), but these measurements are not always available.Another way relies only on image information; the position of the sun in the TCI image is always changing but depends only on both the imaging time and the geographical position of the observer.Calculating the solar position requires two basic steps: one is to compute the solar zenith angle and azimuth and the other is to determine the specific coordinates of the sun in the image.The same steps as mentioned in Yang et al. (2015) are adopted in this study to accurately calculate the central coordinate of the sun in the TCI image, and then the circumsolar saturated pixels and their circularity can be used to determine whether the sun is visible (Yang et al., 2015).When the sun is blocked, the single threshold algorithm is applied to identify clouds.For the sun-visible conditions, the CSBD algorithm is recommend to perform cloud detection.
Figure 3 shows the cloud detection results of three TCI images using a single threshold for their RAS channels.Fig- ure 3a shows the original TCI images, Fig. 3b denotes the images of RAS channel, and Fig. 3c shows the ultimate cloud detection results.A suitable threshold is the key of a successful cloud detection algorithm.An exact threshold should be higher than the sky background brightness and lower than the cloud brightness.That means the accurate threshold is depend on local climatic conditions.Since the sky background is mainly related to the aerosol/molecules scattering intensity in the RAS channels, and the aerosol concentration above the Tibetan Plateau is very low in most cases, a fixed threshold of 10 is set to perform binarization for the RAS channels in our experiments.The first two examples in Fig. 3 show a good performance for the single threshold algorithm when the sun is obscured in the total-sky images.When the sun is visible, the single threshold method unsurprisingly results in detection errors, especially in the circumsolar region (see the last example in Fig. 3).This is because strong direct solar radiation causes the pixels in the circumsolar region to have a similar brightness distribution to the cloud regions.So the CSBD algorithm is applied to perform cloud detection when the sun is visible in the TCI images.
We have built a real clear-sky background library (CSBL) in the previous CSBD algorithm (Yang et al., 2016).The CSBL includes the initial creation phase and the subsequent update phase.At the initial stage, the brightness histogram of each TCI image is analyzed.When the histogram shows significant unimodal distribution and the peak of the histogram is on the low brightness side, the image can be considered as  clear sky (Yang et al., 2015).Then the image is rotated by an angle equal to its solar azimuth angle.The rotated image is one of background images in the CSBL, which consists of series of real clear-sky images with a solar zenith angle interval of 1 • .At the update stage, the results of cloud detection and brightness histogram analysis are combined to determine whether the image is clear sky.Considering the aerosols and climate seriously affect the brightness distribution of the clear-sky background, the CSBL is updated on each clear-sky day to ensure that the clear-sky background image with the closest date as the TCI image is available for cloud detection.Figure 4 shows an example of cloud detection using CSBD algorithm.Figure 4a is the image after rotation from the image of the third row of Fig. 3a, which was captured on 21 June 2013.Figure 4b shows the RAS channel image of Fig. 4a, then the clear-sky image, which was shot on 11 June 2013 and had the same solar zenith angle as Fig. 4a, is picked out from the CSBL and shown in Fig. 4c. Figure 4d shows the RAS channel image of Fig. 4c.When the sun is shining on the hemispherical shield of the TCI device, it produces significant noise in the circumsolar region.To better reduce the detection errors in the circumsolar region, we enhanced the brightness values in the circumsolar region by multiplying an empirical coefficient.Here, we set the factor equal to 2. Figure 4e represents the new RAS channel of Fig. 4d after brightness enhancement for the circumsolar region, and Fig. 4f denotes the difference of Fig. 4b  and e.The background brightness is very small in the differencing image (Fig. 4f) because of their close dates (Fig. 4a  and c) and low aerosol concentration in the Tibetan Plateau.Due to the potential difference in aerosol loading in two different images (days), the clear-sky backgrounds in the reference image and in the processing image may not be the same.We assume that the difference or the noise level in the clearsky background is small.Therefore, we set a threshold of 10 for the differencing algorithm.Figure 4g shows the result of binarization processing for Fig. 4f, and Fig. 4h is the ultimate result obtained by reversing rotation an angel of solar azimuth.Comparing the result of CSBD with that of threshold method (Fig. 4h and the last row of Fig. 3c), it can be clearly seen that the CSBD algorithm obtained satisfactory cloud identification results in the whole image.

DTCA algorithm for the images after white balance processing
We have reserved the original radiation relationship for each channel in the TCI images, which use a linear stretch to transfer the raw data to RGB image without white balance processing.The performance of the DTCA method for these images has been described in the last subsection.However, most of hemispherical sky imagers adopt a certain automatic white balance technique to obtain RGB images, which are more consistent with human vision.To check whether the DTCA algorithm is applicable to the images after white balance processing, we do automatic white balance processing (Liu et al., 1995) for a few TCI images and perform cloud detection for these images using a single threshold.Figure 5a is the TCI images after white balance processing, Fig. 5b denotes the images of RAS channel, and Fig. 5c is the ultimate cloud detection results.For the sun-obscured condition, the sky background in the RAS channel is homogeneous but with a relatively high brightness value.Thus in this case, a threshold equal to 20 is set to perform binarization and the cloud identification result is satisfactory (see the first row of Fig. 5).
When the sun is visible, many errors are still present because of the strong solar radiation (see the second row of Fig. 5).This implies the single threshold method is unsuitable for the sun-visible conditions.Figure 6 shows the cloud detection result using CSBD algorithm for the image of the second row of Fig. 5a, which was captured on 17 October 2012.Figure 6a is the image after rotation from the image of the second row of Fig. 5a and its RAS channel is shown in Fig. 6b. Figure 6c denotes the clear-sky image, which was shot on 8 October 2012 and had the same solar elevation angle as Fig. 6a. Figure 6d and e show the RAS channel of the clear-sky image and the new RAS channel after brightness enhancement for the circumsolar region, respectively.Figure 6f denotes the difference between Fig. 6b and e, and Fig. 6g shows the cloud detection result for Fig. 6a, which is visually satisfactory.The ultimate result after reversing rotation is shown in Fig. 6h.The experimental results explain that the DTCA algorithm is still effective for the images with automatic white balance processing.

DTCA algorithm for the images under low visibility
Low visibility is caused mainly by fog and haze, which not only seriously affect the image quality but also impose difficulties for accurate cloud identification.Mie scattering of aerosol particles is responsible for the most of visibility reduction, which has similar scattering intensity in the visible range and makes the sky background appear as grayish white color.Fig. 7a shows two images under low visibility, both of which were acquired on 24 November 2012.It is clear that the sky backgrounds have very high brightness values in their RAS channels (Fig. 7b).The adaptive thresholds, which are relative to the concentration of aerosol, should be considered for binarization of RAS channels.The results of cloud detection are shown in Fig. 7c.The Mie scattering and forward scattering of aerosols result in evident cloud identification errors in the circumsolar region.
Similarly, the CSBD algorithm is applied to detect clouds when the sun is visible (the second row of Fig. 7a).The key point of the CSBD algorithm is that the clear-sky image should have a background similar to that in the cloudy image.Fortunately, the clear-sky image (Fig. 8c) was captured also on 24 November 2012, and its concentration of aerosol was very similar with that in Fig. 8a. Figure 8 represents the detailed cloud detection steps based on the CSBD algorithm.The identification result (Fig. 8h) has significant improvement compared with the result of threshold algorithm, but it still misses many cloud pixels because the brightness values of these pixels are lower than the brightness values of the sky region.The take-away is that as long as the brightness values of cloud pixels are higher than those of the sky region under low visibility, those cloud pixels can be identified successfully.Contrarily, when the concentration of aerosol is high enough to shelter the cloud regions, it is impossible to accurately identify clouds using a single visible imager.

Results comparison
To better explain the performance of the proposed DTCA algorithm, its identification results for eight different TCI images were compared with several traditional cloud detection methods, including R / B, multicolor, GBSAT, and CSBD.These traditional algorithms have both threshold methods (R / B and multicolor) and differencing methods (GBSAT and CSBD).The channels used in these traditional algorithms include 2-D red and blue channels, 3-D RGB channels, and a 1-D green channel.Figure 9 shows the cloud identification results of different algorithms, in which the black regions denote sky and the white regions denote cloud pixels.Figure 9a represents the original TCI images, the results of R / B are shown in Fig. 9b, Fig. 9c represents the results of multicolor, Fig. 9d shows the results of GBSAT, the results of CSBD are shown in Fig. 9e, and Fig. 9f denotes the results of the proposed DTCA method.When the sun is invisible in the TCI images, the R / B algorithm has very good identification precision for the opaque clouds but has poor precision for thin clouds.However, when the sun is visible in the TCI images, the R / B algorithm has obvious detection errors in the circumsolar region.For the multicolor algorithm, the recognition precision is low for almost all the TCI images.The reason may be that the several fixed thresholds are not adequate for our TCI sensors and the local atmospheric conditions.The GBSAT algorithm has obvious improvement in the circumsolar region, but the simulated background sometimes over-or underestimates the background brightness values, leading to the introduction of detection errors.The CSBD algorithm can identify cloud pixels accurately when the sun is visible, but it is inappropriate for the sun-obscured conditions.The identification errors for dark clouds in the GB-SAT and CSBD methods were caused mainly by the green channel, in which the brightness values of some dark clouds are lower than those of sky background.Overall, the threshold algorithms are good for thick clouds, while the differencing algorithms obtain better identification for thin clouds and have higher detection accuracy in the circumsolar and near- horizon regions.The proposed DTCA algorithm combined the merits of the two kinds of algorithms and acquired more satisfactory results for all these cases.In addition to qualitative assessment, the quantitative evaluation can provide a more objective comparison.We have established a total-sky image set (available after signing the user license agreement at http://www.camscma.cn/cgi/agreement-e.pdf), in which the images are divided into five sky types: clear sky, cirriform, stratiform, cumuliform, and mixed clouds.Each type contains 1000 images captured in Tibetan Plateau during 2012 and 2014.We randomly selected 50 total-sky images from each type for quantitative evaluation of cloud detection algorithms.The cloudiness results were given by two experienced weather observers in percentage, and then their results were averaged for each test image as standard cloudiness.Since the GBSAT and CSBD algorithms are aimed at partly cloudy images, which are not suitable for the clear-sky and overcast images, we only compared the results of R / B, multicolor, and DTCA.The identified cloudiness of each method was compared with the human standard cloudiness, image by image.The average recognition error rates and their standard deviations for different cloud detection algorithms are shown in Table 1.Here, negative values denote underestimation, and positive values mean overestimation.The conclusions are similar to the qualitative assessment in that the multicolor algorithm is poor for all types of TCI images, the identification precision is low for the cirriforms in the R / B algorithm.The average recognition error rate of DTCA algorithm is −5.2 %, but the error rate is −19.6 for the cirriforms, which means it still underestimates some thin clouds.
To better emphasize the merit of the proposed algorithm, we also compared the error rates under different sun conditions.We randomly selected 100 total-sky images (50 vis-ible sun cases and 50 blocked sun cases) from the mixed cloud type for quantitative evaluation of cloud detection algorithms.The results are shown in Table 2.The CSBD algorithm performs well under visible sun conditions but poorly under fully blocked sun conditions.The DTCA algorithm obtains the best recognition accuracy under both conditions.

Conclusions
A big challenge for accurate cloud detection algorithms is the inhomogeneous brightness distribution of sky background.The solutions for the existing methods are mainly based on differencing technology, which use the original image to subtract the simulated or true clear-sky background image.This paper proposed a RAS channel using a simple RGB channel operation.The RAS channel can effectively remove the difference of atmospheric scattering in the total-sky images, especially when atmospheric aerosol concentration is low.Then the DTCA algorithm was proposed to detect clouds, which combined the merits of the threshold and the differencing methods.The RAS channel was first calculated in the DTCA algorithm, and then sun visibility was determined by using the circularity of the circumsolar saturated pixels.When the sun is blocked, the single threshold strategy was adopted to identify cloud pixels, while the CSBD algorithm was used for cloud detection in the sun-visible cases.The experimental results for eight different total-sky images showed that the DTCA algorithm was much more effective at cloud identification than several traditional algorithms.The quantitative evaluation also stated clearly that the DTCA algorithm has the best identification results for all types of clouds and under both visible sun and blocked sun conditions.
Considering that the total-sky images acquired by most of the hemisphere sky imagers are processed by automatic white balancing, we also tested detection effectiveness of the DTCA algorithm for those processed images.The experimental results show that the DTCA algorithm is still applicable to the total-sky images after automatic white balance processing.As low visibility is still a big obstacle for accurate cloud recognition, we performed a preliminary experiment to test the applicability of DTCA algorithm to images under low visibility.The DTCA algorithm identified a portion of the cloud pixels successfully, but many cloud pixels were missed because their brightness values were lower than www.atmos-meas-tech.net/10/1191/2017/Atmos.Meas.Tech., 10, 1191-1201, 2017 the sky background.In this situation, when the concentration of aerosol is high enough to shelter the cloud regions, it is impossible to identify clouds only using visible imager.Some microwave sensors that can penetrate aerosols should be considered for cloud recognition under such low visibility.

Figure 1 .
Figure 1.The basic concept of the RAS channel.Panel (a) shows the original TCI image, (b) is the panchromatic channel image, (c) denotes the B-R channel, which represents the background image of atmospheric scattering, (d) is the image of RAS channel, (e) denotes the horizontal brightness distribution for the red, green, and blue channels, and (f) is the horizontal brightness distribution for (b), (c) and (d).

Figure 2 .
Figure 2.An example for removal of atmospheric scattering and comparison of different channels.Panel (a) shows the original TCI image, (b) is the panchromatic channel image, (c) represents the background image of atmospheric scattering, which is equal to B-R channel, (d) shows the image of R / B, (e) represents the image of green channel, (f) is the image of RAS channel, (g) denotes the horizontal brightness distribution for (b), (c), and (f), and (h) is the horizontal brightness distribution for (d), (e), and (f).

Figure 3 .
Figure 3. Cloud detection results using single threshold for the RAS channels.Column (a) is the original TCI images, (b) denotes the images of RAS channel, and (c) is the ultimate cloud detection results.

Figure 4 .
Figure 4. Cloud detection result using the CSBD algorithm.Panel (a) is the image after rotation from the image of the third row of Fig. 3a, (b) shows the RAS channel image of (a), (c) is the clearsky image with the same solar elevation angle as (a), (d) shows the RAS channel image of (c), (e) represents the new RAS channel of (d) after brightness enhancement for the circumsolar region, (f) denotes the difference of (b) and (e), (g) shows the cloud detection result for (a), and (h) is ultimate result after reversing rotation.

Figure 5 .
Figure 5. Cloud detection as Fig. 3 but for the TCI images after white balance processing.Column (a) is the TCI images after white balance processing, (b) denotes the images of RAS channel, and (c) is the ultimate cloud detection results.

Figure 6 .
Figure 6.Cloud detection as Fig. 4 but for the TCI image after white balance processing.Panel (a) is the image after rotation from the image of the second row of Fig. 6a, (b) shows the RAS channel image of (a), (c) is the clear-sky image with the same solar elevation angle as (a), (d) shows the RAS channel image of (c), (e) represents the new RAS channel of (d) after brightness enhancement for the circumsolar region, (f) denotes the difference of (b) and (e), (g) shows the cloud detection result for (a), and (h) is ultimate result after reversing rotation.

Figure 7 .
Figure 7. Cloud detection as Fig. 3 but for the TCI images under low visibility.Column (a) is the original TCI images, (b) denotes the images of RAS channel, and (c) is the ultimate cloud detection results.

Figure 8 .
Figure 8. Cloud detection as Fig. 4 but for the TCI image under low visibility.Panel (a) is the image after rotation from the image of the fourth row of Fig. 7a, (b) shows the RAS channel image of (a), (c) is the clear-sky image with the same solar elevation angle as (a), (d) shows the RAS channel image of (c), (e) represents the new RAS channel of (d) after brightness enhancement for the circumsolar region, (f) denotes the difference of (b) and (e), (g) shows the cloud detection result for (a), and (h) is ultimate result after reversing rotation.

Figure 9 .
Figure 9.Comparison of different cloud detection methods.Column (a) is the original TCI images, (b) shows the results of R / B, (c) represents the results of multicolor method, (d) shows the results of GBSAT, (e) denotes the results of CSBD, and (f) shows the results of the proposed DTCA method.

Table 1 .
The recognition error rates of different cloud detection algorithms in percentage.

Table 2 .
The recognition error rates under different sun conditions.