A method for detecting thread flat defects

CN115984258BActive Publication Date: 2026-08-07GUANGDONG AIKEXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG AIKEXIN TECH CO LTD
Filing Date
2023-02-24
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0007]为解决上述问题,本发明的首要目的在于提供一种螺纹平纹缺陷检测方法,可以通过图像处理技术快速方便的检测出螺杆是否存在平纹缺陷,检测效率高,且更加精确,能够避免螺杆在装配时无法使用的问题

Benefits of technology

[0026]相比于现有技术,本发明的有益效果是:本方法可以通过图像处理技术快速方便的检测出螺杆是否存在平纹缺陷,检测效率高,且更加精确,能够避免螺杆在装配时无法使用的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115984258B_ABST
    Figure CN115984258B_ABST
Patent Text Reader

Abstract

The application discloses a kind of thread flat grain defect detection methods, belong to thread detection field.There is following step: S1: calculate screw area binary image, separate screw and its background, all pixels in screw area are set as full white, background is set as full black;S2: calculate the thread concave point of screw;S3: judge whether there is flat grain defect.Compared with prior art, the beneficial effects of the present application are: this method can quickly and conveniently detect whether there is flat grain defect in screw by image processing technology, the detection efficiency is high, and more accurate, can avoid the problem that screw cannot be used when assembling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical fields:

[0001] This invention belongs to the field of thread inspection, specifically relating to a method for detecting thread run defects. Background technology:

[0002] Screws are a common type of fastener in industrial manufacturing, with high demand and extremely stringent quality requirements. Before assembly, the screw threads need to be inspected to ensure they are free of defects. Manual thread inspection is labor-intensive, and factors such as working conditions and subjective judgment can affect the accuracy of the results. With the development of computer technology, machine vision-based thread inspection technology has emerged. Based on acquired images, through preprocessing and contour matching, the number of screw turns is obtained, enabling quantitative overall and local screw inspection.

[0003] For example, the existing patent with application number CN202211325564.3 discloses a scale-space adaptive method for detecting the internal thread of a nut. Through image acquisition and processing, based on the SIFT algorithm, in the scenario of detecting the internal thread of a hexagonal screw, it matches the key points of standard parts and production parts, and obtains the pass rate by the degree of matching of key points. It can detect defects such as local wear, corrosion or deformation of the internal thread.

[0004] Although this internal thread inspection method can perform overall and partial inspection of the screw, it is mainly used to detect thread breakage defects and cannot detect thread run defects.

[0005] A flat thread refers to a thread structure where no rotation is possible; all threads on a screw or bolt are blocked. If a thread has a flat thread defect, when you place your fingernail against one of the threads and rotate the screw or bolt multiple times, your fingernail will remain on that thread and will not rotate onto other threads. If a bolt has a flat thread defect, the bolt cannot be screwed into the corresponding bolt, resulting in assembly problems.

[0006] Currently, many screws on the rotor shaft of air conditioner motors with metal casings have thread run defects, which affects the assembly and use of the product. Therefore, there is an urgent need in the market for a method to detect thread run defects. Summary of the Invention

[0007] To address the aforementioned problems, the primary objective of this invention is to provide a method for detecting thread run defects. This method can quickly and conveniently detect whether a screw has run defects using image processing technology. It is highly efficient and more accurate, and can prevent the screw from being unusable during assembly.

[0008] To achieve the above objectives, the technical solution of the present invention is as follows:

[0009] The present invention provides a method for detecting thread plain weave defects, comprising the following steps:

[0010] S1: Calculate the binary image of the screw rod area, separate the screw rod from its background, set all pixels within the screw rod area to all white, and set the background to all black;

[0011] S2: Calculate the concave points inside the threads of the screw rod;

[0012] S3: Determine whether there are plain weave defects.

[0013] Furthermore, step S1 includes:

[0014] Step S11: Preset the minimum gray value of the background area as bg_val, and then separate the pixels with gray values < bg_val in the image to obtain the initial binary image of the screw rod;

[0015] Step S12: Remove burrs through the operator operation of openCV, and then filter out small blocks to obtain the area binary image with all pixels white and the background all black.

[0016] Furthermore, step S2 includes:

[0017] Step S21: Calculate the vertical center line x = x0 of the entire screw rod area;

[0018] Step S22: Take the left and right edge points of the screw rod in the y-axis direction, record them in the interval [ymin, ymax], and take the point closest to the center line x0 in the interval as the reference point (xbase, ybase);

[0019] Step S23: Preset the standard thread pitch of the screw rod as d0, and search for all concave points inside the threads upward and downward from y1 = ybase on both the left and right sides of x0;

[0020] Furthermore, in step S21, the center of gravity point of the screw rod area is obtained through the operator operation of openCV, and the perpendicular line of the x-axis where the x coordinate of this point is located is the vertical center line.

[0021] Furthermore, in step S22, when taking the left and right edge points of the screw rod, remove the edge points at the positions of the top screw tail and the bottom screw head, that is: do not take the 1 - 2 thread edge points below the screw tail, and do not take the 1 - 2 threads above the screw head either, and only retain the middle part [ymin, ymax] in the y direction as the edge points.

[0022] Furthermore, in step S22, the reference point (xbase, ybase) must be a concave point inside a certain thread on the screw rod.

[0023] Further, in step S23, the specific method for searching for the concave point of the thread is as follows: From the edge points of [y1-d0 / 2, y1-d0*3 / 2], take the point closest to x0 laterally as a concave point (x2, y2). Then, from this concave point, continue upwards and take the point closest to x0 within the edge points of [y2-d0 / 2, y2-d0*3 / 2] as a concave point, until the search ends at ymin. Similarly, from the reference point y1, from the edge points of [y1+d0 / 2, y1+d0*3 / 2], take the point closest to x0 laterally as a concave point (x2', y2'). Then, from this concave point, continue upwards and take the point closest to x0 within the edge points of [y2'+d0 / 2, y2'+d0*3 / 2] as a concave point, until the search ends at ymax.

[0024] Further, in step S3, the method for determining whether a flat thread defect exists is as follows: It is assumed that the screw calculated in S2 has ln thread concave points on the left side, from top to bottom: (lx1, ly1), (lx2, ly2), ..., (lxn, lyn); and rn thread concave points on the right side, from top to bottom: (rx1, ry1), (rx2, ry2), ..., (rxn, ryn). The first thread concave point on the left (lx1, ly1) is taken, and the absolute value of the angle between the line connecting (lx1, ly1) and all thread concave points on the right side and the horizontal line is calculated to obtain the angle of ln. The smallest angle, min_deg_1, is taken as half a revolution of the thread segment (lx1, ly1). The thread helix angle is calculated. Then, using the same method as (lx1, ly1), the absolute value of the angle between the line connecting (lx2, ly2), ..., (lxn, lyn) and the horizontal line connecting all the concave points of the thread on the right is calculated to obtain the angle of ln. The smallest angle is taken to obtain min_deg_2, ..., min_deg_ln. Assuming that the thread helix angle of the screw of this model is deg0 for one revolution, determine whether there is a value less than (deg0-deg_d1) / 2 among min_deg_1, min_deg_2, ..., min_deg_ln. If so, it is determined that there is a flat thread defect. If not, there is no flat thread defect.

[0025] Furthermore, in step S3, to ensure detection accuracy, a preset value ln / 2 is used. Only when the number of detected values ​​less than (deg0-deg_d1) / 2 is greater than or equal to ln / 2 is it determined that a flat weave defect exists.

[0026] Compared with the prior art, the beneficial effects of the present invention are as follows: This method can quickly and conveniently detect whether there are plain weave defects on the screw through image processing technology, with high detection efficiency and greater accuracy, and can avoid the problem that the screw cannot be used during assembly. Brief Description of the Drawings

[0027] Figure 1 It is the binary image of the area of a normal screw.

[0028] Figure 2 It is the binary image of the area of a screw with plain weave defects. Detailed Embodiment

[0029] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0030] The present invention is implemented as follows:

[0031] As Figure 1-2 shown, this embodiment provides a method for detecting plain weave defects of threads, including the following steps:

[0032] S1: Calculate the binary image of the screw area, separate the screw from its background, set all pixels in the screw area to all white, and set the background to all black;

[0033] S2: Calculate the concave points inside the threads of the screw;

[0034] S3: Determine whether there are plain weave defects.

[0035] Further, step S1 includes:

[0036] Step S11: Preset the minimum gray value of the background area as bg_val, and then separate the pixels with gray values <bg_val in the image to obtain the initial binary image of the screw;

[0037] Step S12: Remove burrs through the operator operation of openCV, and then filter out small blocks to obtain a binary image of the area with all pixels white and the background all black.

[0038] Further, step S2 includes:

[0039] Step S21: Calculate the vertical center line x = x0 of the entire screw area;

[0040] Step S22: Take the left and right edge points of the screw in the y-axis direction, record them in the interval [ymin, ymax], and take the point closest to the center line x0 in the interval as the reference point (xbase, ybase);

[0041] Step S23: Set the standard pitch of the screw to d0. On the left and right sides of x0, search upwards and downwards for all the concave points of the thread.

[0042] Furthermore, in step S21, the centroid of the screw region is obtained through operator operations in OpenCV, and the perpendicular line to the x-axis where the x-coordinate of this point is located is the vertical center line.

[0043] Furthermore, in step S22, when taking the left and right edge points of the screw, the edge points at the locations of the top screw tail and the bottom screw head are removed. That is, 1-2 thread edge points below the screw tail are not needed, and 1-2 threads above the screw head are also not needed. Only the middle part [ymin, ymax] is retained as edge points in the y direction.

[0044] Furthermore, in step S22, the reference point (xbase, ybase) must be a certain concave point of the thread on the screw.

[0045] Further, in step S23, the specific method for searching for the concave point of the thread is as follows: From the edge points of [y1-d0 / 2, y1-d0*3 / 2], take the point closest to x0 laterally as a concave point (x2, y2). Then, from this concave point, continue upwards and take the point closest to x0 within the edge points of [y2-d0 / 2, y2-d0*3 / 2] as a concave point, until the search ends at ymin. Similarly, from the reference point y1, from the edge points of [y1+d0 / 2, y1+d0*3 / 2], take the point closest to x0 laterally as a concave point (x2', y2'). Then, from this concave point, continue upwards and take the point closest to x0 within the edge points of [y2'+d0 / 2, y2'+d0*3 / 2] as a concave point, until the search ends at ymax.

[0046] Further, in step S3, the method for determining whether a flat thread defect exists is as follows: It is assumed that the screw calculated in S2 has ln thread concave points on the left side, from top to bottom: (lx1, ly1), (lx2, ly2), ..., (lxn, lyn); and rn thread concave points on the right side, from top to bottom: (rx1, ry1), (rx2, ry2), ..., (rxn, ryn); The first thread concave point on the left (lx1, ly1) is taken, and (lx1, ly1) is calculated. The absolute value of the angle between the line connecting all concave points of the thread on the right and the horizontal line is used to obtain the angle of ln. The smallest angle, min_deg_1, is taken as the thread helix or helix angle of (lx1, ly1) for half a revolution of the thread segment. The same method is used to obtain the thread helix or helix angle min_deg_2 for half a revolution of the thread segment. This process continues until ln such angles are obtained, namely min_deg_1, min_deg_2, ..., min_deg_ln. Assuming that the thread helix or helix angle of one revolution of the thread of this type of screw is deg0 (the tolerance range is [-deg_d1, +deg_d2]), it is determined whether there is a value less than (deg0-deg_d1) / 2 among min_deg_1, min_deg_2, ..., min_deg_ln. If so, it is determined that there is a flat thread defect; if not, there is no flat thread defect.

[0047] Furthermore, in step S3, to ensure detection accuracy, a preset value ln / 2 is used. Only when the number of detected values ​​less than (deg0-deg_d1) / 2 is greater than or equal to ln / 2 is it determined that a flat weave defect exists.

[0048] Furthermore, it should be noted that the OpenCV image processing technology used in this application is prior art.

[0049] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting thread run-out defects, characterized in that, It includes the following steps: S1: Calculate the binary image of the screw region to separate the screw from its background. All pixels within the screw region are set to pure white, and the background is set to pure black; S2: Calculate the concave points inside the screw threads; S3: Determine whether there are plain weave defects; In step S3, the method for determining whether there are plain weave defects is as follows: Assume that there are ln concave points inside the screw threads calculated in S2 on the left side of the screw, which are (lx1, ly1), (lx2, ly2),..., (lxn, lyn) from top to bottom; and there are rn concave points inside the screw threads on the right side, which are (rx1, ry1), (rx2, ry2),..., (rxn, ryn) from top to bottom. Take the first concave point (lx1, ly1) on the left side, calculate the absolute value of the angle between the line connecting (lx1, ly1) and all concave points on the right side and the horizontal line, obtaining ln angles. Take the minimum angle min_deg_1 as the upward or downward rotation angle of the screw thread for half a turn of the thread where (lx1, ly1) is located. Then, in the same way as (lx1, ly1), calculate the absolute value of the angle between the line connecting (lx2, ly2),..., (lxn, lyn) and all concave points on the right side and the horizontal line, obtaining ln angles. Take the minimum angle to get min_deg_2,..., min_deg_ln. Assume that the upward or downward rotation angle of the screw thread for one full turn of the screw is deg0. Determine whether there is a value less than (deg0 - deg_d1) / 2 among min_deg_1, min_deg_2,..., min_deg_ln. If so, it is determined that there are plain weave defects; if not, there are no plain weave defects.

2. The thread run defect detection method as described in claim 1, characterized in that, Step S1 includes: Step S11: Preset the minimum gray value of the background region as bg_val, and then separate the pixels in the image with gray value < bg_val to obtain the initial binary image of the screw region; Step S12: Remove burrs through the operator operation of openCV, and then filter out small blocks to obtain a binary image of the screw region with all pixels white and the background black.

3. The thread run defect detection method as described in claim 1, characterized in that, Step S2 includes: Step S21: Calculate the vertical center line x = x0 of the entire screw region; Step S22: Take the left and right edge points of the screw in the y-axis direction and record them in the interval [ymin, ymax]. Take the point closest to the center line x0 in the interval as the reference point (xbase, ybase); Step S23: Preset the standard screw pitch of the screw as d0. On both the left and right sides of x0, starting from y1 = ybase, search upward and downward for all concave points inside the screw threads.

4. The thread run defect detection method as described in claim 3, characterized in that, In step S21, the center of gravity point of the screw region is obtained through the operator operation of openCV, and the perpendicular line of the x-axis where the x coordinate of this center of gravity point is located is the vertical center line.

5. The thread run defect detection method as described in claim 3, characterized in that, In step S22, when taking the left and right edge points of the screw, remove the edge points at the positions of the top screw tail and the bottom screw head, that is: do not take the 1 - 2 thread edge points below the screw tail and do not take the 1 - 2 threads above the screw head. Only retain the middle part [ymin, ymax] in the y direction as the edge points.

6. The thread run defect detection method as described in claim 3, characterized in that, In step S22, the reference point (xbase, ybase) is a certain concave point of the thread on the screw.

7. The thread run defect detection method as described in claim 3, characterized in that, In step S23, the specific method for searching for the concave point of the thread is as follows: From the edge points of [y1-d0 / 2, y1-d0*3 / 2], take the point closest to x0 laterally as a concave point (x2, y2). Then, from this concave point, continue upwards and take the point closest to x0 within the edge points of [y2-d0 / 2, y2-d0*3 / 2] as a concave point, until the search ends at ymin. Similarly, from the reference point y1, from the edge points of [y1+d0 / 2, y1+d0*3 / 2], take the point closest to x0 laterally as a concave point (x2', y2'). Then, from this concave point, continue upwards and take the point closest to x0 within the edge points of [y2'+d0 / 2, y2'+d0*3 / 2] as a concave point, until the search ends at ymax.

8. The method for detecting thread runout defects as described in claim 1, characterized in that, In step S3, to ensure detection accuracy, a preset value ln / 2 is used. Only when the number of detected values ​​less than (deg0-deg_d1) / 2 is greater than or equal to ln / 2 is it determined that a flat weave defect exists.

Citation Information

Patent Citations

  • A scale-space adaptive method for detecting internal threads in nuts

    CN115393355B

  • Method for automatically detecting screw anomaly

    CN108010027A