## 2 Materials and Methods
### Image Processing Module
#### 2.2.1 Image Segmentation  
The segmentation task is one of the most difficult tasks in image processing. A great variety of approaches for segmentation are proposed in the literature. Image segmentation aims at partitioning the image into a number of non-overlapping regions, named segments. Ideally, each segment corresponds to an image object or a meaningful part of an object. Mainly, there are two classes of image segmentation approaches. Low-level image processing methods address only the problem of partitioning the image into a number of homogeneous regions. The goal of these methods is to minimize the number of regions, while keeping them homogeneous. The second class of approaches is represented by higher-level image segmentation methods, which address object segmentation. Generally, these objects appear as homogeneous regions in images. The higher-level image segmentation methods are often called semantic segmentation, or image parsing. Object segmentation is most successful in applications with restricted image variability or content. From a mathematical point of view, the general problem of image segmentation is an ill-posed problem [8], meaning that there is no unique solution and that the segmentation problem is task-dependent. The main problems with the existing algorithms for sky segmentation are erroneous detection of sky areas with large ranges of color, false detection of sky reflections or other blue objects and inconsistent detection of small sky areas. Blue sky segmentation for image editing is addressed in [9]. The initial sky probability is modeled as a product of color, position and texture probabilities. After the first sky segmentation is obtained, with the probabilistic model defined, the sky model parameters are re-estimated, from the sky region, to obtain an adaptive model. The adaptive model appends a new feature, defining a sky confidence measure, to the already defined color, position and texture probabilities. This adaptive model is used to obtain the final sky segmentation. Excellent results are obtained for clear skies, as assumed by the authors of [9]. A two-step method for sky detection is proposed in [10]. In the first stage, a region-based segmentation, the Color Structure Code (CSC) [11], is used to generate a number of segments. In the second stage, segments are classified to the sky or to the non-sky class, according to simple yet powerful heuristics. Closer to our approach is the work presented in [12; 13], meaning that real time constraints are taken into account. The authors of [12; 13] conclude that a strategy based on simplification by geodesic reconstruction using dilatation coupled with a classification with [PERSON]'s algorithm and a post-treatment gives the best compromise between quality of results and computational time. The aim of the simplification stage is to smooth the uniform regions of images, making the classification step easier. Therefore, the simplification filter is a smoothing filter which does not affect very much the edges of the image processed. A better choice for the simplification filter concerning the quality of segmentation is proposed in [14]. This approach is based on the remark that the images of Brownian fields (characterized by some values of the Hurst exponent, H) are similar to the images of sky [15]. By estimating the local Hurst exponent in an image, we can localize the sky regions as areas with constant H. The proposal in [14] is to simplify the image content by a denoising filter that uses regularized Hurst estimation, proposed in [16]. The estimation of the Hurst parameter, which models the texture content in the image, is done using a generalized LASSO approach. For comparison purposes, the authors of [14] used the Ordinary Least Squares (OLS) regression from [17] as well. The OLS-based and LASSO-based filters used in [14] remove details from the finest resolution levels of the Dual Tree Complex Wavelet Transform (DTCWT) [18], without degrading the image edges and hence the quality of the segmentation.