# Newly Designed Identification Scheme for Monitoring Ice Thickness on Power Transmission Lines
## 3 New Scheme for Iced Transmission Line Identification
### Image Color Restoration  
The material images taken by cameras often appear dim and unclear, and distorted hues alter their true colors. Likewise, the appearance of color in recorded images is strongly influenced by spectral shifts in the scene illumination. The reason has two parts: insufficient light prevents the camera from gathering enough information, and the dynamic range of a camera is much narrower than that of the human visual system. Some of the iced transmission line images used in this study appear dim and unclear, and distorted hues have altered their original color, so restoring the original image before going to the next stage is needed. Retinex (Retina + Cortex) is an enhancement technique that attempts to attain color constancy and is used to enhance the image's color. Figure 3 shows a block diagram for image color restoration, and Algorithm 1 shows the color restoration algorithm. Figure 1: The PTLI identification uses Canny edge detection and the Hough transform. According to Figure 3, the PTLI images for the experiment are prepared for the initial steps, and then all frames are read from the image. The frames are classified into red, green, and blue. The Gaussian surround is calculated after the image frame is read and used as a filter to smooth out the original image. The formula used is as follows:  
\[F(x,y)=Ke^{-(x^{2}+y^{2})/(2\times\sigma^{2})} \tag{1}\]  
The following is an explanation of Equation (1):  
\(F(x,y)\): Gaussian on pixels \((x,y)\)  
\(e\) : Exponential;  
\((x,y)\) : Pixel coordinates;  
\(\sigma\) : Sigma value  
Figure 2: The new scheme for iced transmission line identification and extraction. The first step uses the Gaussian surroundings to increase the image's brightness. This stage is intended for image smoothing beforehand. The Gaussian value is obtained from Equation (1) and determined using three sigma values. The three sigma values used are \(\sigma_{1}=15\), \(\sigma_{2}=80\), and \(\sigma_{3}=250\). However, this value can be changed as needed. Algorithm 1 shows the color restoration algorithm. After the image brightness increases, the next stage is the original image matrix combined with the Gaussian kernel. The image matrix for each color channel was used as the original image matrix. The detail in dark areas is enhanced by a small sigma. At this stage, a member of the class functions center/surround, where the output is defined by the difference between the input value (center) and the average of its environment (surround). The general mathematical form is as follows:  
\[O_{i}(x,y)=\log(I_{i}(x,y))-\log(I_{i}(x,y)*F(x,y)) \tag{2}\]  
where \(I_{i}\) is the input image on the \(I_{th}\) color channel, \(O_{i}\) is the output image on the \(i-th\) channel, and \(F\) is the normalized surround function. This stage is performed on each color channel. The formula used for convolution calculations is as follows:  
\[F(x,y)*\ I_{i}(x,y). \tag{3}\]  
The following is an explanation of the convolution formula:  
\(F(x,y):\) Gaussian on pixels \((x,y)\)  
\(*:\) Convolution  
\(I_{i}(x,y)\): Image matrix  
\(i:\) Color channels (R, G, and B)  
Different scales are combined with specific weights at a later stage. The initial stage of this method is to determine the weight to be used. Each weight will be multiplied by the results of each convolution matrix and then added up. Weight values can be adjusted according to the requirements. It affords an acceptable trade-off between a good local dynamic range and a good color rendition. The output is defined as the weighted sum of the outputs of several previous stages (dynamic range compression). The equation for this stage is as follows:  
\[O2_{i}(x,y)=\sum_{n=1}^{N}w_{n}O_{i}. \tag{4}\]  
Figure 3: The block diagram for image color restoration. where \(N\) is the number of scales and \(w_{n}\) is the weight of each scale. The last step in image enhancement is improving the image quality in relation to the image's brightness by maintaining the color firmness.