Fastener detection method, device and readable storage medium

Through image processing technology, changes in the number of threads are used to detect loosening of fasteners, which solves the problems of low detection efficiency and high cost in the existing technology, realizes simple and reliable fastener loosening detection, improves detection efficiency and reduces costs.

CN112116578BActive Publication Date: 2024-08-27BEIJING CENTURY DONGFANG COMMUNICATION EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010996995.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-21
Publication Date
2024-08-27
Estimated Expiration
2040-09-21

AI Technical Summary

Technical Problem

In the existing technology, fastener loosening detection requires a large workload, low efficiency, and high cost, and cannot effectively ensure the safety of road patrol workers.

Method used

By obtaining the current image and initial image of the target fastener, the current number of visible threads and the number of initial visible threads are determined, the change in the number of threads is used for loosening detection, the number of elliptical shadows is used to calculate the number of threads, and a threshold is set to determine the loosening status of the fastener.

Benefits of technology

It achieves simple and reliable detection of loose fasteners, improves detection efficiency, reduces detection costs, and does not require the deployment of high-cost equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112116578B
    Figure CN112116578B
Patent Text Reader

Abstract

Embodiments of the present invention provide a fastener detection method, device, and readable storage medium. In the method embodiment of the present invention, a current image of a target fastener is acquired, and the current number of visible threads corresponding to the target fastener is determined based on the current image. Based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener, whether the target fastener is loose is detected. By using the current image and the initial image of the target fastener to respectively determine the current and initial number of visible threads corresponding to the target fastener, and then based on the current and initial number of visible threads, whether the target fastener is loose is detected, the detection means is direct and reliable, and the processing process is simple, the amount of calculation is small, and the detection efficiency is improved. At the same time, it is not necessary to deploy equipment with high cost, thereby reducing the detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of railway maintenance, and in particular to a fastener detection method, device and readable storage medium. Background Art

[0002] Fastener bolts are very common and important connectors on rails. Their main function is to fix the rails and keep their shape and position unchanged. Due to the complex working environment, long working hours and large impact forces of fasteners, they are prone to breakage, loosening of bolts or even missing during operation, which poses a serious safety hazard to train operation.

[0003] The railway bureau's engineering section basically uses manual inspection to detect the tightness of fastener bolts, which has problems such as low efficiency, high labor intensity, and inability to fully guarantee the safety of patrol workers. With the rapid development of computer technology and CMOS (Complementary Metal Oxide Semiconductor) technology, fastener bolt detection based on image processing has become a new trend. One method is to use an image sensor to detect the direction of the direction marker, and determine the looseness of the bolt when the direction change value exceeds the threshold. This method requires the installation of direction markers on each fastener, which is labor-intensive and costly. Another method is to use the three-dimensional morphological data of the fastener to detect the height value change of the fastener bolt, and then determine its looseness. This method requires a three-dimensional imaging system to obtain the three-dimensional data of the target, which is costly and has a large amount of data. Summary of the invention

[0004] Embodiments of the present invention provide a fastener detection method, device and readable storage medium to solve the defects of fastener loosening detection in the prior art, such as large workload, low efficiency and high cost, and achieve simple and reliable detection of fastener loosening while reducing costs.

[0005] In a first aspect, an embodiment of the present invention provides a fastener detection method, comprising:

[0006] Acquire a current image of a target fastener, and determine the current number of visible threads corresponding to the target fastener based on the current image;

[0007] Based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener, detecting whether the target fastener is loose;

[0008] The initial number of visible threads corresponding to the target fastener is determined based on an initial image of the target fastener acquired in a previous detection cycle.

[0009] Optionally, according to a fastener detection method according to an embodiment of the present invention, the target fastener includes a bolt and a nut; accordingly, determining the current number of visible threads corresponding to the target fastener based on the current image includes:

[0010] The number of currently visible threads corresponding to the target fastener is determined based on the number of elliptical shadows between adjacent threads in the current image; wherein:

[0011] If the thread is located on the bolt, the current visible thread quantity is a positive value;

[0012] If the thread is located on the nut, the current visible thread quantity is a negative value.

[0013] Optionally, according to a fastener detection method according to an embodiment of the present invention, the step of determining the current number of visible threads corresponding to the target fastener based on the current image includes:

[0014] The elliptical shadow is represented by an elliptical curve contour, the elliptical curve contour closest to the top of the bolt is regarded as an incomplete contour, and the elliptical curve contours at other positions are regarded as complete contours.

[0015] If an elliptic curve contour is a complete contour, the number of elliptical shadows is increased by 1, and the integer number of elliptical shadows is determined based on the number of all complete elliptic curve contours;

[0016] If an elliptical curve contour is not a complete contour, the number of elliptical shadows corresponding to the elliptical curve contour is calculated as follows: the ratio of the angle between the major axis of the elliptical curve contour and the extended tail end of the contour to π, and the decimal number of elliptical shadows is determined based on the number of incomplete elliptical curve contours.

[0017] Optionally, according to a fastener detection method of an embodiment of the present invention, the detecting whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener includes:

[0018] If the current visible thread quantity is 0, it is determined that the bolt is missing;

[0019] If the current visible thread quantity is greater than or equal to a first threshold, it is determined that the nut is missing;

[0020] If the current visible thread quantity is less than the first threshold value and the thread quantity difference is not less than 0, it is determined that the target fastener is not loose, and the initial visible thread quantity is updated to the current visible thread quantity;

[0021] If the current visible thread quantity is less than the first threshold value, and the thread quantity difference is greater than the second threshold value and less than or equal to 0, it is determined that the target fastener is not loose;

[0022] If the current visible thread quantity is less than a first threshold value, and the thread quantity difference is less than or equal to a second threshold value, it is determined that the target fastener is loose;

[0023] The thread quantity difference is a value determined by subtracting the initial visible thread quantity from the current visible thread quantity; the second threshold is less than the first threshold, and the second threshold is less than 0.

[0024] Optionally, according to a fastener detection method according to an embodiment of the present invention, acquiring a current image of a target fastener specifically includes:

[0025] The target fasteners are imaged using a linear array camera installed on the track inspection vehicle. When the start position mark is identified in the image, the target fasteners in the image are numbered.

[0026] Wherein, the starting position mark is a marker pre-set on the rail for indicating the starting position.

[0027] Optionally, according to a fastener detection method according to an embodiment of the present invention, the specific rule of the numbering is: starting from the starting position, continuous Arabic numerals are used to represent different positions, and continuous English letters are used to represent multiple fasteners corresponding to the same position.

[0028] Optionally, according to a fastener detection method according to an embodiment of the present invention, the direction of the straight line where the sensor of the linear array camera is located is perpendicular to the extension direction of the rail, and the optical axis forms an angle of 45° with the vertical direction.

[0029] In a second aspect, an embodiment of the present invention further provides a fastener detection device, comprising:

[0030] A visible thread quantity acquisition module, used to acquire a current image of a target fastener, and determine a current visible thread quantity corresponding to the target fastener based on the current image;

[0031] A fastener loosening detection module, used to detect whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener;

[0032] The initial number of visible threads corresponding to the target fastener is determined based on an initial image of the target fastener acquired in a previous detection cycle.

[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the fastener detection method provided in the first aspect above are implemented.

[0034] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the fastener detection method provided in the first aspect above.

[0035] The fastener detection method, device and readable storage medium provided by the embodiments of the present invention respectively determine the current number of visible threads and the initial number of visible threads corresponding to the target fastener by utilizing the current image and the initial image of the target fastener, and then detect whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads. The looseness of the fastener is detected by using the change in the number of threads. The detection means is direct and reliable, and the processing process is simple, with a small amount of calculation, thereby improving the detection efficiency. At the same time, it does not require the deployment of equipment with higher costs, thereby reducing the detection cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 is a flow chart of a fastener detection method provided by an embodiment of the present invention;

[0038] Figure 2 is a schematic diagram of a thread on a bolt provided by an embodiment of the present invention;

[0039] Figure 3 is a schematic diagram of the number of visible threads when a thread is located on a bolt provided by an embodiment of the present invention;

[0040] Figure 4 is a schematic diagram of a thread on a nut provided by an embodiment of the present invention;

[0041] Figure 5 is a schematic diagram of the number of visible threads when a thread is located on a nut provided by an embodiment of the present invention;

[0042] Figure 6 is a structural schematic diagram of a fastener detection device provided by an embodiment of the present invention;

[0043] Figure 7 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] The existing technology uses manual inspection to detect fasteners, which has problems such as low efficiency, high labor intensity, and failure to ensure the safety of patrol workers. The fastener detection method based on image processing solves some of the problems of manual inspection, but still has problems such as high workload, high cost, and large amount of data.

[0046] In this regard, an embodiment of the present invention provides a fastener detection method. Figure 1 A schematic diagram of a process flow of a fastener detection method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0047] Step 110 , obtaining a current image of a target fastener, and determining the current number of visible threads corresponding to the target fastener based on the current image.

[0048] Specifically, the looseness detection of fasteners is actually to determine whether the bolts and nuts in the fasteners are loose, and the change in the number of threads is the most direct physical quantity to determine whether the bolts and nuts are loose. According to the fixing principle of bolts and nuts, an increase in the number of threads on the bolts means tighter, and a decrease in the number of threads means looser. Therefore, in the fastener detection method provided by an embodiment of the present invention, during the fastener looseness detection process, the fastener detection device is used to obtain the current image of the target fastener through the corresponding image acquisition device, and the current number of visible threads of the target fastener is determined by analyzing the current image. The current number of visible threads is the number of threads that can be observed in the current image, that is, the current number of threads of the target fastener.

[0049] Step 120, based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener, detecting whether the target fastener is loose;

[0050] The initial number of visible threads corresponding to the target fastener is determined based on an initial image of the target fastener acquired in a previous detection cycle.

[0051] Specifically, to determine the change in the number of threads of the target fastener, it is first necessary to obtain its initial number of threads. Therefore, in the previous detection cycle, the fastener detection device is also used to obtain the initial image of the target fastener through the corresponding image acquisition device, and the initial number of visible threads N of the target fastener can be determined by analyzing the initial image. The initial number of visible threads N is the number of threads that can be observed in the initial image, that is, the initial number of threads of the target fastener;

[0052] Based on the current visible thread number N1 and the initial visible thread number N corresponding to the target fastener, the thread change ΔN of the target fastener can be obtained, and then it can be determined whether the target fastener is loose.

[0053] The method provided by the embodiment of the present invention determines the current number of visible threads and the initial number of visible threads corresponding to the target fastener by utilizing the current image and the initial image of the target fastener, respectively, and then detects whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads. The looseness of the fastener is detected by using the change in the number of threads. The detection means is direct and reliable, and the processing process is simple, with a small amount of calculation, thereby improving the detection efficiency. At the same time, it does not require the deployment of equipment with higher costs, thereby reducing the detection cost.

[0054] Based on the above embodiments, Figure 2 is a schematic diagram of a thread on a bolt provided by an embodiment of the present invention, Figure 3 is a schematic diagram of the number of visible threads when a thread is located on a bolt provided by an embodiment of the present invention, Figure 4 is a schematic diagram of a thread on a nut provided by an embodiment of the present invention, Figure 5 is a schematic diagram of the number of visible threads when a thread is located on a nut provided by an embodiment of the present invention. In step 110, determining the current number of visible threads corresponding to the target fastener based on the current image includes:

[0055] The number of currently visible threads corresponding to the target fastener is determined based on the number of elliptical shadows between adjacent threads in the current image; wherein:

[0056] If the thread is located on the bolt, the current visible thread quantity is a positive value;

[0057] If the thread is located on the nut, the current visible thread quantity is a negative value.

[0058] Specific, combined Figure 2-5 It can be seen that there is an elliptical shadow between adjacent threads in the current image, that is, the number of elliptical shadows and the number of threads correspond to each other. Therefore, the fastener detection device can determine the current number of visible threads corresponding to the target fastener based on the number of elliptical shadows.

[0059] The method provided by an embodiment of the present invention determines the current number of visible threads corresponding to the target fastener by the number of elliptical shadows between adjacent threads in the current image, and can intuitively and quickly obtain the current number of visible threads. At the same time, when the thread is located on the bolt, the current number of visible threads is recorded as a positive value, and when the thread is located on the nut, the current number of visible threads is recorded as a negative value, which can intuitively reflect the relative position status of the bolt and the nut.

[0060] Regarding how to determine the number of corresponding visible threads according to the number of elliptical shadows, based on the above embodiment, in step 110, determining the number of current visible threads corresponding to the target fastener based on the current image includes:

[0061] The elliptical shadow is represented by an elliptical curve contour, the elliptical curve contour closest to the top of the bolt is regarded as an incomplete contour, and the elliptical curve contours at other positions are regarded as complete contours.

[0062] If an elliptic curve contour is a complete contour, the number of elliptical shadows is increased by 1, and the integer number of elliptical shadows is determined based on the number of all complete elliptic curve contours;

[0063] If an elliptical curve contour is not a complete contour, the number of elliptical shadows corresponding to the elliptical curve contour is calculated as follows: the ratio of the angle between the major axis of the elliptical curve contour and the extended tail end of the contour to π, and the decimal number of elliptical shadows is determined based on the number of incomplete elliptical curve contours.

[0064] Specific, combined Figure 2-3 It can be seen that the thread is located on the bolt, and the figure contains 5 elliptical curve contours, of which the contour close to the top of the bolt is an incomplete contour, and the remaining contours are complete contours (the number is 4). The complete contours constitute the integer part of the current visible thread number N1, and the incomplete contours constitute the decimal part of the current visible thread number N1. The calculation rule of the decimal part is: the ratio of the angle between the major axis of the incomplete elliptical contour and the extended tail end of the contour to π, Figure 3 In the figure, point A is the end of the contour, point O is the center of the ellipse contour, and the angle between OA and the major axis is θ, then θ / π is the fractional part of N1. If θ / π=0.4365, then Figure 3 The current visible thread count N1 = 4.4365 for the fastener shown. Figure 4-5 It can be seen that the thread is located on the nut, and the figure contains three elliptical curve contours, namely two complete contours and one incomplete contour. The incomplete contour corresponds to θ / π=0.5846, then Figure 5 The current visible thread count N1 of the fastener shown in is -2.5846.

[0065] The method provided by the embodiment of the present invention adopts an elliptical curve contour to represent the elliptical shadow, and then directly counts the complete elliptical curve contours, performs corresponding calculations on the incomplete contours, and finally determines the number of the elliptical shadows. The calculation process is simple and the amount of calculation is small, which makes the subsequent loose state judgment more direct and simple, and improves the detection efficiency.

[0066] On the basis of obtaining the number of threads, based on the above embodiment, in step 120, based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener, detecting whether the target fastener is loose includes:

[0067] If the current visible thread quantity is 0, it is determined that the bolt is missing;

[0068] If the current visible thread quantity is greater than or equal to a first threshold, it is determined that the nut is missing;

[0069] If the current visible thread quantity is less than the first threshold value and the thread quantity difference is not less than 0, it is determined that the target fastener is not loose, and the initial visible thread quantity is updated to the current visible thread quantity;

[0070] If the current visible thread quantity is less than the first threshold value, and the thread quantity difference is greater than the second threshold value and less than or equal to 0, it is determined that the target fastener is not loose;

[0071] If the current visible thread quantity is less than a first threshold value, and the thread quantity difference is less than or equal to a second threshold value, it is determined that the target fastener is loose;

[0072] The thread quantity difference is a value determined by subtracting the initial visible thread quantity from the current visible thread quantity; the second threshold is less than the first threshold, and the second threshold is less than 0.

[0073] Specifically, when N1=0, it means that no thread is detected, so it is judged that the bolt is missing; the bolt corresponds to the maximum number of visible threads (that is, the maximum number of visible threads when the nut exists), and the maximum number of visible threads is used as the first threshold. If N1 is greater than or equal to the first threshold, it means that the current image does not contain the nut, so it is determined that the nut is missing; if N1 is less than the first threshold and ΔN (that is, N1-N) is not less than 0, it is determined that the target fastener is not loose and the tightening degree is increased, and the initial number of visible threads is updated to the current number of visible threads. Combined with the principle of the tightness of bolts and nuts, it can be known that , the increase in the tightness of the target fastener means that the current number of threads has increased compared to the initial number of threads, that is, ΔN is greater than 0; if the current visible number of threads is less than the first threshold, and the difference in the number of threads is greater than the second threshold and less than or equal to 0, then it is determined that the target fastener is not loose, and the second threshold is less than 0. Typically, when -1<ΔN≤0, it is determined that the target fastener is not loose; if the current visible number of threads is less than the first threshold, and the difference in the number of threads is less than or equal to the second threshold, this means that the number of threads of the nut moving in the loosening direction exceeds the second threshold, so the target fastener is judged to be loose. The specific value of each threshold can be determined by those skilled in the art according to actual conditions, and no specific limitation is made here.

[0074] The method provided in an embodiment of the present invention sets two thresholds by combining the current number of visible threads and the difference in the number of threads with actual working conditions, and judges the fastener status based on the relationship between the current number of visible threads and the difference in the number of threads and the corresponding thresholds. The detection means is direct and reliable, and improves the detection efficiency while ensuring accuracy.

[0075] Since the rail contains multiple fasteners, in the actual detection process, the multiple fasteners need to be detected. In order to facilitate the comparison between the initial visible thread number and the current visible thread number corresponding to the target fastener, the multiple fasteners need to be numbered. Therefore, based on the above embodiment, in the step 110, the current image of the target fastener is obtained, which specifically includes:

[0076] The target fasteners are imaged using a linear array camera installed on the track inspection vehicle. When the start position mark is identified in the image, the target fasteners in the image are numbered.

[0077] Wherein, the starting position mark is a marker pre-set on the rail for indicating the starting position.

[0078] Specifically, before starting the fastener detection, a white rectangular mark (i.e., the starting position mark) is affixed to the rail at the starting position. Of course, the starting position mark can also be a mark that can be recognized by other image acquisition devices, which is not specifically limited here. The carrier of the image acquisition device (i.e., the linear array camera) is a rail inspection vehicle that can move on the track. The linear array cameras installed on the rail inspection vehicle can be two groups. Each group of cameras captures an image of a rail and its corresponding fasteners. The position to start image acquisition should be 2m behind the starting position mark. At this time, the image is acquired but not processed. When passing the starting position, the starting position mark will be recognized in the acquired image. At this time, the target fasteners in the image begin to be numbered. It should be noted that the numbering method of the fasteners in the initial image and the current image is the same to ensure rapid matching of the initial image and the current image of the target fastener.

[0079] The method provided in an embodiment of the present invention utilizes a linear array camera installed on a track inspection vehicle to capture images of target fasteners, and numbers the target fasteners in the image to ensure rapid matching of the initial image and the current image of the target fasteners, thereby providing a guarantee for the subsequent comparison of the current number of visible threads and the initial number of visible threads and the efficient execution of fastener looseness judgment.

[0080] Based on the above embodiment, the specific rule of the numbering is: starting from the starting position, continuous Arabic numerals are used to represent different positions, and continuous English letters are used to represent multiple fasteners corresponding to the same position.

[0081] Specifically, each position has two left and right rails, and each rail has two left and right fasteners, so there are four fastener systems for each position, which are recorded as a, b, c, and d from left to right; and starting from the starting position, there is one such position about every 0.625m, and the position number starts from 1, so the fastener numbers are a_1, b_1, c_1, d_1; a_2, b_2, c_2, d_2; ... Of course, the fastener system of each position can also be numbered by w, x, y, and z, and the corresponding fastener numbers are w_1, x_1, y_1, z_1; w_2, x_2, y_2, z_2; ..., and the numbering method can be adjusted according to actual needs, and this embodiment does not make specific limitations on this.

[0082] The method provided by the embodiment of the present invention sequentially numbers multiple fasteners by means of consecutive numbering. The numbering method is simple and intuitive, and is convenient for quickly matching the initial image and the current image of the target fastener, thus providing a guarantee for the efficient execution of subsequent fastener detection.

[0083] Based on the above embodiment, the direction of the straight line where the sensor of the linear array camera is located is perpendicular to the extension direction of the rail, and the optical axis forms an angle of 45° with the vertical direction.

[0084] Specifically, the direction of the straight line where the sensor of the linear array camera is located is perpendicular to the extension direction of the rail, so as to ensure that the image captured by the linear array camera can include the image of the entire rail and the corresponding fasteners on both sides thereof in the width direction. At the same time, the optical axis is at an angle of 45° to the vertical direction, so as to ensure that the linear array camera lens can better capture a clear image of the fastener.

[0085] The method provided in the embodiment of the present invention can ensure the integrity and clarity of the acquired target fastener image by arranging the direction of the straight line where the sensor of the linear array camera is located to be perpendicular to the extension direction of the rail, and the optical axis is at a 45° angle to the vertical direction, thereby providing a guarantee for the accuracy of subsequent fastener detection. At the same time, the use of a linear array camera for image acquisition can ensure accuracy while saving costs.

[0086] Based on any of the above embodiments, Figure 6 A schematic diagram of a fastener detection device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the fastener detection device includes a visible thread quantity acquisition module 610 and a fastener looseness detection module 620.

[0087] The visible thread quantity acquisition module 610 is used to acquire a current image of a target fastener, and determine the current visible thread quantity corresponding to the target fastener based on the current image.

[0088] Specifically, during the fastener loosening detection process, the visible thread number acquisition module 610 acquires the current image of the target fastener through a corresponding image acquisition device, and determines the current visible thread number of the target fastener by analyzing the current image.

[0089] A fastener loosening detection module 620, configured to detect whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener;

[0090] The initial number of visible threads corresponding to the target fastener is determined based on an initial image of the target fastener acquired in a previous detection cycle.

[0091] Specifically, the fastener loosening detection module 620 can obtain the thread change ΔN of the target fastener based on the current visible thread number N1 and the initial visible thread number N corresponding to the target fastener, and then determine whether the target fastener is loose.

[0092] The device provided by the embodiment of the present invention determines the current number of visible threads and the initial number of visible threads corresponding to the target fastener respectively by utilizing the current image and the initial image of the target fastener obtained by the visible thread number acquisition module 610, and then the fastener loosening detection module 620 detects whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads, and the fastener loosening is detected by using the change in the number of threads. The detection method is direct and reliable, and the processing process is simple, with a small amount of calculation, thereby improving the detection efficiency. At the same time, it does not require the deployment of equipment with higher costs, thereby reducing the detection cost.

[0093] Based on the above embodiment, determining the current visible number of threads corresponding to the target fastener based on the current image includes:

[0094] The number of currently visible threads corresponding to the target fastener is determined based on the number of elliptical shadows between adjacent threads in the current image; wherein:

[0095] If the thread is located on the bolt, the current visible thread quantity is a positive value;

[0096] If the thread is located on the nut, the current visible thread quantity is a negative value.

[0097] Specifically, the visible thread quantity acquisition module 610 can determine the current visible thread quantity corresponding to the target fastener based on the quantity of elliptical shadows.

[0098] Based on the above embodiment, determining the current visible number of threads corresponding to the target fastener based on the current image includes:

[0099] The elliptical shadow is represented by an elliptical curve contour, the elliptical curve contour closest to the top of the bolt is regarded as an incomplete contour, and the elliptical curve contours at other positions are regarded as complete contours.

[0100] If an elliptic curve contour is a complete contour, the number of elliptical shadows is increased by 1, and the integer number of elliptical shadows is determined based on the number of all complete elliptic curve contours;

[0101] If an elliptical curve contour is not a complete contour, the number of elliptical shadows corresponding to the elliptical curve contour is calculated as follows: the ratio of the angle between the major axis of the elliptical curve contour and the extended tail end of the contour to π, and the decimal number of elliptical shadows is determined based on the number of incomplete elliptical curve contours.

[0102] Based on the above embodiment, the detecting whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener includes:

[0103] If the current visible thread quantity is 0, it is determined that the bolt is missing;

[0104] If the current visible thread quantity is greater than or equal to a first threshold, it is determined that the nut is missing;

[0105] If the current visible thread quantity is less than the first threshold value and the thread quantity difference is not less than 0, it is determined that the target fastener is not loose, and the initial visible thread quantity is updated to the current visible thread quantity;

[0106] If the current visible thread quantity is less than the first threshold value, and the thread quantity difference is greater than the second threshold value and less than or equal to 0, it is determined that the target fastener is not loose;

[0107] If the current visible thread quantity is less than a first threshold value, and the thread quantity difference is less than or equal to a second threshold value, it is determined that the target fastener is loose;

[0108] The thread quantity difference is a value determined by subtracting the initial visible thread quantity from the current visible thread quantity; the second threshold is less than the first threshold, and the second threshold is less than 0.

[0109] Based on the above embodiment, the step of obtaining the current image of the target fastener specifically includes:

[0110] The target fasteners are imaged using a linear array camera installed on the track inspection vehicle. When the start position mark is identified in the image, the target fasteners in the image are numbered.

[0111] Wherein, the starting position mark is a marker pre-set on the rail for indicating the starting position.

[0112] Based on the above embodiment, the specific rule of the numbering is: starting from the starting position, continuous Arabic numerals are used to represent different positions, and continuous English letters are used to represent multiple fasteners corresponding to the same position.

[0113] Based on the above embodiment, the direction of the straight line where the sensor of the linear array camera is located is perpendicular to the extension direction of the rail, and the optical axis forms an angle of 45° with the vertical direction.

[0114] The fastener detection device provided in the embodiment of the present invention can execute the above-mentioned fastener detection method. Its specific detection principle and corresponding technical effects are the same as those in the above-mentioned method embodiment, and will not be repeated here.

[0115] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the step flow provided in the above method embodiment.

[0116] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0117] On the other hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the step flow provided in the above method embodiment.

[0118] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fastener detection method, characterized in that: include: Acquire a current image of a target fastener through a linear array camera, and determine the current number of visible threads corresponding to the target fastener based on the current image; wherein the direction of the straight line where the sensor of the linear array camera is located is perpendicular to the extension direction of the rail, and the optical axis is at an angle of 45° to the vertical direction; Based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener, detecting whether the target fastener is loose; The number of initial visible threads corresponding to the target fastener is determined based on an initial image of the target fastener acquired in a previous detection cycle; Wherein, the target fastener includes a bolt and a nut; and the detecting whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener includes: If the current visible thread quantity is 0, it is determined that the bolt is missing; If the current visible thread quantity is greater than or equal to a first threshold, it is determined that the nut is missing; If the current visible thread quantity is less than the first threshold value and the thread quantity difference is not less than 0, it is determined that the target fastener is not loose, and the initial visible thread quantity is updated to the current visible thread quantity; If the current visible thread quantity is less than the first threshold value, and the thread quantity difference is greater than the second threshold value and less than or equal to 0, it is determined that the target fastener is not loose; If the current visible thread quantity is less than a first threshold value, and the thread quantity difference is less than or equal to a second threshold value, it is determined that the target fastener is loose; The thread number difference is a value determined by subtracting the initial visible thread number from the current visible thread number; the second threshold is less than the first threshold, and the second threshold is less than 0; the first threshold is the maximum number of visible threads of the bolt when the nut exists; The determining, based on the current image, the number of currently visible threads corresponding to the target fastener comprises: The number of currently visible threads corresponding to the target fastener is determined based on the number of elliptical shadows between adjacent threads in the current image; wherein: If the thread is located on the bolt, the current visible thread quantity is a positive value; If the thread is located on the nut, the current visible thread quantity is a negative value; The determining, based on the current image, the number of currently visible threads corresponding to the target fastener comprises: The elliptical shadow is represented by an elliptical curve contour, the elliptical curve contour closest to the top of the bolt is regarded as an incomplete contour, and the elliptical curve contours at other positions are regarded as complete contours; If an elliptic curve contour is a complete contour, the number of elliptical shadows is increased by 1, and the integer number of elliptical shadows is determined based on the number of all complete elliptic curve contours; If an elliptical curve contour is not a complete contour, the number of elliptical shadows corresponding to the elliptical curve contour is calculated as follows: the ratio of the angle between the major axis of the elliptical curve contour and the extended tail end of the contour to π, and the decimal number of elliptical shadows is determined based on the number of incomplete elliptical curve contours.

2. The fastener detection method according to claim 1, characterized in that: The obtaining of the current image of the target fastener specifically includes: The target fasteners are imaged using a linear array camera installed on the track inspection vehicle. When the start position mark is identified in the image, the target fasteners in the image are numbered. Wherein, the starting position mark is a marker pre-set on the rail for indicating the starting position.

3. The fastener detection method according to claim 2, characterized in that: The specific rule for the numbering is: starting from the starting position, consecutive Arabic numerals are used to represent different positions, and consecutive English letters are used to represent multiple fasteners corresponding to the same position.

4. A fastener detection device, characterized in that: include: A visible thread number acquisition module, used to acquire a current image of a target fastener through a linear array camera, and determine the current visible thread number corresponding to the target fastener based on the current image; wherein the direction of the straight line where the sensor of the linear array camera is located is perpendicular to the extension direction of the rail, and the optical axis is at a 45° angle to the vertical direction; A fastener loosening detection module, used to detect whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener; The number of initial visible threads corresponding to the target fastener is determined based on an initial image of the target fastener acquired in a previous detection cycle; Wherein, the target fastener includes a bolt and a nut; and the detecting whether the target fastener is loose based on the current number of visible threads and the initial number of visible threads corresponding to the target fastener includes: If the current visible thread quantity is 0, it is determined that the bolt is missing; If the current visible thread quantity is greater than or equal to a first threshold, it is determined that the nut is missing; If the current visible thread quantity is less than the first threshold value and the thread quantity difference is not less than 0, it is determined that the target fastener is not loose, and the initial visible thread quantity is updated to the current visible thread quantity; If the current visible thread quantity is less than the first threshold value, and the thread quantity difference is greater than the second threshold value and less than or equal to 0, it is determined that the target fastener is not loose; If the current visible thread quantity is less than a first threshold value, and the thread quantity difference is less than or equal to a second threshold value, it is determined that the target fastener is loose; The thread number difference is a value determined by subtracting the initial visible thread number from the current visible thread number; the second threshold is less than the first threshold, and the second threshold is less than 0; the first threshold is the maximum number of visible threads of the bolt when the nut exists; The determining, based on the current image, the number of currently visible threads corresponding to the target fastener comprises: The number of currently visible threads corresponding to the target fastener is determined based on the number of elliptical shadows between adjacent threads in the current image; wherein: If the thread is located on the bolt, the current visible thread quantity is a positive value; If the thread is located on the nut, the current visible thread quantity is a negative value; The determining, based on the current image, the number of currently visible threads corresponding to the target fastener comprises: The elliptical shadow is represented by an elliptical curve contour, the elliptical curve contour closest to the top of the bolt is regarded as an incomplete contour, and the elliptical curve contours at other positions are regarded as complete contours; If an elliptic curve contour is a complete contour, the number of elliptical shadows is increased by 1, and the integer number of elliptical shadows is determined based on the number of all complete elliptic curve contours; If an elliptical curve contour is not a complete contour, the number of elliptical shadows corresponding to the elliptical curve contour is calculated as follows: the ratio of the angle between the major axis of the elliptical curve contour and the extended tail end of the contour to π, and the decimal number of elliptical shadows is determined based on the number of incomplete elliptical curve contours.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the fastener detection method according to any one of claims 1 to 3 are implemented.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the fastener detection method according to any one of claims 1 to 3 are implemented.