A method for locating holes in a fuse link
By calculating the possibility of pixel points and fitting the circular boundary of the hole, and weighted summing is performed in combination with confidence, the problem of inaccurate positioning caused by burrs on the edge of the melt hole is solved, and the accuracy of hole positioning is improved.
Patent Information
- Application Number
- CN202510408668.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-04-02
AI Technical Summary
Burrs are prone to appear at the edges of the melt holes, resulting in low accuracy in hole positioning and affecting the quality detection of the melt blade.
By calculating the first possibility and the second possibility of the pixel point, the pixel points at the edge of the hole are screened out, and the circular boundary of the hole is fitted multiple times to obtain the credibility of the center point coordinates of each circular boundary, and the trustworthiness is used for weighted summing to obtain the optimal coordinates.
Reduces interference of burrs on hole edge detection and improves the accuracy of fuse fuse hole positioning.
Smart Images

Figure CN119919415B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of hole positioning, and particularly to a method for positioning holes on a fuse link. Background Art
[0002] A fuse is a device for protecting a circuit. It melts the internal fuse link when the current exceeds a set value, thereby cutting off the current and protecting the circuit from overcurrent damage. The material and shape of the fuse link determine the fusing characteristics. The fuse link is usually made of low-melting-point metal materials (such as lead, aluminum, tin alloy, etc.). The size and thickness of the fuse link determine the current it can withstand and the fusing time. A thinner fuse link usually melts in a shorter time. The position of the holes on the surface of the fuse link has a great influence on the fusing time and current threshold. If the hole position deviates too much, it is easy to cause the fuse link to melt at an unexpected position, generating electric arcs or fragments, damaging the fuse housing or even causing a fire. Therefore, during the production process of the fuse link, it is necessary to detect the position of the holes on the surface of the fuse link to determine whether the hole position meets the quality requirements.
[0003] The Chinese patent application document with the publication number CN110288619A discloses a method for detecting the position of screw holes on the surface of a sunflower module based on vision, including: obtaining an original grayscale image of the entire sunflower module contour; extracting the edge contour after denoising the original grayscale image to obtain a contour image; performing circular region detection on the edge contour image to determine the region where the chip is located; mapping the region where the chip is located in the determined contour image to the denoised image to obtain the region where the chip is located in the denoised image, and performing adaptive thresholding on the region where the chip is located in the denoised image; performing edge detection on the chip region to extract the chip contour, and performing Hough circle detection on the chip contour to obtain the position of the screw hole.
[0004] During the processing of the fuse link, burrs are likely to appear at the hole positions, making the hole edges relatively blurred. When extracting the edge contour of the holes, the burrs cause great interference and are prone to misjudgment problems, resulting in the extracted hole edges not being smooth curves, further leading to low accuracy of hole positioning and being unfavorable for detecting the hole positions on the fuse link. Summary of the Invention
[0005] In order to solve the problem of low accuracy of hole positioning caused by the easy appearance of burrs at the hole edges, the present invention provides a method for positioning holes on a fuse link.
[0006] The present invention provides a method for positioning holes on a fuse link, adopting the following technical solutions:
[0007] Obtain a grayscale image of the fuse link, calculate the first possibility that a pixel point is an edge point of the hole area, and record the pixel points with the first possibility greater than a preset threshold as the first pixel points;
[0008] Calculate the gradient direction of the first pixel point, record the pixel point with the maximum gradient value in the gradient direction as the second pixel point, and calculate the second possibility that the second pixel point is an edge point of the hole area;
[0009] Perform multiple fittings on the second pixel point to obtain multiple circular boundaries of the hole, further obtain the center point coordinates of each circular boundary, calculate the credibility of each center point coordinate, and the credibility is positively correlated with the second possibility of the second pixel point used for fitting; perform a weighted sum on the center point coordinates of multiple circular boundaries to obtain the optimal coordinates, and the expression is:
[0010]
[0011] In the formula, X and Y are respectively the optimal abscissa and optimal ordinate of the center point of the hole in the grayscale image of the fuse link; Represents the total number of times of fitting the circular boundary of the hole for the second pixel point; Represents the credibility of the center point coordinates of the circular boundary of the hole fitted for the v-th time; v represents the index of the number of times of fitting the circular boundary of the hole.
[0012] Obtain the first pixel point by calculating the first possibility, screen out the second pixel point through the first pixel point, calculate the possibility of the second pixel point, perform fitting on the second pixel point to obtain the circular boundary of the hole, calculate the credibility of the center point coordinates of the circular boundary, and use the credibility to correct the center point coordinates of the circular boundary to obtain the optimal coordinates, reducing the interference of burrs when calculating the center point coordinates of the circular boundary and improving the accuracy of locating the hole of the fuse link.
[0013] Preferably, the method further includes: constructing a window with each pixel point in the grayscale image as the origin, and taking the pixel points in the window area as the adjacent pixel points of the corresponding pixel point.
[0014] Preferably, the expression of the first possibility is:
[0015]
[0016] In the formula, Is the first possibility of the pixel point at the i-th row and j-th column in the grayscale image; Is the grayscale value of the pixel point at the i-th row and j-th column in the grayscale image; Is the average value of the grayscale values of the adjacent pixel points of the pixel point at the i-th row and j-th column in the grayscale image; Is the standard deviation of the grayscale values of the adjacent pixel points of the pixel point at the i-th row and j-th column in the grayscale image; exp is the exponential function with the natural constant e as the base.
[0017] The first possibility is obtained by comparing the differences between the pixel points and their adjacent pixel points, and the probability that the corresponding pixel point is a hole edge pixel point can be preliminarily judged through the first possibility.
[0018] Preferably, the expression of the first possibility is:
[0019]
[0020] In the formula, is the first possibility of the pixel point at the i-th row and j-th column in the grayscale image; is the grayscale value of the pixel point at the i-th row and j-th column in the grayscale image; is the average grayscale value of the adjacent pixel points of the pixel point at the i-th row and j-th column in the grayscale image; is the standard deviation of the grayscale values of the adjacent pixel points of the pixel point at the i-th row and j-th column in the grayscale image; exp is the exponential function with the natural constant e as the base.
[0021] Preferably, the method further includes: calculating the gradient value and gradient direction of the first pixel point by using the Sobel operator, and calculating the gradient main direction of the adjacent pixel points of the second pixel point, and the expression is:
[0022]
[0023] In the formula, is the gradient main direction of the adjacent pixel points of the m-th second pixel point, is the gradient value in the horizontal direction of the -th neighborhood pixel point of the m-th second pixel point; is the gradient value in the vertical direction of the -th neighborhood pixel point of the m-th second pixel point.
[0024] Using the ratio of the weighted vertical direction gradient value to the horizontal direction gradient value to calculate the gradient main direction of the adjacent pixel points highlights the contributions of the high gradient values in the horizontal and vertical directions to the gradient main direction, suppresses the texture noise of the low gradient values, improves the estimation accuracy of the gradient main direction, retains the gradient direction continuity, and reduces the discretization error.
[0025] Preferably, the method further includes: calculating the comprehensive gradient value of the adjacent pixel points of the second pixel point, and the expression is:
[0026]
[0027] In the formula, is the comprehensive gradient value of the adjacent pixel points of the m-th second pixel point, is the gradient value in the horizontal direction of the -th neighborhood pixel point of the m-th second pixel point; is the gradient value in the vertical direction of the th neighboring pixel of the m-th second pixel point.
[0028] Preferably, the expression of the second possibility is:
[0029]
[0030]
[0031] In the formula, is the consistency between the gradient direction of the m-th second pixel point and the main gradient direction of its neighboring pixel points; is the gradient direction of the m-th second pixel point; is the main gradient direction of the neighboring pixel points of the m-th second pixel point; is the second possibility of the m-th second pixel point; is the gradient value of the m-th second pixel point; is the maximum gradient value of the m-th second pixel point and its neighboring pixel points; is the comprehensive gradient value of the neighboring pixel points of the m-th second pixel point, represents a preset hyperparameter, and tanh represents the hyperbolic tangent function.
[0032] By calculating the second possibility of the second pixel point, it is convenient to further judge the possibility that the corresponding second pixel point is a hole edge pixel point, providing a theoretical basis for calculating the credibility of the coordinates of the center point of the circular boundary.
[0033] Preferably, the expression of the credibility is:
[0034]
[0035] In the formula, is the credibility of the coordinates of the center point of the circular boundary obtained by fitting the hole for the v-th time; is the second possibility of the n-th second pixel point selected when fitting the hole; is the number of second pixel points covered by the circular boundary of the hole fitted for the v-th time; K is the total number of second pixel points in the hole area of the grayscale image, norm represents the normalization function, and q represents the number of second pixel points fitted when fitting the hole for the v-th time.
[0036] Through the credibility, the fitting effect of the fitted circular boundary can be understood, providing a basis for calculating the coordinates of the center point of the hole area and improving the accuracy of the calculation result.
[0037] Preferably, the RANSAC algorithm is used to fit the second pixel points to obtain the circular boundary of the hole.
[0038] Preferably, before calculating the first possibility that a pixel point is an edge point of a hole region, a step of denoising the grayscale image is further included.
[0039] The present invention has the following technical effects:
[0040] The first pixel point is obtained by calculating the first possibility, the second pixel point is screened out through the first pixel point, and the possibility of the second pixel point is calculated. The circular boundary of the hole is obtained by fitting the second pixel point, the credibility of the center point coordinates of the circular boundary is calculated, and the optimal coordinates are obtained by correcting the center point coordinates of the circular boundary by using the credibility, reducing the interference of the burrs when calculating the center point coordinates of the circular boundary, and improving the accuracy of positioning the holes in the fuse link. Description of the Drawings
[0041] Figure 1 is a flowchart of a method for positioning holes in a fuse link of the present invention. Detailed Embodiments
[0042] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
[0043] An embodiment of the present invention discloses a method for positioning holes in a fuse link. Referring to Figure 1 , it includes step S1-step S2, specifically as follows:
[0044] S1: Obtain a grayscale image of the fuse link.
[0045] Collect an image of the fuse link using an industrial camera, convert the fuse link into a grayscale image, and perform denoising processing on the grayscale image using a Gaussian filter to finally obtain a denoised grayscale image.
[0046] S2: Calculate the first possibility that a pixel point is an edge point of a hole region, and mark the pixel points with the first possibility greater than a preset threshold as the first pixel points.
[0047] Construct a window with the pixel point to be calculated for the first possibility as the origin, the window size is 3×3, and the pixel points in the window area are used as the adjacent pixel points of the corresponding pixel point. It can be understood that the pixel point to be calculated for the first possibility is one of the corner points of the window area.
[0048] In one embodiment, the expression of the first possibility is:
[0049]
[0050] In the formula, is the first possibility of the pixel at the i-th row and j-th column in the grayscale image; is the grayscale value of the pixel at the i-th row and j-th column in the grayscale image; is the average grayscale value of the adjacent pixels of the pixel at the i-th row and j-th column in the grayscale image; is the standard deviation of the grayscale values of the adjacent pixels of the pixel at the i-th row and j-th column in the grayscale image; exp is the exponential function with the natural constant e as the base.
[0051] Since the grayscale values of the edge points of the hole region in the fuse link's grayscale image are relatively low, the normalized grayscale values of the edge points of the hole region on the grayscale image should also be relatively small, that is The smaller it is, the greater the first possibility of this pixel; conversely The larger it is, the smaller the first possibility of this pixel; The larger it is, it indicates that the difference between the grayscale value of the edge point of the fuse link hole region and the average grayscale value of the pixels in the window region is relatively large, and the first possibility of the corresponding pixel is greater. Similarly, The larger it is, it indicates that the change in the grayscale values of the pixels in the adjacent range is relatively large, and the first possibility of the corresponding pixel is greater. In summary, the first possibility indicates the possibility that the corresponding pixel is an edge point of the hole region. The larger its value, the greater the probability that the corresponding pixel is an edge pixel of the hole. The pixels with the first possibility greater than the preset threshold are denoted as the first pixels. The threshold is set artificially according to the actual situation. Exemplarily, the threshold is 0.6.
[0052] In one embodiment, the expression of the first possibility is:
[0053]
[0054] In the formula, is the first possibility of the pixel at the i-th row and j-th column in the grayscale image; is the grayscale value of the pixel at the i-th row and j-th column in the grayscale image; is the average grayscale value of the adjacent pixels of the pixel at the i-th row and j-th column in the grayscale image; is the standard deviation of the grayscale values of the adjacent pixels of the pixel at the i-th row and j-th column in the grayscale image; exp is the exponential function with the natural constant e as the base.
[0055] S3: Calculate the gradient direction of the first pixels, denote the pixel with the maximum gradient value in the gradient direction as the second pixels, and calculate the second possibility that the second pixels are the edge points of the hole region.
[0056] Calculate the gradient value and gradient direction of the first pixel point using the Sobel operator, and record the pixel point with the largest gradient value in the gradient direction as the second pixel point. Construct a window with the second pixel point as the origin, the window size is 3×3, and use the pixel points within the window area as the adjacent pixel points of the corresponding second pixel point. It can be understood that the corresponding second pixel point is one of the corner points of the window area.
[0057] S31: Calculate the gradient main direction of the adjacent pixel points of the second pixel point.
[0058] The expression is:
[0059]
[0060] In the formula, is the gradient main direction of the adjacent pixel points of the m-th second pixel point, is the gradient value in the horizontal direction of the -th neighborhood pixel point of the m-th second pixel point; is the gradient value in the vertical direction of the -th neighborhood pixel point of the m-th second pixel point. By weighting the horizontal gradient and vertical gradient of adjacent pixel points, the contribution of high gradient values in the horizontal and vertical directions to the gradient main direction is highlighted, the texture noise of low gradient values is suppressed, and the estimation accuracy of the gradient main direction within the neighborhood is improved.
[0061] S32: Calculate the comprehensive gradient value of the adjacent pixel points of the second pixel point. The expression is:
[0062]
[0063] In the formula, is the comprehensive gradient value of the adjacent pixel points of the m-th second pixel point, is the gradient value in the horizontal direction of the -th neighborhood pixel point of the m-th second pixel point; is the gradient value in the vertical direction of the -th neighborhood pixel point of the m-th second pixel point. The larger the comprehensive gradient value, the more significant the gradient main direction of the adjacent pixel points of the m-th second pixel point, indicating that the overall change of the gradient of the adjacent pixel points is more accurate.
[0064] The expression of the second possibility is:
[0065]
[0066]
[0067] In the formula, is the consistency between the gradient direction of the m-th second pixel point and the main gradient direction of its adjacent pixel points; is the gradient direction of the m-th second pixel point; is the main gradient direction of the adjacent pixel points of the m-th second pixel point; is the second possibility of the m-th second pixel point; is the gradient value of the m-th second pixel point; is the maximum gradient value of the m-th second pixel point and its adjacent pixel points; is the comprehensive gradient value of the adjacent pixel points of the m-th second pixel point, represents a preset hyperparameter with a value of 0.01 to avoid the phenomenon of a zero denominator term, and tanh represents the hyperbolic tangent function.
[0068] Since the true edge pixel points in the hole edge area of the grayscale image have the maximum gradient value in their corresponding window areas and a high consistency with the main gradient direction of adjacent pixel points, the smaller; the consistency between the gradient direction of the m-th second pixel point and the main gradient direction of its adjacent pixel points the larger, the larger the gradient value of the main gradient direction in the neighborhood, the greater the possibility that the m-th second pixel point is a true hole edge point. In summary, the second possibility further indicates the possibility that the corresponding second pixel point is a true hole edge pixel point.
[0069] S4: Perform multiple fittings on the second pixel points to obtain multiple circular boundaries of the hole, further obtain the center point coordinates of each circular boundary, and calculate the credibility of each center point coordinate. The credibility is positively correlated with the second possibility of the second pixel points used in the fitting.
[0070] Randomly select multiple second pixel points, with the number of second pixel points not less than three. Use the RANSAC algorithm to fit the selected second pixel points to obtain the circular boundary of the hole, and then obtain the center point coordinates of the circular boundary. Calculate the credibility of the center point coordinates of the circular boundary. The expression for the credibility is:
[0071]
[0072] In the formula, is the credibility of the center point coordinates of the circular boundary obtained by the v-th fitting of the hole; is the second possibility of the n-th second pixel point selected when fitting the hole; is the number of second pixel points covered by the circular boundary of the v-th fitting of the hole; K is the total number of second pixel points in the hole area of the grayscale image, norm represents the normalization function, and q represents the number of second pixel points fitted when the v-th fitting of the hole is performed. For example, if the circular boundary is obtained by the 2nd fitting of 5 second pixel points, then the value of q is 5.
[0073] Exemplarily, 5 second pixel points are randomly selected for fitting to obtain a circular boundary. Each circular boundary has a center point coordinate. After fitting 3 times, a total of 3 circular boundaries are obtained, and each fitting corresponds to a credibility.
[0074] S5: Perform weighted summation on the center point coordinates of multiple circular boundaries to obtain the optimal coordinates.
[0075] The expression of the optimal coordinates is:
[0076]
[0077] In the formula, X and Y are respectively the optimal abscissa and optimal ordinate of the center point of the hole in the grayscale image of the fuse link; represents the total number of times of fitting the circular boundary of the hole with the second pixel points; represents the credibility of the center point coordinate of the circular boundary of the v-th fitting of the hole; v represents the index of the number of times of fitting the circular boundary of the hole. The positioning of the hole in the fuse link is realized by using the obtained optimal abscissa and optimal ordinate.
[0078] The above are all the preferred embodiments of the present invention. The protection scope of the present invention is not limited hereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention shall be covered within the protection scope of the present invention.
Claims
1. A method for locating a hole in a fuse link, characterized in that: Includes steps: Obtaining a grayscale image of the fuse link, calculating a first possibility that a pixel point is an edge point of a hole region, and recording a pixel point whose first possibility is greater than a preset threshold as a first pixel point; Calculate the gradient direction of the first pixel point, record the pixel point with the largest gradient value in the gradient direction as the second pixel point, and calculate the second possibility that the second pixel point is the edge point of the hole area; The second pixel point is fitted multiple times to obtain multiple circular boundaries of the hole, and the coordinates of the center point of each circular boundary are further obtained. The credibility of each center point coordinate is calculated, and the credibility is positively correlated with the second possibility of the fitted second pixel point; the center point coordinates of multiple circular boundaries are weighted summed to obtain the optimal coordinates, and the expression is: Where X and Y are the optimal horizontal and vertical coordinates of the center point of the hole in the grayscale image of the fuse link, respectively; represents the total number of times the circular boundary of the hole is fitted to the second pixel point; v represents the index of the number of times the circular boundary of the hole is fitted; , They represent the horizontal and vertical coordinates of the center point of the circular boundary of the v-th fitting hole respectively; Represents the credibility of the coordinates of the center point of the circular boundary of the v-th fitting hole, expressed as: In the formula, The second possibility of the nth second pixel point selected when fitting the hole; is the number of second pixel points covered by the circular boundary of the hole when fitting for the vth time; K is the total number of second pixel points in the hole area on the grayscale image, norm represents the normalization function, and q represents the number of second pixel points fitted when fitting the hole for the vth time.
2. A method for locating a fuse hole according to claim 1, characterized in that: The method also includes: constructing a window with each pixel point in the grayscale image as the origin, and taking the pixel points in the window area as the adjacent pixel points of the corresponding pixel point.
3. A method for locating a hole in a fuse according to claim 2, characterized in that: The first possibility is expressed as: In the formula, is the first possibility of the pixel in the i-th row and j-th column in the grayscale image; is the gray value of the pixel in the i-th row and j-th column in the gray image; is the mean gray value of the adjacent pixels of the pixel in the i-th row and j-th column in the gray image; is the standard deviation of the grayscale values of adjacent pixels of the i-th row and j-th column in the grayscale image; exp is an exponential function with the natural constant e as the base.
4. A method for locating a fuse hole according to claim 2, characterized in that: The first possibility is expressed as: In the formula, is the first possibility of the pixel in the i-th row and j-th column in the grayscale image; is the gray value of the pixel in the i-th row and j-th column in the gray image; is the mean gray value of the adjacent pixels of the pixel in the i-th row and j-th column in the gray image; is the standard deviation of the grayscale values of adjacent pixels of the i-th row and j-th column in the grayscale image; exp is an exponential function with the natural constant e as the base.
5. A method for locating a fuse hole according to claim 2, characterized in that: The method further includes: using the Sobel operator to calculate the gradient value and gradient direction of the first pixel point, and calculating the main gradient direction of the adjacent pixel points of the second pixel point, the expression is: In the formula, is the main gradient direction of the adjacent pixel points of the mth second pixel point, is the mth second pixel point The horizontal gradient value of the neighboring pixels; is the mth second pixel point The vertical gradient value of the neighboring pixels.
6. A method for locating a hole in a fuse link according to claim 5, characterized in that: The method further includes: calculating the comprehensive gradient value of the adjacent pixel points of the second pixel point, the expression is: In the formula, is the comprehensive gradient value of the adjacent pixels of the mth second pixel, is the mth second pixel point The horizontal gradient value of the neighboring pixels; is the mth second pixel point The vertical gradient value of the neighboring pixels.
7. A method for locating a hole in a fuse link according to claim 6, characterized in that: The second possibility is expressed as: In the formula, is the consistency between the gradient direction of the mth second pixel and the main gradient direction of its adjacent pixel; is the gradient direction of the mth second pixel; is the main gradient direction of the adjacent pixel points of the m-th second pixel point; is the second possibility of the mth second pixel point; is the gradient value of the mth second pixel; is the maximum gradient value of the mth second pixel and its adjacent pixels; is the comprehensive gradient value of the adjacent pixels of the mth second pixel, represents the preset hyperparameter, and tanh represents the hyperbolic tangent function.
8. A method for locating a hole in a fuse link according to claim 1, characterized in that: The RANSAC algorithm is used to fit the second pixel point to obtain the circular boundary of the hole.
9. A method for locating a hole in a fuse link according to claim 1, characterized in that: Before calculating the first possibility that the pixel point is an edge point of the hole area, a step of denoising the grayscale image is also included.
Citation Information
Patent Citations
Sunflower module surface screw hole position detection method based on vision
CN110288619A
A method for determining an optimal edge of a given region
CN109558908A
Drilling offset detection method for PCB (Printed Circuit Board)
CN114998208A