Fuse piece hole positioning method
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 fuse hole is solved, and the accuracy of the positioning of the fuse hole is improved.
Patent Information
- Application Number
- CN202510408668.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-02
AI Technical Summary
Burrs are prone to appear at the edges of the fuse holes, resulting in low accuracy in hole positioning and affecting the normal operation of the fuse.
By calculating the first and second possibilities of pixel points, the pixel points at the edge of the hole are filtered out, and the pixel points are fitted multiple times to obtain the circular boundary of the hole, the confidence of the center point coordinates of each circular boundary is calculated, and the confidence is used to weight sum the center point coordinates 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 CN119919415A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of hole positioning, and in particular to a method for positioning a hole in a fuse link. Background Art
[0002] A fuse is a device that protects circuits. It melts the internal fuse when the current exceeds the set value, thereby cutting off the current and protecting the circuit from overcurrent damage. The material and shape of the fuse determine the characteristics of the fuse. The fuse is usually made of metal materials with low melting points (such as lead, aluminum, tin alloy, etc.). The size and thickness of the fuse determine the current it can withstand and the melting time. Thinner fuses usually melt in a shorter time. The position of the holes on the surface of the fuse has a greater impact on the melting time and current threshold. If the hole position deviation is too large, it is easy to cause the fuse to melt at an unexpected position, generate arcs or fragments, damage the fuse casing and even cause a fire. Therefore, during the production process of the fuse, the hole position on the surface of the fuse needs to be detected to determine whether the hole position meets the quality requirements.
[0003] A Chinese patent application document with publication number CN110288619A discloses a vision-based method for detecting the position of screw holes on the surface of a sunflower module, including: obtaining an original grayscale image having the entire outline of the sunflower module; performing denoising on the original grayscale image and extracting the edge outline to obtain a wheel image; performing circular area detection on the edge outline image to determine the area where the chip is located; mapping the area where the chip is located in the determined outline image to the denoised image to obtain the area where the chip is located in the denoised image, and performing adaptive thresholding on the area where the chip is located in the denoised image; performing edge detection on the chip area to extract the chip wheel, performing Hough circle detection on the chip outline to obtain the position of the screw hole.
[0004] During the processing of the fuse, burrs are likely to appear at the hole position, making the hole edge blurred. When extracting the edge contour of the hole, the burrs cause great interference and are prone to misjudgment, resulting in the extracted hole edge not being a smooth curve, further leading to low accuracy of hole positioning, which is not conducive to the detection of the fuse hole position. Summary of the invention
[0005] In order to solve the problem that burrs are likely to appear on the edge of a hole, resulting in low hole positioning accuracy, the present invention provides a method for positioning a fuse link hole.
[0006] The present invention provides a method for locating a hole in a fuse link, which adopts the following technical solution: 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:
[0007] 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; Indicates the credibility of the coordinates of the center point of the circular boundary of the fitted hole for the vth time; v represents the index of the number of times the circular boundary of the hole is fitted.
[0008] The first pixel point is obtained by calculating the first possibility, the second pixel point is screened out by the first pixel point, and the possibility of the second pixel point is calculated. The second pixel point is fitted to obtain the circular boundary of the hole, and the credibility of the coordinates of the center point of the circular boundary is calculated. The coordinates of the center point of the circular boundary are corrected using the credibility to obtain the optimal coordinates, thereby reducing the interference of burrs on the calculation of the coordinates of the center point of the circular boundary and improving the accuracy of locating the hole in the fuse link.
[0009] Preferably, the method further comprises: constructing a window with each pixel in the grayscale image as an origin, and taking the pixels within the window area as adjacent pixels of the corresponding pixel.
[0010] Preferably, the expression of the first possibility is:
[0011] 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.
[0012] By comparing the difference between the pixel point and the adjacent pixels, the first possibility is obtained, and the probability that the corresponding pixel point is a pixel point at the edge of the hole can be preliminarily determined through the first possibility.
[0013] Preferably, the expression of the first possibility is:
[0014] 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.
[0015] Preferably, the method further comprises: using a 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:
[0016] 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.
[0017] The main gradient direction of adjacent pixels is calculated using the ratio of the weighted vertical gradient value to the horizontal gradient value, which highlights the contribution of high gradient values in the horizontal and vertical directions to the main gradient direction, suppresses texture noise of low gradient values, improves the estimation accuracy of the main gradient direction, retains the continuity of the gradient direction, and reduces the discretization error.
[0018] Preferably, the method further comprises: calculating the comprehensive gradient value of the adjacent pixel points of the second pixel point, expressed as:
[0019] 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.
[0020] Preferably, the second possible expression is:
[0021]
[0022] 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.
[0023] By calculating the second possibility of the second pixel point, it is convenient to further determine the possibility that the corresponding second pixel point is a pixel point at the edge of the hole, and provide a theoretical basis for calculating the credibility of the coordinates of the center point of the circular boundary.
[0024] Preferably, the expression of credibility is:
[0025] In the formula, is the credibility of the coordinates of the center point of the circular boundary obtained by fitting the hole for the vth time; 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.
[0026] The credibility can be used to understand the fitting effect of the circular boundary, provide a basis for calculating the coordinates of the center point of the hole area, and improve the accuracy of the calculation results.
[0027] Preferably, the RANSAC algorithm is used to fit the second pixel point to obtain a circular boundary of the hole.
[0028] Preferably, 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.
[0029] The present invention has the following technical effects: The first pixel point is obtained by calculating the first possibility, the second pixel point is screened out by the first pixel point, and the possibility of the second pixel point is calculated. The second pixel point is fitted to obtain the circular boundary of the hole, and the credibility of the coordinates of the center point of the circular boundary is calculated. The coordinates of the center point of the circular boundary are corrected using the credibility to obtain the optimal coordinates, thereby reducing the interference of burrs on the calculation of the coordinates of the center point of the circular boundary and improving the accuracy of locating the hole in the fuse link. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 The present invention is a flow chart of a method for locating a hole in a fuse link. DETAILED DESCRIPTION
[0031] 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.
[0032] The embodiment of the present invention discloses a method for locating a hole in a fuse link, referring to Figure 1 , including steps S1-S2, which are as follows: S1: Obtain a grayscale image of a fuse link.
[0033] An industrial camera is used to collect the image of the fuse link, which is converted into a grayscale image. A Gaussian filter is used to denoise the grayscale image, and finally a denoised grayscale image is obtained.
[0034] S2: Calculate the first possibility that the pixel point is an edge point of the hole area, and record the pixel point whose first possibility is greater than a preset threshold as the first pixel point.
[0035] A window is constructed with the pixel point for which the first possibility is to be calculated as the origin, the window size is 3×3, and the pixels in the window area are taken as the neighboring pixels of the corresponding pixel point. It can be understood that the pixel point for which the first possibility is to be calculated is one of the corner points of the window area.
[0036] In one embodiment, the expression of the first possibility is:
[0037] 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.
[0038] Since the grayscale value of the edge point of the hole area in the grayscale image of the fuse link is low, the normalized grayscale value of the edge point of the hole area on the grayscale image should also be small, that is, The smaller it is, the greater the first possibility of the pixel point; otherwise The larger it is, the smaller the first possibility of the pixel is; The larger the value, the greater the difference between the grayscale value of the edge point of the fuse hole area and the grayscale value of the pixel point in the window area, and the greater the first possibility of the corresponding pixel point. The larger the value, the greater the change in the grayscale value of the pixel in the adjacent range, and the greater the first possibility of the corresponding pixel. In summary, the first possibility indicates the possibility that the corresponding pixel is the edge point of the hole area. The larger the value, the greater the probability that the corresponding pixel is the edge pixel of the hole. The pixel whose first possibility is greater than the preset threshold is recorded as the first pixel. The threshold is artificially set according to the actual situation. For example, the threshold is 0.6.
[0039] In one embodiment, the expression of the first possibility is:
[0040] 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.
[0041] S3: 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 the edge point of the hole area.
[0042] The gradient value and gradient direction of the first pixel are calculated using the Sobel operator, and the pixel with the largest gradient value in the gradient direction is recorded as the second pixel. A window is constructed with the second pixel as the origin, and the window size is 3×3. The pixels in the window area are taken as the adjacent pixels of the corresponding second pixel. It can be understood that the corresponding second pixel is one of the corner points of the window area.
[0043] S31: Calculate the main gradient direction of the neighboring pixels of the second pixel.
[0044] The expression is:
[0045] 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 each neighboring pixel. By weighting the horizontal and vertical gradients of each neighboring pixel, the contribution of high gradient values in the horizontal and vertical directions to the main gradient direction is highlighted, the texture noise of low gradient values is suppressed, and the estimation accuracy of the main gradient direction in the neighborhood is improved.
[0046] S32: Calculate the comprehensive gradient value of the adjacent pixels of the second pixel, the expression is:
[0047] 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 greater the comprehensive gradient value, the more significant the main gradient direction of the adjacent pixels of the mth second pixel is, and the more accurate the overall gradient change of the adjacent pixels is.
[0048] S33: The expression of the second possibility is:
[0049]
[0050] 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, It represents the preset hyperparameter, whose value is 0.01, to avoid the phenomenon that the denominator is zero. Tanh represents the hyperbolic tangent function.
[0051] Since the real edge pixel in the hole edge region of the grayscale image has the largest gradient value in its corresponding window region and has a high consistency with the main gradient direction of the adjacent pixel points, The smaller the value, the more consistent the main gradient direction of the mth second pixel point is with the adjacent pixel points. The larger , the larger the gradient value of the main gradient direction in the neighborhood, and the greater the possibility that the mth second pixel point is the real edge point of the hole. In summary, the second possibility further indicates the possibility that the corresponding second pixel point is the real hole edge pixel point.
[0052] S4: performing multiple fitting on the second pixel point to obtain multiple circular boundaries of the hole, further obtaining the coordinates of the center point of each circular boundary, and calculating the credibility of each center point coordinate, where the credibility is positively correlated with the second possibility of the fitted second pixel point.
[0053] A plurality of second pixel points are randomly selected, the number of the second pixel points is not less than three, and the circular boundary of the hole is obtained by fitting the selected second pixel points using the RANSAC algorithm, and then the coordinates of the center point of the circular boundary are obtained, and the credibility of the coordinates of the center point of the circular boundary is calculated. The credibility expression is:
[0054] In the formula, is the credibility of the coordinates of the center point of the circular boundary obtained by fitting the hole for the vth time; The second possibility of the nth second pixel point selected when fitting the hole; is the number of second pixels covered by the circular boundary of the hole when fitting for the vth time; K is the total number of second pixels in the hole area on the grayscale image, norm represents the normalization function, and q represents the number of second pixels fitted when fitting the hole for the vth time. For example, if the circular boundary is obtained by fitting 5 second pixels for the second time, the value of q is 5.
[0055] Exemplarily, five second pixel points are randomly selected for fitting to obtain a circular boundary, each circular boundary has a center point coordinate, and three circular boundaries are obtained by fitting three times, and each fitting corresponds to a credibility.
[0056] S5: Perform weighted summation on the coordinates of the center points of multiple circular boundaries to obtain the optimal coordinates.
[0057] The expression of the optimal coordinates is:
[0058] 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; It represents the credibility of the coordinates of the center point of the circular boundary of the v-th fitting hole; v represents the index of the number of times the circular boundary of the hole is fitted, and the optimal horizontal coordinate and the optimal vertical coordinate are used to locate the hole of the fuse link.
[0059] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in 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; Indicates the credibility of the coordinates of the center point of the circular boundary of the fitted hole for the vth time; v represents the index of the number of times the circular boundary of the hole is fitted.
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 2, characterized in that: The expression of credibility is: In the formula, is the credibility of the coordinates of the center point of the circular boundary obtained by fitting the hole for the vth time; 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.
9. 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.
10. A method for locating a hole in a fuse 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
A method for determining an optimal edge of a given region
CN109558908A
Drilling offset detection method for PCB (Printed Circuit Board)
CN114998208A
Knitted sheet hole automatic identification method
CN116468717A
Automobile VIN (Vehicle Identification Number) etching image positioning and defect detection method
CN117635581A
Fuse piece fracture detection method based on X-ray image
CN118967666A