Fastener product quality tracing method and system
By extracting the stud profile, filtering edge point groups, and fitting a virtual thread curve, the grayscale and positional distance of the intersection points are calculated, thus solving the problem of low thread detection accuracy in fastener products and achieving higher-precision quality traceability.
Patent Information
- Application Number
- CN202511429954.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-09
AI Technical Summary
Traditional fastener products have low accuracy in detecting thread abnormalities, which affects the safety and reliability of equipment.
By extracting the stud profile, filtering edge point groups and fitting virtual thread curves, calculating the grayscale evaluation of intersection points and positional distances, a distance sequence is constructed to determine thread anomalies in fastener products.
This improves the accuracy of thread inspection for fastener products, ensuring product quality reliability.
Smart Images

Figure CN120912598A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of fastener. More particularly, the present application relates to a fastener product quality traceability method and system. BACKGROUND
[0002] Fastener products include bolts, studs, screws, nuts, etc. As key basic components in the fields of machinery, construction, automobiles, etc., the quality of fastener products directly affects the safety and reliability of the overall equipment. Fastener product quality traceability mainly detects whether there are thread abnormalities on the surface of fastener products, and the precision of thread abnormality detection in the traditional technology is low. SUMMARY
[0003] The main purpose of the embodiments of the present application is to provide a fastener product quality traceability method and system, which aims to improve the precision of thread detection in fastener products.
[0004] To achieve the above purpose, the embodiments of the first aspect of the present application provide a fastener product quality traceability method, which comprises: extracting a stud profile of a fastener product, the stud profile comprising a plurality of edge point groups arranged along the axial direction; for any edge point group, screening the edge points to obtain a thread point set, and fitting the thread point set to obtain a virtual thread curve; presetting a plurality of straight lines parallel to the center axis of the stud profile, obtaining an 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 pixel points on any straight line except the target intersection point as reference points, calculating the gray scale evaluation of the target intersection point and the reference points, taking the pixel point corresponding to the maximum value of the gray scale evaluation as the actual intersection point corresponding to the target intersection point, and traversing to obtain the actual 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 fastener product is qualified, and in response to any distance sequence not satisfying the preset condition, judging that the fastener product has an abnormality.
[0005] In some embodiments, the screening the edge points in the thread point set comprises: obtaining a base curve, selecting one boundary of the stud contour as a starting boundary, selecting another boundary parallel to the starting boundary as a terminal boundary, radially anchoring the base curve at the starting boundary, translating the base curve along an axial direction by a first preset step, and stopping the translation in response to the base curve intersecting with the terminal boundary; taking any of the edge point groups as a target group, taking any pixel point of the base curve as a target point, calculating a Euclidean distance between the target point and each edge point in the target group in response to the base curve being translated once, screening and obtaining a minimum Euclidean distance to obtain a nearest edge point of the target point, traversing to obtain the nearest edge point of each pixel point on the base curve, constructing a discrete point set, accumulating all the minimum Euclidean distances to obtain a comprehensive distance between the base curve and the discrete point set, and traversing to obtain the comprehensive distance between the base curve and the discrete point set after each translation of the base curve; 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, the obtaining the base curve comprises: calculating a length of each of the edge point groups by a cv2.arcLength function, and taking a fitting curve corresponding to the longest edge point group as the base curve.
[0007] In some embodiments, the obtaining the ideal intersection point between any of the straight lines and any of the virtual thread curves comprises: selecting one boundary of the stud contour as a starting boundary, and selecting another boundary parallel to the starting boundary as a terminal boundary; taking any of the straight lines as a target line, establishing a coordinate system with a point on the terminal boundary as an origin, the terminal boundary as a horizontal axis, and the target line as a vertical axis, and taking an intersection point between the vertical axis and any of the virtual threads as the ideal intersection point. Traversing to obtain the ideal intersection point between each of the straight lines and each of the virtual thread curves.
[0008] In some embodiments, the calculating the gray scale evaluation comprises: calculating a vertical axis distance between the target intersection point and the reference point, performing a negative correlation mapping on an inverse of an absolute value of the vertical axis distance by an exponential function to obtain a distance weight, calculating a ratio of a gray scale value of the reference point to a preset gray scale extreme value, and taking a product of the ratio and the distance weight as the gray scale evaluation between the target intersection point and the reference point; and traversing to obtain the gray scale evaluation between the target intersection point and each of the reference points.
[0009] In some embodiments, the calculating the position distance of any two adjacent actual intersection points to construct a distance sequence comprises: selecting one boundary of the stud contour as a starting boundary, selecting another boundary parallel to the starting boundary as a terminal boundary, selecting any straight line as a target line, establishing a coordinate system with a point on the terminal boundary as an origin, with the terminal boundary as a horizontal axis and with the target line as a vertical axis; taking the vertical axis coordinate difference of any two adjacent actual intersection points on the target line as the position distance, and 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.
[0010] In some embodiments, the preset condition comprises a first condition and a second condition; the first condition comprises that the deviation of any distance in the distance sequence is not greater than a first preset threshold; and the second condition comprises generating a sliding window on the distance sequence, calculating the subsequence variance of the distance sequence in the sliding window each time the sliding window moves by a second preset step, and each subsequence variance being not greater than a second preset threshold.
[0011] In some embodiments, the extracting the stud contour comprises: acquiring a stud image captured by a camera aligned with the center of the fastener product; and binarizing a grayscale map of the stud image according to a preset grayscale threshold to obtain the stud contour.
[0012] To achieve the above object, embodiments of a second aspect of the present application provide a fastener product quality traceability system, which comprises: a processor and a memory, and the memory stores computer program instructions, when the computer program instructions are executed by the processor, the fastener product quality traceability method according to the above is implemented.
[0013] The present application has the following beneficial effects: The present application firstly extracts the stud profile, the stud profile including a plurality of axially arranged edge point groups, the edge point groups being the threads to be detected, so as to determine whether the threads are abnormal by detecting the edge point groups, for each edge point group, the present application screens the edge points to obtain a thread point set to fit a virtual thread curve, at this time, the virtual thread curve is an ideal thread curve, and errors may exist, so the present application further presets a plurality of straight lines parallel to the central axis of the stud profile, each straight line and each virtual thread curve have an ideal intersection point, then the gray evaluation of each ideal intersection point and other pixel points on the straight line where the ideal intersection point is located is calculated, and an actual intersection point corresponding to a maximum gray evaluation is selected for each ideal intersection point, the actual intersection point is a correction of the ideal intersection point, and the actual intersection point is closer to the real thread, therefore, for each straight line, the position distance between two adjacent actual intersection points is calculated to construct a distance sequence, if each distance sequence in the fastener product meets the preset condition, the fastener product is determined to be qualified, and if any distance sequence in the fastener product does not meet the preset condition, the fastener product is determined to be abnormal. Therefore, the present application can improve the precision of thread detection in the fastener product. BRIEF DESCRIPTION OF DRAWINGS
[0014] Figure 1 is a flowchart of steps S1-step S4 in a fastener product quality traceability method according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments of the present application.
[0016] The specific embodiments of the present application will be described in detail below with reference to the drawings.
[0017] REFERENCE Figure 1 A fastener product quality traceability method includes steps S1-step S4, and specifically as follows: Step S1: extracting the stud profile of the fastener product, the stud profile including a plurality of axially arranged edge point groups.
[0018] It should be noted that the fastener product is horizontally fixed on a detection station, the center of the fastener product is vertically aligned with the center of the area of the detection station, a camera is arranged above the detection station, and the camera is vertically aligned with the center of the area of the detection station, so that the complete stud image of the fastener product can be collected by the camera, thereby laying a foundation for subsequent thread abnormality detection. Exemplarily, for a stud with a diameter of 5-20 mm, a high-precision industrial camera with a resolution of not less than 5 MP is used, and a lens with a focal length of 16 mm and an object distance of 500 mm is selected, so as to ensure that the pixel resolution of the stud profile is ≥0.01 mm / pixel (a single thread occupies ≥10 pixels).
[0019] It can be understood that the extraction of the shank profile of the fastener product comprises: acquiring a shank image of the camera collection which is directly aligned with the center of the fastener product; binarizing the gray image of the shank image according to a preset gray threshold value to obtain the shank profile.
[0020] It needs to be supplemented that, since the gray value of the thread is higher than that of other areas of the shank, the pixels with a gray value greater than the preset gray threshold value are set as black, and the pixels with a gray value not greater than the preset gray threshold value are converted into black and white images by setting a threshold value, so as to highlight the thread edge, i.e., the edge point group of the present application. Exemplarily, the shank profile can also be extracted by a U-Net++ model.
[0021] Step S2: For any edge point group, the edge points therein are screened to obtain a thread point set, and the virtual thread curve is fitted according to the thread point set.
[0022] It can be understood that the screening of the edge points to obtain the thread point set comprises: acquiring a basic curve, selecting one boundary of the shank profile as a starting boundary and selecting another boundary parallel to the starting boundary as a terminal boundary, anchoring the basic curve radially at the starting boundary, translating the basic curve along the axial direction at a first preset step length, and stopping the translation in response to the existence of intersection pixel points between the basic curve and the terminal boundary; taking any edge point group as a target group and taking any pixel point of the basic 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 translation of the basic curve once, screening and acquiring the minimum Euclidean distance to obtain the nearest edge point of the target point, traversing to obtain the nearest edge point of each pixel point on the basic curve to construct a discrete point set, accumulating all minimum Euclidean distances to obtain the comprehensive distance between the basic curve and the discrete point set, and traversing to obtain the comprehensive distance between the basic 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.
[0023] It needs to be supplemented that, in the collected image, the shank profile is in a rectangular shape, the length direction of the rectangle is the axial direction of the shank, one width of the shank profile is selected as the starting boundary, the other width of the shank profile is selected as the terminal boundary, the basic curve is anchored at the starting boundary, and the basic curve is translated along the axial direction at a first preset step length until the basic curve intersects with the terminal boundary. The first preset step length of the present application is the distance of one pixel point.
[0024] It can be understood that the acquisition of the basic curve comprises: calculating the length of each edge point group by a cv2.arcLength function, and taking the fitting curve corresponding to the longest edge point group as the basic curve.
[0025] It needs to be added that after getting the thread profile, each edge point group in the thread profile can be detected by using the cv2.findContours function in the OpenCV (Open Source Computer Vision Library) image processing library, and then the length of each edge point group is calculated by the cv2.arcLength function, and after traversal and sorting, the longest edge point group (because it is more likely to reflect the real thread) is selected to perform curve fitting to obtain the basic curve.
[0026] It needs to be added that for any edge point group, the basic curve is translated by one pixel point in the axial direction, the edge point group is screened once to obtain a discrete point set, and the comprehensive distance between the basic curve and the discrete point set is calculated once, and after the translation of the basic curve ends, the discrete point set corresponding to the smallest comprehensive distance is taken as the thread point set of the edge point group. Wherein, the screening process for screening the discrete point set is: for any pixel point on the basic curve, the Euclidean distance between the pixel point and each 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 the pixel point on the basic curve, and the nearest edge point of each pixel point on the basic curve is obtained to obtain the discrete point set. Wherein, the comprehensive distance between the basic curve and the discrete point set is calculated once: the smallest Euclidean distance is accumulated to obtain the comprehensive distance between the basic curve and the discrete point set.
[0027] Exemplarily, the calculation formula of the comprehensive distance is as follows: In formula (1), is a pixel point on the basic curve, is a pixel point , is the pixel position coordinate of the pixel point , is a pixel point in the edge point group, is a pixel point , is the pixel position coordinate of the pixel point , is the Euclidean distance between the pixel point and the pixel point .
[0028] In formula (2), indicates the th translation of the basic curve, is the total number of pixel points on the basic curve, for any edge point group, is the th pixel point on the basic curve after the th translation.
[0029] For formula (2), it needs to be pointed out that for any edge point group, the nearest edge point corresponding to the pixel point on the base curve after the second translation is taken as , and the nearest edge point corresponding to each pixel point on the base curve is obtained by traversal to construct the discrete point set , that is, the nearest edge point set corresponding to the pixel points on the base curve.
[0030] It needs to be pointed out that for any edge point group, after the base curve translation ends, the smallest corresponding discrete point set is selected as the thread point set of the edge point group. The virtual thread curve fitted through the thread point set is closer to the actual thread.
[0031] It needs to be pointed out that since there may be local noise (such as small fluctuations remaining after isolated noise is removed) in the thread point set, the virtual thread curve directly fitted may present a jagged shape, which does not conform to the physical characteristics of the thread “continuous spiral”. Therefore, for the thread point set , a quadratic function is used to solve the coefficients by least squares method, so that the overall deviation of the virtual thread curve and the thread point set is minimized. At this time, the overall trend of the discrete point set can be preserved, and only the local high-frequency noise can be eliminated, so that a smooth curve is obtained.
[0032] In formula (3), In formula (3), represents the error square of the pixel point in the thread point set , is the minimum error square sum corresponding to the thread point set , and the coefficient value corresponding to the minimum error square sum is taken.
[0033] For formula (3), it needs to be pointed out that “square” is used to eliminate the offset of positive and negative errors, amplify the influence of points with large deviation, and ensure the overall stability. Since the overall error is to be obtained, the error square of each pixel point in the thread point set is summed and the appropriate is found to make the overall error minimum.
[0034] Step S3: presetting a plurality of straight lines parallel to the central axis of the stud profile, obtaining an 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 any pixel point on any straight line except the target intersection point as a reference point, calculating a gray evaluation of the target intersection point and the reference point, taking a pixel point corresponding to a maximum value of the gray evaluation as an actual intersection point corresponding to the target intersection point, and traversing to obtain the actual intersection point on each straight line.
[0035] It can be understood that the ideal intersection point of any straight line and any virtual thread curve includes: selecting one boundary of the stud profile as a starting boundary and selecting another boundary parallel to the starting boundary as a terminating boundary; taking any straight line as a target line, taking a point on the terminating boundary as an origin, taking the terminating boundary as a horizontal axis and taking the target line as a vertical axis to establish a coordinate system, and taking an intersection point of the vertical axis and any virtual thread as an ideal intersection point; and traversing to obtain the ideal intersection point of each straight line and each virtual thread curve.
[0036] It should be noted that the length of the terminating boundary in the two-dimensional image is a mapping of the diameter of the three-dimensional fastener product stud, and three origins can be selected within every millimeter on the terminating boundary to ensure comprehensive coverage of the axial characteristics of the stud and provide a basis for subsequent fine judgment of whether the thread is abnormal.
[0037] It should be noted that the ideal intersection point represents a theoretical intersection point, and there may be errors between the ideal intersection point and the real thread curve intersection point, so the present application corrects the ideal intersection point by calculating the gray evaluation of the ideal intersection point and other pixel points on the same straight line and selecting the pixel point corresponding to the maximum gray evaluation as the actual pixel point.
[0038] It can be understood that the calculation of the gray evaluation includes: calculating the vertical axis distance between the target intersection point and the reference point, obtaining the distance weight by negatively correlating the inverse of the absolute value of the vertical axis distance through an exponential function, calculating the ratio of the gray value of the reference point to the preset gray extreme value, and taking the product of the ratio and the distance weight as the gray evaluation between the target intersection point and the reference point; and traversing to obtain the gray evaluation between the target intersection point and each reference point.
[0039] It should be noted that after establishing a plurality of coordinate systems, for each coordinate system, the coordinate information and the gray value information of each pixel point on the vertical axis of the coordinate system are collected. For the vertical axis, the gray evaluation of the ideal intersection point of the vertical axis and other pixel points on the vertical axis is calculated to correct the ideal intersection point of the vertical axis.
[0040] The formula for calculating the gray evaluation of the ideal intersection point and other pixel points on the same straight line is as follows: In formula (4), is the first The vertical axis coordinate of the first pixel point is also , , The gray evaluation of the ideal intersection point and the first pixel point on the straight line is The gray value of the first pixel point is The vertical axis coordinate of the ideal intersection point is The absolute value of the vertical axis distance between the ideal intersection point and the first pixel point is The distance weight is preset to be 255. For formula (4), it needs to be supplemented that The Euclidean distance metric between the first pixel point on the straight line and the ideal intersection point is
[0041] With the decrease of the distance, the distance weight gradually increases, and is closer to 1. The gray value of the current pixel is , The gray value is closer to the theoretical intersection point, and is used for normalization to eliminate the influence of brightness difference. When is smaller and is larger, the value of tends to 1, and by calculating the uniqueness evaluation of other pixel points on this column to the ideal intersection point , the other pixel point closest to 1 is selected as the actual intersection point. It needs to be supplemented that other pixel points on the same straight line are potential intersection points, the vertical axis distance is the distance between the ideal intersection point and the potential intersection point, the potential intersection point with the smallest gray evaluation is selected as the actual intersection point, and the vertical axis coordinate of the actual intersection point is obtained. It needs to be supplemented that for any straight line, there are several ideal intersection points for several virtual thread curves, and each ideal intersection point has a corresponding actual intersection point.
[0042] Step S4: For any straight line, the position distance of any two adjacent actual intersection points is calculated to construct a distance sequence, in response to the fact that all distance sequences meet the preset condition, it is judged that the fastener product is qualified, and in response to the fact that any distance sequence does not meet the preset condition, it is judged that the fastener product has an abnormality.
[0043]
[0044]
[0045] It can be understood that the position distance of any two adjacent actual intersection points is calculated to construct the distance sequence, including: selecting one boundary of the stud profile as a starting boundary, selecting another boundary parallel to the starting boundary as a terminating boundary, selecting any straight line as a target line, establishing a coordinate system with a point on the terminating boundary as the origin, the terminating boundary as the horizontal axis and the target line as the vertical axis; taking the vertical axis coordinate difference of any two adjacent actual intersection points on the target line as the position distance, and 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.
[0046] It can be understood that the preset condition includes: 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 first preset threshold; and the second condition includes: generating a sliding window on the distance sequence, the sliding window moves by a second preset step each time, calculating the variance of a subsequence in the distance sequence in the sliding window each time, and each subsequence variance is not greater than a second preset threshold.
[0047] It should be noted that, correspondingly, the preset condition is satisfied when the first condition and the second condition are both satisfied; and correspondingly, the preset condition is not satisfied when the first condition is not satisfied or the second condition is not satisfied.
[0048] It should be noted that the first condition is not satisfied or the second condition is not satisfied represents three cases: a first case where any distance sequence does not satisfy the first condition; a second case where any distance sequence does not satisfy the second condition; and a third case where any distance sequence does not satisfy the first condition and the second condition.
[0049] Exemplarily, for actual intersection points, after establishing a coordinate system, the vertical axis coordinates thereof are respectively, the position distance of any two adjacent actual intersection points is the vertical axis coordinate difference, and represents the thread spacing on the corresponding straight line, i.e. , wherein ; the position distance of all adjacent actual intersection points is obtained, and thus the distance sequence can be obtained. The distance sequence can reflect the distribution of the actual thread spacing, and the mean value of the distance sequence represents the average thread spacing (overall pitch level) of the stud. The sliding window mechanism is introduced, and the variance sum of the continuous 5 intervals is calculated.
[0050] It should be noted that the second preset step is 1.
[0051] The sliding window calculation variance formula is as follows: In formula (5), the local variance of the sub-sequence of the distance sequence in the sliding window, the local mean of the distance of the position in the sliding window, the deviation of the distance of the position in the sliding window from the local mean, the deviation square of the thread interval in the sliding window from the local mean.
[0052] It should be noted that the deviation of the distance of the position in the distance sequence is , the first threshold is obtained from the qualified fastener product sample, the mean of the thread interval of the qualified fastener product sample is taken as the qualified mean, and the first threshold is exemplarily 0.1 times of the qualified mean. For the distance sequence on any straight line, if the distance sequence is 0.1 times of the qualified mean, it indicates that the distance sequence satisfies the first condition, otherwise it indicates that the distance sequence does not satisfy the first condition, and the fastener product may have an abnormal thread interval. The thread interval variance of the qualified fastener product sample can be obtained by referring to formula (5), and the number of is adjusted according to actual conditions. Exemplarily, the second threshold is 2 times of the qualified variance, the sub-sequence variance of the distance sequence is calculated using the sliding window, and for any sub-sequence variance, if the sub-sequence variance is not greater than 2 times of the qualified variance, it indicates that the sub-sequence variance satisfies the second condition, otherwise it indicates that the sub-sequence variance does not satisfy the second condition, and the fastener product may have a pitch gradient defect.
[0053] It should be noted that if each distance sequence on each straight line satisfies the first condition, and each sub-sequence variance on each straight line satisfies the second condition, it is determined that the fastener product is qualified, otherwise it is determined that the fastener product has an abnormality.
[0054] It should be noted that the above refers to the preferred embodiments of the embodiments of the application, and is not limited to the scope of the embodiments of the application. For those skilled in the art, without departing from the inventive concept, a number of modifications and improvements can be made, which are within the scope of the application. Therefore, the protection scope of the patent of the application should be subject to the appended claims.
Claims
1. A fastener product quality traceability method characterized by, The method comprises the following steps: extracting a stud profile of a fastener product, the stud profile comprising a plurality of edge point groups arranged in an axial direction; for any edge point group, screening edge points therein to obtain a thread point set, and fitting the thread point set to obtain a virtual thread curve; predefining a plurality of straight lines parallel to a central axis of the stud profile, obtaining an 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 a pixel point on any straight line other than the target intersection point as a reference point, calculating a gray scale evaluation of the target intersection point and the reference point, taking a pixel point corresponding to a maximum value of the gray scale evaluation as an actual intersection point corresponding to the target intersection point, and iteratively obtaining the actual intersection point on each straight line; for any straight line, calculating a position distance between any two adjacent actual intersection points to construct a distance sequence, judging that the fastener product is qualified in response to all distance sequences satisfying a preset condition, and judging that the fastener product has an abnormality in response to any distance sequence not satisfying the preset condition.
2. The fastener product quality traceability method according to claim 1, wherein, The screening of the edge points to obtain the thread point set comprises: obtaining a base curve, selecting one boundary of the stud profile as a starting boundary and another boundary parallel to the starting boundary as a terminal boundary, radially anchoring the base curve at the starting boundary, axially translating the base curve by a first preset step, and stopping the translation in response to the base curve having intersection pixel points with the terminal boundary; taking any edge point group as a target group and any pixel point 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 one translation of the base curve, screening and obtaining the minimum Euclidean distance to obtain the nearest edge point of the target point, iteratively obtaining the nearest edge point of each pixel point on the base curve to construct a discrete point set, accumulating all minimum Euclidean distances to obtain the comprehensive distance between the base curve and the discrete point set, and iteratively obtaining the comprehensive distance between the base curve and the discrete point set after each translation of the base curve; and selecting 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, wherein The obtaining of the base curve comprises: calculating the length of each edge point group by using a cv2.arcLength function, and taking the fitting curve corresponding to the longest edge point group as the base curve.
4. The fastener product quality traceability method according to claim 1, wherein The obtaining of the ideal intersection point of any straight line and any virtual thread curve comprises: selecting one boundary of the stud profile as a starting boundary and another boundary parallel to the starting boundary as a terminal boundary; taking any straight line as a target line, establishing a coordinate system with a point on the terminal boundary as an origin, the terminal boundary as a horizontal axis and the target line as a vertical axis, and taking the intersection point of the vertical axis and any virtual thread as the ideal intersection point; iteratively obtaining the ideal intersection point of each straight line and each virtual thread curve.
5. The fastener product quality traceability method according to claim 4, wherein The calculation of the gray scale evaluation comprises: The target intersection point and the reference point are calculated for the longitudinal axis distance, the distance weight is obtained by negatively correlating the inverse of the absolute value of the longitudinal axis distance with an exponential function, the ratio of the gray value of the reference point to the preset gray extremum is calculated, and the product of the ratio and the distance weight is taken as the gray evaluation between the target intersection point and the reference point. The gray evaluation between the target intersection point and each reference point is obtained by iteration.
6. The method of claim 1, wherein, The position distance of any two adjacent actual intersection points is calculated to construct a distance sequence, including: One boundary of the stud profile is selected as a starting boundary, and another boundary parallel to the starting boundary is selected as a terminal boundary; Any straight line is taken as a target line, a point on the terminal boundary is taken as an origin, the terminal boundary is taken as a horizontal axis, and the target line is taken as a vertical axis to establish a coordinate system; The vertical axis coordinate difference between any two adjacent actual intersection points on the target line is taken as the position distance, and each vertical axis coordinate difference is obtained by iteration to construct the distance sequence corresponding to the target line; Each distance sequence corresponding to each straight line is obtained by iteration.
7. The method of claim 1, wherein, The preset condition includes: The first condition and the second condition; The first condition includes that the deviation of any distance in the distance sequence is not greater than a preset first threshold value; The second condition includes that a sliding window is generated on the distance sequence, the sliding window is moved by a second preset step each time, the variance of a subsequence of the distance sequence in the sliding window is calculated each time, and each subsequence variance is not greater than a preset second threshold value.
8. The method of claim 1, wherein, The extraction of the stud profile of the fastener product includes: A stud image captured by a camera aligned with the center of the fastener product is obtained; The gray image of the stud image is binarized according to a preset gray threshold value to obtain the stud profile.
9. A fastener product quality traceability system characterized by, It includes: A processor and a memory, the memory stores computer program instructions, when the computer program instructions are executed by the processor, the fastener product quality traceability method according to any one of claims 1-8 is realized.
Citation Information
Patent Citations
Grouting pipe surface defect detection method and system based on image data
CN115170507A
Bolt thread defect detection method based on image processing
CN116664554A
Screw inspection device
JP2006145557A
Manufacturing line abnormality portent detection apparatus, manufacturing line abnormality portent detection method, manufacturing line abnormality portent detection program, manufacturing apparatus, and inspection apparatus
US20240045407A1
Object detecting device, object detecting method, and program
WO2024071347A1
Cited By
Intelligent defect detection method and system for coated iron core
CN121169930A
A method and system for intelligent detection of defects for coating a core
CN121169930B
