A guided filter is an edge-preserving smoothing image filter. As with a bilateral filter, it can filter out noise or texture while retaining sharp edges.
Comparison Compared to the bilateral filter, the guided image filter has two advantages: bilateral filters have high computational complexity, while the guided image filter uses simpler calculations with linear computational complexity. Bilateral filters sometimes include unwanted gradient reversal artifacts and cause image distortion. The guided image filter is based on linear combination, making the output image consistent with the gradient direction of the guidance image, preventing gradient reversal.
Definition One key assumption of the guided filter is that the relation between guidance I {\displaystyle I} and the filtering output q {\displaystyle q} is linear. Suppose that q {\displaystyle q} is a linear transformation of I {\displaystyle I} in a window ω k {\displaystyle \omega _{k}} centered at the pixel k {\displaystyle k} . In order to determine the linear coefficient ( a k , b k ) {\displaystyle (a_{k},b_{k})} , constraints from the filtering input p {\displaystyle p} are required. The output q {\displaystyle q} is modeled as the input p {\displaystyle p} with unwanted components n {\displaystyle n} , such as noise/textures subtracted. The basic model: (1) q i = a k I i + b k , ∀ i ∈ ω k {\displaystyle q_{i}=a_{k}I_{i}+b_{k},\forall i\in \omega _{k}}
(2) q i = p i − n i {\displaystyle q_{i}=p_{i}-n_{i}}
in which:
q i {\displaystyle q_{i}} is the i t h {\displaystyle i_{th}} output pixel;
p i {\displaystyle p_{i}} is the i t h {\displaystyle i_{th}} input pixel;
n i {\displaystyle n_{i}} is the i t h {\displaystyle i_{th}} pixel of noise components;
I i {\displaystyle I_{i}} is the i t h {\displaystyle i_{th}} guidance image pixel;
( a k , b k ) {\displaystyle (a_{k},b_{k})} are some linear coefficients assumed to be constant in ω k {\displaystyle \omega _{k}} . The reason to use a linear combination is that the boundary of an object is related to its gradient. The local linear model ensures that q {\displaystyle q} has an edge only if I {\displaystyle I} has an edge, since ∇ q = a ∇ I {\displaystyle \nabla q=a\nabla I} . Subtract (1) and (2) to get formula (3);At the same time, define a cost function (4): (3) n i = p i − a k I i − b k {\displaystyle n_{i}=p_{i}-a_{k}I_{i}-b_{k}}
(4) E ( a k , b k ) = ∑ i ϵ ω k
( ( a k I i + b k − p i ) 2 + ϵ a k 2 ) {\displaystyle E(a_{k},b_{k})=\sum _{i{\epsilon }{\omega }_{k}}^{}((a_{k}I_{i}+b_{k}-p_{i})^{2}+{\epsilon }a_{k}^{2})}
in which
… excerpt ends here. Continue reading the full article.
