A HYBRID SYSTEM FOR IDENTIFYING THE PRESENCE OF CLOUDS ON THE HORIZON LINE

Common passive surveys for the presence of clouds in the sky are carried out using the digital processing of photographs taken using fish-eye type lenses. Another type of survey is carried out using active measuring systems, e.g. thermal imaging, active laser distance sensors, etc. A common feature of these sensors is the high cost of the measuring apparatus, which is hardly acceptable for small local short-term weather forecasting stations. The main task of these weather stations is to forecast local dynamic weather phenomena that have (or may have) an impact on the use or operation of technical facilities (e.g. photovoltaic farms, wind farms, cranes, etc.) or agricultural plant protection measures. This paper proposes a hybrid method for detecting clouds and predicting changes in cloud cover on the horizon line. The proposed method is based on an analysis of colour photographs of the cross-section of the sky using chrominance distribution by the RGB method. In the next step, the CCT colour temperature and the ALS-based ambient light intensity resulting from spectral analysis are determined for the cross-section of the sky being identified. The survey results indicate the dependence of the variability of CCT and ALS parameters for classifying objects on the horizon line. The above analysis makes it possible to distinguish the sky on the horizon, a cloud, or agglomeration elements. The data obtained from the surveys show that the proposed structure of the hybrid system for analysing the presence and movement of clouds on the horizon line can provide the basis for further development of data processing algorithms for a passive sensor of the apparatus for detecting clouds and other objects on the horizon line.


Introduction
A major challenge modern meteorology faces is predicting the movement of air masses in relation to the Earth's surface.Forecasts of the direction and average speed of wind and, in particular, daily forecasts of peak wind gusts, are determined by the altitude and location of the measurement (Kwon, Kareem 2019).Wind gusts represent the maximum wind speed observed over a particular time interval (mercer, Dyer 2014) and are often associated with thunderstorms (chen, LombarDo 2020).
Wind gusts can lead to technical equipment failure and risk human health during maintenance operations.Therefore, reliable forecasts of wind gusts (Gutiérrez, FoveLL 2018, wanG et al. 2020) help to prevent damage, which is particularly important in engineering work, including wind energy production, construction, transport and agriculture.
Clouds are characterised by various shapes and can be found at different altitude ranges, with these properties being subject to change as clouds are visible sets of the products of water vapour transformations, i.e. condensation and sublimation (narasimha, bhat 2008).The pace of changes in the properties of clouds is determined by the gradient of temperature decrease with an increase in the altitude.On the other hand, condensation starts when water vapour reaches a saturated state.In addition to water vapour, clouds also contain inclusions of solid particles (baKer et al. 1999).The current classification of clouds is adopted according to the standard proposed by the World Meteorological Organization (hoLLe 1987).
The weather can be described using meteorological factors defined as a set of physical characteristics describing the Earth's atmosphere.The most important features describing the weather are presented graphically in Figure 1.Local weather conditions can be determined in the simplest manner by analysing the data obtained from local weather stations dispersed over a particular area.
Another approach relies on predictive models operating based on numerical models whose key issues include parametrisation and resolution (De troch et al. 2013).The most popular short-term predictive models include AROME (bousquet et al. 2020, Fumière et al. 2020), WRF METEOPG (FiGursKi et al. 2021), COSMO (muGume et al. 2018) or ALARO (brabec et al. 2021).All of these models show discrepancies in the indications of predicted cloud cover, which is due to the limitations of weather prediction models that do not incorporate the current weather conditions at a location selected by the user in their observation structure.The safe operation of a crane depends on wind parameters, and photovoltaic farm efficiency is determined by the current cloud cover, etc. Being aware of the short-term local prediction of changes in wind parameters or cloud cover is an important factor affecting the level of safety of the operation of these facilities and the management of their performance.
The most common measuring facilities used in meteorology include weather stations and multi-sensor measuring systems.The main equipment in these systems includes anemometers, ultrasonic anemometers (huanG et al. 2019), less commonly pyranometers (terrén-serrano et al. 2021) and wind vanes.Another method that enables the estimation of the direction and speed of cloud movement involves measurements based on an analysis of photographs and satellite images.The vision system-based measuring systems currently presented in the literature mainly use cameras recording images in the visible light and infrared spectrums (terrén-serrano et al. 2021).Direct measurements from photographs are supplemented with satellite measurements (borecKi et al. 2019).
Remote sensing methods for measuring wind speed represent an alternative to measurements using meteorological masts.These methods rely on the emission of electromagnetic or sound waves and the recording of the dispersion of these waves with a measuring apparatus using the Doppler effect (Doubrawa et al. 2016).A popular measuring device used to determine the position and velocity of weather elements and the wind speed profile is LIDAR (huanG et al. 2019, taszareK et al. 2020, ceKus et al. 2019, simLey et al. 2018, wiLczaK at al. 1996).Another meteorological device, less commonly used due to its dimensions, is SODAR (wiLczaK et al.1996, shu et al. 2017).
The current state of knowledge in the area of short-term and local weather forecasting methods indicates that the information on local weather conditions obtained from online weather services processing data from local weather stations is subject to uncertainty.This is due to the use of a data processing algorithm which does not take into account the specific nature of local geographical conditions, such as topography or the distribution of water bodies or forest stretches over a particular area in a public or free access application.
The use of local data, recorded using various measuring devices with unknown response characteristics and different signal processing procedures, in weather services can cause errors in the determination of weather parameters (zhenG at al. 2019).Furthermore, such a data processing structure is characterised by the time inertia of the weather forecasts being generated.At the same time, the currently available forecasting models are not able to correctly or clearly estimate local changes in cloud cover on the spatial and temporal scales.
A local weather change is forecast most frequently and most effectively by assessing changes in wind strength and direction, i.e. features that are currently easy to identify using simple and low-cost measuring devices arranged in close proximity to the forecasting site of interest.Another feature that forecasts a change in weather conditions is an increase in cloud cover.This weather symptom can be identified using costly measuring instruments, which, for economic reasons, cannot be used in the local weather prediction systems.Therefore, a major limitation to the use of widespread local weather prediction is the lack of simple and low-cost methods for identifying the current cloud cover and its changes to obtain information on an impending change in weather conditions.
After analysing the available information and the issue described above, it can be concluded that real-time local weather identification is crucial for improving the safety of technical facilities such as cranes and photovoltaic farms, as well as for protecting human lives against severe weather phenomena like thunderstorms and hurricanes.It also plays a significant role in enhancing the efficiency of agricultural and forestry operations, especially in the case of precision agriculture.

Image analysis
The analysis of RGB images, which is one of the statistical analysis methods, enables the determination of the basic data as well as the plotting of a histogram of the brightness and colour components of the image of the sky on the horizon line.In order to perform an RGB analysis aimed at verifying the thesis concerning the possibility of the passive detection of clouds on the horizon line, it is required to extract the colour channels of the obtained digital image of the sky.
The extraction of colour channels involves the conversion of each individual channel into a 2D table and storing it using numerical values from the range of 0-255, which represent the luminance of a particular colour.In addition, corresponding colour masks can be superimposed onto each colour, thus carrying out chrominance distribution.This yields three separate images, in which the brighter the area of the image, the greater the proportion of the component in the respective channel.Alternatively, the darker the area, the smaller the proportion of the component in the particular channel.It should be noted here that classical extraction does not produce obvious conclusions.What is indisputable, however, is the fact that a clear blue sky contains no red component in its optical spectrum.On the other hand, and this is not entirely obvious, a clear blue sky contains a considerable proportion of the green component.
The most common approach to detecting clouds on the horizon line is to regard a cloud as an object and apply the analysis of objects, which allows objects to be sought in a single image or moved in a sequence of images.
It should be noted at this point that clouds are objects that are extremely difficult to recognise due to their amorphous nature.In practice, this means that a measuring system has to recognise an object which, most often, has no well-defined shape, and the boundary between a cloud and the surroundings can be rather arbitrary for certain colour parameters.Another impediment in the process of analysing a base photograph image by the RGB method is the presence of agglomeration elements such as an electric pole with overhead power lines, a chimney, or tree crowns.

Spectral analysis
Current methods for analysing weather objects on the horizon line, combined with image analysis and searching for objects, do not live up to expectations.The strenuous implementation of popular solutions leads to detections with a very low level of reliability (zhenG et al. 2019), affected by a high false detection rate.On the other hand, data obtained from simulations can only be related to the few real cases that show a mutual similarity of the parameters being observed (barthe et al. 2010).In view of the above, ideas involving the analysis of images carried out post factum, or the creation of simulation models, were rejected.The proposed alternative is a spectral analysis of objects on the horizon line, the undoubted advantage of which is the possibility of acquiring local data in quasi-real time.
The issue of the possibility for passive recognition of objects on the horizon line using spectral analysis is present in the following studies (borecKi et al. 2019, oLejniK et al. 2019).
The analyses presented in the paper (borecKi et al. 2019) clearly show that there is a possibility for detecting and distinguishing clouds against the background of the sky using spectral signals.Spectral characteristics of the sky on the horizon line are characterised by a signal mode at a wavelength of 450 nm, which corresponds directly to the blue colour wavelength.Above the value of 520 nm (the beginning of the green colour), the spectral signal of the sky begins to diminish.A white cloud, on the other hand, is characterised by a signal mode at a wavelength of 550 nm, which corresponds to a yellow--green colour, yet the high value of the spectral signal persists between 500 and 700 nm, which in practice means the detection of white colour on the horizon line.It should also be noted that spectral measurements allow the shades of the sky to be distinguished.The spectral signal of the sky on the horizon line is characterised by higher values than those of the sky signal recorded above the observation point, which coincides with the intuitive feeling of a "brighter" sky observed on the horizon line.
Therefore, it was demonstrated that spectral measurements offered a tangible alternative to conventional detection methods based on image analysis, e.g. by the RGB method.Spectral measurements enable the detection of static objects that remain motionless on the horizon line (oLejniK et al. 2019).It is also possible to detect changes in the colours in the observed section of the horizon line, which implies a direct conclusion on the possibility of detecting cloud movement on the horizon line.

Hybrid analysis of cloud presence and movement signals
In the field of analysis of weather objects on the horizon line, a reliable algorithm offering a high degree of certainty in cloud detection and, consequently, predicting changes in cloud cover should be sought among hybrid methods.A solution is therefore proposed that combines the possibilities of object-based analysis with possibilities for processing direct spectral data acquired from a passive optoelectronic sensor.It should be noted that the current insolation above the observer represents a reference point, while the change in insolation is related to the movement of clouds in the sky.
In a photograph, the movement of clouds and their instantaneous location on the celestial sphere can be interpreted as a change in their position relative to the artificial time horizon.The clouds approaching from the horizon line towards the observers will move upward relatively via the artificial time horizon, while the receding clouds will make a relatively downward movement.The interpretation of the analysed section of the sky is presented graphically in Figure 2.
The base photograph was taken at a resolution of 4,000 × 1,800 pixels.It was, therefore, assumed that the local cross-section of the sky would be performed for the coordinate representing the centre of the frame, i.e.X = 2,000.Along the Y-axis, on the local cross-section line, the following elements are found: a clear sky, clouds (white and bluish), and trees.
The analysis of the local cross-section of the sky by the RGB method was carried out using the authors' original script written in the Python language.The result of the operation of the script processing the base photograph is presented in the form of characteristics of the RGB cross-section in Figure 3.It should be noted that the Y-axis from the base photograph is now the ordinate axis on the cross-section characteristics.When analysing the base photograph (Fig. 2) from top to bottom, it can be noted that a clear, blue sky has a dominant blue component.Such a regularity is evident in the characteristics of a local cross-section of the sky (Fig. 3) within the Y-axis in the ranges of 100-250 and 1,100-1,220.On the other hand, a white cloud can be observed on the Y-axis within the range of 430-600 where, according to the exposure rules, the values of RGB components approach values close to the maximum (255 for image RGB888).Then, for the Y-axis value of approx.700, one can observe the local minimum of red and green colours, which corresponds to a change in the insolation of a bluish-tinged cloud segment.It should be noted at this point that a darker cloud indicates a reduced amount of solar radiation reaching the observer.For a Y-axis value above 1,500, the equalisation of the RGB component values can be seen.Such a signal represents information on the colours of the background, i.e. objects on the horizon line.In terms of predicting changes in cloud cover, this signal is irrelevant and can be regarded as noise.
Similarly, an analysis of a local cross-section of the sky was carried out for lines with a width of 10 and 100 pixels, and the obtained results are provided in Figure 4.An analysis of the obtained RGB colour curves shows that with an increase in the averaging of the horizontal value being measured, the value of information on the variability of the signal being recorded decreases.This outcome represented an expected result.It should be noted that the maximum values also decreased, and the minimum values increased.Hence, the conclusion is that a change in cloud cover should be observed using the possibly smallest point, i.e. 1 pixel.In view of the possibility of the occurrence of potentially erroneous cloud detection based on the analysis of only the distribution of chrominance on the local cross-section line, it is reasonable to implement additional analytical solutions.
The proposed analytical parameters include the correlated colour temperature (CCT) and the ALS-based ambient light intensity resulting from spectral analysis.In this application, the ALS parameters are understood as a photometric value of the light intensity that is received from a particular direction of observation, i.e. the intensity of light reflected by the objects found on the horizon line or the intensity of sunlight during direct observation.These parameters are difficult to obtain from a camera's video signal or from a photograph taken.Hence, there is a need for the use of an optoelectronic sensor in the hardware solution, which will enable the determination of the above-mentioned parameters in real-time.
Figure 5 shows a diagram of the hybrid system for carrying out object-based analysis and processing spectral data.
In order to determine the CCT values of individual pixels located on the line of the local cross-section of the sky, McCamy's approximation was applied, which is described by equation (1) (shamey, Kuehni 2020, schaar 2019): CCT(, ) = 449 3 + 3525 2 + 6823.3+ 5520.33 (1) It should be noted that the presented method for determining the CCT parameter is indicative and serves to determine the waveform of the colour temperature characteristics in order to assess the possibilities for eliminating false detections.The values determined by approximation will be different from the values retrieved directly in the hardware solution of the measuring system.This situation is due to the fact that without information on the D uv parameter or the original xy CIE coordinates, it is not possible to determine whether particular colours are identical.The D uv parameter is a value whose name is short for "Delta u, v", which describes the distance between the light colour point and the black body colour curve.This parameter is usually used in combination with the correlated colour temperature value in order to determine the "purity" of the whiteness of a particular light source.
Another step in the determination of the CCT parameter is to determine the n coefficient (schaar 2019) described by equations ( 2 where: X, Y, Z -R, G, B values of a particular pixel, respectively [-].
Due to the lack of access to such a sensor, the ALS parameter was determined based on the analysis of the base photograph.This experiment was aimed at identifying the possibilities for supporting the decision-making process when detecting objects on the horizon line using the ALS parameter.Ultimately, the ALS parameter will be measured directly from the optoelectronic sensor.
In most applications, the ALS parameter is determined as the product of the green colour channel and a coefficient derived from the adopted optical signal integral time on a photosensitive matrix.For camcorders and cameras, the integral time parameter or the scaling factor are unavailable.It can be assumed, however, that the currently produced photosensitive matrices of recording devices feature green colour sensitivity characteristics close to that of the human eye.Therefore, the obtained green colour characteristics can be used as an equivalent of the ALS characteristics in percentage normalised form.Normalisation was carried out against the maximum possible value for an 8-bit green colour signal, i.e. a value of 255.This approach enabled the determination of an indicative ALS parameter thresholding level.
The determined CCT and ALS values of particular pixels on the line of the local cross-section of the sky for the base photograph are shown in Figure 6.Having analysed the obtained waveforms from Figure 6 with particular characteristic ranges corresponding to the RGB ranges from Figure 3, it can be concluded that: -a clear sky, observed within the Y-axis within the ranges of 100-250 and 1,100-1,220, is characterised by a high value of the correlated colour temperature, exceeding 10,000 K, and a low ALS parameter value of an order of approx.40%.A Hybrid System for Identifying the Presence of Clouds on the Horizon Line 259 Such a result is expected, considering the values in the colour space as well as the fact that a clear sky has no objects reflecting solar radiation, hence the high CCT parameter values and low ALS parameter values; -a white cloud, visible within the Y-axis within the range of 430-600, is characterised by the CCT parameter value of an order of 6,000 K and a high reflected light value of up to 95%; -a bluish cloud, visible within the Y-axis near the value of 700, is characterised by the CCT parameter value of an order of approx.6,000 K, yet it will not be classified as a white cloud as the ALS parameter value does not exceed 80%; -the frame background formed by tree crowns, visible above the value of 1,500 on the Y-axis, has a colour temperature not exceeding 4,000 K and a reflected light value of less than 40%, thus failing to meet the classification criteria.
Based on the above consideration, the thresholding levels of CCT and ALS parameters for classifying objects on the horizon line can be initially estimated.The CCT parameter adopts the following ranges of variability: -10,000 K and above -the object is the sky; -6,000-9,000 K -the object is a cloud with a colour from white to bluish-grey; -above 5,000 K -the object is not a cloud but an agglomeration element or the background instead.
Similar thresholding levels can be determined for the ALS parameter, and they amount to the following values: -above 60% -light reflected by a cloud coloured from white to grey; -40-60 % -light of the surroundings, typical of the sky; -below 35% -light of the background or light reflected by grey-bluish clouds.
The threshold values presented above are analytical in nature and represent a reference to estimating the application values recorded by the system for the local, short-term prediction of changes in cloud cover.

Summary
Preliminary testing of the hybrid system for analysing the presence and movement of clouds using the RGB analysis supported by the analysis of the CCT parameter in the form or colour temperature and the intensity of ALS-based ambient light, resulting from spectral analysis, showed the possibility for passive detecting of clouds as well as agglomeration objects of the background on the horizon line.
The obtained results confirm the possibility of the proposed classification of objects in real-time using a low-cost sensor device with software.Moreover, additional information in the form of CCT and ALS parameters ensure precise, real-time identification of objects such as the sky, clouds, buildings, agglomeration elements, or the background.
In the authors' opinion, future research work will focus on improving the level of readiness of the proposed hybrid method of analysis and performing tests on real objects under different cloud cover and location conditions, using an optoelectronic sensor in the hardware solution, which enables the determination of the CCT and ALS parameters in real-time.
The next stage of work will involve the acquisition of a large set of signals and their analysis for the purposes of the assessment of the effectiveness of identification of the presence and movement of clouds as well as architectural or background objects on the horizon line, using the proposed hybrid identification system.
Fig. 1.Atmospheric factors describing the weather

Fig. 2 .Fig. 3 .
Fig. 2. A local cross-section of a base photograph for the analysis of cloud occurrence detection

Fig. 4 .
Fig. 4. A local cross section of the sky with a line width of 10 pixels (a), and 100 pixels (b) Fig. 5.A diagram of the configuration of the hybrid system for carrying out object-based and spectral analysis of the sky on the horizon line xy coordinates according to standard CIE 1931… (2019).

Fig. 6 .
Fig. 6.The experimental results of the colour analysis of lines of the local cross-section of base photograph