## 1 Introduction  
As the basic equipment of power transmission and transformation in the electric power industry, transformers are widely used in power plants, converter stations, substations, and customer sides, and occupy a very important position in the electric power industry [1, 2]. Usually, transmission and distribution transformers are mainly composed of high and low-voltage coils, magnetic cores, insulation parts, and equipment protection parts; the high-voltage coils are made of polyester-enameled copper wire through winding machines [3], and the main workflow of the current production coils is shown in Figure 1.  
The wire layout control section generally has the problems of large tension fluctuation and more manual intervention [4], and during the winding forming process, the low mechanical precision and sudden change in load are likely to cause certain errors in the synchronous movement of the traverse movement of the wire layout device and the rotation of the main axis. The fluctuation of tension and the error of synchronous movement will cause a change in the winding angle and wire spacing. Variation of the winding angle can cause the effective lateral travel of the wire to exceed the permissible range; a tiny wire spacing will cause the problem of wire stacking and crossover and affect the flatness of the winding layers; a large wire spacing will result in a cavity, causing the latter layer of wire to be embedded in the gap of the former layer; and finally, the mechanical and insulating performance of the whole coil will not reach the expected standard [5, 6, 7, 8]. Therefore, the winding status of the coil needs to be checked in time. Currently, the winding angle and wire spacing are measured by the operator, either by observation or using tools, and if they are outside the specified range, adjustments need to be made to the coil. But the evaluation standards of different operators depend on subjective experience, and they need to observe the wires for a long time, which is prone to visual fatigue, and it is impossible to detect winding errors in time and correct them [9; 10]. Machine vision technology is the emerging contactless measurement technology after optical inspection technology, with a very wide range of application prospects [11; 12]. For high-speed automated production lines, the use of visual detection methods can effectively avoid missed or error judgments [13]. In recent years, many scholars have conducted various research in the related industries of transformer manufacturing. Reference [14] used machine vision to realize the correction process of coil wire winding position defects. By analyzing the landing position of each turn of wire, the control system coordinates the traverse movement of the wire arrangement motor to correct the current point, but the scope of application of the algorithm is not well described; Reference [15] uses the defective frame method and boundary tracking method to realize real-time detection and feedback of the surface quality of the enameled wire; Reference [16] establishes a wire jitter model, the cubic spline interpolation operation is used to eliminate micro-vibration, and the calculation of the wire diameter of the enameled wire is completed online; Reference [17] establishes the standard deviation function of the adjacent distance between the coil wires, if the coils are arranged neatly, the distance between adjacent wires is basically the same, and the standard deviation is small; otherwise, the standard deviation will be large, indicating that the coil is highly cluttered, and the data changes can be used to determine whether the coil is qualified or not; reference [18] proposed a method for identifying defects in the wire electroplating process based on machine vision, using the HSV model to set the defect threshold, distinguish whether there is a defect or not, and using the algorithm of image segmentation to eliminate the interference of the bearing around the wire.