## 4 ADR Algorithms
### Localised Segmentation  
To overcome the issue of weak intensity pixels, the ROI that contain wires are proposed be inspected locally and individually so that the weak signatures can be extracted in a  
Figure 13: Demonstration of edge detection methods: (**a**) [PERSON]’s method; (**b**) Canny edge detector with sigma = 0.1, threshold = [0.025, 0.03].  
refined ROI. The working principle of R2R and DLIT determines that the relative positions of the wires are fixed during inspection, making the localized inspection possible. The schematic diagram for this process is depicted in Figure 14.  
The averaging filter is applied as a first step to further remove any unwanted noise and minor fluctuations. For this study, it was discovered that a general \(15\times 15\) averaging filter was adequate. The intensity estimator plot shown in Figure 15 demonstrates the smooth effect in comparison to the unprocessed intensity plot in Figure 12. It is shown that the minor fluctuations are suppressed, as well as the \"bathtub\" curves in between the front and back edges for each wire.  
The next step was to extract the pixels within the specified a rough ROI individually so that a more refined ROI could be defined for wire detection. To achieve highlighting possible pixel peaks and reducing the pixel noises, a 0-1 scaler function was applied for each specified ROI. The 0-1 scaler was defined as a mapping function, which converts the pixel values from one range to range of [0, 1], so that the smaller pixels are suppressed and pixels with larger intensities are amplified. The scaler is achieved through the equation defined in Equation (4):  
\[I_{n}\ \in ROI \tag{2}\] \[I_{scaled}=\frac{I_{n}-Min(I_{n})}{Max(I_{n})-Min(I_{n})}\]  
The effect of this 0-1 scaler is demonstrated in Figure 16, where an example of rough ROI of [300-400] row index is given. It is worth noting that the 0-1 scaler itself does not modify the shape of the curve, but rather normalizes the DLIT image so that all pixels are comparable in the same scale of [0, 1] for the thresholding process.  
Figure 14: Schematic diagram of the process to refine ROI.  
Figure 15: Intensity plot after applying \(15\times 15\) average filter.  
From Figure 16, a globally applicable threshold, in this study 0.4 can be applied to detect the edges using heuristic rules:  
\[\begin{split} I_{n}\text{ is a Front edge if }:& I_{n}\text{ and }I_{n-1}\text{$< threshold, $I_{n+1}>$ threshold}\\ I_{n}\text{ is a Back edge if }:& I_{n}\text{ and }I_{n+1}\text{$< threshold, $I_{n-1}>$ threshold}\\ \end{split} \tag{3}\]  
There should be other heuristics, including that the detected Back edge should come after the Front edge, the number of Front edges and Back edges should be equal, and multiple Front edges and Back edges should be allowed to be discovered in order to increase the sensitivity of weak signal detection. If after processing, no edges are discovered, satisfying the rules specified above, then it indicates no wire is detected in the specified ROI.  
If edges are detected, the refined ROI is formed by combining earliest Front edge and latest Back edge. In the Figure 16 example, the detected refined ROI is [342; 377], noted that the 300 offset is added on row index from Figure 16b. The refined ROI is sent to a z-score analyzer to detect irregularities that are associated with hot spots.