L = R ⊙ T \mathbf {L=R \odot T} L=R⊙T
where
Assume: for color images, three channels share the same illumination map. T \mathbf T T and T ^ \hat {\mathbf T} T^ to represent one-channel and three-channel illumination maps.
T ^ ( x ) ← max c ∈ { R , G , B } L c ( x ) (1) \hat {\mathbf T}(x) \leftarrow \max_{c∈\{R,G,B\}} \mathbf L ^c(x)\tag 1 T^(x)←c∈{R,G,B}maxLc(x)(1)
so R ( x ) = L ( x ) max c L c ( x ) + ϵ (2) \mathbf R(x)={\mathbf L(x)\over \max_c \mathbf L^c(x)+\epsilon}\tag 2 R(x)=maxcLc(x)+ϵL(x)(2)
In dehaze model:
1 − L = ( 1 − R ) ⊙ T ~ + a ( 1 − T ~ ) (3) \mathbf{1-L=(1-R)\odot\tilde T}+ a \mathbf{(1-\tilde T)} \tag 3 1−L=(1−R)⊙T~+a(1−T~)(3)
where
with dark channel prior
T ~ ( x ) ← 1 − min c 1 − L c ( x ) a = 1 − 1 a + max c L c ( x ) a (4) \mathbf {\tilde T}(x) \leftarrow 1-\min_c{1-\mathbf L^c(x)\over a}=1-{1 \over a}+\max_c{\mathbf L^c(x)\over a}\tag 4 T~(x)←1−cmina1−Lc(x)=1−a1+cmaxaLc(x)(4)
substituting (2) into (1)
R ( x ) = L ( x ) − 1 + a ( 1 − 1 a + max c L c ( x ) a + ϵ ) + ( 1 − a ) (5) \mathbf R(x) ={\mathbf L(x) − 1 + a\over (1 −{1\over a}+ \max_c {\mathbf L^c(x)\over a}+ \epsilon) }+(1 − a)\tag 5 R(x)=(1−a1+maxcaLc(x)+ϵ)L(x)−1+a+(1−a)(5)
we can see that when a = 1 a=1 a=1 the equation (5) and (2) reach the same result.
min T ∥ T ^ − T ∥ F 2 + α ∥ W ⊙ ∇ T ∥ 1 (6) \min_ \mathbf T\|\hat {\mathbf T} − \mathbf T\|^2_F+ α\|\mathbf W\odot \nabla \mathbf T\|_1 \tag 6 Tmin∥T^−T∥F2+α∥W⊙∇T∥1(6)
where
the optimal problem ( 6 ) (6) (6) can be solved by the [[Basic Knowledge/Optimization/alternating multiplier descent method|alternating direction minimization technique]]
it is obvious that
lim ϵ → 0 + ∑ x ∑ d ∈ { h , v } W d ( x ) ( ∇ d T ( x ) ) 2 ∣ ∇ d T ( x ) ∣ + ϵ = ∥ W ◦ ∇ T ∥ 1 \lim_{\epsilon \rightarrow 0^+}\sum_x\sum_{d∈\{h,v\}} {\mathbf W_d(x)(∇_d\mathbf T(x))^2\over |∇_d\mathbf T(x)| +\epsilon} = \|\mathbf W ◦ ∇\mathbf T\|_1 ϵ→0+limx∑d∈{h,v}∑∣∇dT(x)∣+ϵWd(x)(∇dT(x))2=∥W◦∇T∥1
so we can use ∑ x ∑ d ∈ { h , v } W d ( x ) ( ∇ d T ( x ) ) 2 ∣ ∇ d T ^ ( x ) ∣ + ϵ \sum_x\sum_{d∈\{h,v\}}{\mathbf W_d(x)(∇_d\mathbf T(x))^2\over |∇_d\mathbf {\hat T}(x)| +\epsilon} ∑x∑d∈{h,v}∣∇dT^(x)∣+ϵWd(x)(∇dT(x))2 to approximate ∥ W ◦ ∇ T ∥ 1 \|\mathbf W ◦ ∇\mathbf T\|_1 ∥W◦∇T∥1
the problem ( 6 ) (6) (6) can be written as
min T ∥ T ^ − T ∥ F 2 + α ∑ x ∑ d ∈ { h , v } W d ( x ) ( ∇ d T ( x ) ) 2 ∣ ∇ d T ^ ( x ) ∣ + ϵ (7) \min_ \mathbf T\|\hat {\mathbf T} − \mathbf T\|^2_F+ α \sum_x\sum_{d∈\{h,v\}}{\mathbf W_d(x)(∇_d\mathbf T(x))^2\over |∇_d\mathbf {\hat T}(x)| +\epsilon} \tag 7 Tmin∥T^−T∥F2+αx∑d∈{h,v}∑∣∇dT^(x)∣+ϵWd(x)(∇dT(x))2(7)
Thus, the problem can be directly obtained by solving the following
( I + α ∑ d ∈ { h , v } D d T Diag ( w ~ d ) D d ) t = t ^ (\mathbf I +\alpha \sum_{d∈\{h,v\}}\mathbf D^T_d \text {Diag}(\tilde{\mathbf w}_d)\mathbf D_d)\mathbf t = \hat {\mathbf t} (I+αd∈{h,v}∑DdTDiag(w~d)Dd)t=t^
where
By doing this, the complexity reaches O ( N ) \mathcal O(N) O(N)
W d ( x ) ← 1 , d ∈ { h , v } \mathbf W_d(x) ← \mathbf 1,d\in\{h,v\} Wd(x)←1,d∈{h,v}
W d ( x ) ← 1 ∣ ∇ d T ^ ( x ) ∣ + ϵ , d ∈ { h , v } (8) \mathbf W_d(x) ← {1\over |∇_d\mathbf {\hat T}(x)| +\epsilon },d\in\{h,v\}\tag 8 Wd(x)←∣∇dT^(x)∣+ϵ1,d∈{h,v}(8)
W d ( x ) ← ∑ y ∈ Ω ( x ) G σ ( x , y ) ∣ ∑ y ∈ Ω ( x ) G σ ( x , y ) ∇ d T ^ ( y ) ∣ + ϵ , d ∈ { h , v } \mathbf W_d(x) ← \sum_{y∈\Omega(x)}{G_σ(x, y)\over |\sum_{y∈\Omega(x)}G_σ(x, y)∇_d\hat {\mathbf T}(y)| + \epsilon} ,d\in\{h,v\} Wd(x)←y∈Ω(x)∑∣∑y∈Ω(x)Gσ(x,y)∇dT^(y)∣+ϵGσ(x,y),d∈{h,v}
where
this expression means that compose the denoised low-light patches ( 1 − T 1 − \mathbf T 1−T) and the un-denoised high-light patches ( T \mathbf T T)
the following pic (e) is the composed result of (b) and (d)