Distribution identification method of fuse fuse based on image recognition
Through image recognition technology, the problem of gradient discontinuity and interference in melt wire edge detection is solved, the accurate assessment of melt wire uniformity is achieved, and the accuracy and uniformity analysis of melt wire detection in fuses are improved.
Patent Information
- Application Number
- CN202410954623.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-17
AI Technical Summary
When detecting melt filaments, existing gradient-based edge detection methods have discontinuous gradients due to specular reflection and environmental interference, and cannot accurately identify the edges of melt filaments, thus affecting the recognition effect of melt filament distribution uniformity.
Using a method based on image recognition, the gradient image is obtained by obtaining the image of the fuse for pre-processing, and the cumulative value of the gradient value at each angle is corrected in the spatial transformation, and the angle corresponding to the maximum corrected cumulative value is selected as the direction of the melt filament. The projection values and gradient values are used for clustering, linear fitting, and angle and distance variances are calculated to evaluate the uniformity of the melt filaments.
It improves the accuracy of melt wire edge detection, reduces noise interference, can accurately evaluate the uniformity of the melt wire, realizes accurate detection and uniformity analysis of the melt wire in the fuse, and avoids uneven distribution of the melt wire. products mixed in.
Smart Images

Figure CN118506019B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fuses, and more specifically, to a method for identifying the distribution of fuse fusible elements based on image recognition. Background Art
[0002] The main function of the fuse is to cut off the circuit by melting when the circuit is overloaded, preventing equipment damage or fire caused by excessive current. The fuse is designed to melt quickly at a specific current value to ensure that the power supply can be quickly cut off when an abnormality occurs in the circuit. It is an important part of circuit safety and can protect circuits and equipment from electrical faults.
[0003] In the related art, for example, the Chinese patent document with the invention publication number CN117710307A discloses a method, device, electronic device and storage medium for detecting welding defects of fuses. The method can determine the effective welding area in the acquired copper sheet welding image. Since most welding defects of the copper sheet are manifested as the effective welding area not meeting the requirements, the first defect detection result of the fuse can be obtained according to the determined effective welding area; through image processing, the copper sheet welding defect detection is effectively realized. However, sometimes the defect of the fuse is related to the distribution of the fusible wire on the fuse. If the distribution of the fusible wire is uneven, it will affect the performance of the fuse. However, the above patent does not detect the uniform distribution of the fusible wire.
[0004] Currently, a gradient-based edge detection method is used to detect the uniformity of the fuse wire. However, since the fuse wire is a silver-white metal with a smooth surface, mirror reflection will occur, so that other mirror images in the environment are mapped on the surface of the fuse wire, resulting in discontinuous gradients and more interference when detecting the edge of the fuse wire. This also results in poor effect of existing gradient-based edge detection, and the failure to accurately identify the edge of the fuse wire, which in turn leads to poor identification of the uniformity of the fuse wire distribution, thereby affecting the quality of the fuse wire of the fuse. Summary of the invention
[0005] The present invention provides a distribution identification method for a fuse wire based on image recognition, aiming to solve the problem that when edge detection of the fuse wire is performed in the related art, the gradient is discontinuous and there are many interferences, which leads to the poor effect of the existing gradient-based edge detection and the inability to accurately identify the edge of the fuse wire, which in turn leads to poor identification effect of the uniformity of the distribution of the fuse wire.
[0006] In a first aspect, the present invention provides a method for identifying the distribution of fuse wires based on image recognition, comprising: acquiring an image of the fuse, preprocessing the image to obtain a gradient image; performing spatial transformation on the gradient image, correcting the accumulated value of the gradient values of the pixel points at each angle in the transformed space, and selecting the angle corresponding to the maximum corrected accumulated value as the direction of the fuse wire. The formula for correcting the accumulated value is: ; In the formula, To correct the accumulated value at angle d, is the first The accumulated value of the gradient value of the pixel point that the corresponding straight line passes through in the gradient image at the distance is At angle d The ratio of the cumulative number of pixels that the corresponding straight line passes through in the gradient image at a distance to the number of pixels on the diagonal line in the gradient image. and are all hyperparameters, is the total number of all distances; obtaining a projection straight line in the direction of the melt filament, and obtaining the projection value of the coordinates corresponding to each pixel point in the gradient image on the projection straight line; clustering the projection values and the gradient values to obtain clustering results, performing linear fitting on each clustering result to obtain a fitting straight line corresponding to the melt filament; calculating the variance of the angle between each fitting straight line and the projection straight line and the sum of the variances of the distances of two adjacent intersections to obtain the uniformity of the melt filament, and detecting the melt filament according to the uniformity.
[0007] Classification and optimization of gradient information reduces the impact of noise on the edge detection of the fuse wire and improves the accuracy of the edge detection of the fuse wire. Clustering of projection values and gradient values effectively distinguishes the intervals between different fuse wires and reduces environmental interference. Then, by using linear fitting and angle calculation, the uniformity of the fuse wire can be accurately evaluated, realizing accurate detection and uniformity analysis of the fuse wire in the fuse.
[0008] In one embodiment, obtaining an image of a fuse includes: collecting a single-side image of the fuse, inputting the single-side image of the fuse into a trained fuse detection network model, outputting an image containing only the fuse, and using the image as the image of the fuse.
[0009] By training the fuse detection network model, an image containing only fuses is obtained. Using this image for processing can avoid the influence of noise and improve the accuracy of detection.
[0010] In one embodiment, an image of a fuse is acquired, and the image is preprocessed to obtain a gradient image, including: using a comprehensive gradient algorithm to process the image to obtain a gradient image.
[0011] In one embodiment, obtaining a projection line in the direction of the melt thread includes: obtaining a perpendicular direction in the direction of the melt thread as the projection direction, and obtaining the projection line according to the image origin and the projection direction.
[0012] In one embodiment, clustering the projection values and the gradient values to obtain a clustering result includes: using a dbscan algorithm to classify the projection values and the gradient values to obtain a clustering result.
[0013] Clustering is performed through projection values and gradient values, which effectively distinguishes the intervals between different melt filaments and reduces the interference of the environment on edge detection.
[0014] In one embodiment, obtaining the projection value of the coordinates corresponding to each pixel point in the gradient image on the projection line further includes: normalizing the horizontal coordinate and the vertical coordinate of the gradient image.
[0015] In one embodiment, the distance variance of two adjacent intersection points includes: obtaining the intersection points of each fitting straight line and the projected straight line, calculating the Euclidean distance value between two consecutive adjacent intersection points, and counting all Euclidean distance values to calculate the distance variance of the two adjacent intersection points.
[0016] By using linear fitting and the angle between each fitting straight line and the projection straight line for calculation, the uniformity of the fuse wire can be accurately evaluated, and the accurate detection and uniformity analysis of the fuse wire in the fuse can be achieved.
[0017] In one embodiment, the fusible wire is detected according to the uniformity, including: in response to the uniformity being greater than a preset threshold, an alarm is performed.
[0018] An alarm is triggered when the uniformity of the melt wire is greater than a preset threshold value, and the melt wire can be detected in real time to avoid mixing products with uneven melt wire distribution with products with uniform melt wire distribution, thereby improving the accuracy of detection and work efficiency.
[0019] In one embodiment, linear fitting is performed on each clustering result to obtain a fitting straight line corresponding to the melt filament, including: each clustering result corresponds to a connected domain, and linear fitting is performed on the connected domain to obtain a fitting straight line corresponding to the melt filament.
[0020] Beneficial effects: Classification is performed according to projection values and gradient values, which reduces the influence of noise on the edge detection of the fuse wire and improves the accuracy of edge detection. The uniformity of the fuse wire is calculated according to linear fitting and angle, which improves the accuracy of fuse wire detection in the fuse and the accuracy of uniformity analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0022] Figure 1 FIG. 4 is a flow chart schematically illustrating the calculation of the uniformity of a melt filament according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0024] like Figure 1 As shown, the specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings.
[0025] S101: Acquire a gradient image of a fuse.
[0026] Specifically, an image of the fuse is acquired, and the image is preprocessed to obtain a gradient image.
[0027] In one embodiment, a single-sided image of a fuse is captured by a camera device, and the single-sided image of the fuse is input into a trained fuse detection network model, and an image containing only the fuse is output, and the image is used as the image of the fuse. Specifically, training the fuse detection network model includes: collecting a training data set, and the data set acquisition process is: a person with relevant experience captures a single-sided image of the fuse, wherein when capturing the single-sided image of the fuse, the camera is used to face the single side of the fuse, and when annotating the collected single-sided image of the fuse, the pixels belonging to the fuse are marked as 1, and the background is marked as 0, and then a cross-entropy loss function is used to perform semantic segmentation network training to obtain a trained fuse detection network model.
[0028] In one embodiment, the image is preprocessed to obtain a gradient image, including: using a comprehensive gradient calculation method in image processing to obtain a gradient image B of the image of the fuse, wherein the comprehensive gradient calculation method in image processing can use a Sobel operator or other image gradient detection methods. The Sobel operator is a discrete difference operator used to calculate the gradient approximation of the image brightness function. Using this operator at any point in the image will generate a corresponding gradient vector or its normal vector. The Sobel operator not only has a good detection effect, but also has a smoothing and suppressing effect on noise.
[0029] After obtaining the gradient image, there will be a high gradient value at the obvious position of the melt filament, but due to environmental interference, the gradient corresponding to the continuous melt filament will be unstable, and a lot of gradient noise will be generated due to environmental interference, so the gradient classification method is chosen to reduce the noise in the melt filament edge acquisition result. In order to obtain the accurate melt filament edge, the gradient image is classified. However, directly classifying the gradient image will result in poor clustering effect because the length of the melt filament is greater than the interval between the melt filaments, and the gradients of the upper and lower melt filaments will be clustered together. Therefore, improvement is needed. The specific method of improvement is as follows.
[0030] S102: Determine the direction of the melt filament.
[0031] Specifically, the gradient image is spatially transformed, the accumulated value of the gradient values of the pixel points at each angle in the transformed space is corrected, and the angle corresponding to the maximum corrected accumulated value is selected as the direction of the melt wire.
[0032] In one embodiment, the gradient image is mapped to the radon space using the radon transform, wherein the radon space is a two-dimensional space, the horizontal axis is the angle value, the vertical axis is the distance value, and the data point in the space is the cumulative value of the gradient value of the pixel point passed by the corresponding straight line in the gradient image at the corresponding angle and distance value. Then, the larger the cumulative value of the data point in the radon space, the larger the gradient value of the pixel point passed by the corresponding straight line in B at the corresponding angle and distance value.
[0033] It should be noted that the Radon transform is an integral transform that integrates a function (such as image intensity) along a straight line and maps the result to a parameter space (radon space). In image processing, this means that the straight lines in the original image will appear as points in the Radon space, and the points in the original image will appear as lines in the Radon space.
[0034] In one embodiment, in order to obtain the angle of the melt wire, the present invention chooses to stretch the value at a single angle by squaring or cubing the value, so that the cumulative value is more prominent. In addition, since the fuse is in the shape of a long strip, the cumulative value of the single body is larger. The cumulative value of the single body is affected by the length of the corresponding straight line and may also be affected by the size of the gradient value.
[0035] In one embodiment, the accumulated value of the gradient value of the pixel point at each angle in the converted space is corrected, and the correction formula is: Where To correct the accumulated value at angle d, is the first The accumulated value of the gradient value of the pixel point that the corresponding straight line passes through in the gradient image at the distance is At angle d The ratio of the cumulative number of pixels that the corresponding straight line passes through in the gradient image at a distance to the number of pixels on the diagonal line in the gradient image. is the total number of all distances, and are all hyperparameters, among which, The value of should be greater than 1. In this embodiment, The value of is 2, the value of K is 10, and The value of can be adjusted by the implementer according to the specific implementation scenario. So far, the correction cumulative value at each angle can be obtained. After the correction cumulative value at each angle is obtained, the angle corresponding to the maximum correction cumulative value is selected as the direction of the melt wire.
[0036] For example, if four angles d1, d2, d3 and d4 are selected, the correction cumulative values of the four angles calculated according to the above formula are respectively , , and Among them, the correction cumulative values of the four angles are arranged from large to small, and the obtained Then select The corresponding angle is taken as the direction of the melt filament.
[0037] S103: Clustering the projection values and gradient values to obtain a clustering result.
[0038] In one embodiment, after obtaining the direction of the melt thread, the direction of the perpendicular line to the direction of the melt thread is obtained, and the perpendicular line direction is used as the projection direction. According to the image origin and the projection direction, a projection straight line can be obtained, and then the projection value of the corresponding coordinates of each pixel point in the gradient image on the projection straight line is obtained. Then, the projection value and the gradient value are classified using the dbscan algorithm to obtain multiple clustering results, and the projection values and the gradient values are classified into one category, where the cluster radius is 0.1 and the minimum number is 5. It should be noted that the horizontal and vertical coordinates of the gradient image can be normalized before projection.
[0039] S104: Calculate the uniformity of the melt wire.
[0040] In one embodiment, after obtaining multiple clustering results, each clustering result corresponds to a connected domain, and a linear fit is performed on the connected domain to obtain a fitting straight line corresponding to each melt thread. Then, the angle between each straight line and the projected straight line is obtained, and then the variance value of all angles is calculated. Then, the intersection of each fitting straight line and the projected straight line is obtained, and the Euclidean distance value between two consecutive adjacent intersections is obtained, and then the variance value of all Euclidean distance values is calculated, and then the variance value of all Euclidean distance values and the variance value of all angles are normalized, and finally the value of adding the variance value of all normalized Euclidean distance values and the variance value of all normalized angles is used as the uniformity of the melt thread.
[0041] S105: According to the uniformity, the melt filaments are tested.
[0042] In one embodiment, if the uniformity of the fusible wire is greater than a preset threshold, it means that the current fusible wire is unevenly distributed, and an alarm is performed to remind the staff to process the fusible wire. If the uniformity of the fusible wire is less than the preset threshold, it means that the current fusible wire is evenly distributed. Among them, the preset threshold can be adjusted by the implementer according to the specific implementation scenario. In this embodiment, the threshold value is 0.7. In other embodiments, the threshold value can be 0.8 or 0.75, etc.
[0043] In another embodiment, the molten filaments whose uniformity is greater than a preset threshold value may be regarded as unqualified products, and the molten filaments whose uniformity is less than the preset threshold value may be regarded as qualified products.
[0044] Through the above steps, the gradient information is classified and optimized to reduce the influence of noise on the edge detection of the fuse wire and improve the accuracy of the edge detection of the fuse wire. And by clustering the projection value and the gradient value, the intervals between different fuse wires are effectively distinguished, and the interference of the environment is reduced. Then, by using linear fitting and angle calculation, the uniformity of the fuse wire can be accurately evaluated, and the accurate detection and uniformity analysis of the fuse wire in the fuse can be realized.
[0045] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0046] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0047] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A method for identifying the distribution of fuse wires based on image recognition. It is characterized in that include: Acquire an image of the fuse, and preprocess the image to obtain a gradient image; The gradient image is spatially transformed, including: using Radon transformation to map the gradient image to Radon space, wherein the Radon space is a two-dimensional space, the abscissa is the angle value, the ordinate is the distance value, and the data point in the space is the cumulative value of the gradient value of the pixel point passed by the corresponding straight line in the gradient image at the corresponding angle and distance value, and the cumulative value of the gradient value of the pixel point at each angle in the converted space is corrected, and the angle corresponding to the maximum corrected cumulative value is selected as the direction of the melt wire. The formula for correcting the cumulative value is: ; In the formula, To correct the accumulated value at angle d, is the first The accumulated value of the gradient value of the pixel point that the corresponding straight line passes through in the gradient image at the distance is At angle d The ratio of the cumulative number of pixels that the corresponding straight line passes through in the gradient image at a distance to the number of pixels on the diagonal line in the gradient image. and are all hyperparameters, is the total number of all distances; Obtaining a projection straight line in the direction of the melt, and obtaining projection values of coordinates corresponding to each pixel point in the gradient image on the projection straight line; clustering the projection values and the gradient values to obtain clustering results, performing linear fitting on each clustering result to obtain a fitting straight line corresponding to the melt, wherein obtaining the projection straight line in the direction of the melt includes: obtaining a vertical line direction in the direction of the melt as the projection direction, and obtaining the projection straight line according to the image origin and the projection direction; The variance of the angle between each fitting straight line and the projection straight line and the sum of the variance of the distances between two adjacent intersection points are calculated to obtain the uniformity of the melt filaments, and the melt filaments are detected according to the uniformity.
2. The method for identifying the distribution of fuse fusible elements based on image recognition according to claim 1, It is characterized in that Get an image of the fuse, including: A single-side image of a fuse is collected, and the single-side image of the fuse is input into a trained fuse detection network model, and an image containing only the fuse is output, and the image is used as the image of the fuse.
3. The method for identifying the distribution of fuse fusible elements based on image recognition according to claim 1, It is characterized in that Acquire an image of the fuse, and preprocess the image to obtain a gradient image, including: The image is processed using a comprehensive gradient algorithm to obtain a gradient image.
4. The method for identifying the distribution of fuse fusible elements based on image recognition according to any one of claims 1 to 3, It is characterized in that The projection values and gradient values are clustered to obtain clustering results, including: The projection values and gradient values are classified using the dbscan algorithm to obtain a clustering result.
5. The method for identifying the distribution of fuse fusible elements based on image recognition according to claim 1, It is characterized in that Obtaining the projection value of the coordinates corresponding to each pixel point in the gradient image on the projection line also includes: The horizontal coordinate and the vertical coordinate of the gradient image are normalized.
6. The method for identifying the distribution of fuse fusible elements based on image recognition according to claim 1, It is characterized in that The distance variance of two adjacent intersection points includes: The intersection points of each fitted straight line and the projected straight line are obtained, and the Euclidean distance between two consecutive adjacent intersection points is calculated. All Euclidean distance values are counted to calculate the distance variance between two adjacent intersection points.
7. The method for identifying the distribution of fuse fusible elements based on image recognition according to claim 1, It is characterized in that According to the uniformity, the melt wire is tested, including: In response to the uniformity being greater than a preset threshold, an alarm process is performed.
8. The method for identifying the distribution of fuse fusible elements based on image recognition according to claim 1, It is characterized in that Perform linear fitting on each clustering result to obtain the fitting straight line corresponding to the melt filament, including: Each clustering result corresponds to a connected domain, and a linear fitting is performed on the connected domain to obtain a fitting straight line corresponding to the melt filament.
