## 5 Conclusions  
In this paper, machine vision technology is used to implement an automatic measurement scheme for winding angle and wire spacing that needs to be monitored in real-time for controlling the winding process in the production of transformer high voltage coils, which is summarized as follows:  
1. Analyze the structural characteristics of wire coils, build an image acquisition system, and extract ROI images of different regions for different measurement parameters as sample images.
2. A slicing gray equalization method is proposed to solve the problem of excessive gray span in the image area caused by uneven light reflection. After determining the threshold, the binarization process is performed, and the automatic measurement of the winding angle is realized by extracting the characteristic curve of the wire skeleton. Compared with manual measurements, the maximum error of the experiment is only 6.4%, which meets the expected detection target.
3. An intersection of the perpendicular lines method is proposed to calculate the centroid coordinates of wire contours, and four models are established according to different contours, defined as \"W-type\", \"M-type\", \"N-type\", and \"inv-N-type\". The different  
Figure 25: Comparison of the results of each group obtained by the four measurement methods.  
models require the removal of different pseudo-coordinate points and the determination of the center coordinates of the wire contour. The pixel spacing of the adjacent wires is derived from the shape center coordinates, and the automatic measurement of the winding spacing is realized in combination with pixel calibration. The measurement error does not exceed 10% compared with commonly used detection methods. In addition, when the spacing is too large in the experiment, it can be detected and marked in time.
4. Due to the special structure of the coil, we are somewhat limited in the range of detection in the image.  
The above results show that the proposed method has great advantages in terms of both cost and accuracy. Excluding the errors arising from filming and image pre-processing, we believe that the results obtained by the proposed detection method can be used as the detection standard for coil winding spacing, and the method can be used in the detection process instead of manual parameter monitoring, which at the same time can improve the quality of the finished coil. As a topic for future research, we will consider combining deep learning algorithms on this basis to make this method more accurate in terms of measurement results.  
Conceptualization, K.S.; methodology, K.S.; software, S.Z.; validation, S.Z.; formal analysis, N.Z.; investigation, K.S.; resources, J.X.; data curation, N.Z.; writing--original draft preparation, S.Z.; writing--review and editing, K.S.; visualization, S.Z.; supervision, J.X.; project administration, J.X.; funding acquisition, J.X. All authors have read and agreed to the published version of the manuscript.  
This research was funded by Heilongjiang Province Applied Technology Research and Development, Grant Number GA20A401.  
Not applicable.  
Data availability Statement: Data is contained within the article.  
The authors would like to thank the Heilongjiang Province Applied Technology Research and Development (Grant No. GA20A401) for their support.  
The authors declare no conflict of interest.