Coil winding detection method and device, electronic equipment and storage medium
By simplifying the coil winding detection method and utilizing wire contour segmentation and caliper line judgment, the problems of large computational load and high resource consumption of existing algorithms are solved, achieving efficient coil winding detection that is suitable for high-throughput production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU MEGAROBO TECH CO LTD
- Filing Date
- 2022-12-07
- Publication Date
- 2026-07-10
AI Technical Summary
Existing coil winding detection algorithms are computationally intensive, resource-intensive, and time-consuming, making it difficult to complete real-time detection and output results in a short time, thus failing to meet the needs of high-throughput production.
By acquiring the image to be tested, the wire outline of the coil is determined and divided into caliper lines along a preset angle direction. The length and number of caliper lines between adjacent wire segments are judged to be qualified. A simplified calculation method is used to judge whether the winding is loose.
It improves detection efficiency, saves computing resources, is suitable for high-throughput scenarios, enhances the reliability and stability of detection results, and avoids false detections caused by image noise and foreign object interference.
Smart Images

Figure CN115775244B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semiconductor processing technology, and more specifically to a method for detecting coil windings, a device for detecting coil windings, an electronic device, and a storage medium. Background Technology
[0002] Typically, after electronic devices (hereinafter referred to as "devices") are manufactured, they need to undergo defect detection before leaving the factory to eliminate devices with quality defects. Defect detection of devices generally requires the use of specialized testing equipment. With the continuous development of technology, the structural complexity of various devices and the production capacity of devices are also constantly increasing, which correspondingly places higher demands on device testing equipment.
[0003] Machine vision is a rapidly developing sunrise industry, and visual inspection equipment has been widely used in various fields and production processes of manufacturing. Visual inspection equipment uses cameras to capture images of components and then uses visual inspection algorithms to analyze and process these images to determine the quality of the components.
[0004] Inductors are typically manufactured with various defects, one of the more common being loose winding (loose winding is considered a defect if the spacing between adjacent conductors is too large). To inspect the quality of inductors, visual inspection equipment usually needs to be equipped with image processing algorithms capable of detecting loose winding.
[0005] In many current production testing scenarios, there are high requirements for the speed (throughput) of device inspection, and the sorting and unloading of good and defective products must be carried out immediately after inspection. This requires algorithms to complete the detection of device assembly gaps in an image within a very short time, so as to determine whether the devices are good or defective before unloading, and thus place the devices in the correct bins during unloading. Although existing image processing algorithms are capable of detecting loose wires, these existing algorithms often require edge detection, connected component (Blob) analysis, or the identification of specific objects such as wires. Both edge detection and object recognition algorithms have problems such as high computational load, high resource consumption, long processing time, or complex parameter tuning, which are not suitable for scenarios that require real-time detection and quick completion of calculations and output of results. Summary of the Invention
[0006] The present invention was proposed in view of the above-mentioned problems. The present invention provides a method for detecting coil winding, a device for detecting coil winding, an electronic device, and a storage medium.
[0007] According to one aspect of the present invention, a method for detecting coil winding is provided, comprising: acquiring a test image, the test image including a coil wound by at least one conductor along a predetermined direction; determining conductor profiles of multiple conductor segments of the coil based on the test image; determining at least one sampling line along a direction forming a preset angle with the predetermined direction, wherein, along the extension direction of the sampling line, the conductor profiles of the multiple conductor segments divide each sampling line into multiple caliper lines, the preset angle being less than or equal to a preset angle threshold; determining whether the coil winding is qualified based on the length of the caliper lines between the conductor profiles of every two adjacent conductor segments in a target conductor segment, wherein the target conductor segment is at least a portion of the multiple conductor segments.
[0008] For example, multiple sampling lines are defined along a direction at a preset angle to a predetermined direction. The winding of the coil is judged to be qualified based on the length of the caliper line between the conductor contours of any two adjacent conductor segments in the target conductor segment. This includes: for any two adjacent conductor segments in the target conductor segment, identifying a specific caliper line that meets a preset requirement among all the caliper lines between the conductor contours of the two adjacent conductor segments, wherein the preset requirement includes: the length of the caliper line exceeds a preset length threshold; judging whether the distance between the two adjacent conductor segments is qualified based on the number of specific caliper lines, obtaining a qualified judgment result corresponding to the two adjacent conductor segments; and determining whether the winding of the coil is qualified based on the qualified judgment result corresponding to each two adjacent conductor segments in the target conductor segment.
[0009] For example, the preset requirement also includes that the caliper lines are continuous with each other in a direction perpendicular to the sampling lines.
[0010] For example, determining whether the distance between two adjacent conductor segments is acceptable based on the number of specific caliper lines includes: if the number of specific caliper lines is greater than a preset quantity threshold, then determining that the distance between the two adjacent conductor segments is unacceptable; if the number of specific caliper lines is less than or equal to the preset quantity threshold, then determining that the distance between the two adjacent conductor segments is acceptable.
[0011] For example, determining the wire contours of multiple wire segments of a coil based on a test image includes: determining a target region based on the test image, the target region containing at least one wire and a background; performing image segmentation on the target region to obtain a test winding region with the background removed; and determining the wire contours of multiple wire segments based on the test winding region.
[0012] For example, determining a target region based on a test image includes: acquiring a template image, on which a region of interest is marked to indicate the location of a wire on a coil; determining a second identifier feature in the test image that matches the first identifier feature based on a first identifier feature in the template image; determining a positional offset between the image position of the first identifier feature in the template image and the image position of the second identifier feature in the test image; adjusting the position of the region of interest in the template image according to the positional offset; and determining the region in the test image corresponding to the adjusted region of interest as the target region.
[0013] For example, image segmentation of the target region to obtain the test winding region with background removed includes: segmenting and extracting the initial winding region within the target region using a dynamic thresholding method; and performing a morphological closing operation on the initial winding region in a direction perpendicular to a predetermined direction to obtain the test winding region.
[0014] For example, determining the conductor profiles of multiple conductor segments based on the winding region to be tested includes: performing a morphological opening operation on the winding region to be tested in a direction perpendicular to a predetermined direction to divide the winding region to be tested into multiple independent conductor regions, each conductor region corresponding to a conductor segment; and determining the conductor profiles of multiple conductor segments based on the multiple conductor regions.
[0015] For example, determining the conductor contours of multiple conductor segments based on multiple conductor regions includes: extracting and trimming the skeletons of the multiple conductor regions respectively to obtain the skeletons of the multiple conductor segments as their respective conductor contours.
[0016] For example, before determining whether the coil winding is qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment, the method further includes: obtaining region images corresponding to the first color channel and the second color channel respectively based on the target region; subtracting the grayscale values of the region image corresponding to the first color channel and the region image corresponding to the second color channel to obtain an initial difference image; extracting the background region by binarizing the initial difference image; removing the background region from the target region to obtain the foreground winding region; and determining the target wire segment based on the foreground winding region.
[0017] For example, determining the target conductor segment based on the foreground winding region includes: determining a specific contour position with a depression depth greater than a preset depression threshold from the contour of the foreground winding region; deleting the conductor segment corresponding to the specific contour position from multiple conductor segments to obtain the target conductor segment.
[0018] For example, the preset angle threshold is equal to 0.
[0019] According to another aspect of the present invention, a coil winding detection device is also provided, comprising: an acquisition module for acquiring a test image, the test image including a coil formed by winding at least one conductor along a predetermined direction; a first determination module for determining conductor profiles of multiple conductor segments of the coil based on the test image; a second determination module for determining at least one sampling line along a direction forming a preset angle with the predetermined direction, wherein, along the extension direction of the sampling line, the conductor profiles of the multiple conductor segments divide each sampling line into multiple caliper lines, the preset angle being less than a preset angle threshold; and a judgment module for judging whether the coil winding is qualified based on the length of the caliper line between the conductor profiles of every two adjacent conductor segments in the target conductor segment, wherein the target conductor segment is at least a portion of the multiple conductor segments.
[0020] According to another aspect of the present invention, an electronic device is also provided, characterized in that it includes a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement the above-described coil winding detection method.
[0021] According to another aspect of the present invention, a storage medium is also provided, characterized in that it stores a computer program / instructions, which, when executed by a processor, implement the above-described coil winding detection method.
[0022] According to embodiments of the present invention, the coil winding detection method, coil winding detection device, electronic device, and storage medium divide the horizontal sampling line by the conductor contour to obtain caliper lines and determine whether the distance between the conductors is qualified. This scheme does not employ complex calculation methods, so the calculation efficiency is very high, which can effectively save computing resources and thus can be applied to scenarios with high throughput requirements.
[0023] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0024] The above and other objects, features, and advantages of the present invention will become more apparent from the more detailed description of the embodiments of the invention in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.
[0025] Figure 1 A schematic flowchart of a coil winding detection method according to an embodiment of the present invention is shown;
[0026] Figure 2 An example of a test image including a coil is shown according to an embodiment of the present invention;
[0027] Figure 3 A schematic diagram of multiple sampling lines according to an embodiment of the present invention is shown;
[0028] Figure 4 A schematic diagram of caliper lines according to an embodiment of the present invention is shown;
[0029] Figure 5 A schematic diagram of a conductor profile according to an embodiment of the present invention is shown;
[0030] Figure 6 A schematic diagram of a binarized image obtained by binarizing an initial difference image according to an embodiment of the present invention is shown;
[0031] Figure 7 A schematic block diagram of a coil winding detection device according to an embodiment of the present invention is shown; and
[0032] Figure 8 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described herein, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of the present invention.
[0034] To at least partially solve the above problems, embodiments of the present invention provide a method for detecting coil windings. Figure 1 A schematic flowchart of a coil winding detection method 100 according to an embodiment of the present invention is shown. Figure 1 As shown, the method 100 may include the following steps: S110, S120, S130, and S140.
[0035] Step S110: Obtain the image to be tested, which contains a coil formed by at least one wire wound in a predetermined direction.
[0036] For example, the image to be tested can be any image containing a coil, which is formed by winding at least one wire in a predetermined direction. The predetermined direction can be understood as the direction of extension of the winding axis around which the at least one wire is wound. For example, the coil may include at least one wire and an insulating pipe, with the at least one wire wound around the insulating pipe, and the winding axis being the central axis of the insulating pipe. The image to be tested can be a still image or any video frame in a dynamic video. The image to be tested can be the original image captured by the image acquisition device, or an image obtained after preprocessing (such as digitization, normalization, smoothing, etc.) the original image captured by the image acquisition device. It is understood that preprocessing the original image may include the operation of extracting a sub-image containing the coil from the original image captured by the image acquisition device to obtain the image to be tested.
[0037] Step S120: Based on the image to be tested, determine the wire profiles of multiple wire segments of the coil.
[0038] Based on the image to be tested, the individual conductor profiles of multiple conductor segments can be determined. For example, the conductor profile of each conductor segment can be the skeleton or envelope of that conductor segment, etc.
[0039] For example, since the coil's wire is wound turn by turn on an insulating conduit, each turn contains a portion of the wire, such as a wire knot. Whether the coil's winding is loose can be determined by examining the spacing between the two wire knots corresponding to adjacent turns. Figure 2 An example of a test image including a coil is shown according to an embodiment of the present invention. See also Figure 2 Therefore, for each turn of the coil, what is displayed on the image under test is at least a portion of the conductor joint corresponding to that turn. For ease of description, this article refers to at least a portion of the conductor joint as a conductor segment. Typically, for each turn, the conductor segment displayed on the image under test is the conductor segment located on the front side of the coil, while the conductor segment on the back side is not visible (see [link to image]). Figure 2 (As shown). However, the present invention is not limited to this case. For example, an image containing a complete conductor segment of each turn of the coil (i.e., containing both the front and back conductor segments) can be obtained by means of image stitching, etc. In this case, the conductor outline of each turn of conductor segment (which is a complete conductor segment at this time) can also be determined by step S120.
[0040] Step S130: Determine at least one sampling line along a direction that forms a preset angle with the predetermined direction. Along the extension direction of the sampling line, the wire outlines of multiple wire segments divide each sampling line into multiple caliper lines, and the preset angle is less than or equal to a preset angle threshold.
[0041] In one embodiment, the predetermined direction is represented as a horizontal direction in the image under test. In this case, one or more sampling lines can be determined on the image under test along a direction at a preset angle to the horizontal direction. However, the above is only an example; based on changes in the relative position of the image acquisition device and the coil, the predetermined direction may also be represented as other directions in the image under test, such as a vertical direction. One or more sampling lines can extend along a direction at a preset angle to the predetermined direction, with different sampling lines parallel to each other. The preset angle is less than or equal to a preset angle threshold. The preset angle threshold can be set to any suitable threshold as needed. For example, the preset angle threshold can be any angle within the range of [0, 90) degrees. More preferably, the preset angle threshold can be any angle within the range of [0, 45] degrees. For example, the preset angle threshold can be 0 degrees, 5 degrees, 10 degrees, 20 degrees, 45 degrees, etc. When the preset angle threshold is 0 degrees, the preset angle is also equal to 0 degrees. This situation means that at least one sampling line is determined along a direction parallel to the predetermined direction. The smaller the angle between the extension direction of the sampling line and the predetermined direction, the higher the accuracy of judging whether the winding is qualified by the length of the caliper line.
[0042] Along the extension direction of each sampling line, the conductor profile of multiple conductor segments can divide each sampling line into multiple caliper lines. Figure 3 A schematic diagram of multiple sampling lines according to an embodiment of the present invention is shown. Figure 3 The image shows multiple sampling lines 310. Figure 4 A schematic diagram of caliper lines according to an embodiment of the present invention is shown. Figure 4 This illustrates caliper lines 410 formed by multiple sampling lines between the conductor profiles of partially adjacent conductor segments. See also... Figure 3 and Figure 4 It can be seen that the outline of multiple conductor segments can divide each sampling line into multiple caliper lines.
[0043] Step S140: Determine whether the coil winding is qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment. The target wire segment is at least a portion of the multiple wire segments.
[0044] In one embodiment, all conductor segments from a plurality of conductor segments can be considered as target conductor segments, and the winding qualification is determined based on the length of the caliper line between the conductor outlines of every two adjacent conductor segments. In another embodiment, a portion of the conductor segments from a plurality of conductor segments can be considered as target conductor segments, and the winding qualification is determined based on the length of the caliper line between the conductor outlines of every two adjacent conductor segments in this portion of conductor segments. For the latter embodiment, exemplarily and not limitingly, the target conductor segments can be obtained by excluding some conductor segments that are considered interference from the plurality of conductor segments, thus obtaining the remaining conductor segments as target conductor segments. For example, if only a portion of the conductor segments near the edge of the image under test is displayed due to limitations in the acquisition angle of the image under test, the conductor segments near the edge of the image under test can be excluded. As another example, if the coil conductors may be wound in more than one layer, and the detected plurality of conductor segments include the bottom layer conductor segments, the bottom layer conductor segments can be excluded. It is understood that if no interference information is included, then all the conductor segments in the image under test can be considered as target conductor segments. The quality of the coil winding can be determined based on the length of the caliper line between any two adjacent conductor segments in the obtained target conductor segment. The length of the caliper line between any two adjacent conductor segments represents the distance between these two conductor segments. For example, for any two adjacent conductor segments, it can be determined whether the length of each caliper line between them is greater than a preset length threshold, and the caliper lines with lengths greater than the preset length threshold can be counted. If the number of caliper lines with lengths greater than the preset length threshold is greater than a preset number threshold, then the coil winding is considered loose, i.e., unqualified. Conversely, if the number of caliper lines with lengths greater than the preset length threshold is less than or equal to the preset number threshold, then the coil winding is considered qualified. Of course, the judgment criteria used in step S140 are not limited to the above example; other schemes can also be used, which will be described below.
[0045] According to the coil winding detection method of this invention, a caliper line is obtained by dividing a horizontal sampling line through the conductor contour, and the distance between conductor segments is determined by the caliper line to determine whether the distance is within acceptable limits, thereby determining whether the coil winding is qualified. This scheme does not employ complex calculation methods, thus achieving high computational efficiency and effectively saving computational resources, making it suitable for high-throughput scenarios. Furthermore, determining the distance between conductor segments using the caliper line obtained by sampling line segmentation is an interval sampling method, which further reduces computational load and improves detection efficiency.
[0046] For example, multiple sampling lines are defined along a direction at a preset angle to a predetermined direction. Determining whether the coil winding is qualified based on the length of the caliper line between the wire profiles of every two adjacent wire segments in the target wire segment can include: for any two adjacent wire segments in the target wire segment, identifying a specific caliper line that meets a preset requirement among all the caliper lines between the wire profiles of the two adjacent wire segments, wherein the preset requirement may include: the length of the caliper line exceeds a preset length threshold; determining whether the distance between the two adjacent wire segments is qualified based on the number of specific caliper lines, obtaining a qualification judgment result corresponding to the two adjacent wire segments; and determining whether the coil winding is qualified based on the qualification judgment result corresponding to every two adjacent wire segments in the target wire segment.
[0047] In one embodiment, for any two adjacent conductor segments in the target conductor segment, multiple caliper lines exist between the conductor profiles of these two adjacent conductor segments. For all caliper lines among the multiple caliper lines, a specific caliper line that meets a preset requirement can be identified. The preset requirement can be a requirement set by the user according to their expectations. For example, the preset requirement can be that the length of the caliper line exceeds a preset length threshold. Of course, in addition to the length of the caliper line exceeding the preset length threshold, other limiting conditions can be further set as preset requirements. The preset length threshold can be any length greater than 0 set by the user. For example, the preset length threshold can be a length within the range of [0.05, 0.2] mm. For example, the preset length threshold can be equal to 0.05 mm, 0.1 mm, 0.15 mm, 0.2 mm, etc. Each caliper line can be sequentially determined to exceed the preset length threshold, and caliper lines exceeding the preset length threshold (e.g., 0.05 mm) (e.g., three caliper lines exceeding 0.05 mm) can be identified as specific caliper lines.
[0048] Based on the determined number of specific caliper lines, it can be determined whether the distance between two adjacent conductors is acceptable. Using the above method, the distance between each pair of adjacent conductor segments can be sequentially determined to be acceptable, yielding the corresponding acceptable result. If the acceptable result indicates that the distance between every two adjacent conductor segments in the target conductor segment is acceptable, then the coil winding is acceptable. If the acceptable result indicates that one or more pairs of adjacent conductor segments in the target conductor segment are unacceptable, then the coil winding is unacceptable. Of course, the above method of determining whether the winding is acceptable based on the acceptable result is only an example; other methods can be used, as illustrated below. For example, the number of pairs of adjacent conductor segments with acceptable results can be counted. If the count exceeds a preset logarithmic threshold, or if the proportion of the count in the total number of pairs in the target conductor segment (i.e., the number of pairs obtained by combining every two adjacent conductor segments in the target conductor segment) exceeds a preset proportion threshold, then the coil winding is acceptable. Conversely, if the logarithm obtained by statistics does not exceed the preset logarithm threshold, or if the proportion of the logarithm obtained by statistics in the total logarithm of the target conductor segment does not exceed the preset proportion threshold, then the winding of the coil can be determined to be unqualified.
[0049] According to the above technical solution, the distance between any two adjacent wires is determined by counting the number of specific caliper lines that meet preset requirements, thereby determining whether the coil winding is qualified. This method combines both length and quantity standards to determine whether the winding is qualified. Compared with judging solely based on length, this approach can effectively avoid false detections caused by excessively large local spacing due to image noise or foreign object interference in the image under test, thus effectively improving the reliability and stability of the winding detection results.
[0050] For example, the preset requirement may also include: the caliper lines are continuous with each other in a direction perpendicular to the sampling lines.
[0051] As described above, in addition to the caliper lines exceeding a preset length threshold, other limiting conditions can be further set as preset requirements. In one embodiment, the preset requirement can be set as follows: the length of the caliper lines exceeds the preset length threshold, and they are continuously distributed along a direction perpendicular to the sampling line. For caliper lines that meet the above conditions, they can be counted as specific caliper lines, and it can be determined whether their number exceeds a preset quantity threshold.
[0052] According to the above technical solution, the caliper lines are continuous along a direction perpendicular to the sampling line. Only when the number of continuous caliper lines exceeding a preset length threshold exceeds a preset quantity threshold will the distance between two adjacent conductor segments be considered unqualified. Therefore, this solution can further improve the anti-interference capability of the detection method 100 and further improve the reliability and stability of the winding detection results.
[0053] For example, determining whether the distance between two adjacent conductor segments is acceptable based on the number of specific caliper lines includes: if the number of specific caliper lines is greater than a preset quantity threshold, then determining that the distance between the two adjacent conductor segments is unacceptable; if the number of specific caliper lines is less than or equal to the preset quantity threshold, then determining that the distance between the two adjacent conductor segments is acceptable.
[0054] In one embodiment, a user can set a preset quantity threshold as needed to determine whether the distance between any two adjacent conductor segments is acceptable. The preset quantity threshold can be any integer greater than 0. For example, the preset quantity threshold can be a value in the range [1, 20]. Preferably, the preset quantity threshold can be a value in the range [3, 10]. For example, the preset quantity threshold can be equal to 3, 5, 8, 10, etc. For any two adjacent conductor segments, if the number of a specific caliper line is greater than the preset quantity threshold of 3, for example, if the number of a specific caliper line is 5, then the distance between the two adjacent conductor segments can be determined to be unacceptable. For any two adjacent conductor segments, if the number of a specific caliper line is less than or equal to the preset quantity threshold of 3, for example, if the number of a specific caliper line is 1, then the distance between the two adjacent conductor segments can be determined to be acceptable.
[0055] According to the above technical solution, by determining whether the number of specific caliper lines between any two adjacent conductor segments is greater than a preset threshold, it can be determined whether the distance between the two adjacent conductor segments is qualified. This method is relatively simple and efficient.
[0056] For example, determining the wire outlines of multiple wire segments of a coil based on the image to be tested (step S120) may include: determining a target region based on the image to be tested, the target region containing at least one wire and a background; performing image segmentation on the target region to obtain a winding region to be tested with the background removed; and determining the wire outlines of multiple wire segments based on the winding region to be tested.
[0057] In one embodiment, a target region can be determined based on the obtained image to be tested. The target region may contain at least one wire and a background. For the obtained target region, image segmentation methods based on thresholds, such as minimum error method, maximum entropy method, etc., can be used to segment the target region. In addition, edge-based segmentation methods, such as Robert operator, Prewitt operator, Sobel operator, Laplacian operator, Canny operator, etc., can also be used to segment the target region. After image segmentation, a test winding region without background can be obtained. Based on the obtained test winding region, the wire contours of multiple wire segments in the test winding region can be determined by manual annotation or by automatic annotation by the device (e.g., computer system) used to perform the coil winding detection method 100.
[0058] According to the above technical solution, the target region in the image to be tested is segmented to determine the winding region to be tested. Then, the wire outlines of multiple wire segments are determined based on the winding region to be tested. This image segmentation method is relatively mature, therefore it is low-cost and easy to implement. Furthermore, determining the wire outlines of multiple wire segments based on the winding region to be tested obtained after image segmentation can effectively eliminate background interference, thus resulting in greater accuracy.
[0059] For example, determining a target region based on a test image includes: acquiring a template image, on which a region of interest is marked to indicate the location of a wire on a coil; determining a second identifier feature in the test image that matches the first identifier feature based on a first identifier feature in the template image; determining a positional offset between the image position of the first identifier feature in the template image and the image position of the second identifier feature in the test image; adjusting the position of the region of interest in the template image according to the positional offset; and determining the region in the test image corresponding to the adjusted region of interest as the target region.
[0060] In one embodiment, the method of acquiring the template image is similar to step S110, and will not be repeated here for brevity. The template image and the image to be tested have the same image size. The template image is pre-marked with a Region of Interest (ROI) to indicate the location of the wires on the coil. The position of the wire in the template image and its position in the image to be tested may be offset, that is, they may not be perfectly aligned. In order to accurately determine the target area corresponding to the ROI, the offset between the wire in the template image and the wire in the image to be tested can be optionally determined, and the ROI can be adjusted based on the offset. For example, the template image may contain a first identification feature. Based on the first identification feature in the template image, a second identification feature matching the first identification feature can be determined in the image to be tested. The first identification feature and the second identification feature may be the same feature on both the template image and the image to be tested, such as two wire segments of the coil that are not wrapped around the insulating pipe. These two wire segments belong to the beginning and end of the wire and are used to extend out and connect with other circuit elements. Since the test image and the template image are the same size, the positional offset between the first identifier feature in the template image and the second identifier feature in the test image can be determined based on the pixel positions in both images. Based on this offset, the position of the region of interest (ROI) in the template image can be adjusted so that it covers the corresponding region in the test image. The region in the test image corresponding to the adjusted ROI is then defined as the target region. This adjustment of the ROI based on the offset to determine the target region is optional; the target region can also be determined directly based on the initial, unadjusted ROI when necessary.
[0061] According to the above technical solution, the target region in the test image corresponding to the region of interest on the template image is determined. This method determines the target region relatively accurately, and the technology is relatively mature, thus offering low cost and high efficiency.
[0062] For example, image segmentation of the target region to obtain the test winding region with background removed includes: segmenting and extracting the initial winding region within the target region using a dynamic thresholding method; and performing a morphological closing operation on the initial winding region in a direction perpendicular to a predetermined direction to obtain the test winding region.
[0063] In one embodiment, based on the obtained target region, an initial winding region can be extracted by segmenting within the target region using a dynamic thresholding method. For example, based on the position and grayscale features of each pixel in the target region, a corresponding grayscale threshold can be set for different pixels or pixel regions. Then, the grayscale value of each pixel in the target region is compared with its corresponding grayscale threshold, and the region to which the pixel with a grayscale value greater than the threshold belongs is retained as the initial winding region. Because the conductor itself is affected by its own pose and shape during imaging, the imaging is not very stable, manifested as uneven grayscale, uneven brightness distribution, and large fluctuations in color values, making it difficult to perform image segmentation with a fixed threshold using only color component values. Dynamic thresholding segmentation can effectively resist the influence of imaging differences, thereby stably extracting the initial conductor region. After determining the initial winding region, a morphological closing operation can be performed on the initial winding region in a direction perpendicular to the predetermined direction described herein to obtain the winding region to be tested.
[0064] According to the above technical solution, the initial winding region is extracted by segmentation using a dynamic thresholding method within the target area. This segmentation method can effectively resist the influence of imaging differences in the image under test, thus ensuring stable extraction of the initial winding region and laying a necessary foundation for subsequent detection of the coil winding's quality. Performing morphological closing operations on the initial winding region in a direction perpendicular to the predetermined direction can eliminate the influence of foreign objects on the conductor or poor reflectivity, thereby obtaining a more accurate winding region to be tested.
[0065] For example, determining the conductor profiles of multiple conductor segments based on the winding region to be tested includes: performing a morphological opening operation on the winding region to be tested in a direction perpendicular to a predetermined direction to divide the winding region to be tested into multiple independent conductor regions, each conductor region corresponding to a conductor segment; and determining the conductor profiles of multiple conductor segments based on the multiple conductor regions.
[0066] In one embodiment, a morphological opening operation is performed on the winding region to be tested in a direction perpendicular to a predetermined direction, which can divide the winding region into individual conductor regions. Each conductor region corresponds to a conductor segment. Based on multiple conductor regions, the conductor contours of multiple conductor segments can be determined for each conductor region using methods such as skeleton extraction. Figure 5 A schematic diagram of a conductor profile according to an embodiment of the present invention is shown. Figure 5 In the diagram, the broken line indicated by the white arrow represents the outline of two of the multiple conductor segments. The outlines of the other conductor segments can be understood based on this.
[0067] According to the above technical solution, performing morphological opening operations on the area to be tested in a direction perpendicular to the predetermined direction can eliminate the influence of wire adhesion between two adjacent wire areas, thereby ensuring the accuracy of the obtained wire profile.
[0068] For example, determining the conductor contours of multiple conductor segments based on multiple conductor regions includes: extracting and trimming the skeletons of the multiple conductor regions respectively to obtain the skeletons of the multiple conductor segments as their respective conductor contours.
[0069] In one embodiment, based on multiple conductor regions, skeleton extraction can be performed on each conductor region using methods such as fire simulation-based extraction, maximum disk-based extraction, or 3D model skeleton extraction from the Scikit-based image processing library. Optionally, some post-processing can be performed after skeleton extraction. Post-processing may include cropping (or trimming) the extracted skeleton. After skeleton extraction, some noise, such as skeleton burrs, may exist. Cropping can remove this noise. After cropping, skeletons of multiple conductor segments can be obtained, serving as the conductor contours for each segment. Using the skeletons as conductor contours, the sampling lines can be segmented to obtain caliper lines.
[0070] In this embodiment, the extracted conductor region is not directly used for spacing measurement because the conductor region is affected by factors such as wire reflection, noise, and imaging differences, which can cause variations in the diameter of the extracted conductor, thus affecting the stability of the spacing measurement. This embodiment uses the skeleton of the conductor region to characterize the conductor; regardless of changes in the extracted wire diameter, the skeleton remains unchanged. Spacing measurement based on the skeleton offers high robustness.
[0071] According to the above technical solution, extracting and trimming the skeleton separately for multiple conductor regions can further eliminate interference from conductor adhesion within these regions. Furthermore, using the skeleton as the conductor outline for caliper line division and spacing measurement exhibits high robustness.
[0072] For example, before determining whether the coil winding is qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment, the method further includes: obtaining region images corresponding to the first color channel and the second color channel respectively based on the target region; subtracting the grayscale values of the region image corresponding to the first color channel and the region image corresponding to the second color channel to obtain an initial difference image; extracting the background region by binarizing the initial difference image; removing the background region from the target region to obtain the foreground winding region; and determining the target wire segment based on the foreground winding region.
[0073] In one embodiment, the image to be tested can be an RGB image. Channel images corresponding to the R channel, G channel, and B channel can be obtained for the image to be tested. Any two of the three color channels can be selected as the first color channel and the second color channel, respectively. For example, the first color channel can be the R channel, and the second color channel can be the G channel. Based on the target region in the image to be tested, region images corresponding to the first color channel (R channel) and the second color channel (G channel) can be obtained. The region image corresponding to any color channel refers to the image obtained by extracting the image patch belonging to the target region from the channel image corresponding to that color channel. Subtracting the grayscale value of each pixel in the region image corresponding to the first color channel (R channel) from the corresponding pixel in the region image corresponding to the second color channel (G channel) yields an initial difference image. Binarizing the initial difference image allows for the extraction of the background region. Figure 6 A schematic diagram is shown of a binarized image obtained by binarizing an initial difference image according to an embodiment of the present invention. Figure 6 As shown, the white area represents the background area. Removing the background area from the target area yields the foreground wrapping area. The foreground wrapping area is... Figure 6 The black area shown is the foreground winding region. It can be understood that the foreground winding region is the area containing the conductor, and the background region is the area containing the background excluding the conductor. Based on the foreground winding region, the target conductor segment can be determined. For example, conductor segments located at the edge or in a concave position within the foreground winding region can be discarded, and the remaining conductor segments can be identified as the target conductor segment.
[0074] According to the above technical solution, region images corresponding to the first and second color channels can be obtained based on the target region to obtain an initial difference image. Further, the background region is extracted from the initial difference image to obtain the target conductor segment in the foreground winding region that does not contain the background region. Based on this method, by subtracting the corresponding region images under the two color channels, the contrast between the background region and the foreground winding region can be highlighted, thereby facilitating the determination of the target conductor segment and improving the accuracy of the determined target conductor segment.
[0075] For example, determining the target conductor segment based on the foreground winding region includes: determining a specific contour position with a depression depth greater than a preset depression threshold from the contour of the foreground winding region; deleting the conductor segment corresponding to the specific contour position from multiple conductor segments to obtain the target conductor segment.
[0076] In one embodiment, the user can preset a concavity threshold. This preset concavity threshold can represent a threshold value for the concavity depth of the concave portion. The concavity depth can represent the distance between the lowest point in the corresponding concave portion and the highest point of the edge of the concave portion. The preset concavity threshold can be set to any suitable depth value. For example, the preset concavity threshold can be in the range [0.05, 0.25] mm. For instance, the preset concavity threshold can be equal to 0.05 mm, 0.1 mm, 0.15 mm, 0.2 mm, etc. Figure 6 In the outline of the foreground region shown, if the depth H of the recessed area is greater than the preset recess threshold of 0.05mm, then that location can be identified as a specific outline location. The target guide segment can be obtained by deleting the guide segment corresponding to the specific outline location from multiple guide segments.
[0077] According to the above technical solution, by analyzing the contour edge of the foreground winding area, it is found that since the winding has multiple layers, if the inner layer wires are extracted as outer layer wires, it will affect the accuracy of the outer layer wire spacing measurement. Therefore, by filtering out the interference of the inner layer wires based on the location of the contour depression, the accuracy of detecting whether the winding of the coil is qualified can be guaranteed.
[0078] For example, the preset angle threshold can be equal to 0.
[0079] In this case, the preset angle is also equal to 0. In one embodiment, multiple sampling lines are determined along a direction at a preset angle to a predetermined direction. The preset angle can be equal to 0. This ensures that the multiple sampling lines are parallel to the winding axis of the conductor, making it simpler and more accurate to determine whether the coil winding is qualified based on the length of the caliper line between any two determined conductor segments.
[0080] According to another aspect of the present invention, a coil winding detection device is also provided. Figure 7 A schematic block diagram of a coil winding detection device 700 according to an embodiment of the present invention is shown. Figure 7 As shown, the device 700 may include an acquisition module 710, a first determination module 720, a second determination module 730, and a judgment module 740.
[0081] The acquisition module 710 is used to acquire a test image, which contains a coil formed by winding at least one wire in a predetermined direction.
[0082] The first determining module 720 is used to determine the wire profiles of multiple wire segments of a coil based on the image to be tested.
[0083] The second determining module 730 is used to determine at least one sampling line along a direction that forms a preset angle with a predetermined direction, wherein, along the extension direction of the sampling line, the wire outlines of multiple wire segments divide each sampling line into multiple caliper lines, and the preset angle is less than or equal to a preset angle threshold.
[0084] The judgment module 740 is used to determine whether the winding of the coil is qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment. The target wire segment is at least a portion of the multiple wire segments.
[0085] For example, the sampling lines determined along a direction at a preset angle to the predetermined direction are multiple. The judgment module 740 includes: a first determination submodule, used to determine, for any two adjacent conductor segments in the target conductor segment, a specific caliper line that meets a preset requirement among all caliper lines between the conductor contours of the two adjacent conductor segments, wherein the preset requirement includes: the length of the caliper line exceeds a preset length threshold; a judgment submodule, used to determine, for any two adjacent conductor segments in the target conductor segment, whether the distance between the two adjacent conductor segments is qualified based on the number of specific caliper lines, and obtain a qualified judgment result corresponding to the two adjacent conductor segments; and a second determination submodule, used to determine whether the winding of the coil is qualified based on the qualified judgment result corresponding to each pair of adjacent conductor segments in the target conductor segment.
[0086] For example, the preset requirement also includes that the caliper lines are continuous with each other in a direction perpendicular to the sampling lines.
[0087] For example, the determination submodule includes: a first determining unit, used to determine that the distance between any two adjacent conductor segments is unqualified if the number of specific caliper lines is greater than a preset quantity threshold for any two adjacent conductor segments in the target conductor segment; and a second determining unit, used to determine that the distance between any two adjacent conductor segments is qualified if the number of specific caliper lines is less than or equal to a preset quantity threshold for any two adjacent conductor segments in the target conductor segment.
[0088] For example, the first determining module 720 includes: a third determining submodule, used to determine a target region based on the image to be tested, the target region containing at least one wire and a background; a segmentation submodule, used to perform image segmentation on the target region to obtain a wire-wound region to be tested with the background removed; and a fourth determining submodule, used to determine the wire outlines of multiple wire segments based on the wire-wound region to be tested.
[0089] For example, the third determining submodule includes: an acquisition unit for acquiring a template image, on which a region of interest is marked to indicate the location of the wire on the coil; a third determining unit for determining a second identifier feature in the image to be tested that matches the first identifier feature based on the first identifier feature in the template image; a fourth determining unit for determining the positional offset between the image position of the first identifier feature in the template image and the image position of the second identifier feature in the image to be tested; an adjustment unit for adjusting the position of the region of interest in the template image according to the positional offset; and a fifth determining unit for determining the region in the image to be tested that corresponds to the adjusted region of interest as the target region.
[0090] For example, the segmentation submodule includes: a segmentation unit, used to segment and extract the initial winding region within the target region using a dynamic threshold method; and a closing operation unit, used to perform a morphological closing operation on the initial winding region in a direction perpendicular to a predetermined direction to obtain the winding region to be tested.
[0091] For example, the fourth determining submodule includes: an opening operation unit, used to perform a morphological opening operation on the winding region to be tested in a direction perpendicular to a predetermined direction, so as to divide the winding region to be tested into multiple independent conductor regions, each conductor region corresponding to a conductor segment; and a sixth determining unit, used to determine the conductor profile of multiple conductor segments based on multiple conductor regions.
[0092] For example, the sixth determining unit includes a skeleton extraction and trimming subunit, used to extract and trim the skeletons of multiple conductor regions respectively, to obtain the skeletons of multiple conductor segments as their respective conductor outlines.
[0093] For example, the device 700 further includes: an acquisition module, configured to acquire region images corresponding to the first color channel and the second color channel respectively based on the target region before the judgment module 740 determines whether the winding of the coil is qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment; a grayscale subtraction module, configured to subtract the grayscale values of the region image corresponding to the first color channel and the region image corresponding to the second color channel to obtain an initial difference image; a binarization module, configured to extract the background region by binarizing the initial difference image; remove the background region from the target region to obtain the foreground winding region; and a third determination module, configured to determine the target wire segment based on the foreground winding region.
[0094] For example, the third determining module includes: a fifth determining submodule, used to determine a specific contour position from the contour of the foreground winding region where the depression depth is greater than a preset depression threshold; and a deletion submodule, used to delete the wire segment corresponding to the specific contour position from multiple wire segments to obtain the target wire segment.
[0095] For example, the preset angle threshold is equal to 0.
[0096] According to another aspect of the present invention, an electronic device is also provided. Figure 8 A schematic block diagram of an electronic device 800 according to an embodiment of the present invention is shown. Figure 8 As shown, the electronic device 800 includes a processor 810 and a memory 820. The memory 820 stores computer program instructions, which are executed by the processor 810 to perform the aforementioned coil winding detection method 100.
[0097] According to another aspect of the present invention, a storage medium is also provided. A computer program / instructions are stored on the storage medium, which, when executed, performs the coil winding detection method 100 as described above. The storage medium may, for example, include a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.
[0098] Those skilled in the art can understand the specific implementation schemes of the above-mentioned coil winding detection device, electronic equipment and storage medium by reading the relevant description of the coil winding detection method. For the sake of brevity, they will not be described in detail here.
[0099] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of the invention. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of the invention. All such changes and modifications are intended to be included within the scope of the invention as claimed in the appended claims.
[0100] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0101] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.
[0102] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0103] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of the invention. However, this approach should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with fewer features than all of those in a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0104] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0105] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0106] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the coil winding detection device according to embodiments of the present invention. The present invention can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0107] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0108] The above description is merely a specific embodiment of the present invention or an explanation of that embodiment. The scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting coil winding, characterized in that, include: Acquire a test image, wherein the test image contains a coil formed by winding at least one wire in a predetermined direction; Based on the image to be tested, the wire outlines of multiple wire segments of the coil are determined; At least one sampling line is determined along a direction that forms a preset angle with the predetermined direction. Along the extension direction of the sampling line, the wire profiles of the multiple wire segments divide each sampling line into multiple caliper lines. The preset angle is less than or equal to a preset angle threshold. Different sampling lines are parallel to each other. There is at least one caliper line between the wire profiles of each two adjacent wire segments that corresponds one-to-one with at least one sampling line. The winding of the coil is deemed qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment. The target wire segment is at least a portion of the multiple wire segments. The length of the caliper line between the wire outlines of every two adjacent wire segments is used to represent the distance between the wire outlines of the two adjacent wire segments. The sampling lines, defined along a direction at a preset angle to the predetermined direction, are multiple. The step of determining whether the coil winding is qualified based on the length of the caliper line between the wire profiles of every two adjacent wire segments in the target wire segment includes: For any two adjacent conductor segments in the target conductor segment Among all the caliper lines between the conductor profiles of the two adjacent conductor segments, a specific caliper line that meets the preset requirements is identified, wherein the preset requirements include: the length of the caliper line exceeds a preset length threshold. Based on the number of the specific caliper lines, determine whether the distance between the two adjacent conductor segments is qualified, and obtain the qualified judgment result corresponding to the two adjacent conductor segments; Based on the pass / fail judgment results corresponding to each two adjacent conductor segments in the target conductor segment, it is determined whether the winding of the coil is qualified.
2. The method as described in claim 1, wherein, The preset requirements also include: the caliper lines are continuous with each other in a direction perpendicular to the sampling lines.
3. The method as described in claim 1, wherein, The determination of whether the distance between two adjacent conductor segments is acceptable based on the number of the specific caliper lines includes: If the number of the specific caliper lines is greater than a preset threshold, then the distance between the two adjacent conductor segments is determined to be unqualified. If the number of the specific caliper lines is less than or equal to the preset number threshold, then the distance between the two adjacent conductor segments is determined to be acceptable.
4. The method according to any one of claims 1-3, wherein, The step of determining the wire outlines of multiple wire segments of the coil based on the image to be tested includes: A target region is determined based on the image to be tested, the target region including the at least one wire and the background; The target region is segmented to obtain the test winding region after removing the background; Based on the winding region to be tested, the conductor profiles of the multiple conductor segments are determined.
5. The method of claim 4, wherein, The step of determining the target region based on the image to be tested includes: Obtain a template image, on which a region of interest is marked to indicate the location of the wires on the coil; Based on the first identification feature in the template image, a second identification feature matching the first identification feature is determined in the image to be tested; Determine the positional offset between the image position of the first identification feature in the template image and the image position of the second identification feature in the image to be tested; Adjust the position of the region of interest on the template image according to the position offset; The region on the image to be tested that corresponds to the adjusted region of interest is determined as the target region.
6. The method of claim 4, wherein, The step of performing image segmentation on the target region to obtain the test winding region after removing the background includes: Within the target area, the initial winding region is extracted by segmentation using a dynamic threshold method; A morphological closing operation is performed on the initial winding region in a direction perpendicular to the predetermined direction to obtain the winding region to be tested.
7. The method of claim 4, wherein, Determining the conductor profiles of the multiple conductor segments based on the winding region to be tested includes: A morphological opening operation is performed on the winding region to be tested in a direction perpendicular to the predetermined direction to divide the winding region to be tested into multiple independent conductor regions, each conductor region corresponding to a conductor segment. The conductor profiles of the multiple conductor segments are determined based on the multiple conductor regions.
8. The method of claim 7, wherein, Determining the conductor profile of the multiple conductor segments based on the multiple conductor regions includes: The skeletons of the multiple conductor regions are extracted and trimmed to obtain the skeletons of the multiple conductor segments as their respective conductor outlines.
9. The method of claim 4, wherein, Before determining whether the coil winding is qualified based on the length of the caliper line between every two adjacent conductor segments in the target conductor segment, the method further includes: Based on the target region, obtain the region images corresponding to the first color channel and the second color channel, respectively; Subtract the grayscale values of the region image corresponding to the first color channel from those of the region image corresponding to the second color channel to obtain an initial difference image; The background region is extracted by binarizing the initial difference image; Remove the background region from the target region to obtain the foreground wrapping region; The target conductor segment is determined based on the foreground winding region.
10. The method of claim 9, wherein, Determining the target conductor segment based on the foreground winding region includes: From the contour of the foreground winding region, determine the specific contour position where the depression depth is greater than a preset depression threshold; The target conductor segment is obtained by deleting the conductor segment corresponding to the specific contour position from the multiple conductor segments.
11. The method according to any one of claims 1-3, wherein, The preset angle threshold is equal to 0.
12. A device for detecting coil windings, characterized in that, include: An acquisition module is used to acquire an image to be tested, wherein the image to be tested contains a coil formed by at least one wire wound in a predetermined direction; The first determining module is used to determine the wire outlines of multiple wire segments of the coil based on the image to be tested; The second determining module is used to determine at least one sampling line along a direction that forms a preset angle with the predetermined direction, wherein, along the extension direction of the sampling line, the wire contours of the multiple wire segments divide each sampling line into multiple caliper lines, the preset angle is less than or equal to a preset angle threshold, different sampling lines are parallel to each other, and there is at least one caliper line between the wire contours of each two adjacent wire segments that corresponds one-to-one with at least one sampling line. The judgment module is used to determine whether the winding of the coil is qualified based on the length of the caliper line between the wire outlines of every two adjacent wire segments in the target wire segment. The target wire segment is at least a portion of the multiple wire segments. The length of the caliper line between the wire outlines of every two adjacent wire segments is used to represent the distance between the wire outlines of the two adjacent wire segments. Among them, the sampling lines determined along a direction forming a preset angle with the predetermined direction are multiple, and the judgment module is specifically used for: For any two adjacent conductor segments in the target conductor segment Among all the caliper lines between the conductor profiles of the two adjacent conductor segments, a specific caliper line that meets the preset requirements is identified, wherein the preset requirements include: the length of the caliper line exceeds a preset length threshold. Based on the number of the specific caliper lines, determine whether the distance between the two adjacent conductor segments is qualified, and obtain the qualified judgment result corresponding to the two adjacent conductor segments; Based on the pass / fail judgment results corresponding to each two adjacent conductor segments in the target conductor segment, it is determined whether the winding of the coil is qualified.
13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement the coil winding detection method as described in any one of claims 1-11.
14. A storage medium, characterized in that, The device stores a computer program / instructions that, when executed by a processor, implement the coil winding detection method as described in any one of claims 1-11.