## 4 Experiment and Discussion
### Wire Spacing Experiment  
In the wire spacing experiment, the coil-to-lens distance is set to 550 mm, according to Equation (7); the distance conversion ratio \(k\) is 0.09 (mm/pixel), and the ROI image size of the outline part is set to 320 \(\times\) 230 pixels. In addition, this method uses the edge profile curve of the wire, in Figure 3, the edge profile of the wire increases in the direction perpendicular to the camera view; the changing distance is negligible compared with the distance from the winding to the camera, so the value of \(k\) represented by each layer of the wire is considered constant. A laser profilometer is based on laser scanning technology, which has the advantages of high frequency and high accuracy. In the wire spacing experiment, to verify the accuracy of our spacing detection method, the experimental results measured by the laser profiler will be used as the reference standard. Figure 23 shows the ROI images obtained for different layers. Table 1 shows the maximum spacing results measured using the spacing detection algorithm, micrometer, 3D laser profiler, and the method proposed in the reference [14], respectively. Figure 24 shows the location of the maximum spacing on the ROI image with a rectangular box. Figure 22: Comparison of the algorithm-detected angle and the manual-detected angle for each wire: (**a**–**d**) are the detection results of 2.4 mm wire; (**e**–**h**) are the detection results of 2.6 mm wire. The horizontal coordinate represents the wire number from the left in the ROI image, the vertical coordinate represents the angle-taking interval, the red dash is the algorithm-detected angle, and the blue dash is the angle ruler detection result. It should be noted that for the measurement of spacing, we only focus on the maximum spacing within the ROI region; as mentioned above, when the spacing exceeds the width of a wire, it will affect the next layer of wire alignment, so this paper requires that the maximum spacing does not exceed the width of the wire flattened to 1/2 of that through which the winding passes. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Collected Images** & **(a)** & **(b)** & **(c)** & **(d)** & **(e)** & **(f)** & **(g)** & **(h)** \\ \hline Maximum distance (mm) & 0.664 & 0.802 & 0.789 & 0.748 & 0.745 & 0.452 & 0.562 & 0.768 \\ \hline Micrometer (mm) & 0.62 & 0.85 & 0.81 & 0.67 & 0.72 & 0.48 & 0.50 & 0.64 \\ \hline
3D Laser Profiler (mm) & 0.6442 & 0.8412 & 0.8228 & 0.7121 & 0.7344 & 0.4629 & 0.5325 & 0.7852 \\ \hline Reference 14 (mm) & 0.569 & 0.77 & 1.27 & 0.43 & 0.53 & 0.2 & 0.39 & 0.45 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The spacing test results are in Figure 24.  
Figure 23: ROI image of the guide wire profile: (**a–d**) is the ROI of the 2.4 mm wire profile; (**e–h**) is the ROI of the 2.6 mm wire profile. Figure 24: Information on the location of the maximum spacing within the ROI: (**a–d**) are the results of the maximum gap detection result within the ROI of the 2.4 mm wire profile; (**e–h**) are the results of the maximum gap detection result within the ROI of the 2.6 mm wire profile. From the data obtained in Table 1 and Figure 25, it can be seen that, first, the least squares fitting method proposed in the literature12 does not apply to this study, and the difference between group 3 experiments and the laser profiler reaches 0.4 mm, and the average difference of the other groups also reaches 0.3 mm. Second, when the micrometer measurement results were compared with those of the laser profiler, only the difference between group 1 and group 8 exceeded 0.04 mm; the other groups did not differ much, but the use of a micrometer requires more inspection time, which is not conducive to enhancing the automation of the production process.