# A Stronger Adaptive Local Dimming Method with Details Preservation
## 3 Method  
In this section, we document our local dimming method elaborately. We first introduce the holistic structure of the method. Then, the proposed backlight extraction method and the compensation method are described, respectively. The diagram of the proposed method is shown in Figure 3. The whole architecture consists of two modules: an Adjustable Backlight Extraction (ABE) module and a pixel compensation module. Furthermore, the ABE module consists of base backlights extraction and optimal backlight selection. To avoid color distortion, most of the existing local dimming algorithms are performed on the luminance rather than the chroma component. Following this, we separate the luminance information by converting the color space from \(RGB\) into \(YCbCr\)[19] before all of the succeeding operations. The conversion formula is  
\[ \begin{cases}\left[\mathbf{Y}\quad\mathbf{Cb}\quad\mathbf{Cr}\right]^{T}= \mathbf{M_{sRGB}}\times\left[\mathbf{R}\quad\mathbf{G}\quad\mathbf{B}\right]^ {T}+\left[16\quad 128\quad 128\right]^{T}\\ \mathbf{M_{sRGB}}=\begin{bmatrix}0.257&0.564&0.098\\ -0.148&-0.291&0.439\\ 0.439&-0.368&-0.071\end{bmatrix}\end{cases}  \tag{1}\]  
According to the Retinex theory [20], which is widely used in image processing [21], an image is composed of reflectance and illuminance. The former presents the detail information and the latter determines the dynamic range. This is represented as:  
\[\mathbf{S}(x,y)=\mathbf{R_{c}}(x,y)\times\mathbf{I}(x,y) \tag{2}\]  
Figure 3: The diagram of the proposed method. It is better to look at it in color: orange block, adjustable backlight extraction module; white block, backlight smoothing module; and pink block, pixel compensation module. where \((x,y)\) is the coordinate of the pixel in the image, \(\mathbf{S}\) is the image perceived by human eyes, \(\mathbf{R_{c}}\) is the reflectance, and \(\mathbf{I}\) is the illuminance. In our method, \(\mathbf{Y}\) component in \(YCbCr\) color space is considered as \(\mathbf{S}\). \(\mathbf{I}\) is obtained by:  
\[\mathbf{I}(x,y)=\mathbf{F}(x,y)\otimes\mathbf{Y}(x,y) \tag{3}\]  
where \(\mathbf{F}\) is the Weighted Least Squares (WLS) filter [22], which is known as an edge-preserving filter; \(\otimes\) is the convolution operation; and \(\mathbf{Y}\) is the \(\mathbf{Y}\) component in \(YCbCr\) color space. Image edge is the most concentrated part of image information such as the change of gray level and the mutation of texture structure, which contains rich details. Therefore, the edge information must be decomposed and kept to improve image quality in image processing. An alternative filter is bilateral filtering, which has been used in many previous works as a base-detail decomposition technique. However, WLS filter is chosen in this paper because of its better performance, especially for increased blur level compared with bilateral filtering. WLS filter is well suited for progressive coarsening of images and for multi-scale detail extraction. For an input image \(g\), an image \(u\) is expected to be as close to \(g\) as possible and be smoother except for some places where the gradient of the edge of \(g\) changes greatly. Formally, the solution to minimize the objective function in Equation (4) is the result of filtering \(u\). \[\sum_{p}\left(\left(u_{p}-g_{p}\right)^{2}+\lambda\left(a_{x,p(g)}\left(\frac{ \partial u}{\partial x}\right)^{2}+a_{y,p(g)}\left(\frac{\partial u}{\partial y }\right)^{2}\right)\right) \tag{4}\]  
where the subscript \(p\) represents the coordinate of the pixel. The first term \(\left(u_{p}-g_{p}\right)^{2}\) is used to measure the similarity between \(g\) and \(u\). The second term is a regular term, and \(\lambda\) is a weight coefficient of the regular term. The larger \(\lambda\) is, the smoother the image will be. The image \(g\) is smoothed by minimizing the partial derivative of \(u\), and the weights of smoothing terms are \(a_{x,p(g)}\) and \(a_{y,p(g)}\), respectively. The definitions of \(a_{x,p(g)}\) and \(a_{y,p(g)}\) are shown in Equation (5). \[