A quantitative evaluation method for bolt and nut connection anti-loosening performance based on machine vision

By directly measuring the nut loosening angle using machine vision technology, the complexity of quantitative evaluation of nut anti-loosening performance in existing technologies is solved, and the accurate judgment of the critical lateral force range is achieved, thus improving the accuracy of the evaluation.

CN119027399BActive Publication Date: 2025-10-24BEIJING INST OF TECH +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411137063.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-10-24
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

It is difficult to accurately and quantitatively evaluate the anti-loosening performance of nuts with existing technologies. The calculation process is complex and has many influencing factors, making it difficult to determine the threshold value of the preload attenuation rate for rotational loosening.

Method used

By employing machine vision technology, the video of the nut is read, and grayscale processing, Gaussian filtering, Canny edge detection, contour extraction, and minimum circumscribed rectangle deflection angle calculation are performed. The nut loosening angle is then directly measured to determine the critical lateral force, thereby achieving an accurate quantitative evaluation of the anti-loosening performance.

Benefits of technology

Accurate judgment of initial loosening of nuts improves the accuracy of quantitative evaluation of anti-loosening performance and enables accurate judgment of the critical lateral force range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027399B_ABST
    Figure CN119027399B_ABST
Patent Text Reader

Abstract

The application provides a quantitative evaluation method for bolt-nut connection anti-loose performance based on machine vision, comprising: reading a video of a nut; acquiring all frame images in the video; performing gray processing and Gaussian filtering on all frame images; determining edge pixel points in a target image; determining target edge pixel points; determining all contours in the target image among the target edge pixel points; determining coordinates of contour pixel points among all contours; determining a minimum circumscribed rectangle among contour point sets, and determining a deflection angle; determining whether the nut is loose according to the deflection angle, taking the minimum lateral force causing the nut to loosen as a critical lateral force of the nut; and evaluating the bolt-nut connection anti-loose performance according to the critical lateral force. The method can accurately judge the initial loosening of the nut, accurately judge the critical lateral force range, and improve the accuracy of quantitative evaluation of the anti-loose performance of the nut.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of nut anti-loosening performance detection, and particularly relates to a bolt and nut connection anti-loosening performance quantitative evaluation method based on machine vision. BACKGROUND

[0002] Bolt connection has the advantages of simple structure, convenient assembly and disassembly, and low price, and is widely used in various industrial products and mechanical structures. Engineering experience shows that bolt connection is prone to loosening failure in a vibration environment, which is a common problem threatening the reliability of mechanical products. Therefore, it is necessary to evaluate the anti-loosening performance of bolt connection.

[0003] The anti-loosening performance evaluation method of bolt connection structure can be divided into two categories, namely qualitative evaluation and quantitative evaluation. Among them, Chinese patent 202010393182.9 proposes a quantitative evaluation method taking the critical lateral force triggering the rotation loosening of bolt connection as an index. The method is based on a lateral vibration test, and according to the data of the second stage of the pre-tightening force decay curve under different lateral force conditions, the pre-tightening force decay rate (percentage of pre-tightening force decay per cycle to initial pre-tightening force) is calculated. When the pre-tightening force decay rate exceeds a certain threshold, it is judged that the bolt connection has occurred rotation loosening, wherein the minimum lateral force triggering the rotation loosening of bolt connection is called critical lateral force. However, in this method, the calculation process of the pre-tightening force decay rate is complex, and the factors affecting the decay rate include other factors (such as fretting wear) in addition to rotation loosening, making it difficult to determine the threshold of the pre-tightening force decay rate corresponding to the rotation loosening.

[0004] Therefore, there is an urgent need for an evaluation method that can accurately quantify the anti-loosening performance. SUMMARY

[0005] The present application provides a bolt and nut connection anti-loosening performance quantitative evaluation method based on machine vision to solve the technical problem of being unable to accurately quantify the nut anti-loosening performance.

[0006] The machine vision-based quantitative evaluation method for bolt-nut connection anti-loosening performance provided in the application comprises the following steps: reading a video of a nut; wherein the nut is in a connected state; obtaining all frame images in the video; performing gray-scale processing on all the frame images to obtain a plurality of first images; performing Gaussian filtering on the first images to obtain second images; determining edge pixel points in a target image by using a Canny edge detection algorithm; wherein the target image is any one of the second images; determining target edge pixel points in the edge pixel points; wherein the target edge pixel points are obtained by denoising the edge pixel points; determining all contours in the target image from the plurality of target edge pixel points by using a FindContours function; determining coordinates of contour pixel points in all the contours; determining a minimum circumscribed rectangle from the contour point set by using a minAreaRect function, and determining a deflection angle of the minimum circumscribed rectangle relative to a coordinate axis according to coordinates of four vertices of the minimum circumscribed rectangle; wherein the contour point set comprises the coordinates of the contour pixel points, and the deflection angle is a rotation angle of the nut between the target image and a previous second image; determining whether the nut is loosened according to the deflection angle, and taking a minimum transverse force causing the nut to loosen as a critical transverse force of the nut; evaluating the anti-loosening performance of the bolt-nut connection according to the critical transverse force; wherein the greater the critical transverse force, the better the anti-loosening performance of the bolt-nut connection, and the smaller the critical transverse force, the worse the anti-loosening performance of the bolt-nut connection.

[0007] In some possible implementation manners, the gray-scale processing on all the frame images to obtain the first images comprises: processing all the frame images by using a weighted average method, and the calculation formula is as follows:

[0008] Gray(i,j) = 0.114 B(i,j) + 0.578 G(i,j) + 0.299 R(i,j); wherein i and j are respectively the row and column numbers of a pixel point, B(i,j), G(i,j) and R(i,j) are respectively the numerical values of the B channel, G channel and R channel components corresponding to the i-th row and j-th column pixel point, and Gray(i,j) is the gray value corresponding to the i-th row and j-th column pixel point.

[0009] In some possible implementation manners, the Gaussian filtering on the first images to obtain the second images comprises: determining a weight matrix corresponding to a convolution kernel by using a two-dimensional Gaussian distribution probability density function, wherein the weight matrix is calculated by using the following formula:

[0010] G(x,y) is the size of an element in the weight matrix; sigma is the standard deviation of the Gaussian distribution; (x,y) is the coordinates of an element in the weight matrix; the convolution kernel is determined according to the weight matrix; and the second image is determined according to the convolution kernel and the first image.

[0011] In some possible implementation manners, the Canny edge detection algorithm is adopted to determine the edge pixel points in the target image, including: adopting the Canny edge detection algorithm to calculate the variation gradient of the gray value of all pixel points in the target image; wherein the variation gradient of the gray value includes a gradient amplitude G and a gradient direction θ, and the calculation formula of the gradient amplitude G and the gradient direction θ is as follows:

[0012] G x is a horizontal component of the gradient amplitude G, and G y is a vertical component of the gradient amplitude G, and G x is a horizontal component of the gradient amplitude G, and G y is a vertical component of the gradient amplitude G.

[0013] I is a matrix composed of the gray values of the current pixel point and the adjacent pixel points thereof; all the pixel points are traversed, and the pixel point with the maximum gradient amplitude in the same group of gradient directions is determined as an edge pixel point; wherein the same group of gradient directions is a straight line in which the gradient directions coincide.

[0014] In some possible implementation manners, the target edge pixel points are determined from the edge pixel points, including: determining the relationship between the edge pixel points and a first threshold value and a second threshold value respectively; wherein the first threshold value is greater than the second threshold value; retaining first edge pixel points; wherein the first edge pixel points are the edge pixel points with the gradient amplitude greater than the first threshold value; retaining second edge pixel points; wherein the second edge pixel points are the edge pixel points with the gradient amplitude greater than or equal to the second threshold value and less than or equal to the first threshold value, and connected with the first edge pixel points; and the target edge pixel points include the first edge pixel points and the second edge pixel points.

[0015] In some possible implementation manners, the target edge pixel points are determined from the edge pixel points, and further including: removing third edge pixel points; wherein the third edge pixel points are the edge pixel points with the gradient amplitude less than the second threshold value.

[0016] In some possible implementation manners, the FindContours function is adopted to determine all the contours in the target image from the plurality of target edge pixel points, including: adopting an edge tracking algorithm in the FindContours function to determine all the contours in the target image according to the connectivity relationship between the target edge pixel points.

[0017] In some possible implementation manners, the minAreaRect function is used to determine the minimum circumscribed rectangle in the contour point set, including: using the Sklansky algorithm in the minAreaRect function to determine the convex hull of the contour; wherein the convex hull is a convex polygon with the smallest area connected according to the contour point set, and all pixel points in the contour point set are located on the edge of the convex hull or inside the convex hull; using the enumeration method, the different edges of the convex hull are used to make the circumscribed rectangle respectively, and the circumscribed rectangle with the smallest area is determined as the minimum circumscribed rectangle.

[0018] In some possible implementation manners, the deflection angle of the minimum circumscribed rectangle relative to the coordinate axis is determined according to the coordinates of the four vertices of the minimum circumscribed rectangle, including: determining the number of the vertex with the smallest value in the y-axis direction of the global coordinate system oxy of the target image of the minimum circumscribed rectangle; if the number is one, the vertex with the smallest value is determined as the origin o' of the local coordinate system o'x'y' of the minimum circumscribed rectangle; if the number is two, the vertex with the smallest value in the x-axis direction of the global coordinate system oxy of the minimum circumscribed rectangle is determined as the origin o' of the local coordinate system o'x'y'; the local coordinate system o'x'y' is established with the origin o', the x' axis and the y' axis; wherein the positive direction of the x' axis is the same as the positive direction of the x-axis of the global coordinate system oxy, and the positive direction of the y' axis is opposite to the positive direction of the y-axis of the global coordinate system oxy; the x' axis is counterclockwise rotated to the first coincidence with the edge of the minimum circumscribed rectangle, and the angle rotated is the deflection angle of the nut.

[0019] In some possible implementation manners, whether the nut is loose is determined according to the deflection angle, including: determining the loosening angle of the nut according to the deflection angle; and determining whether the nut is loose according to the loosening angle.

[0020] The method for quantitatively evaluating the anti-loosening performance of a bolt and nut connection based on machine vision provided in the application can accurately determine the initial loosening of the nut, accurately determine the critical transverse force range, and improve the accuracy of the quantitative evaluation of the anti-loosening performance of the nut. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the application, the drawings needed in the embodiments will be briefly introduced below. Obviously, other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0022] Figure 1a It is a schematic diagram of the basic principle of transverse vibration test;

[0023] Figure 1b It is a structural schematic diagram of a transverse vibration test device;

[0024] Figure 2A schematic diagram of a bolt connection pre-tightening force attenuation process under transverse vibration test conditions;

[0025] Figure 3 A flowchart of a quantitative evaluation method for bolt and nut connection anti-loosening performance based on machine vision provided by the embodiments of the present application;

[0026] Figure 4 A recording effect schematic diagram of a nut video provided by the embodiments of the present application;

[0027] Figure 5a A BGR image schematic diagram provided by the embodiments of the present application;

[0028] Figure 5b A gray scale image schematic diagram provided by the embodiments of the present application;

[0029] Figure 6 A Gaussian filter principle schematic diagram provided by the embodiments of the present application;

[0030] Figure 7a A coordinate schematic diagram of an element in a weight matrix provided by the embodiments of the present application;

[0031] Figure 7b A size schematic diagram of an element in a weight matrix provided by the embodiments of the present application;

[0032] Figure 8a A gradient schematic diagram provided by the embodiments of the present application;

[0033] Figure 8b A gradient instance schematic diagram provided by the embodiments of the present application;

[0034] Figure 9a A gradient schematic diagram for determining an edge pixel point provided by the embodiments of the present application;

[0035] Figure 9b Another gradient schematic diagram for determining an edge pixel point provided by the embodiments of the present application;

[0036] Figure 10 A screening schematic diagram of an edge pixel point provided by the embodiments of the present application;

[0037] Figure 11 A contour extraction schematic diagram provided by the embodiments of the present application;

[0038] Figure 12a A structure schematic diagram for calculating a contour convex hull provided by the embodiments of the present application;

[0039] Figure 12b A structure schematic diagram for calculating a minimum circumscribed rectangle of a contour by an enumeration method provided by the embodiments of the present application;

[0040] Figure 13a is a structural diagram of a deflection angle provided by an embodiment of the application;

[0041] Figure 13b is another structural diagram of a deflection angle provided by an embodiment of the application;

[0042] Figure 14a is a gray-scale processing effect diagram provided by an embodiment of the application;

[0043] Figure 14b is a Gaussian filtering effect diagram provided by an embodiment of the application;

[0044] Figure 14c is a Canny edge detection effect diagram provided by an embodiment of the application;

[0045] Figure 14d is a schematic diagram of calculating a minimum circumscribed rectangle provided by an embodiment of the application;

[0046] Figure 15 is a nut loosening angle size change curve schematic diagram provided by an embodiment of the application;

[0047] Figure 16 is a flowchart of a bolt and nut connection anti-loosening performance quantitative evaluation method based on machine vision in a specific implementation of an embodiment of the application;

[0048] Figure 17 is a nut loosening angle algorithm flowchart in a specific implementation provided by an embodiment of the application. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the application will be clearly described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments of the application, other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.

[0050] Hereinafter, the terms “first”, “second”, and the like are only used for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first”, “second”, and the like can explicitly or implicitly include one or more of the features. In the description of the application, unless otherwise specified, the meaning of “a plurality of” is two or more.

[0051] In addition, in the present application, the orientation terms such as "upper", "lower", "inner", "outer" and the like are defined with respect to the orientation in which the components are shown in the drawings, and it should be understood that these directional terms are relative concepts, which are used for relative description and clarification, and can be changed accordingly according to the change of the orientation in which the components are placed in the drawings.

[0052] Bolt connection has the advantages of simple structure, convenient assembly and disassembly, low price, etc., and is widely used in various industrial products and mechanical structures. Engineering experience shows that bolt connection is prone to looseness failure in a vibration environment, which is a common problem threatening the reliability of mechanical products. A large number of domestic and foreign researches have fully proved that transverse vibration load is usually the main load form leading to bolt connection looseness, and therefore the bolt connection looseness performance is usually tested based on transverse vibration test in engineering.

[0053] Figure 1a Fig. 1 is a schematic diagram of the basic principle of a transverse vibration test.

[0054] Figure 1b Fig. 2 is a schematic diagram of the structure of a transverse vibration test device.

[0055] In combination with Figure 1a and Figure 1b , the test is mainly carried out on a typical bolt connection structure, including a bolt, a nut and two compressed parts. In the test process, one compressed part (fixed part) is fixed, and a periodic reciprocating load is applied to the other compressed part (movable part), so as to obtain a pre-tightening force decay curve under different load conditions, and then the bolt connection looseness performance is evaluated. The principle of the test method was first found in a paper published by a German scholar Junker in 1969. The test method has been standardized, and the commonly used standards include Chinese national standard GB / T 10431, German standard DIN-65151 and international standard ISO 16130. The basic principles of the tests specified in these standards are the same, but there are differences in test procedures, load control methods and result interpretation. Among them, Figure 1b The test device shown is designed according to the requirements of national standard ISO 16130.

[0056] Figure 2 Fig. 3 is a schematic diagram of the pre-tightening force decay process of bolt connection under transverse vibration test conditions.

[0057] As Figure 2As shown, the typical process of bolt connection pre-tightening force attenuation during transverse vibration test should include three stages. In stage one, the pre-tightening force will rapidly attenuate, and the main reasons for the pre-tightening force attenuation in this stage include plastic deformation, stress redistribution and rotation loosening. In stage two, the pre-tightening force will attenuate more stably, and the main reason for the pre-tightening force attenuation in this stage is rotation loosening. In stage three, the bolt connection will cause the pre-tightening force to attenuate rapidly due to the emergence of fatigue cracks, and eventually break. The pre-tightening force attenuation in all three stages is actually also caused by micromotion wear, but the amount of pre-tightening force attenuation caused by micromotion wear is relatively small, Figure 2 Not marked in the middle.

[0058] When calculating the rate of pre-tightening force attenuation, the calculation process is complex, and among the factors affecting the size of the attenuation rate, there are other factors (such as micromotion wear) in addition to rotation loosening, so it is difficult to determine the threshold of the pre-tightening force attenuation rate corresponding to the triggering of rotation loosening.

[0059] To solve the above problems, the present application provides a quantitative evaluation method for bolt and nut connection anti-loosening performance based on machine vision, which directly measures the loosening angle of the nut during transverse vibration test, judges whether the nut has occurred rotation loosening, and further determines the critical transverse force, so as to realize accurate judgment of the critical transverse force and accurate quantitative evaluation of the anti-loosening performance.

[0060] The present application directly measures the loosening angle of the nut during transverse vibration, judges whether the nut has occurred rotation loosening through the loosening angle, and further determines the critical transverse force, so as to take the critical transverse force as an index to quantitatively evaluate the anti-loosening performance of the bolt connection structure.

[0061] Figure 3 It is a flowchart of a quantitative evaluation method for bolt and nut connection anti-loosening performance based on machine vision provided by the present application.

[0062] Referring to Figure 3 The quantitative evaluation method for bolt and nut connection anti-loosening performance based on machine vision provided by the present application can be realized by the following steps S1 to S11.

[0063] Step S1: reading the video of the nut.

[0064] Wherein, the nut is in a connected state. By video shooting of the nut in the connected state, it is judged whether the nut has initial loosening in the video obtained by shooting.

[0065] Specifically, during the transverse vibration test, the video of the nut can be recorded by using a camera.

[0066] Step S2: obtaining all frame images in the video.

[0067] Figure 4 is a recording effect schematic diagram of a nut video provided by an embodiment of the present application.

[0068] Referring to Figure 4 , the nut is a hexagonal nut. The shooting direction should be along the nut axis direction, and the obtained video should completely contain the nut.

[0069] Step S3: Perform grayscale processing on all frame images to obtain a plurality of first images.

[0070] Figure 5a is a BGR image schematic diagram provided by an embodiment of the present application.

[0071] Figure 5b is a grayscale image schematic diagram provided by an embodiment of the present application.

[0072] In the nut recording video, all frame images are acquired. The format of the image read from the video is a BGR image, which is a three-channel color image, and is saved and operated in a three-dimensional matrix form in the program. Referring to Figure 5a , the image includes three channels, namely B (Blue) channel, G (Green) channel and R (Red) channel positions. The color of each pixel point in the image is determined by three components B, G and R, each component occupies one byte, and each component takes a value range of 0-255, so a pixel point can have 255 3 colors. Although the BGR image contains more color information, the matrix is complex, resulting in large amount of calculation and low calculation efficiency. Therefore, in order to improve the calculation efficiency, the BGR image can be grayscaled to obtain the corresponding grayscale image. The grayscale image is a single-channel image, which is saved and operated in a two-dimensional matrix form in the program. Referring to Figure 5b , Figure 5b can be Figure 5a grayscale processed. Figure 5b In the grayscale image, the color of each pixel point in the image is determined by one component, so a pixel point can only have 255 colors. Although the grayscale image loses some color features, it does not affect the feature extraction of the subsequent image, and the matrix dimension is changed from the three-dimensional matrix corresponding to the BGR image to the two-dimensional matrix corresponding to the grayscale image, which significantly reduces the calculation amount.

[0073] Specifically, the weighted average method can be used to process all frame images, and the grayscale value is calculated by the following formula (1):

[0074] Gray(i,j) = 0.114 B(i,j) + 0.578 G(i,j) + 0.299 R(i,j) (1)

[0075] In formula (1), i and j are respectively row and column numbers of a pixel point, B(i, j), G(i, j) and R(i, j) are respectively values of a B (blue) channel, a G (green) channel and an R (red) channel component corresponding to an i-th row and a j-th column pixel point, and Gray(i, j) is a gray value corresponding to the i-th row and the j-th column pixel point.

[0076] Step S4: performing Gaussian filtering on the first image to obtain a second image.

[0077] In the process of shooting a video, due to light problems such as insufficient brightness of light or insufficient uniformity of light distribution, it is easy to cause Gaussian noise to exist in the image of the video. Gaussian noise refers to noise with a probability density function subject to Gaussian distribution (i.e. normal distribution). Therefore, in order to reduce noise and improve the accuracy of image processing, Gaussian filtering needs to be performed on the gray image.

[0078] The process of Gaussian filtering is actually that, for each pixel point in the image, a matrix is formed by the gray values of the neighborhood pixel points of the pixel point, the sum (convolution) of the product of the matrix and the corresponding elements of a two-dimensional filter matrix (convolution kernel) is calculated, and the sum of the product is taken as the gray value after filtering to replace the gray value before filtering.

[0079] The step S4 can be realized by the following steps S41 to S43.

[0080] Step S41: determining a weight matrix corresponding to the convolution kernel by using a probability density function of two-dimensional Gaussian distribution.

[0081] The size of the element in the weight matrix corresponding to the convolution kernel is calculated by the following formula (2):

[0082]

[0083] G(x, y) is the size of the element in the weight matrix; σ is a standard deviation of Gaussian distribution, which needs to be set by a user, and (x, y) is the coordinate of the element in the weight matrix.

[0084] Step S42: determining the convolution kernel according to the weight matrix.

[0085] Step S43: determining the second image according to the convolution kernel and the first image.

[0086] Figure 6 is a schematic diagram of a Gaussian filtering principle provided by an embodiment of the present application.

[0087] In a specific implementation manner, referring to Figure 6, the gray value of the current pixel point in the image before filtering is 5, and the calculation formula of the gray value after filtering is (1*0.1+2*0+3*0+…+8*0.2+9*0.1), and the gray value after filtering is 5.8, if all pixel points are calculated according to the formula, the gray value of all pixel points after filtering can be obtained, that is, the image after filtering. Wherein, the first image can be the image before filtering, and the second image can be the image after filtering.

[0088] At the same time, it can be seen from Figure 6 that the core of Gaussian filtering is the convolution kernel, which gives different weights to the gray values of the current pixel point and its neighborhood pixel points, and then sums to obtain the gray value after filtering. Next, the calculation method of the convolution kernel is introduced.

[0089] The convolution kernel is essentially a matrix, and the size of the element in the matrix reflects the weight of the gray value of different pixel points in the filtering process. In Gaussian filtering, the convolution kernel gives different weights to the gray values of different pixel points according to the two-dimensional Gaussian distribution. Therefore, the idea of calculating the convolution kernel is to first determine the size of the convolution kernel, then calculate the weight matrix corresponding to the convolution kernel through the two-dimensional Gaussian distribution, and finally normalize the weight matrix. Wherein, the size of the convolution kernel m*n is defined by the user, generally m=n and is an odd number, and the commonly used convolution kernel size is 3*3 or 5*5.

[0090] Figure 7a is a coordinate diagram of an element in a weight matrix provided by an embodiment of the present application.

[0091] Figure 7b is a size diagram of an element in a weight matrix provided by an embodiment of the present application.

[0092] Specifically, the definition method of the element coordinates in the weight matrix is: the coordinates of the central position element are defined as (0, 0), and the distance between adjacent elements is 1, so the coordinates of other elements can be calculated according to the method of the rectangular coordinate system, as shown in Figure 7a . The weight matrix calculated according to formula 2 is shown in Figure 7b .

[0093] Since the sum of the elements in the weight matrix is not necessarily 1, it is necessary to normalize the weight matrix to ensure that the brightness of the image after filtering is unchanged. Normalization is to first calculate the sum of the elements in the weight matrix, and then divide all the elements in the weight matrix by the sum of the elements, and the normalized matrix of the weight matrix is the convolution kernel.

[0094] Step S5: determining the edge pixel points in the target image by using the Canny edge detection algorithm.

[0095] Wherein, the target image is any one second image.

[0096] Specifically, step S5 can be implemented by steps S51 to S52.

[0097] Step S51: Calculate the change gradient of the gray value of all pixel points in the target image using the Canny edge detection algorithm.

[0098] After the gray image is completed Gaussian filtering, the Canny edge detection algorithm needs to be used to find the edge pixel points in the image. The principle of the Canny edge detection algorithm is to calculate the change gradient of the gray value of all pixel points in the image, and to judge whether the pixel point is an edge pixel point according to whether the gradient amplitude is a maximum value in the gradient direction, and to filter according to certain rules.

[0099] The change gradient of the gray value can be calculated by the following formula (3) and formula (4):

[0100]

[0101] The change gradient of the gray value includes the gradient amplitude G and the gradient direction θ, and the horizontal component G x of the gradient amplitude G is the first derivative of the gray value in the horizontal direction, and the vertical component G y of the gradient amplitude G is the first derivative of the gray value in the vertical direction, according to the first derivative G x of the gray value in the horizontal direction and the first derivative G y in the vertical direction, the change gradient amplitude G and the gradient direction θ of the gray value can be calculated, the horizontal component G x and the vertical component G y can be calculated by the following formula (5) and formula (6):

[0102]

[0103] Specifically, I is a matrix composed of the gray values of the current pixel point and its neighborhood pixel points, and the size is the same as the convolution kernel.

[0104] Figure 8a is a gradient schematic diagram provided by an embodiment of the application.

[0105] Referring to Figure 8a , the gradient has a direction and a numerical value, and the direction θ of the gradient is the included angle between the gradient amplitude G and the horizontal direction. Among them, in order to facilitate calculation, the numerical value of θ can be set to a fixed value, such as 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315° and 360°. In other words, when the gradient direction is 40°, it can be approximated to 45° to facilitate subsequent calculation.

[0106] Figure 8bis a gradient instance schematic diagram provided by an embodiment of the present application.

[0107] In a specific implementation, referring to Figure 8b It can be seen that the finally calculated gradient includes two parts of gradient amplitude G and gradient direction θ. Take the "2↑" in the first row and the first column as an example for a simple introduction, wherein "2" is the gradient amplitude, and "↑" represents the gradient direction, and θ is 90° at this time.

[0108] After calculating the gray value change gradient of all the pixel points, step S52 is performed.

[0109] Step S52: traverse all the pixel points, and determine the pixel point with the maximum gradient amplitude in the same group of gradient directions as the edge pixel point.

[0110] Specifically, after obtaining the gray value change gradient of all the pixel points in the second image, all the pixel points are traversed, and it is judged whether the gradient amplitude of the current pixel point is the maximum in the same group of gradient directions. If it is the maximum, the current pixel point is determined as the edge pixel point. If it is not the maximum, the current pixel point is determined as the non-edge pixel point. The same group of gradient directions is the straight line in which the gradient directions coincide. For example, the positive and negative directions are the same group of gradient directions. In other words, "↑" and "↓" are the same group of gradient directions.

[0111] Figure 9a is a gradient schematic diagram for determining an edge pixel point provided by an embodiment of the present application.

[0112] Referring to Figure 9a , the A pixel point is the current pixel point, the B pixel point and the C pixel point have the same gradient direction as the A pixel point. If the gradient amplitude of the A pixel point is greater than the gradient amplitudes of the B pixel point and the C pixel point, the A pixel point is determined as the edge pixel point, otherwise, the A pixel point is determined as the non-edge pixel point.

[0113] Figure 9b is another gradient schematic diagram for determining an edge pixel point provided by an embodiment of the present application.

[0114] In a specific implementation, referring to Figure 9bIn the same set of gradient directions, the pixel point with the largest gradient amplitude is identified as an edge pixel point, represented by a white background, and the remaining pixel points are identified as non-edge pixel points, represented by a black background. For example, the fourth row and first column "7↑" is used to illustrate the process. The direction of "7↑" is represented by "↑", and the angle θ with the horizontal direction is 90°. The same set of gradient directions includes "↑" and "↓". In this case, the same gradient direction of the pixel point "7↑" includes "2↑", "3↓", "4↑", "7↑", and "6↑". Among the five pixel points, the gradient amplitudes are "2", "3", "4", "7", and "6". The gradient amplitude of the pixel point "7↑" is the largest, so the pixel point "7↑" is an edge pixel point, marked as a white background. Similarly, the remaining edge pixel points are determined.

[0115] Step S6: determining a target edge pixel point among the edge pixel points.

[0116] After determining whether all pixel points are edge pixel points, all edges in the current image have been retained. However, some of the edges may be caused by noise, so in order to improve the accuracy of nut loosening judgment and to determine the loosening state as early as possible, further screening of the edge pixel points is required.

[0117] Specifically, the gradient amplitude of the gray value of the edge pixel point can be used for noise removal and screening to obtain a target edge pixel point. The target edge pixel point is the edge pixel point after noise removal.

[0118] The noise removal process can be achieved by setting a threshold value. Step S6 can be implemented by steps S61 to S63.

[0119] Step S61: determining the relationship between the edge pixel point and the first threshold value and the second threshold value.

[0120] In the present application, a first threshold value and a second threshold value are set. The first threshold value can be a high threshold value maxVal, and the second threshold value can be a low threshold value minVal. The first threshold value is greater than the second threshold value.

[0121] Step S62: retaining a first edge pixel point.

[0122] Specifically, in the judgment process, if the gradient amplitude of the current edge pixel point is greater than the first threshold value, the current edge pixel point is defined as a first edge pixel point, which can be a strong edge pixel point. The strong edge pixel point is retained, and its gray value is changed to 1, and the background of the pixel point is marked as white.

[0123] Step S63: retaining a second edge pixel point.

[0124] Specifically, if the gradient amplitude of the current edge pixel point is between the second threshold and the first threshold, that is, the gradient amplitude of the current pixel point is greater than or equal to the second threshold and less than or equal to the first threshold, the current edge pixel point is defined as a virtual edge pixel point. If the virtual edge pixel point is connected with a strong edge pixel point, the virtual edge pixel point is retained, defined as a second edge pixel point, the gray value of the virtual edge pixel point is changed to 1, and the background of the virtual edge pixel point is marked as white. The target edge pixel point includes the first edge pixel point and the second edge pixel point.

[0125] In some possible implementation manners, the step S6 can further include a step S64.

[0126] Step S64: removing a third edge pixel point.

[0127] Specifically, if the gradient amplitude of the current edge pixel point is less than the second threshold, the current edge pixel point is defined as a third edge pixel point. The third edge pixel point is a weak edge pixel point, the weak edge pixel point is removed, the gray value of the weak edge pixel point is changed to 0, and the background of the weak edge pixel point is marked as black.

[0128] In some possible implementation manners, the step S6 can further include a step S65.

[0129] Step S65: removing a fourth edge pixel point.

[0130] If the virtual edge pixel point is not connected with a strong edge pixel point, the current edge pixel point is defined as a fourth edge pixel point, the fourth edge pixel point is removed, the gray value of the fourth edge pixel point is changed to 0, and the background of the fourth edge pixel point is marked as black.

[0131] It is worth noting that there is no strict execution order between the steps S62 to S65, and the steps S62 to S65 can be executed in any order.

[0132] Figure 10 FIG. 1 is a schematic diagram of screening of edge pixel points provided by an embodiment of the present application.

[0133] Referring to FIG. 1, Figure 10 four edge pixel points with different gradient amplitudes are exemplarily shown, which are A1, B1, C1 and D1. The gradient amplitude of the A1 edge pixel point is greater than the first threshold, so the A1 edge pixel point is retained as a strong edge pixel point. The gradient amplitude of the B1 edge pixel point is less than the second threshold, so the B1 edge pixel point is removed as a weak edge pixel point. The gradient amplitude of the C1 edge pixel point is between the second threshold and the first threshold, but the C1 edge pixel point is connected with the strong edge pixel point A1, so the C1 edge pixel point is retained as a virtual edge pixel point. The gradient amplitude of the D1 edge pixel point is between the second threshold and the first threshold, and the D1 edge pixel point is not connected with a strong edge pixel point, so the D1 edge pixel point is removed as a virtual edge pixel point.

[0134] At this point, the edge pixels have been identified through Canny edge detection, but these edge pixels are still discrete and do not form a complete outline. Therefore, step S7 is executed next.

[0135] Step S7: using the FindContours function to determine all contours in the target image from a plurality of target edge pixels.

[0136] In step S7, the FindContours function can use an edge tracing algorithm to traverse all edge pixels and determine whether they belong to the same contour based on the connectivity relationship between the target edge pixels, thereby identifying all contours in the target image. Based on the identified contours, the coordinates of the pixels that constitute the contours are extracted. The connectivity relationship includes connectivity and non-connectivity.

[0137] Step S8: Determine the coordinates of the contour pixels in all contours.

[0138] Figure 11 This is a schematic diagram of contour extraction provided in an embodiment of the present application.

[0139] See also Figure 11 By judging the connection relationship between edge pixels, it is recognized that the image contains two rectangular contours. In addition, in order to simplify the subsequent calculation, when extracting the coordinates of the contour pixels, only the coordinates of the inflection points of the rectangular contour can be extracted. Figure 11 In this way, compared with extracting the coordinates of all pixel points on the two rectangular contours, only extracting eight vertices in the two rectangular contours can effectively reduce the amount of calculation and improve the calculation efficiency.

[0140] After obtaining the coordinates of the contour pixels, the set of contour pixel coordinates is assembled into a contour point set. Next, the minAreaRect function calculates the minimum bounding rectangle of the contour based on the contour point set and calculates the deflection angle relative to the coordinate axis based on the four vertices of the minimum bounding rectangle. Specifically, step S9 is performed.

[0141] Step S9: Determine a minimum bounding rectangle (MBR) from the contour point set using the minAreaRect function, and determine the deflection angle of the MBR relative to the coordinate axes based on the coordinates of the four vertices of the MBR. The contour point set is composed of the coordinates of the contour pixel points, and the deflection angle of the MBR is the loosening angle of the nut. The deflection angle is the rotation angle of the nut between the target image and the second image in the previous frame.

[0142] Specifically, the step of determining the minimum circumscribed rectangle in step S9 can be implemented by steps S91 and S92.

[0143] Step S91: the Sklansky algorithm in the minAreaRect function is used to determine the convex hull of the contour.

[0144] Specifically, the minimum circumscribed rectangle of the contour is calculated based on the convex hull of the contour, the convex hull is connected into a convex polygon according to the contour point set, and the coordinates of all pixel points in the contour point set are located on the edges of the convex hull or inside the convex hull. At the same time, the convex polygon is the one with the smallest area that meets the above conditions.

[0145] Figure 12a is a structural schematic diagram of calculating a contour convex hull provided by an embodiment of the present application.

[0146] Referring to Figure 12a , the Sklansky algorithm in the minAreaRect function is used to determine the convex hull of the contour.

[0147] Figure 12b is a structural schematic diagram of calculating a contour minimum circumscribed rectangle by an enumeration method provided by an embodiment of the present application.

[0148] Referring to Figure 12b , the convex hull includes four edges, which are edge L1, edge L2, edge L3 and edge L4.

[0149] Step S92: by using the enumeration method, the different edges of the convex hull are used to make circumscribed rectangles respectively, and the circumscribed rectangle with the smallest area is determined as the minimum circumscribed rectangle.

[0150] Referring to Figure 12b , based on the conclusion that one edge of the polygon minimum circumscribed rectangle is collinear with one edge of the polygon, the enumeration method can be used to make circumscribed rectangles respectively with different edges of the convex hull, and in these circumscribed rectangles, the circumscribed rectangle with the smallest area is determined as the minimum circumscribed rectangle. Among them, Figure 12b in the circumscribed rectangle ① is made with the edge L1 of the convex hull, the circumscribed rectangle ② is made with the edge L2 of the convex hull, the circumscribed rectangle ③ is made with the edge L3 of the convex hull, and the circumscribed rectangle ④ is made with the edge L4 of the convex hull.

[0151] After obtaining the minimum circumscribed rectangle of the contour, the deflection angle of the relative coordinate axis is calculated.

[0152] Specifically, the step of determining the deflection angle in step S9 can be realized by steps S93 to S97.

[0153] Step S93: determining the number of the vertex with the smallest value in the y-axis direction of the global coordinate system oxy of the target image of the minimum circumscribed rectangle.

[0154] The deflection angle can be determined by establishing a local coordinate system o'x'y', and the local coordinate system o'x'y' needs to determine the origin first, and the vertex of the minimum circumscribed rectangle is preferably taken as the origin o' of the local coordinate system o'x'y'.

[0155] In step S93, if the number is one, step S94 is performed, and if the number is two, step S95 is performed.

[0156] Step S94: If the number is one, the vertex with the smallest value is determined as the origin o' of the local coordinate system o'x'y'.

[0157] In other words, when there is only one vertex with the smallest y value, the vertex is taken as the origin o'.

[0158] Step S95: If the number is two, the vertex with the smallest value in the x-axis direction of the minimum circumscribed rectangle in the global coordinate system oxy is determined as the origin o' of the local coordinate system o'x'y'.

[0159] In other words, if there are two vertices with the same smallest y value, the vertex with the smallest x value is taken as the origin o'.

[0160] Step S96: The local coordinate system o'x'y' is established with the origin o', the x' axis and the y' axis; wherein the positive direction of the x' axis is the same as the positive direction of the x-axis of the global coordinate system oxy, and the positive direction of the y' axis is opposite to the positive direction of the y-axis of the global coordinate system oxy.

[0161] After the origin is determined, the positive direction of the x' axis of the local coordinate system o'x'y' is the positive direction of the x-axis of the global coordinate system oxy of the second image, and the positive direction of the y' axis of the local coordinate system o'x'y' is the opposite direction of the y-axis of the global coordinate system oxy of the second image.

[0162] Step S97: The positive half axis of the x' axis is rotated counterclockwise by an angle to the first coincidence of the edge of the minimum circumscribed rectangle with the origin o' as the center, and the angle is the deflection angle of the nut.

[0163] In step S97, the range of the deflection angle is [-π / 2, 0).

[0164] Figure 13a is a structural schematic diagram of a deflection angle provided by an embodiment of the application.

[0165] Figure 13b is another structural schematic diagram of a deflection angle provided by an embodiment of the application.

[0166] Referring to Figure 13a , the size of the deflection angle is -π / 6; referring to Figure 13b , the size of the deflection angle is -π / 2.

[0167] Step S10: determining whether the nut is loose according to the deflection angle, and the minimum lateral force causing the nut to be loose as the critical lateral force of the nut.

[0168] Specifically, the step of determining whether the nut is loose in step S10 can be realized by the following steps S101 and S102.

[0169] Step S101: determining the loosening angle of the nut according to the deflection angle.

[0170] The difference between the deflection angles of the minimum circumscribed rectangles in the adjacent two frames of the second images can be obtained, that is, the relative rotation angle between the nuts in the adjacent two frames of the second images. If the relative rotation angles between the nuts in all adjacent two frames of the second images are calculated and summed, the loosening angle of the nut in the entire video can be obtained. The loosening state of the nut can be determined by the loosening angle.

[0171] Step S102: determining whether the nut is loose according to the loosening angle.

[0172] During the lateral vibration test, after the size of the loosening angle is calculated, it can be determined whether the nut is loose by the loosening angle. When the loosening angle of the nut continues to increase, it is judged that the nut is loose. When the loosening angle of the nut is basically zero or there is a small loosening angle at the beginning of vibration but it will not continue to increase, it is judged that the nut is not loose.

[0173] In step S102, the lateral force of the lateral vibration test bench is adjusted, and tests are repeatedly carried out under different lateral forces to gradually find the minimum lateral force triggering the loosening, that is, the critical lateral force. The critical lateral force is a quantitative evaluation index of the loosening performance. The greater the critical lateral force, the better the loosening performance. Therefore, the determination of the critical lateral force means that the quantitative evaluation of the loosening performance of the current bolted joint is realized.

[0174] Specifically, the range of the critical lateral force of the nut can be determined by multiple deflection angles. Specifically, the range of the critical lateral force can be determined by the loosening angle calculated by multiple deflection angles. The minimum lateral force is within the critical lateral force range. When the minimum value of the critical lateral force range acts on the vibration test bench, the nut does not loosen. When the maximum value of the critical lateral force range acts on the vibration test bench, the nut loosens. At this time, the loosening of the nut is determined by the loosening angle calculated by the deflection angle. The range of the critical lateral force of the nut can be obtained by the maximum and minimum values of the critical lateral force.

[0175] Step S11: evaluating the loosening performance of the bolt and nut connection by the critical lateral force.

[0176] Specifically, the critical lateral force is positively correlated with the anti-loosening performance of the bolt and nut, that is, the greater the critical lateral force, the better the anti-loosening performance of the bolt and nut, and the smaller the critical lateral force, the worse the anti-loosening performance of the bolt and nut.

[0177] Figure 14a is a gray processing effect diagram provided by an embodiment of the application.

[0178] Figure 14b is a Gaussian filter effect diagram provided by an embodiment of the application.

[0179] Figure 14c is a Canny edge detection effect diagram provided by an embodiment of the application.

[0180] Figure 14d is a schematic diagram for calculating a minimum circumscribed rectangle provided by an embodiment of the application.

[0181] In a specific implementation manner, Figure 14a is obtained by processing using step S3. Figure 14b is obtained by processing using step S4. Figure 14c is obtained by processing using step S5. Figure 14d is obtained by processing using step S9.

[0182] Figure 15 is a nut loosening angle size change curve schematic diagram provided by an embodiment of the application.

[0183] In a specific implementation manner, referring to Figure 15 When the nut is vibrated, the loosening angle of the nut has a fluctuating increasing trend with the growth of vibration time.

[0184] The bolt and nut connection anti-loosening performance quantitative evaluation method based on machine vision provided by the embodiment of the application can accurately judge the initial loosening of the nut, accurately judge the critical lateral force range, and improve the accuracy of quantitative evaluation of the anti-loosening performance of the nut.

[0185] Figure 16 is a flowchart of the bolt and nut connection anti-loosening performance quantitative evaluation method based on machine vision in a specific implementation manner provided by an embodiment of the application.

[0186] In a specific implementation manner, referring to Figure 16 The evaluation method can be realized by the following steps S201 to S204.

[0187] Step S201: transverse vibration test.

[0188] Step S202: video recording.

[0189] Wherein, in step S201 can be synchronized with step S202 start implementation. Step S202 can be recorded by the camera installed on the test platform.

[0190] Step S203: calculate the loosening angle.

[0191] The image processing calculation can be performed by the program in the recorded video.

[0192] Step S204: determine whether to rotate loose.

[0193] According to the calculated loosening angle to determine whether the nut is loose.

[0194] Step S205: critical lateral force.

[0195] When the nut is loose, determine the critical lateral force.

[0196] Figure 17 Is a specific implementation of the application embodiment of the nut loosening angle algorithm flow chart.

[0197] In a specific implementation, see Figure 17 The loosening angle algorithm can be implemented by the following steps S301 to S308.

[0198] Step S301: read the video.

[0199] Step S302: all frame images.

[0200] Wherein, the purpose of step S301 and step S302 is image acquisition. Step S301 can correspond to the step S1 provided in the above embodiment, and step S302 can correspond to the step S2 provided in the above embodiment.

[0201] Step S303: gray processing.

[0202] Step S304: Gaussian filter.

[0203] Wherein, the purpose of step S303 and step S304 is image preprocessing. Step S303 can correspond to the step S3 provided in the above embodiment, and step S304 can correspond to the step S4 provided in the above embodiment.

[0204] Step S305: Canny edge detection.

[0205] Step S306: FindContours contour extraction.

[0206] The step S305 and the step S306 are used for contour detection and extraction. The step S305 can correspond to the step S5 provided in the above embodiment, and the step S306 can correspond to the step S7 provided in the above embodiment.

[0207] Step S307: The minAreaRect function is used to calculate the minimum circumscribed rectangle and the deflection angle relative to the coordinate axis.

[0208] Step S308: Nut loosening angle.

[0209] The step S307 and the step S308 are used for calculating the nut loosening angle. The step S307 can correspond to the step S8 provided in the above embodiment.

[0210] In this implementation, first, the recorded video is read, and all frame images in the video are preprocessed. The image preprocessing includes grayscale processing and Gaussian filtering. Then, the Canny edge detection algorithm and the FindContours function are used to detect and extract the edges. Finally, the minAreaRect function is used to calculate the minimum circumscribed rectangle of the image and the deflection angle relative to the coordinate axis. The relative rotation angle between the minimum circumscribed rectangles in the adjacent two frame images, i.e., the relative rotation angle between the nuts, can be obtained. If the relative rotation angles between the nuts in all adjacent two frame images are calculated and summed, the nut loosening angle in the entire video can be obtained.

[0211] It should be noted that other embodiments of the present application will readily occur to those skilled in the art, having the benefit of the description and practice of the application disclosed herein. The application is intended to embrace all such alterations, modifications, and variations that fall within the scope of the present application, including those that are presently known or accepted or that are developed and which have comparable technical effects. The application is intended to embrace all such alterations, modifications, and variations that fall within the scope of the present application, including those that are presently known or accepted or that are developed and which have comparable technical effects.

[0212] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The true scope of the application is set forth in the appended claims.

Claims

1. A machine vision-based quantitative evaluation method for the anti-loosening performance of a bolt-nut connection, characterized by, The method comprises the following steps: reading a video of a nut; wherein the nut is in a connected state; obtaining all frame images in the video; gray processing the all frame images to obtain a plurality of first images; Gaussian filtering the first images to obtain second images; determining edge pixel points in a target image by using a Canny edge detection algorithm; wherein the target image is any one of the second images; determining target edge pixel points from the edge pixel points; wherein the target edge pixel points are obtained by denoising the edge pixel points; determining all contours in the target image from a plurality of the target edge pixel points by using a FindContours function; determining coordinates of contour pixel points from the all contours; determining a minimum circumscribed rectangle from a contour point set by using a minAreaRect function, and determining a deflection angle of the minimum circumscribed rectangle relative to a coordinate axis according to coordinates of four vertices of the minimum circumscribed rectangle; wherein the contour point set comprises the coordinates of the contour pixel points, and the deflection angle is a rotation angle of the nut between the target image and a previous frame of the second image; determining whether the nut is loose according to the deflection angle, and taking a minimum lateral force causing the nut to be loose as a critical lateral force of the nut; evaluating a bolt-nut connection anti-looseness performance of the bolt-nut connection according to the critical lateral force; wherein the greater the critical lateral force, the better the anti-looseness performance of the bolt-nut connection, and the smaller the critical lateral force, the worse the anti-looseness performance of the bolt-nut connection.

2. The method according to claim 1, wherein Gray processing the all frame images to obtain first images comprises: processing the all frame images by using a weighted average method, and a calculation formula is as follows: Gray(i,j) = 0.114·B(i,j) + 0.578·G(i,j) + 0.299·R(i,j); wherein i and j are respectively a row and a column sequence number of a pixel point, B(i,j), G(i,j) and R(i,j) are respectively a value of a B channel, a G channel and an R channel component corresponding to an i-th row and a j-th column pixel point, and Gray(i,j) is a gray value corresponding to the i-th row and the j-th column pixel point.

3. The method according to claim 2, wherein the method is characterized by, Gaussian filtering the first images to obtain second images comprises: determining a weight matrix corresponding to a convolution kernel by using a two-dimensional Gaussian distribution probability density function, wherein a calculation of the weight matrix uses a formula as follows: G(x,y) is a size of an element in the weight matrix; σ is a standard deviation of a Gaussian distribution; and (x,y) is a coordinate of the element in the weight matrix; determining the convolution kernel according to the weight matrix; determining a second image according to the convolution kernel and the first image.

4. The method according to claim 3, wherein Determining edge pixel points in a target image by using a Canny edge detection algorithm comprises: calculating a variation gradient of a gray value of all pixel points in the target image by using the Canny edge detection algorithm; wherein the variation gradient of the gray value comprises a gradient amplitude G and a gradient direction θ, and calculation formulas of the gradient amplitude G and the gradient direction θ are as follows: G x is the horizontal component of the gradient amplitude G, is the first-order derivative of the grayscale value in the horizontal direction, G y is the vertical component of the gradient amplitude G, is the first-order derivative of the grayscale value in the vertical direction, and the horizontal component G x and the vertical component G y The calculation formula is as follows: I is a matrix of gray values of a current pixel point and its adjacent domain pixel points; Traversing all the pixel points, determining the pixel points with the largest gradient amplitude in the same set of gradient directions as edge pixel points; wherein the same set of gradient directions are the coincidence of straight lines where the gradient directions are located.

5. The method for quantitatively evaluating the anti-loosening performance of bolt and nut connections based on machine vision according to claim 4 is characterized in that: Determining a target edge pixel point among the edge pixel points includes: Determine the relationship between the edge pixel point and a first threshold and a second threshold respectively; wherein the first threshold is greater than the second threshold; retaining a first edge pixel point; wherein the first edge pixel point is the edge pixel point whose gradient amplitude is greater than the first threshold; Retain a second edge pixel point; wherein, the second edge pixel point is an edge pixel point whose gradient amplitude is greater than or equal to the second threshold and less than or equal to the first threshold, and is connected to the first edge pixel point; the target edge pixel point includes the first edge pixel point and the second edge pixel point.

6. The method according to claim 5, wherein the method is characterized by, Determining a target edge pixel point among the edge pixel points further includes: Remove the third edge pixel point; wherein the third edge pixel point is the edge pixel point whose gradient amplitude is less than the second threshold.

7. The method according to claim 6, wherein the method is characterized by, The FindContours function is used to determine all contours in the target image from a plurality of target edge pixels, including: The edge tracking algorithm in the FindContours function is used to determine all contours in the target image based on the connectivity relationship between the target edge pixels.

8. The method for quantitatively evaluating the anti-loosening performance of bolt and nut connections based on machine vision according to claim 7, characterized in that: The minAreaRect function is used to determine the minimum enclosing rectangle in the contour point set, including: Determine the convex hull of the contour using the Sklansky algorithm in the minAreaRect function; wherein the convex hull is a convex polygon with the smallest area formed by connecting the contour point set, and all pixels in the contour point set are located on the edge of the convex hull or inside the convex hull; An enumeration method is adopted to respectively use different sides of the convex hull as circumscribed rectangles, and the circumscribed rectangle with the smallest area is determined as the minimum circumscribed rectangle.

9. The method for quantitatively evaluating the anti-loosening performance of bolt and nut connections based on machine vision according to claim 8, characterized in that: Determining a deflection angle of the minimum circumscribed rectangle relative to a coordinate axis according to the coordinates of four vertices of the minimum circumscribed rectangle includes: Determine the number of vertices of the minimum bounding rectangle having the smallest value in the y-axis direction in the global coordinate system oxy of the target image; If the number is one, determining the vertex with the smallest value as the origin o' of the local coordinate system o'x'y' where the minimum circumscribed rectangle is located; If the number is two, determine the vertex of the minimum circumscribed rectangle with the smallest value in the x-axis direction in the global coordinate system oxy as the origin o′ of the local coordinate system o′x′y′; The local coordinate system o'x'y' is established with the origin o', the x' axis and the y' axis; wherein the positive direction of the x' axis is the same as the positive direction of the x axis in the global coordinate system oxy, and the positive direction of the y' axis is opposite to the positive direction of the y axis in the global coordinate system oxy; The x' axis positive half axis is rotated counterclockwise with the origin o' as the center, and the angle rotated when the x' axis positive half axis first coincides with the side of the minimum circumscribed rectangle is the deflection angle of the nut.

10. The machine vision-based quantitative evaluation method for bolt and nut connection anti-loosening performance according to claim 9, characterized in that, According to the deflection angle, it is determined whether the nut is loose, comprising: According to the deflection angle, the loosening angle of the nut is determined; According to the loosening angle, it is determined whether the nut is loose.

Citation Information

Patent Citations

  • Pre-tightening force change curve processing method, and thread anti-loosening performance testing method and device

    CN111351649A

  • Train bolt loosening detection method based on anti-loosening line identification

    CN113469966A

  • Method for monitoring vehicle bottom bolt tightness and electronic equipment

    CN114399518A