# Highlight Removal Emphasizing Detail Restoration
## 3 Method of This Article
### Highlight Removal  
The accurate detection of highlight positions is crucial for highlight removal and directly affects the image restoration results and the efficiency of highlight removal algorithms. This paper is inspired by the Retinex model [28], which suggests that a digital image can be represented as the pixel-wise product of illumination and reflection components. In this context, the illumination component reflects ambient light information, while the reflection component reflects the detail information of the image. The relationship between them can be expressed as:  
\[I_{c}(x,y)=R_{c}(x,y)\cdot L_{c}(x,y) \tag{2}\]  
Figure 1: The framework of the proposed method. where \(I_{c}(x,y)\) represents the pixel at position \((x,y)\) in the image, \(c\in\{R,G,B\}\) represents the color channel, and \(R_{c}(x,y)\) and \(L_{c}(x,y)\) represent the reflection and illumination component information at the corresponding pixel position. Based on this theory, this paper separates the highlight image into reflection and illumination components and performs highlight localization based on the illumination component, as shown below. \[R_{m}=\frac{\sum_{i=1}^{n}L_{i}}{n}+\sqrt{\frac{\sum_{i=1}^{n}\left(L_{i}- \overline{L_{i}}\right)^{2}}{n}} \tag{3}\]  
In the above equation, \(R_{m}\) represents the extracted highlight mask, which also serves as the threshold for highlights. Here, \(n=W\times H\) represents the total number of pixels, where \(W\) is the width and \(H\) is the height of the image. \(L_{i}\) represents the i-th pixel value in the illumination component. Finally, the two are added together to obtain the mask for the highlight region. Subsequently, in the mask region extracted based on the approach in this paper, specular reflection is separated using the dichromatic reflection model. However, compared to traditional methods, this paper processes only the region identified by highlight localization rather than the entire image. This can improve the color bias issues encountered in previous methods. The specific improvements are as follows:  
\[I(x)=D(x)+S(x)=m_{d}(x)\Lambda(x)+m_{s}(x)\Gamma(x) \tag{4}\]  
The above formula represents the dichromatic reflection model, where \(x=(x,y)\) denotes the image's horizontal and vertical coordinates, and \(I(x)=\left\{I_{r}(x),I_{g}(x),I_{b}(x)\right\}\) represents the intensity of the three-channel pixels in a color image. In the formula, \(D(x)\) and \(S(x)\) indicate the diffuse reflection and specular reflection components, respectively, \(\Lambda(x)\) represents the diffuse reflection chromaticity, and \(\Gamma(x)\) represents the specular reflection chromaticity. \(m_{d}(x)\) and \(m_{s}(x)\) are the coefficients for these two components. Based on the inference from reference [12], according to formula (4), the following formula can be derived, where \(\hat{I}(x)\) is the approximate illumination-free image separated in the RGB space, \(I_{\min}(x)\) is the minimum pixel value in the RGB space, and \(\overline{I_{\min}}(x)\) is the mean of the minimum pixel values in the RGB space. \[\hat{I}(x)=I(x)-I_{\min}(x)+\overline{I_{\min}(x)} \tag{5}\]  
However, on the surface of metals, because they are mostly smooth and lack proper diffuse reflectance chromaticity [15], the highlight removal process in this paper is as follows. First, based on the highlight mask separated in this paper, the following operation is performed, where \(\gamma\) represents the conversion of the image to the HSV space, \(I(x)\) is the original RGB image, \(I_{\min}(x)\) is the minimum value in the RGB pixels, \(R_{m}\) is the highlight mask separated based on Formula (3), and \(\circ\) indicates that the operation is only applied to the masked area.