Visibility Restoration Using Generalized Haze-Lines

Corresponding authors: waqasanwar@cuilahore.edu.pk; ynam@sch.ac.kr Samia Riaz Department of Computer Science, COMSATS University, Wah, Pakistan; e-mail: samiariaz@gmail.com Muhammad Waqas Anwar Department of Computer Science, COMSATS University, Lahore, Pakistan; e-mail: waqasanwar@cuilahore.edu.pk Irfan Riaz Department of Electronics and Communication Engineering, Hanyang University, Ansan, South Korea; e-mail: irfancra@gmail.com Yunyoung Nam Department of Computer Science and Engineering, Soonchunhyang University, Asan, South Korea; e-mail: ynam@sch.ac.kr Muhammad Attique Khan Department of Computer Science, HITEC University Taxila, Pakistan; e-mail: attique.khan@hitecuni.edu.pk


Introduction
Outdoor images are mostly distorted by the turbid medium of dust, water vapors, and various airborne particles. These particles scatter the scene radiance traveling from its linear path to multiple directions. Various scattering events across the medium create a translucent veil of light for observer known as haze. It obscures the clarity of the scenery objects and severely degrades the quality of the outdoor images. Moreover a haze free input image is usually expected by most of the computer vision techniques. Therefore, haze removal is prerequisite for many practical applications.
Haze introduces two type of distortions in the radiance of a scene point: 1) visibility is attenuated, and 2) a semi-transparent layer of ambient light, known as airlight is added. Mathematically, this physical phenomenon is represented by the following image formation model [41,42] ( ) According to image formation model the observed hazy image is linear blend of : 1) tainted scene radiance, and 2) air-light that gets dispersed into the lineof-sight of an observer . Here, I(x) is an RGB color hazy image, J(x) represents scene radiance, t(x) is visibility map or transmission of an image and A is airlight. Illumination is commonly assumed to be uniform across a scene [41,54,44,26,22,51,52], hence airlight A becomes a three-dimensional constant vector, which is often assumed to be the brightest point in the haziest region of the image [9]. Transmission t(x) depicts the proportion of scene radiance J(x) approaching the camera directly without being scattered. It is inversely proportional to: 1) the distance from the camera i.e. scene-depth d(x) and, 2) attenuation coefficient β which depends on aerosol type and density. The diffusion process administers the dispersal of these particles, and their density varies smoothly across the scene [24]. This makes attenuation coefficient β a constant [67,29,18,19,2,64]. Transmission follows Beer-Lambert law i.e.
Mathematically, single image dehazing is an ill-posed problem. For input RGB image I(x) with N pixels, 3N values are known. The number of unknowns are: 1) 3N for scene radiance J(x), 2) N for transmission t(x), and 3) 3 for airlight A. Hence, for 3N equations there are 4N + 3 unknowns. The ambiguity is mainly due to spatially varying N unknown values of transmission.
To constrain this indeterminacy, we need at least one extra constraint (prior) per pixel for estimation of its transmission, or scene depth value.
The proposed method is based on the observation that a few hundred distant colors can be used to approximat colors present in an image [47]. We generalize this concept over a collection of natural hazefree images to learn their color-palette. This palette consists of a few thousand colors and their shades, and can approximate colors of unseen natural images quite accurately. The pixels clustered together, in haze-free image, form a line (haze-line) in RGB space in presence of haze [7,8,9]. The two end points of this haze-line are the haze-free color and the airlight. We propose that these haze-lines can be generalized, with one end as learned color-palette of natural images and the other as airlight. Hence the scene radiance end becomes independent of underlying image. The algorithm recovers the transmission map, by determining the membership of each pixel to a given haze-line and finding how far-off it is from corresponding value of natural color-palette. The algorithm is linear to the size of image, and requires just a collection of hazefree natural images for training. It achieves quiet good results for a variety of images and is competitive with other state-of-the-art methods.

Related Work
Haze removal using a single input image is an under-constrained problem. Methods used to solve such problems either include some additional information or impose further constraints or priors. Some of the pioneer work [41,42,54,43,44] used the difference in multiple images of identical scene taken under varying weather conditions for the estimation of scene depth. While few others used images of the same scene captured with different degrees of polarization [54,55]. Some of additional information based methods assumes that the hazy input image and its depthmap describing the structure of the scene is available [43,60,31]. In [4] scene geometry is assumed to be known, and through estimation of camera pose scene transmission was obtained. In [60,31] user-assisted depth-map were generated. Even though these methods can provide promising results in some situations, but they become impractical when extra data is not available.
Currently, single image dehazing has become more sought after technique owing its popularity to broader application range. To solve image-dehazing problem, these methods introduce heuristic assumptions, statistical or physical properties, and application-based rules to impose at least one constraint per pixel.
Fattal used independent component analysis in 18], and in [19] a local formation model using color-lines for transmission estimation. He et al. [33] generalized dark-object subtraction method and proposed the Dark Channel Prior (DCP). DCP method produced excellent results, hence much work after that [22,51,52,64,21,45,33,38] focused on its drawbacks for improvement. Carr [13] used piece-wise planar-geometry with DCP and energy minimization framework. Gibson et al. [21] proposed using darkest pixel average in each ellipsoid. Matlin et al. [38] used non-parametric denoising with DCP. Tarel and Hautiere [62,63], Gibson et al. [22], and He et al. [23] circumvent the time-taking soft-matting using the standard median filter, guided-joint bilateral filtering [65], and guided filter respectively. In [16] [40] proposed inherent boundary-constraint over the transmission function. The unknown scene transmission is estimated by combining the boundary constraint with weighted L1norm. Fang et al. [17] proposed dehazing as well as denoising at the same time using energy model based on adaptive window DCP. Galdran [20] used a series of gamma correction operations for contrast and saturation enhancement of different hazy regions of an image. This avoided time consuming steps of depth-map estimation and refinement. Visibility maximization approaches mostly focus on visibility enhancement and does not aim to recover scene radiance physically. Though, they are able to reveal the details and structures but the recovered images (as can be observed in qualitative results section) are often improperly saturated and unnatural.  [48] proposed FFA-Net a feature attention module that combines channel attention with pixel attention under the observation that haze is unevenly distributed in an image. An adaptive and automatic patchsize selection method PMS-Net was proposed for image dehazing by Chen et al. [14]. Ren [50] learned mapping between hazy images and transmission map using a multi-scale deep neural network. Which was then used to solve single image dehazing problem.
Berman et al. [7,8,9] used the observation that colors in a clear image can be represented by a few hundred distinct color. The tight clusters in haze-free image, form haze-lines in hazy images. This is a pixel based method while the previous methods are mostly patch based methods. Our proposed technique is primary based on Berman work and it is further explained in the following sections.

The Prior
The following section provides the motivation and procedure for learning color-palette of natural images. Haze-lines model [9] and its generalized through learning of natural image color-palette is also discussed in detail.

Learning the Natural Color-Palette
The proposed technique uses the observation that the number of distinct colors in outdoor haze-free images is much less than the number pixels [46,47]. The said assumption has been extensively used in color-palette selection [47], segmentation [28], stitching [36], compression [1], color matting [68] and tone mapping [55] of images. Hence we propose natural images can be approximated by a set of distant colors and their shadings, which can be learned beforehand over a collection of haze-free images. The learned palette consists of a few thousand colors and their shades, and can approximate unseen natural images quite accurately.
The color approximation problem has two parts: 1) an optimal color palette selection, and 2) optimal mapping of each pixel of the image to a color from the palette. We follow four design principles for selecting an effective color-palette [39] as listed below: Since, over and under exposed pixels do not have reliable colour information, hence as pre-processing of training data we filter pixels that are s(x) < 0.05T and s(x) > 0.95T, where T is maximum value of s(x) for a given image. The processed training data is converted to LAB color-space, which is a reversible non-linear transformation from RGB color-space. In LAB color-space the color information is represented as three values: L* contains the luminosity and a*,b* have the color data. L* goes from black (0) to white (100), chromaticity-layer a* indicates where color falls along the green (-) to red (+) axis, and chromaticity-layer b* indicates where the color falls along the blue (-) to yellow (+) axis. Separation of luminosity from color information enables us to learn the color-palette independent of luminosity. Also, LAB color-space is designed so that the change in numerical values corresponds to the same amount of visually perceived change [56]. Hence as per design principles stated above, LAB colorspace is more suitable than RGB for learning color palette of natural images.
We learn the color palette of natural images via dense and sparse clustering of chromatic and luminosity layers respectively. Dense chromatic clustering is achieved by k-mean clustering of a* and b* color channels into M = 1024 clusters. For each chromatic cluster, sparse luminosity clustering is achieved by k-mean clustering of L* channel of corresponding pixels into P = 5 clusters. In this way we learn k-color-p for natural images in LAB colorspace or Ψ, with M colors and P shadings per color, hence K = M × P = 5120.
To measure the accuracy of sparse clustering, we compute luminosity normalized variance σ l k for each cluster Figure 1 k-color palette and its variance learned from Berkley Segmentation Dataset consisting of 500 images (BSD-500) [53] Left to right: 1) k-color palette Ωk for natural images, 2) zoomed version of marked area in Ω, 3) zoomed version of marked area in for each member of k-color palette where µ l k is mean and σ l k is variance of luminosity L(x). N k is number of pixels belonging to k th chromatic cluster.
The haze image formation model (1) is defined for RGB color-space, therefore we convert the learned k-color palette from Lab to RGB color-space denoted by Ω. For each member of Ω, C k is cluster centroid (typical appearance) and σ l k is cluster variance (percentage shading variance from typical appearance) of pixels belonging to k th cluster. Figure 1 presents C k and of the learned k-color palette Ω. For better viewing, the zoomed version of marked regions of C k and σ l k is also presented. Each row of the zoomed Ω consists of two colors and five shades, e.g. the first row consists bluish-gray and cyan color with five shades each. It can be observed that: 1) variance changes abruptly even among shades of same color, and 2) bright haze-like shades often have high variance. Hence probability of error εk for all members of Ω varies, and is function of For testing the learned k-color palette Ω, we take haze-free outdoor images from O-haze dataset [3].
axis, and chromaticity-layer b* indicates where the color falls along the blue (-) to yellow (+) axis. Separation of luminosity from color information enables us to learn the color-palette independent of luminosity. Also, LAB color-space is designed so that the change in numerical values corresponds to the same amount of visually perceived change [56]. Hence as per design principles stated above, LAB colorspace is more suitable than RGB for learning color palette of natural images.
We learn the color palette of natural images via dense and sparse clustering of chromatic and luminosity layers respectively. Dense chromatic clustering is achieved by kmean clustering of a* and b* color channels into M = 1024 clusters. For each chromatic cluster, sparse luminosity clustering is achieved by k-mean clustering of L* channel of corresponding pixels into P = 5 clusters. In this way we learn k-color-p for natural images in LAB colorspace or Ψ, with M colors and P shadings per color, hence K = M × P = 5120.
To measure the accuracy of sparse clustering, we compute luminosity normalized variance σ l k for each cluster Figure 1 k-color palette and its variance learned from Berkley Segmentation Dataset consisting of 500 images (BSD-500) [53]. Left to right: 1) k-color palette Ωk for natural images, 2) zoomed version of marked area in Ω, 3) zoomed version of marked area in σ l k and 4) normalized variance of luminosity σ l k for each member of k-color palette.

Figure 2
Testing natural k-color palette Ω on O-haze dataset [59] Left to right: 1) input image, 2) output image with worst PSNR (38.28) after being mapped to k-color palette Ω, and 3) absolute error between input and output images with maximum error value of 0.08

Figure 3
Approximating unseen natural image with k-color palette Ω Left to right: 1) as expected from a scene with greenery (not part of our training data), the pixels from various regions of image marked in red form tight clusters around shades of green, 2) shades of green from k-color palette (squares), and pixels marked in red plotted in RGB color-space, 3) shades of green from learned k-color palette and their corresponding luminosity variance σ l k .
We start by growing a kd-tree [6] using centroids C k of Ω. For test image I(x), each pixel value is substituted by its nearest neighbor in C k kd-tree. Figure 2 presents the dataset image with worst PSNR (38.28) after mapping to Ω colorspace. Visually input output images look identical, quantitatively the maximum absolute error between them is 0.08. At the end of the training phase we have our natural k-color palette Ω consisting of a variety of colors and their shades, and σ l k as reliability measure of each member.

Generalized Haze-Line Model
In presence of haze, the pixels forming a cluster in haze-free image make a line (haze-line) in RGB space [19,7,9]. The two end points of haze-line are the scene Figure 1 k-color palette and its variance learned from Berkley Segmentation Dataset consisting of 500 images (BSD-500) [53]. Left to right: 1) k-color palette Ωk for natural images, 2) zoomed version of marked area in Ω, 3) zoomed version of marked area in σ l k and 4) normalized variance of luminosity σ l k for each member of k-color palette.

Figure 2
Testing natural k-color palette Ω on O-haze dataset [59]. Left to right: 1) input image, 2) output image with worst PSNR (38.28) after being mapped to k-color palette Ω, and 3) absolute error between input and output images with maximum error value of 0.08.
where µ l k is mean and σ l k is variance of luminosity L(x). Nk is number of pixels belonging to k th chromatic cluster.
The haze image formation model (1) is defined for RGB colorspace, therefore we convert the learned k-color palette from Lab to RGB color-space denoted by Ω. For each member of Ω, Ck is cluster centroid (typical appearance) and σ l k is cluster variance (percentage shading variance from typical appearance) of pixels belonging to k th cluster. Figure 1 presents Ck and σ l k of the learned k-color palette Ω. For better viewing, the zoomed version of marked regions of Ck and σ l k is also presented. Each row of the zoomed Ω consists of two colors and five shades, e.g. the first row consists bluish-gray and cyan color with five shades each. It can be observed that: 1) variance changes abruptly even among shades of same color, and 2) bright haze-like shades often have high variance. Hence probability of error εk for all members of Ω varies, and is function of σ l k.
radiance and the airlight. We propose that these hazelines can be generalized, with one end as learned color-palette of natural images and the other as airlight.
In Figure 3, we present an outdoor image with known depth-map taken from [19]. This image is not part of our training dataset. We approximate it using k-color palette of natural images. As expected from a scene with greenery, numerous pixels (marked in red) are the nearest neighbor to shades of green from k-color palette. The pixels belonging to a single shade can represent different areas in the image having different distance from camera in actual scene. These pixels are plotted in RGB colorspace to observe their distribution. They form tight clusters around learned shades of green (green squares), hence are well approximated by k-color palette. Shades of green from the k-color ˆl For testing the learned k-color palette Ω, we take haze-free outdoor images from O-haze dataset [3]. We start by growing a kd-tree [6] using centroids Ck of Ω. For test image I(x), each pixel value is substituted by its nearest neighbor in Ck kd-tree. Figure 2 presents the dataset image with worst PSNR (38.28) after mapping to Ω colorspace. Visually input output images look identical, quantitatively the maximum absolute error between them is 0.08. At the end of the training phase we have our natural k-color palette Ω consisting of a variety of colors and their shades, and σ l k as reliability measure of each member Figure 3 Approximating unseen natural image with k-color palette Ω. Left to right: 1) as expected from a scene with greenery (not part of our training data), the pixels from various regions of image marked in red form tight clusters around shades of green, 2) shades of green from k-color palette (squares), and pixels marked in red plotted in RGB color-space, 3) shades of green from learned k-color palette and their corresponding luminosity variance σ l k.
Information Technology and Control 2021/1/50 194 palette and their corresponding learned luminosity variance σ l k is also shown. This variance provides us a confidence measure for the color palette. Statistically shades with low σ l k will be well approximated by k-color palette.
In Figure 4, formation of haze-lines in presence of haze is demonstrated. With known depth-map d(x), taking A = [0.5, 0.6, 1.0] and β = 1, the transmission t(x) can be determined by Equation (2). Artificial haze can then be induced in the image using image formation model Equation (1). In presence of haze, the red marked pixels forms haze-lines in RGB colorspace [19,7,9]. Where one end represents the haze-free color and the other end represents airlight. As the visibility (transmission) of pixel starts to decrease, it starts traveling along the haze-line from its haze-free color J(x) towards the common point airlight A. The pixels with similar color radiance in the entire image are represented in the form a haze-line. Their acquired color can be modeled by a convex combination of the radiance color and the airlight color i.e. Equation (1), such objects span a line in RGB space.
Shades of green from k-color palette and their corresponding haze-line variance σ h k is also shown. This variance provides a confidence measure for a given haze-line. Statistically haze-lines with high σ h k will be long with well distributed pixels. For example, hazelines formed by darker shades of green are long and have well distributed pixels, hence have a higher σ h k value. The transmission map is recovered by determining the membership of each pixel to a given haze-line and finding how far-off it is from corresponding haze-free value.
The method by Berman et al. [7,9] use haze-lines for image dehazing. However, it has following shortcomings: 1) it assumes that in each haze-line a haze-free pixel is present but this assumption usually does not hold. As can be observed in RGB plot of haze-lines presented in Figure 4, all haze-lines lack haze-free pixels, which results in over-estimation of transmission values, hence poor recovery of member pixels, 2) the orientation of a haze-line does not depend on the image data, it can only have a fixed number of directions obtained by uniform sampling of a unit sphere. This results in sub-optimum mapping of pixels to a haze-line and may render fine tones indistinguishable, 3) it requires finding the pixel with maximum distance from A per haze-line which is computationally expensive, and 4) it is prone to noise as transmission per haze-line depends on a single pixel value. Berman et al. [7,9] relies on regularization [34] to correct errors of initial estimate of transmission values.
The proposed method overcome the above shortcomings by introducing generalized haze-lines. These lines have well-defined end-points. Irrespective of image one end is always the learned k-color palette that can approximate the natural images accurately, while the other comes from image data as airlight. In this way, we ensure that each haze-line have haze-free radiance and an optimum orientation. This circumvents the need of finding the least hazy pixel per hazeline, hence saves computation time. Also, airlight is usually resilient to noise as it is estimated by voting Figure 3 Approximating unseen natural image with k-color palette Ω. Left to right: 1) as expected from a scene with greenery (not part of our training data), the pixels from various regions of image marked in red form tight clusters around shades of green, 2) shades of green from k-color palette (squares), and pixels marked in red plotted in RGB color-space, 3) shades of green from learned k-color palette and their corresponding luminosity variance σ l k.

Generalized Haze-Line Model
In presence of haze, the pixels forming a cluster in haze-free image make a line (haze-line) in RGB space [19,7,9]. The two end points of haze-line are the scene radiance and the airlight. We propose that these haze-lines can be generalized, with one end as learned color-palette of natural images and the other as airlight.
In Figure 3, we present an outdoor image with known depthmap taken from [19]. This image is not part of our training dataset. We approximate it using k-color palette of natural images. As expected from a scene with greenery, numerous pixels (marked in red) are the nearest neighbor to shades of green from k-color palette. The pixels belonging to a single shade can represent different areas in the image having different distance from camera in actual scene. These pixels are plotted in RGB colorspace to observe their distribution. They form tight clusters around learned shades of green (green squares), hence are well approximated by k-color palette. Shades of green from the k-color palette and their corresponding learned luminosity variance σ l k is also shown. This variance provides us a confidence measure for the color palette. Statistically shades with low σ l k will be well approximated by k-color palette.
In Figure 4, formation of haze-lines in presence of haze is demonstrated. With known depth-map d(x), taking A = [0.5, 0.6, 1.0] and β = 1, the transmission t(x) can be determined by Equation (2). Artificial haze can then be induced in the image using image formation model Equation (1). In presence of haze, the red marked pixels forms haze-lines in RGB colorspace [19,7,9]. Where one end represents the haze-free color and the other end represents airlight. As the visibility Figure 4 Formation of haze-lines Left to right: 1) In presence of haze, the pixels marked in red from various regions of image forms haze-lines in RGB colorspace, 2) The two ends of a haze-line are airlight A and shades of green from learned k-color palette, 3) shades of green from learned k-color palette and their corresponding haze-line variance σ h k Information Technology and Control 2021/1/50 [8], statistical modeling [58] or analyzing haziest regions of the image [27,64,16]. Hence, in presence of noise as long as airlight estimate remains accurate the proposed generalized haze-lines remain intact.

Dehazing
The proposed algorithm consists of the following key steps: 1) initial transmission estimation, 2) regularization, and 3) recovery haze-free image.

Estimating Initial Transmission
The algorithm begins by establishing generalized haze-lines. One end of generalized haze-lines is always the learned k-color palette of natural images, hence there are total K = 5120 haze-lines. The other comes from image data as airlight. A reliable estimate of airlight can be obtained by [51,27,8,58]. From Equation (1), transmission can be expressed as It is intuitive to translate RGB coordinates so that A is at origin, so input image is (x) (x) = − r I A (11) and k-color palette becomes Figure 5 illustrates initial transmission estimation for pixel at x through proposed generalized haze-lines method. The haze-lines shown in Figure 4 are translated using Equation (11) and (12). As per Equation (10) transmission at x is a ratio of how far observed image pixel has traveled down the haze-line from its scene radiance. In proposed method, each member of k-color palette acts as scene-radiance and forms a haze-line. Therefore, the only thing left to do is to determine which pixel belongs to which haze-line. We determine the orientation of pixels of input image in translated RGB space by Orientation of generalized haze-lines can be determined as A pixel is member of a haze-line if it lies in the same orientation. We grow a kd-tree [6] using orientation vectors v k of haze-lines. For translated hazy image r(x), pixels are clustered into haze-lines by pushing them down the tree. For pixel at x, ζ(x) is index of nearest orientation neighbor in v k list At each location x, v k (x) is nearest orientation neighbor from v k list ( ) Transmission per pixel is then obtained by Initial transmission obtained by Equation (17) is shown in Figure 5. It is a very coarse estimate and requires further refinement. For a given haze-line, we compute normalized haze-line variance σ h k as a confidence measure. Average euclidean distance from A and its variance for N k member pixels of k th haze-line is Normalized haze-line variance is obtained by σ h k plays a significant role since it allows us to apply our estimate only to pixels where the assumptions hold. If the radii distribution in a given haze-line σ h k is small, it is considered unreliable. Due to small radial distance, clustering according to angles can get easily affected by noise. Such lines are usually formed by the pixels found in the sky (as the distance form A in RGB space is small). In Figure 5, the marked haze-line formed by the brightest shade of green is unreliable according to above criteria.
It is also important to mention that there is an inherent ambiguity when the color of an object is co-linear to A. In this case the haze-line passes through color and its shades and ends at A. Hence, it becomes non-trivial to identify which shade out of five is actual radiance of the object. This is the only case when multiple shades will belong to the same haze-line.

Regularization
Studies in range images [25], optical flow fields [59], and stereo vision [5,37] often describe natural environments as a collection of distinct objects that are characterized by being composed of nearly-planar object surfaces. Hence, we expect piecewise smooth scene depth d(x) variation. In presence of homogeneous haze the scattering coefficient β is constant. Therefore, the Equation 2 implies that the resulting transmission t(x) should also follow a piece-wise smooth function. It should be almost constant/ smooth within an object boundary, and change at depth boundaries only. However, the initial transmission map shown in Figure 5 is a per-pixel estimate and does not impose spatial coherency. It is also influenced by texture details of the scene objects. Hence certain restrictions are added on initial transmission map for further refinement. We impose upper and lower bound on initial transmission map so radiance J(x) does not becomes negative.
( ) where LB = 0.1, and UB = 1, hence transmission value stays between 0.1 to 1. Normalized haze-line and luminosity variance for each pixel is We seek a transmission map t(x) that is close to t˜(x) and is smooth when the input image is smooth. Mathematically, this requires us to minimize the following function w.r.t. t(x): The above equation is combination of a data-term and a smoothness-term. The α parameter is selected by user and it controls the mix-ratio between the data and the smoothness terms. ∆ x represents the four spatial neighbors of x. I is the captured hazy image, and t(x) is the refined transmission map we seek to find. To solve Equation (24), Weighted Least Squares (WLS) [32] method has been used.
plays a vital role as it allows us to rely on our data-term (ˆt(x)) only when it is derived from long and well distributed haze-lines with low luminosity and high haze-line variance. For such haze- Transmission estimation process Left to right: 1) transmission estimation for pixel located at x, 2) initial transmission map, and 3) refined transmission map σ h k plays a significant role since it allows us to apply our estimate only to pixels where the assumptions hold. If the radii σ h k is small, it is considered where LB = 0.1, and UB = 1, hence transmission value stays between 0.1 to 1. Normalized haze-line and luminosity variance for each pixel is Figure 5 Transmission estimation process. Left to right: 1) transmission estimation for pixel located at x, 2) initial transmission map, and 3) refined transmission map.
We seek a transmission map t(x) that is close to t˜(x) and is smooth when the input image is smooth. Mathematically, this requires us to minimize the following function w.r.t. t(x):  (24), t(x) is kept smooth w.r.t. to its neighborhood. The refined transmission t(x) shown in Figure 5. It appears to be a function of depth and of a piece-wise nature. The haziest regions of the image are mostly estimated by the smoothness-term, e.g. sky, whereas, the contribution of data-term is dominant for near-camera regions.

Haze Removal
This image formation model in Equation (1) can be rewritten as Image dehazing is a process of selective contrast enhancement. It can be observed in Figure 5, hazy regions usually have a lower transmission value. This makes denominator term in Equation (26) small, hence details of these regions is greatly enhanced by the dehazing process.
To improve clarity, the dehazing algorithm is listed step-by-step below: 3 Find orientation matrix ˆ(x) r using Equation (13). 4 Find orientation vector ˆk v using Equation (14). i.e. scene radiance end of haze-line to which pixel (x) r belongs to.
c Compute coarse transmission using Equation (17). end for 7 Calculate h k µ , h k σ and ˆh k σ .
8 Use regularization to refine transmission map by minimizing Equation (24) with respect to (x) t . 9 Calculate the dehazed image using Equation (26).

Experimental Setup
This section presents a comparison of the proposed algorithm against the state-of-the-art dehazing methods on a set of well-known benchmark images. We focus on the accuracy of estimated transmission map. It is assumed that A is estimated by any of these methods [51,27,8,16,61,58]. The estimated ambient light vector A for each figure is listed in its caption. For a fair and diverse comparison, we benchmark the qualitative and quantitative analysis of the proposed method with the recent works of [51,27,67,19,64,7,9,16,40,20,49,11,50,15]. We are using author's recommended parameter settings and original source codes for generation of results.

Qualitative Analysis
Qualitative analysis is a subjective comparison of dehazed images in term of visual pleasure. It depends on contrast, color, tone, saturation, visibility and sharpness preferences of the observer. It is also influenced by viewing angle, display monitor settings, ambient light conditions of the observer. Hazy images with numerous challenging regions are selected to test the robustness of proposed algorithm under different conditions.  [51,52,27,19,64,20,49,11,50] assume that transmission remains constant within a small patch of neighborhood pixels. This assumption becomes invalid at depth discontinuity of object boundaries, which causes halo artifacts to appear around objects in the de-hazed image. Hence it is a common practice to employee a transmission refinement scheme [27,34] to reduce halos. However, Information Technology and Control 2021/1/50 198 it can be observed in the regions marked in yellow of Figure 6, and in red of Figures 7-8, the methods by [27,9,40,20,11,50] fails to get a stable and reliable transmission estimate at sharp depth changes, hence they have halos and unwanted haze in resultant images.    The proposed algorithm is evaluated against the methods of [27,67,19,64,9,16,20,11,50]. These algorithms are compared in terms of visibility, clarity Information Technology and Control 2021/1/50   [27,19,9].
Visibility restoration in dark regions with fine details is quite challenging as well. Estimation of transmission lower than actual value over-saturate colors and make fine details in dark regions vanish. In the red marked region of Figure 6 observe the dark v-shaped branches between the leaves, and in 11 the   [27,19,9].
Visibility restoration in dark regions with fine details is quite challenging as well. Estimation of transmission lower than actual value over-saturate colors and make fine details in dark regions vanish. In the red marked region of Figure 6 observe the dark v-shaped branches between the leaves, and in 11 the gray and beige colored buildings. The methods [27,19,11,50]  of details of distant objects and color/contrast saturation. It can be observed that each method recovers the visibility of distant objects up to a reasonable degree. The proposed algorithm along with the works of Gladran's [20], Fattal's [19], He's [27] are possibly the ones recovering the most vivid details. Fig 9 and 10 have complex fine details at varying scene depth. Inaccurate estimation of haze-thickness results in poor recovery such details. By comparing the recovery through different methods of marked regions it can be seen that proposed method offers more clarity of the details.
Visibility restoration of haze-like sky regions of Figures 8-11 is also a challenging task. As discussed earlier, bright (sky-like) shades usually have high luminosity and low haze-line variance, hence the proposed method through regularization Equation (24) penalize the data-term and try to approximate transmission by the smoothness-term. Therefore, it handles sky regions more gracefully than the other state-of-the-art techniques [27,67,19,9,16,20,11,50]. For example, in the Lviv image the sky recovered by our approach looks more natural compared others [27,19,9].
Visibility restoration in dark regions with fine details is quite challenging as well. Estimation of transmission lower than actual value over-saturate colors and make fine details in dark regions vanish. In the red marked region of Figure 6 observe the dark v-shaped branches between the leaves, and in 11 the gray and beige colored buildings. The methods [27,19,11,50] produce over-saturated results, hence shades of buildings seems distorted and branches have vanished in their output image. Whereas under-dehazing results in poor recovery as in methods by [9,20]. It can be observed, the proposed method produces a better color saturation and accurately removes even small haze patches between leaves.
However, our method and the related works of [27,67,19,64,9,16,20,11,50] share a common limitation, i.e., the output image often appears dark, so a post-processing technique like gamma correction is required to make the output visually more pleasant. In our method, we use the standard gamma correction equation, i.e., I out = (I in ) 1/γ with the gamma value manually selected to make the dehazed output as bright as the input image.

Quantitative Analysis
Quantitative analysis of image quality with respect to a known ground-truth is not influenced by observer's viewing angle, monitor settings, ambient light conditions and color preferences. Hence it is considered to be more realistic and accurate approach to rate the resultant image quality [51,52,19,7,21,49].
In order to make the experimental results more convincing and objective, we compare the proposed method with the some of the most cited image dehazing works of [27,19,64,9,16,40,20,11,15] on a set of 13 synthetic haze images. These images are subset of Middlebury Stereo Dataset [53] and have known depth-map. To generate a synthetic haze image, the transmission is obtained via t(x) = exp( βd(x)), where β is assumed to be a constant value 1. While airlight vector A can be chosen randomly, but for consistency with the rest of literature, we assume it to be same as in [51,19,64,9], i.e. A = [0.5, 0.6, 1]. Using groundtruth as J(x), synthetic haze image I(x) is produced via Equation (1).
These images are dehazed using above mentioned methods and are compared with the haze-free ground-truth using the mean squared error (MSE) and the structural similarity index measure (SSIM) [66]. As dehazed image statistically becomes similar to haze-free ground-truth, the SSIM increases to one and MSE decreases to zero.
The MSE and SSIM values on a set of 13 synthetic haze images for each method is presented in Table  1. On average, the proposed method achieves better MSE and SSIM scores. Some sample results with SSIM scores of top 6 (out of 10) algorithms according to Table. I are presented in Figure 12.
It can be observed that the marked haze lookalike regions are quite challenging. As bright shades usually have high luminosity and low haze-line variance, hence the proposed method through regularization penalize data-term and try to approximate transmission by smoothness-term i.e. neighbourhood region. Therefore, it handles haze lookalike regions better than the other state-of-the-art techniques. Meng [40] Fattal [19] Yu [64] Zhu [49] Berman [9] Cai [11] Ren [50] Cho [15] Proposed

Quantitative Analysis
Quantitative analysis of image quality with respect to a known ground-truth is not influenced by observer's viewing angle, monitor settings, ambient light conditions and color preferences. Hence it is considered to be more realistic and accurate approach to rate the resultant image quality [51,52,19,7,21,49].
In order to make the experimental results more convincing and objective, we compare the proposed method with the some of the most cited image dehazing works of [27,19,64,9,16,40,20,11,15] on a set of 13 synthetic haze images. These images are subset of Middlebury Stereo Dataset [53] and have known depth-map. To generate a synthetic haze image, the transmission is obtained via t(x) = exp( βd(x)), where β is assumed to be a constant value 1. While airlight vector A can be chosen randomly, but for consistency with the rest of literature, we assume it to be same as in [51,19,64,9], i.e. A = [0.5, 0.6, 1]. Using ground-truth as J(x), synthetic haze image I(x) is produced via Equation(1). These images are dehazed using above mentioned methods and are compared with the haze-free ground-truth using the mean squared error (MSE) and the structural similarity index measure (SSIM) [66]. As dehazed image statistically becomes similar to hazefree ground-truth, the SSIM increases to one and MSE decreases to zero.

Complexity Analysis
The complexity of the proposed technique is linear O(N) where N is number of pixels in the image. Nearest neighbor clustering is performed using KD-Tree search algorithm which is of O(N). The complexity of radius estimation within cluster is also linear in N. Similarly minimization of regularization function is linear in N as well as image restoration from transmission map.

Conclusion
In this paper a simple yet effective prior is proposed. It is based on statistical observation that natural images can be well approximated by a relatively small set colors. By using a collection of haze-free images a 'natural color-palette' consisting of a thousand colors and their shades is learned. The hypothesis is tested on a set of an unseen natural images. They are well approximated and their colors form tight clusters around the learned palette. When haze is introduced these clusters form haze-lines in RGB space. The common end for all haze-lines is airlight, and the other end is the scene radiance of member pixels. We propose that these haze-lines can be generalized, with one end as learned color-palette of natural images and the other as airlight. The algorithm recovers the transmission map, by determining membership of each pixel to a given haze-line and finding how far-off it is from its learned color-palette. Regularization is then performed to smooth and refine the initial transmission map. An obvious failure case for the proposed method is when color of an object is col-linear with airlight.
In that case haze line passes through the all shades of a color and ends at A. So it becomes ambiguous as to which shades does the object belongs to.
The proposed generalized haze-lines have well defined end-points, even in presence of noise. As one end is the statistically learned (k-color-palette), hence is independent of underlying image. The other end is airlight. This ensures that each haze-line have a haze-free color and an optimum orientation as long as airlight estimate remains accurate. It also avoids the need of finding the least-hazy pixel per haze-line thus saving computation time. The proposed method estimates per-pixel transmission, hence the issues associated with patch-based techniques e.g. handling patches at object boundaries, determining patch size and patch tiling, becomes irrelevant. This proposed algorithm is simple, fast yet robust in challenging regions of input hazy image. Qualitative and quantitative analysis shows that the proposed algorithm competes well with many state-of-the-art methods.

Conflict of Interest.
All authors declares that they have no conflict of interest.