Fastener product quality traceability method and system

By extracting the grayscale evaluation and position distance sequence of the stud profile and virtual thread curve of fastener products, the problem of low accuracy in thread anomaly detection in traditional technology is solved, and higher accuracy thread detection is achieved.

CN120912598BActive Publication Date: 2025-12-12ZHEJIANG HIGH INTENSITY FASTENER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511429954.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-09
Publication Date
2025-12-12
Estimated Expiration
2045-10-09

AI Technical Summary

Technical Problem

Traditional technologies have low accuracy in detecting thread abnormalities in fastener products.

Method used

Extract the stud profile of the fastener product, filter the edge point group and fit the virtual thread curve, and determine whether the thread is abnormal by calculating the gray value evaluation of the intersection point and the position distance sequence.

Benefits of technology

It improves the accuracy of thread inspection in fastener products, enabling accurate determination of whether there are any abnormalities in the threads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120912598B_ABST
    Figure CN120912598B_ABST
Patent Text Reader

Abstract

The present application relates to the field of fastener, specifically relates to a fastener product quality traceability method and system, comprising: extracting a stud profile, screening edge points in the stud profile to obtain a thread point set, fitting the thread point set to obtain a virtual thread curve; presetting a plurality of straight lines parallel to the central axis of the stud profile, calculating the gray evaluation between the target intersection point and other pixel points on the corresponding straight line except the target intersection point, taking the other pixel point corresponding to the maximum gray evaluation as the actual intersection point, and traversing to obtain the actual intersection point corresponding to the ideal intersection point on each straight line; for any straight line, calculating the position distance of any two adjacent actual intersection points to construct a distance sequence, in response to all distance sequences satisfying a preset condition, judging that the stud workpiece is qualified, and in response to any distance sequence not satisfying the preset condition, judging that the stud workpiece exists abnormity. The present application can improve the precision of thread detection in fastener products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fasteners. More specifically, this invention relates to a method and system for tracing the quality of fastener products. Background Technology

[0002] Fastener products include bolts, studs, screws, nuts, etc. As key basic components in fields such as machinery, construction, and automobiles, the quality of fasteners directly affects the safety and reliability of the overall equipment. Fastener product quality traceability mainly involves detecting whether there are thread abnormalities on the surface of fastener products, but traditional technologies for detecting thread abnormalities have low accuracy. Summary of the Invention

[0003] The main objective of this application is to propose a method and system for tracing the quality of fastener products, which aims to improve the accuracy of thread detection in fastener products.

[0004] To achieve the above objectives, an embodiment of the first aspect of this application proposes a method for tracing the quality of fastener products. The method includes: extracting the stud profile of the fastener product, wherein the stud profile includes multiple edge point groups arranged axially; for any edge point group, filtering the edge points to obtain a thread point set, fitting the thread point set to obtain a virtual thread curve; presetting multiple straight lines parallel to the central axis of the stud profile, obtaining the ideal intersection point of any straight line and any virtual thread curve, taking any ideal intersection point on any straight line as a target intersection point, taking the pixels on any straight line other than the target intersection point as reference points, calculating the grayscale evaluation of the target intersection point and the reference points, taking the pixel point corresponding to the maximum value of the grayscale evaluation as the actual intersection point corresponding to the target intersection point, and traversing to obtain the actual intersection points on each straight line; for any straight line, calculating the positional distance between any two adjacent actual intersection points to construct a distance sequence, determining that the fastener product is qualified in response to all distance sequences satisfying a preset condition, and determining that the fastener product is abnormal in response to any distance sequence not satisfying the preset condition.

[0005] In some embodiments, the step of filtering edge points to obtain a thread point set includes: obtaining a base curve; selecting one boundary of the stud profile as a starting boundary; selecting another boundary parallel to the starting boundary as a termination boundary; radially anchoring the base curve to the starting boundary; translating the base curve axially by a first preset step size; stopping the translation in response to the existence of intersecting pixels between the base curve and the termination boundary; taking any group of edge points as a target group; taking any pixel of the base curve as a target point; calculating the Euclidean distance between the target point and each edge point in the target group in response to the base curve translating once; filtering and obtaining the minimum Euclidean distance to obtain the nearest edge point of the target point; traversing to obtain the nearest edge point of each pixel on the base curve; constructing a discrete point set; accumulating all the minimum Euclidean distances to obtain the comprehensive distance between the base curve and the discrete point set; traversing to obtain the comprehensive distance between the base curve and the discrete point set after each translation; and selecting the discrete point set corresponding to the minimum comprehensive distance as the thread point set of the target group.

[0006] In some embodiments, obtaining the base curve includes: calculating the length of each edge point group using the cv2.arcLength function, and using the fitted curve corresponding to the longest edge point group as the base curve.

[0007] In some embodiments, obtaining the ideal intersection point of any of the straight lines and any of the virtual thread curves includes: selecting one boundary of the stud profile as the starting boundary, and selecting another boundary parallel to the starting boundary as the ending boundary; taking any of the straight lines as the target line, establishing a coordinate system with a point on the ending boundary as the origin, the ending boundary as the horizontal axis and the target line as the vertical axis, and taking the intersection point of the vertical axis and any of the virtual threads as the ideal intersection point;

[0008] Iterate through each of the described straight lines and each of the described virtual spiral curves to obtain the ideal intersection point.

[0009] In some embodiments, calculating the grayscale evaluation includes: calculating the vertical distance between the target intersection point and the reference point; obtaining a distance weight by negatively correlated mapping of the negative of the absolute value of the vertical distance using an exponential function; calculating the ratio of the grayscale value of the reference point to a preset grayscale extreme value; using the product of the ratio and the distance weight as the grayscale evaluation between the target intersection point and the reference point; and iterating through and obtaining the grayscale evaluation between the target intersection point and each of the reference points.

[0010] In some embodiments, calculating the positional distance between any two adjacent actual intersection points to construct a distance sequence includes: selecting one boundary of the stud profile as a starting boundary, selecting another boundary parallel to the starting boundary as a termination boundary, taking any one of the straight lines as a target line, establishing a coordinate system with a point on the termination boundary as the origin, the termination boundary as the horizontal axis, and the target line as the vertical axis; taking the difference in the vertical axis coordinates of any two adjacent actual intersection points on the target line as the positional distance, traversing to obtain each vertical axis coordinate difference to construct the distance sequence corresponding to the target line; and traversing to obtain the distance sequence corresponding to each straight line.

[0011] In some embodiments, the preset conditions include: a first condition and a second condition; the first condition includes: the deviation of any distance in the distance sequence is not greater than a preset first threshold; the second condition includes: generating a sliding window on the distance sequence, the sliding window moving once every second preset step, calculating the variance of the subsequence of the distance sequence within the sliding window, and each subsequence variance not being greater than a preset second threshold.

[0012] In some embodiments, extracting the stud profile includes: acquiring a stud image captured by a camera aligned with the center of the fastener product; and binarizing the grayscale image of the stud image according to a preset grayscale threshold to obtain the stud profile.

[0013] To achieve the above objectives, an embodiment of the second aspect of this application proposes a fastener product quality traceability system, the system comprising: a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement the fastener product quality traceability method described above.

[0014] The beneficial effects of this invention are:

[0015] This invention first extracts the stud profile, which includes multiple axially arranged edge point groups. These edge point groups represent the thread to be inspected. Therefore, the abnormality of the thread is determined by detecting these edge point groups. For each edge point group, this invention filters the edge points to obtain a thread point set to fit a virtual thread curve. This virtual thread curve is an ideal thread curve and may contain errors. Therefore, this invention pre-defines multiple straight lines parallel to the central axis of the stud profile. Each straight line has an ideal intersection point with each virtual thread curve. Next, by calculating the grayscale evaluation of each ideal intersection point and other pixels on its corresponding straight line, an actual intersection point corresponding to the maximum grayscale evaluation is selected for each ideal intersection point. This actual intersection point corrects the ideal intersection point and more closely approximates the real thread. Therefore, for each straight line, the positional distance between two adjacent actual intersection points is calculated to construct a distance sequence. If every distance sequence in the fastener product meets the preset conditions, the fastener product is judged to be qualified; if any distance sequence in the fastener product does not meet the preset conditions, the fastener product is judged to be abnormal. Therefore, this invention can improve the accuracy of thread detection in fastener products. Attached Figure Description

[0016] Figure 1 This is a flowchart of steps S1-S4 in a fastener product quality traceability method according to an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0018] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0019] Reference Figure 1 A fastener product quality traceability method includes steps S1-S4, as detailed below:

[0020] Step S1: Extract the stud profile of the fastener product, which includes multiple edge point groups arranged along the axial direction.

[0021] It should be further explained that the fastener product is horizontally fixed on the inspection station, with the center of the fastener product vertically aligned with the center of the inspection station area. A camera is installed above the inspection station, also vertically aligned with the center of the inspection station area. This allows the camera to capture a complete image of the fastener stud, laying the foundation for subsequent thread anomaly detection. For example, for studs with a diameter of 5-20mm, a high-precision industrial camera with a resolution of at least 5MP is used, along with a lens with a focal length of 16mm and an object distance of 500mm, ensuring that the stud outline pixel resolution is ≥0.01mm / pixel (each thread occupies ≥10 pixels).

[0022] It is understandable that extracting the stud profile of a fastener product includes: acquiring a stud image captured by a camera aligned with the center of the fastener product; and binarizing the grayscale image of the stud image according to a preset grayscale threshold to obtain the stud profile.

[0023] It should be further explained that, since the thread has a higher grayscale value compared to other areas of the stud, pixels with grayscale values ​​greater than a preset grayscale threshold are set to black, while pixels with grayscale values ​​no greater than the preset grayscale threshold are converted from grayscale images to black and white images by setting a threshold, thus highlighting the thread edge, i.e., the edge point group of this invention. For example, the stud contour can also be extracted using a U-Net++ model.

[0024] Step S2: For any group of edge points, filter the edge points to obtain a set of thread points, and fit the set of thread points to obtain a virtual thread curve.

[0025] Understandably, the process of selecting edge points to obtain the thread point set includes: acquiring the base curve, selecting one boundary of the stud profile as the starting boundary, selecting another boundary parallel to the starting boundary as the ending boundary, radially anchoring the base curve to the starting boundary, axially translating the base curve by a first preset step size, and stopping the translation when there are intersecting pixels between the base curve and the ending boundary; taking any group of edge points as the target group, taking any pixel of the base curve as the target point, calculating the Euclidean distance between the target point and each edge point in the target group in response to one translation of the base curve, selecting and obtaining the minimum Euclidean distance to obtain the nearest edge point of the target point, traversing to obtain the nearest edge point of each pixel on the base curve, constructing a discrete point set, accumulating all minimum Euclidean distances to obtain the comprehensive distance between the base curve and the discrete point set, traversing to obtain the comprehensive distance between the base curve and the discrete point set after each translation; and selecting the discrete point set corresponding to the minimum comprehensive distance as the thread point set of the target group.

[0026] It should be further explained that the stud outline in the acquired image is rectangular, and the length direction of the rectangle is the axial direction of the stud. One width of the stud outline is used as the starting boundary, and the other width is used as the ending boundary. The base curve is anchored at the starting boundary, and the base curve is translated axially by a first preset step size until the base curve intersects the ending boundary. The first preset step size of this invention is the distance of one pixel.

[0027] It is understandable that obtaining the base curve involves: calculating the length of each edge point group using the cv2.arcLength function, and using the fitted curve corresponding to the longest edge point group as the base curve.

[0028] It should be added that after obtaining the thread profile, the cv2.findContours function in the OpenCV (Open Source Computer Vision Library) image processing library can be used to detect each edge point group in the thread profile. Then, the length of each edge point group can be calculated by the cv2.arcLength function. After traversing and sorting, the longest edge point group (because it is more likely to reflect the real thread) is selected for curve fitting to obtain the basic curve.

[0029] It should be further explained that for any group of edge points, the base curve is shifted along the axial direction by one pixel. This process filters the group of edge points to obtain a discrete point set, and then calculates the combined distance between the base curve and this discrete point set. After the base curve is shifted, the discrete point set corresponding to the smallest combined distance is taken as the spiral point set of the edge point group. The filtering process for obtaining the discrete point set is as follows: For any pixel on the base curve, the Euclidean distance between that pixel and every edge point in the edge point group is calculated. The edge point corresponding to the smallest Euclidean distance is taken as the nearest edge point of that pixel on the base curve. This process is repeated to obtain the nearest edge point of every pixel on the base curve, resulting in a discrete point set. The calculation of the combined distance between the base curve and this discrete point set involves summing all the smallest Euclidean distances to obtain the combined distance between the base curve and the discrete point set.

[0030] For example, the formula for calculating the overall distance is as follows:

[0031]

[0032]

[0033] In formula (1), Pixels on the base curve For pixels pixel position coordinates, For pixels in the edge point group, For pixels pixel position coordinates, For pixels With pixels Euclidean distance.

[0034] In formula (2), Indicates the base curve number Second translation, Given the total number of pixels on the base curve, for any group of edge points, For the first The first translation on the base curve The minimum Euclidean distance of 1 pixel.

[0035] Regarding formula (2), it should be noted that for any group of edge points, the th... The first translation on the base curve The nearest edge point corresponding to each pixel is used as Iterate through the base curve to obtain the nearest edge point corresponding to each pixel to construct a discrete point set. That is, on the basic curve The set of nearest edge points corresponding to each pixel.

[0036] It should be noted that, for any group of edge points, after the base curve translation is completed, the smallest value should be selected. The corresponding discrete point set This serves as the set of thread points for the edge point group. The virtual thread curve obtained by fitting this set of thread points is closer to the actual thread.

[0037] It should be noted that, due to the potential presence of local noise in the thread point set (such as the minute fluctuations remaining after removing isolated noise points), the virtual thread curve obtained by direct fitting may exhibit a sawtooth shape, which does not conform to the physical characteristic of a thread as a "continuous spiral." Therefore, for thread point sets... Using quadratic functions The coefficients are solved using the least squares method. This minimizes the overall deviation between the virtual thread curve and the thread point set. At this point, the overall trend of the discrete point set can be preserved, and only local high-frequency noise is eliminated, thus obtaining a smooth curve.

[0038] The least squares method formula is as follows:

[0039]

[0040] In formula (3), Represents the thread point set pixels in The square of the error, For thread point set The corresponding minimum sum of squared errors, Take the coefficient value corresponding to the minimum sum of squared errors.

[0041] Regarding formula (3), it should be noted that the use of "square" is to eliminate the cancellation of positive and negative errors, while amplifying the influence of points with large deviations to ensure greater overall stability. Since the overall error needs to be obtained, the thread point set is... Sum the squared errors of each pixel and find a suitable... Let this overall error Minimum.

[0042] Step S3: Preset multiple straight lines parallel to the central axis of the stud profile, obtain the ideal intersection point of any straight line and any virtual thread curve, take any ideal intersection point on any straight line as the target intersection point, take the pixels on any straight line other than the target intersection point as reference points, calculate the grayscale evaluation of the target intersection point and the reference points, take the pixel point corresponding to the maximum value of the grayscale evaluation as the actual intersection point corresponding to the target intersection point, and iterate to obtain the actual intersection points on each straight line.

[0043] Understandably, obtaining the ideal intersection point of any straight line and any virtual thread curve includes: selecting one boundary of the stud profile as the starting boundary, and selecting another boundary parallel to the starting boundary as the ending boundary; taking any straight line as the target line, establishing a coordinate system with a point on the ending boundary as the origin, the ending boundary as the horizontal axis and the target line as the vertical axis, and taking the intersection point of the vertical axis with any virtual thread as the ideal intersection point; and traversing to obtain the ideal intersection point of each straight line and each virtual thread curve.

[0044] It should be noted that the length of the termination boundary in the two-dimensional image is a mapping of the diameter of the stud in the three-dimensional fastener product. Three origins can be selected within each millimeter of the termination boundary to ensure full coverage of the axial features of the stud, providing a basis for subsequent precise judgment of whether there are any abnormalities in the thread.

[0045] It should be noted that the ideal intersection point represents the theoretical intersection point. There may be errors between the ideal intersection point and the actual intersection point of the spiral curve. Therefore, this invention corrects the ideal intersection point by calculating the grayscale evaluation of the ideal intersection point and other pixels on the same straight line, and selecting the pixel point corresponding to the maximum grayscale evaluation as the actual pixel point.

[0046] Understandably, calculating grayscale evaluation includes: calculating the vertical distance between the target intersection point and the reference point; obtaining the distance weight by negatively correlated mapping of the negative of the absolute value of the vertical distance using an exponential function; calculating the ratio of the grayscale value of the reference point to the preset grayscale extreme value; and using the product of the ratio and the distance weight as the grayscale evaluation between the target intersection point and the reference point; and iterating through the grayscale evaluation between the target intersection point and each reference point.

[0047] It should be further explained that after establishing multiple coordinate systems, for each coordinate system, the coordinate information and grayscale value information of each pixel on the vertical axis are collected. For that vertical axis, the grayscale evaluation of the ideal intersection point with other pixels on that vertical axis is calculated to correct for the ideal intersection point.

[0048] The formula for calculating the grayscale value of the ideal intersection point and other pixels on the same straight line is as follows:

[0049]

[0050] In formula (4), The first point on the straight line, counting from the origin. The nth pixel, therefore the nth The ordinate of each pixel is also , For the ideal intersection point and the first point on the same straight line Grayscale evaluation of each pixel For the first The grayscale value of each pixel Let be the ordinate of the ideal intersection point on the straight line. For the ideal intersection point and the first The absolute value of the vertical distance of each pixel. As a distance weight, the preset grayscale extreme value is 255.

[0051] Regarding formula (4), it should be noted that... Represents the first line. The Euclidean distance metric between each pixel and the ideal intersection point is used to convert the distance metric into a weight value between 0 and 1, which varies with the distance. As the value decreases, the distance weight gradually increases, becoming more pronounced as it approaches 1. This represents the grayscale value of the current pixel, and its range is... , This indicates that the grayscale value is larger the closer it is to the theoretical intersection point, and it is used for normalization to eliminate the influence of brightness differences. When smaller and The larger The closer the value is to 1, the more unique the intersection point between other pixels in this column and the ideal intersection point is evaluated. The actual intersection point is the other pixel that is closest to 1.

[0052] It should be noted that other pixels on the same straight line are potential intersection points. The vertical distance is the distance between the ideal intersection point and the potential intersection point. The potential intersection point with the smallest grayscale evaluation is selected as the actual intersection point, and the vertical coordinate of the actual intersection point is obtained.

[0053] It should be added that for any straight line, there will be as many ideal intersection points as there are virtual spiral curves, and each ideal intersection point has a corresponding actual intersection point.

[0054] Step S4: For any straight line, calculate the position distance between any two adjacent actual intersection points to construct a distance sequence. If all distance sequences meet the preset conditions, the fastener product is deemed qualified. If any distance sequence does not meet the preset conditions, the fastener product is deemed to have an abnormality.

[0055] Understandably, calculating the positional distance between any two adjacent actual intersection points to construct a distance sequence includes: selecting one boundary of the stud profile as the starting boundary, selecting another boundary parallel to the starting boundary as the ending boundary, taking any straight line as the target line, establishing a coordinate system with a point on the ending boundary as the origin, the ending boundary as the horizontal axis, and the target line as the vertical axis; taking the difference in the vertical axis coordinates of any two adjacent actual intersection points on the target line as the positional distance, traversing to obtain each vertical axis coordinate difference to construct the distance sequence corresponding to the target line; and traversing to obtain the distance sequence corresponding to each straight line.

[0056] It is understandable that the preset conditions include: a first condition and a second condition; the first condition includes: the deviation of any distance in the distance sequence is not greater than a preset first threshold; the second condition includes: generating a sliding window on the distance sequence, the sliding window moving once every second preset step, calculating the variance of the subsequence of the distance sequence within the sliding window, and the variance of each subsequence not being greater than a preset second threshold.

[0057] It should be further explained that, correspondingly, satisfying the preset conditions means simultaneously satisfying the first condition and the second condition; correspondingly, not satisfying the preset conditions means not satisfying either the first condition or the second condition.

[0058] It should be further explained that not satisfying the first condition or not satisfying the second condition means three situations: First, there exists a distance sequence that does not satisfy the first condition; second, there exists a distance sequence that does not satisfy the second condition; third, there exists a distance sequence that does not satisfy either the first condition or the second condition.

[0059] For example, for After establishing a coordinate system at the actual intersection points, their ordinate coordinates are as follows: The distance between any two adjacent actual intersection points is the difference in the vertical axis coordinates, representing the thread interval on the corresponding straight line. ,in Obtain the distance between any two adjacent actual intersection points, thus obtaining the distance sequence. This distance sequence reflects the distribution of actual thread pitch. The mean of this distance sequence is calculated. The mean value represents the average thread spacing (overall thread pitch level) of the stud. A sliding window mechanism is introduced to calculate the sum of variances for five consecutive intervals.

[0060] It should be noted that the second preset step size is 1.

[0061] The formula for calculating variance using a sliding window is as follows:

[0062]

[0063] In formula (5), The variance of the subsequence within the sliding window is the local variance. This represents the local mean of the distances between positions within the sliding window. This represents the difference between the distance to any position within the sliding window and the local mean. It is the squared deviation of any thread interval within the sliding window from the local mean.

[0064] It should be noted that the deviation of the distance to any position in the distance sequence is... The first threshold is obtained from a sample of qualified fastener products, and the average thread spacing of the qualified fastener product samples is used as the qualified average. For example, the first threshold... For any straight line, the distance sequence is 0.1 times the acceptable mean. ,like A distance sequence that is 0.1 times the acceptable mean indicates a distance sequence. If the first condition is met, otherwise it indicates a distance sequence. If the first condition is not met, the fastener product may have abnormal thread spacing. The variance of the thread spacing of a qualified fastener product sample can be calculated using formula (5). The quantity is adjusted according to the actual situation. For example, the second threshold is twice the qualified variance. The variance of the subsequence of the distance sequence is calculated using a sliding window. For any subsequence variance, if the subsequence variance is not greater than twice the qualified variance, it indicates that the subsequence variance meets the second condition. Otherwise, it indicates that the subsequence variance does not meet the second condition. At this time, the fastener product may have a pitch gradient defect.

[0065] It should be added that if each distance sequence on each straight line... If the first condition is met and the variance of each subsequence on each straight line meets the second condition, then the fastener product is judged to be qualified; otherwise, the fastener product is judged to be abnormal.

[0066] It should be noted that the preferred embodiments of this application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of this application. For those skilled in the art, various modifications and improvements can be made without departing from the concept of the invention, and these all fall within the protection scope of the invention. Therefore, the protection scope of this patent should be determined by the appended claims.

Claims

1. A method for tracing the quality of fastener products, characterized in that, include: Extract the stud profile of the fastener product, wherein the stud profile includes a group of edge points arranged along the axial direction; For any of the aforementioned edge point groups, the edge points are filtered to obtain a thread point set, and the thread point set is fitted to obtain a virtual thread curve; Multiple straight lines parallel to the central axis of the stud profile are preset. One boundary of the stud profile is selected as the starting boundary, and another boundary parallel to the starting boundary is selected as the ending boundary. Any one of the straight lines is taken as the target line. A coordinate system is established with a point on the ending boundary as the origin, the ending boundary as the horizontal axis, and the target line as the vertical axis. The intersection of the vertical axis and any of the virtual threads is taken as the ideal intersection point. The ideal intersection points of each straight line and each virtual thread curve are obtained through iteration. Any ideal intersection point on any straight line is taken as the target intersection point. Using the pixels outside the target intersection point as reference points, the vertical distance between the target intersection point and the reference point is calculated. The distance weight is obtained by negatively mapping the negative of the absolute value of the vertical distance using an exponential function. The ratio of the gray value of the reference point to the preset gray extreme value is calculated. The product of the ratio and the distance weight is used as the gray value evaluation between the target intersection point and the reference point. The gray value evaluation between the target intersection point and each reference point is obtained by traversing. The pixel corresponding to the maximum value of the gray value evaluation is used as the actual intersection point corresponding to the target intersection point. The actual intersection points on each line are obtained by traversing. For any of the straight lines, calculate the positional distance between any two adjacent actual intersection points to construct a distance sequence. In response to all the distance sequences satisfying a preset condition, determine that the fastener product is qualified. In response to any of the distance sequences not satisfying the preset condition, determine that the fastener product is abnormal.

2. The fastener product quality traceability method according to claim 1, characterized in that, The process of filtering the edge points to obtain the thread point set includes: Obtain the base curve, select one boundary of the stud profile as the starting boundary, select another boundary parallel to the starting boundary as the ending boundary, radially anchor the base curve to the starting boundary, translate the base curve axially by a first preset step size, and stop translating when there are intersecting pixels between the base curve and the ending boundary. Taking any of the aforementioned edge point groups as the target group and any pixel of the base curve as the target point, in response to a single translation of the base curve, calculate the Euclidean distance between the target point and each edge point in the target group, filter and obtain the minimum Euclidean distance to obtain the nearest edge point of the target point, traverse to obtain the nearest edge point of each pixel on the base curve, construct a discrete point set, accumulate all the minimum Euclidean distances to obtain the comprehensive distance between the base curve and the discrete point set, traverse to obtain the comprehensive distance between the base curve and the discrete point set after each translation, and select the discrete point set corresponding to the minimum comprehensive distance as the thread point set of the target group.

3. The fastener product quality traceability method according to claim 2, characterized in that, The acquisition of the basic curve includes: The length of each edge point group is calculated using the cv2.arcLength function, and the fitted curve corresponding to the longest edge point group is used as the base curve.

4. The fastener product quality traceability method according to claim 1, characterized in that, Calculating the positional distance between any two adjacent actual intersection points to construct a distance sequence includes: Select one boundary of the stud profile as the starting boundary, and select another boundary parallel to the starting boundary as the ending boundary; Take any of the straight lines as the target line, and establish a coordinate system with a point on the termination boundary as the origin, the termination boundary as the horizontal axis and the target line as the vertical axis. The difference in the vertical axis coordinates of any two adjacent actual intersection points on the target line is taken as the position distance. Each vertical axis coordinate difference is obtained through traversal to construct the distance sequence corresponding to the target line. Iterate through each of the lines to obtain the distance sequence corresponding to each line.

5. The fastener product quality traceability method according to claim 1, characterized in that, The preset conditions include: First condition and second condition; The first condition includes: the deviation of any distance in the distance sequence is not greater than a preset first threshold; The second condition includes: generating a sliding window on the distance sequence, moving the sliding window once every second preset step size, calculating the variance of the subsequence of the distance sequence within the sliding window, and ensuring that the variance of each subsequence is not greater than a preset second threshold.

6. The fastener product quality traceability method according to claim 1, characterized in that, The stud profile of the extracted fastener product includes: Acquire a stud image captured by a camera that is aligned with the center of the fastener product; The stud image is binarized into grayscale based on a preset grayscale threshold to obtain the stud outline.

7. A fastener product quality traceability system, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the fastener product quality traceability method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Screw inspection device

    JP2006145557A

  • Object detecting device, object detecting method, and program

    WO2024071347A1