Bolt disease detection method, device and equipment and readable storage medium
Through differential model and image processing technology, bolt corrosion is automatically detected, which solves the problems of low accuracy, high cost and poor safety of manual detection, and achieves efficient and safe bolt corrosion detection and missing early warning.
Patent Information
- Application Number
- CN202410803726.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-11
AI Technical Summary
In the existing technology, manual detection of bolt corrosion degree has problems such as unguaranteed accuracy, high cost and poor safety.
The difference model is used to detect the gray value difference between the bolt image to be detected and the standard image. If the gray value difference is greater than the preset difference, it is determined that there is rust. Image cropping, smoothing filtering and gray value high frequency area enhancement are combined. and deformity correction technology, automatically detecting bolt corrosion and providing early warning.
It improves detection accuracy, reduces detection costs, ensures the safety of inspection personnel, and realizes automated bolt corrosion detection and missing early warning.
Smart Images

Figure CN118761971A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bridge bolt detection, and in particular to a bolt defect detection method, device, equipment and readable storage medium. Background Art
[0002] Bolts are important connecting components of steel structure beam bridges. Currently, they are mainly used in the connection of main truss members of steel truss bridges and bridge connection components of some steel structure bridges with historical value, cultural relic value and important traffic arteries. However, under the influence of factors such as moisture and oxidation in the air, railway bridge bolts will rust, loosen and fall off, resulting in loss of bolt bearing capacity and affecting the working performance of the bridge. Therefore, detecting the degree of rust and whether the bolts are missing is a very important part of bridge health detection.
[0003] At present, in the actual bridge inspection process, the main means to detect the degree of bolt corrosion is still manual visual inspection. Although the manual inspection method is relatively simple, on the one hand, it is restricted by the installation position of the bolt group, making manual inspection not only time-consuming and labor-intensive but also dangerous. On the other hand, the accuracy of manual inspection depends to a large extent on the professional ability and experience of the inspectors, resulting in large discreteness of the bolt inspection results and poor referenceability.
[0004] In summary, the current manual inspection of bolt corrosion has the disadvantages of uncertain accuracy, high cost and poor safety. Summary of the invention
[0005] The present application provides a bolt disease detection method, device, equipment and readable storage medium, aiming to solve the technical problems that the current manual detection of bolt corrosion degree has shortcomings such as lack of guaranteed accuracy, high cost and poor safety.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting bolt defects, the method comprising:
[0007] Acquire an image to be detected, where the image to be detected is an image obtained by photographing the bolt to be detected;
[0008] Crop the bolt area in the image to be detected to obtain the bolt image to be detected;
[0009] Using a difference model to detect the image of the bolt to be detected, and obtaining a gray value difference between the image of the bolt to be detected and a standard image of the difference model, wherein the difference model is trained based on an original image, wherein the original image is an image obtained by photographing the bolt to be detected in a non-rusted state, wherein the original image and the image to be detected have the same shooting position and angle;
[0010] If the gray value difference is greater than the first preset difference, it is determined that the bolt to be detected has bolt corrosion, and a bolt corrosion warning is issued.
[0011] Optionally, after the bolt region in the image to be detected is cropped to obtain the bolt image to be detected, the method further includes:
[0012] Divide the image of the bolt to be detected into multiple areas;
[0013] Traversing each area, if the difference between the grayscale value of the traversed current area and the grayscale value of each adjacent area within a preset distance is greater than a second preset difference, then determining that the current area is a bolt missing area;
[0014] The bolt missing area is marked in the image of the bolt to be detected, and a bolt missing warning is issued.
[0015] Optionally, before cropping the bolt region in the image to be detected to obtain the bolt image to be detected, the method includes:
[0016] The image to be detected is subjected to smoothing filtering, and the image obtained after the smoothing filtering is used as a new image to be detected.
[0017] Optionally, before using the difference model to detect the image of the bolt to be detected and obtaining the gray value difference between the image of the bolt to be detected and the standard image of the difference model, the method includes:
[0018] Performing grayscale value high-frequency area enhancement, contrast enhancement and deformity correction on the bolt image to be inspected, wherein the grayscale value high-frequency area is an area where the grayscale value difference between the area and the adjacent area is greater than a third preset difference;
[0019] The image obtained after grayscale high-frequency area enhancement, contrast enhancement and deformity correction is used as a new bolt image to be detected.
[0020] Optionally, the grayscale value high-frequency area enhancement of the bolt image to be detected includes:
[0021] For each pixel in the high-frequency region of the grayscale value of the bolt image to be detected, the grayscale value enhancement coefficient is used to calculate the new grayscale value of each pixel through formula 1, and the formula 1 is:
[0022] New gray value = round ((gray value of the pixel before smoothing filter processing - gray value after smoothing filter processing) * gray value enhancement coefficient) + gray value of the pixel before smoothing filter processing;
[0023] The gray value of each pixel in the gray value high frequency region is updated using the new gray value of each pixel.
[0024] In a second aspect, an embodiment of the present application provides a bolt defect detection device, the bolt defect detection device comprising:
[0025] An acquisition module, used for acquiring an image to be detected, wherein the image to be detected is an image obtained by photographing the bolt to be detected;
[0026] A cropping module, used for cropping the bolt area in the image to be detected to obtain the bolt image to be detected;
[0027] A detection module, used to detect the image of the bolt to be detected using a difference model to obtain a gray value difference between the image of the bolt to be detected and a standard image of the difference model, wherein the difference model is trained based on an original image, wherein the original image is an image obtained by photographing the bolt to be detected in a non-rusted state, wherein the original image and the image to be detected have the same shooting position and angle;
[0028] The early warning module is used to determine that the bolt to be detected has bolt corrosion if the gray value difference is greater than a first preset difference, and to issue a bolt corrosion early warning.
[0029] Optionally, the bolt defect detection device further includes a bolt missing detection module, which is used to:
[0030] Divide the image of the bolt to be detected into multiple areas;
[0031] Traversing each area, if the difference between the grayscale value of the traversed current area and the grayscale value of each adjacent area within a preset distance is greater than a second preset difference, then determining that the current area is a bolt missing area;
[0032] The bolt missing area is marked in the image of the bolt to be detected, and a bolt missing warning is issued.
[0033] Optionally, the bolt defect detection device further includes a smoothing filter module, which is used to:
[0034] The image to be detected is subjected to smoothing filtering, and the image obtained after the smoothing filtering is used as a new image to be detected.
[0035] In a third aspect, an embodiment of the present application provides a bolt disease detection device, which includes a processor, a memory, and a bolt disease detection program stored in the memory and executable by the processor, wherein when the bolt disease detection program is executed by the processor, the steps of the bolt disease detection method described above are implemented.
[0036] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a bolt disease detection program is stored, wherein when the bolt disease detection program is executed by a processor, the steps of the bolt disease detection method as described above are implemented.
[0037] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0038] In an embodiment of the present application, an image to be detected is obtained, and the image to be detected is an image obtained by photographing the bolt to be detected; the bolt area in the image to be detected is cropped to obtain the image of the bolt to be detected; the image of the bolt to be detected is detected using a difference model to obtain the gray value difference between the image of the bolt to be detected and the standard image of the difference model, and the difference model is obtained by training the original image, and the original image is an image obtained by photographing the bolt to be detected in a non-rusted state, wherein the original image and the image to be detected have the same shooting position and angle; if the gray value difference is greater than the first preset difference, it is determined that the bolt to be detected has bolt rust, and a bolt rust warning is issued. Through the embodiment of the present application, a difference model is used to compare the gray value difference between the image of the bolt to be detected and the standard image to perform rust detection, which can automatically detect whether the bolt is rusted and issue a warning without relying on the professional ability and experience of the inspection personnel, which not only improves the detection accuracy, but also reduces the detection cost and ensures the safety of the inspection personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flow chart of an embodiment of a bolt defect detection method of the present application;
[0040] Figure 2 A schematic diagram of a bolt group according to an embodiment of a bolt defect detection method of the present application;
[0041] Figure 3 This is another schematic diagram of a process of an embodiment of a bolt defect detection method of the present application;
[0042] Figure 4 This is a schematic diagram of the functional modules of an embodiment of a bolt defect detection device of the present application;
[0043] Figure 5 This is a schematic diagram of the hardware structure of the bolt defect detection equipment involved in the embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0046] In a first aspect, an embodiment of the present application provides a method for detecting bolt defects.
[0047] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of a bolt defect detection method of the present application. Figure 1 As shown in the figure, the bolt disease detection method includes:
[0048] Step S10, obtaining an image to be detected, wherein the image to be detected is an image obtained by photographing the bolt to be detected.
[0049] In this embodiment, the bolt to be detected may be a single bolt or multiple bolts. Figure 2 , Figure 2 This is a schematic diagram of a bolt group according to an embodiment of a bolt defect detection method of the present application. Figure 2 As shown, for bridges, there are often multiple bolts forming a bolt group. Specifically, the installation point of the image collector can be determined near the bolt group to be detected and the image collector can be installed, and the image capture function of the image collector can be turned on at the same time. The image collector can preferably use an industrial camera, and the installation position of the image collector is preferably opposite to the bolt group so that the front of the bolt can be seen more completely. Of course, the image collector can also be allowed to be tilted to a certain extent. The principle is to ensure that the image collector can completely capture the nail cap of any bolt in the bolt group, that is, all bolts in the bolt group photographed by the image collector must have clearly visible nail caps. In order to determine the best installation point of the image collector, the shooting function of the image collector can be turned on to test whether the installation of each installation point is reasonable, whether the nail cap of each bolt in the bolt group photographed can be fully displayed, whether the bolt cap photographed is located in the center of the image and whether the imaging is normal.
[0050] Step S20, cropping the bolt area in the image to be detected to obtain the bolt image to be detected.
[0051] In this embodiment, the reduce_domin operator in the Halcon algorithm can be used to crop the area where the target of interest (i.e., the bolt) is marked by the area of interest in the bolt group image to be detected, so as to create a bolt image to be detected that only contains the bolt group area, thereby reducing the amount of image calculation in bolt corrosion and missing detection and improving detection efficiency.
[0052] Step S30, using the difference model to detect the image of the bolt to be detected, and obtaining the grayscale value difference between the image of the bolt to be detected and the standard image of the difference model, wherein the difference model is trained based on the original image, and the original image is an image obtained by photographing the bolt to be detected in a non-rusted state, wherein the shooting position and angle of the original image and the image to be detected are the same.
[0053] In this embodiment, the use of the variation model for rust detection is mainly to compare the image of the bolt to be detected with the standard image of the variation model, find out the obvious difference (that is, the rust area) between the image to be detected and the standard image in the variation model, mainly the difference between the grayscale values of the two, and the variation model can be trained in advance using one or more bolt images in a non-rusted state taken at the same position and angle as the image to be detected to obtain a trained variation model, the trained variation model includes a standard image and a variation image, and the variation image stores the range of grayscale values allowed to vary for each pixel. In the comparison process, the detection bolt image can be aligned with the standard image of the variation model, and the grayscale value of the detection bolt image can be compared point by point with the standard image of the variation model. By comparison, not only the overall grayscale value difference between the image of the bolt to be detected and the standard image of the variation model can be obtained, but also the position of the area where the grayscale value difference between the image of the bolt to be detected and the standard image of the variation model is too large can be obtained.
[0054] Step S40: If the gray value difference is greater than the first preset difference, it is determined that the bolt to be detected has bolt corrosion, and a bolt corrosion warning is issued.
[0055] In this embodiment, if the grayscale value difference between the image of the bolt to be detected and the standard image of the difference model is greater than a certain preset difference, it means that the difference between the image of the bolt to be detected and the standard image of the bolt in a non-rusted state is too large, then it is determined that there is bolt rust on the bolt to be detected, and a bolt corrosion warning is issued by means of sound and light.
[0056] In this embodiment, an industrial camera is used to photograph the bolt group of the bridge to obtain an image to be detected, the area of interest is cropped to obtain an image of the bolt to be detected, and a difference model is used to compare the grayscale value difference between the image of the bolt to be detected and the standard image to perform rust detection. It can automatically detect whether the bolts are corroded and issue an early warning, without relying on the professional ability and experience of the inspectors. This not only improves the detection accuracy, but also reduces the detection cost and ensures the safety of the inspectors.
[0057] Further, in one embodiment, referring to Figure 3 , Figure 3 Another flow chart of an embodiment of the bolt defect detection method of the present application is as follows: Figure 3 As shown, after step S20, the following steps are included:
[0058] Step S300, dividing the image of the bolt to be detected into multiple areas;
[0059] Step S400, traversing each area, if the difference between the grayscale value of the traversed current area and the grayscale value of each adjacent area within a preset distance is greater than a second preset difference, then determining that the current area is a bolt missing area;
[0060] Step S500: marking the bolt missing area in the bolt image to be detected, and issuing a bolt missing warning.
[0061] In this embodiment, the image of the bolt to be detected can be divided into multiple areas according to the grayscale value, or the image of the bolt to be detected can be divided into multiple areas according to the set block size. If the bolt is missing, a circular hole will be formed. The grayscale value of the circular hole area must be greatly different from the grayscale value of other areas. Therefore, each area after division is traversed. If the difference between the grayscale value of the current area and the grayscale value of each adjacent area within a certain preset distance is greater than a certain preset difference, it means that the current area is a bolt missing area. The bolt missing area is further marked in the image of the bolt to be detected, and a bolt missing warning is performed in the form of sound and light, where the grayscale value of each area can be obtained by calculating the median or average grayscale value of each pixel in the area. It should be noted that since the algorithms used for bolt missing detection and bolt corrosion detection are different, bolt missing detection can be performed simultaneously with bolt corrosion detection, or bolt missing detection can be performed first, and then bolt corrosion detection can be performed for areas without bolt missing.
[0062] Furthermore, in one embodiment, before step S20, the following steps are included:
[0063] The image to be detected is subjected to smoothing filtering, and the image obtained after the smoothing filtering is used as a new image to be detected.
[0064] In this embodiment, the image to be detected is subjected to smoothing filtering to make the image grayscale value linearly smooth, remove the noise in the image information, and avoid the influence of image defects caused by image noise on image processing, so as to further improve the detection accuracy of subsequent steps.
[0065] Furthermore, in one embodiment, before step S30, the following steps are included:
[0066] Performing grayscale value high-frequency area enhancement, contrast enhancement and deformity correction on the bolt image to be inspected, wherein the grayscale value high-frequency area is an area where the grayscale value difference between the area and the adjacent area is greater than a third preset difference;
[0067] The image obtained after grayscale high-frequency area enhancement, contrast enhancement and deformity correction is used as a new bolt image to be detected.
[0068] In this embodiment, grayscale value high-frequency area enhancement, contrast enhancement and deformity correction are performed on the bolt image to be detected. The ultimate goal is to improve the detection accuracy of bolt corrosion detection and bolt missing detection. Grayscale value high-frequency area enhancement, contrast enhancement and deformity correction can be used simultaneously or selectively. Among them, grayscale value high-frequency area enhancement of the bolt image to be detected can make the edges and corners of different color blocks of the image more obvious. The equ_histo_image operator in the Halcon algorithm can be used to enhance the contrast of the bolt image to be detected, that is, the histogram of the bolt image to be detected is equalized. The pixel interpolation method can be used to perform deformity correction processing on the bolt image to be detected to improve the image quality.
[0069] Furthermore, in one embodiment, the grayscale value high-frequency region enhancement of the bolt image to be detected includes:
[0070] For each pixel in the high-frequency region of the grayscale value of the bolt image to be detected, the grayscale value enhancement coefficient is used to calculate the new grayscale value of each pixel through formula 1, and the formula 1 is:
[0071] New gray value = round ((gray value of the pixel before smoothing filter processing - gray value after smoothing filter processing) * gray value enhancement coefficient) + gray value of the pixel before smoothing filter processing;
[0072] The gray value of each pixel in the gray value high frequency region is updated using the new gray value of each pixel.
[0073] In this embodiment, the grayscale high-frequency area is an area where the grayscale value difference between the adjacent area is greater than a certain preset difference. The edge of the image and the background in the image usually has a relatively obvious difference. By using a formula to update the grayscale value of each pixel in the grayscale high-frequency area, the edges and corners of different color blocks of the image can be made more obvious.
[0074] In a second aspect, an embodiment of the present application also provides a bolt defect detection device.
[0075] In one embodiment, referring to Figure 4 , Figure 4 This is a functional module diagram of an embodiment of a bolt defect detection device of the present application, as shown in FIG. Figure 4 As shown, the bolt defect detection device comprises:
[0076] An acquisition module 10 is used to acquire an image to be detected, where the image to be detected is an image obtained by photographing the bolt to be detected;
[0077] A cropping module 20, used for cropping the bolt area in the image to be detected to obtain the bolt image to be detected;
[0078] A detection module 30 is used to detect the image of the bolt to be detected using a difference model to obtain a grayscale value difference between the image of the bolt to be detected and a standard image of the difference model, wherein the difference model is trained based on an original image, wherein the original image is an image obtained by photographing the bolt to be detected in a non-corroded state, wherein the original image and the image to be detected have the same shooting position and angle;
[0079] The early warning module 40 is used to determine that the bolt to be detected has bolt corrosion if the gray value difference is greater than a first preset difference, and to issue a bolt corrosion early warning.
[0080] Furthermore, in one embodiment, the bolt defect detection device further includes a bolt missing detection module, which is used to:
[0081] Divide the image of the bolt to be detected into multiple areas;
[0082] Traversing each area, if the difference between the grayscale value of the traversed current area and the grayscale value of each adjacent area within a preset distance is greater than a second preset difference, then determining that the current area is a bolt missing area;
[0083] The bolt missing area is marked in the image of the bolt to be detected, and a bolt missing warning is issued.
[0084] Furthermore, in one embodiment, the bolt defect detection device further includes a smoothing filter module, which is used to:
[0085] The image to be detected is subjected to smoothing filtering, and the image obtained after the smoothing filtering is used as a new image to be detected.
[0086] Furthermore, in one embodiment, the bolt defect detection device further includes an enhancement module, including:
[0087] An enhancement unit, used for performing gray value high frequency area enhancement, contrast enhancement and deformity correction on the bolt image to be detected, wherein the gray value high frequency area is an area where the gray value difference between the area and the adjacent area is greater than a third preset difference;
[0088] The replacement unit is used to use the image obtained after gray value high frequency area enhancement, contrast enhancement and deformity correction as a new bolt image to be detected.
[0089] Furthermore, in one embodiment, the enhancement unit is used to:
[0090] For each pixel in the high-frequency region of the grayscale value of the bolt image to be detected, the grayscale value enhancement coefficient is used to calculate the new grayscale value of each pixel through formula 1, and the formula 1 is:
[0091] New gray value = round ((gray value of the pixel before smoothing filter processing - gray value after smoothing filter processing) * gray value enhancement coefficient) + gray value of the pixel before smoothing filter processing;
[0092] The gray value of each pixel in the gray value high frequency region is updated using the new gray value of each pixel.
[0093] Among them, the functional implementation of each module in the above-mentioned bolt disease detection device corresponds to the various steps in the above-mentioned bolt disease detection method embodiment, and its functions and implementation processes will not be repeated here one by one.
[0094] In a third aspect, an embodiment of the present application provides a bolt defect detection device.
[0095] Reference Figure 5 , Figure 5 Schematic diagram of the hardware structure of the bolt disease detection device involved in the embodiment of the present application. In the embodiment of the present application, the bolt disease detection device may include a processor, a memory, a communication interface and a communication bus.
[0096] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0097] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the bolt disease detection device, and the interface used to realize the interconnection between the bolt disease detection device and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0098] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0099] The processor may be a general-purpose processor, which may call the bolt defect detection program stored in the memory and execute the bolt defect detection method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the bolt defect detection program is called may refer to the various embodiments of the bolt defect detection method of the present application, which will not be described in detail here.
[0100] Those skilled in the art will understand that Figure 5 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0101] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.
[0102] A bolt disease detection program is stored on the readable storage medium of the present application, wherein when the bolt disease detection program is executed by the processor, the steps of the bolt disease detection method as described above are implemented.
[0103] Among them, the method implemented when the bolt disease detection program is executed can refer to the various embodiments of the bolt disease detection method of the present application, and will not be repeated here.
[0104] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0105] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0106] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0107] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0108] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0110] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for detecting bolt defects. It is characterized in that The bolt disease detection method comprises: Acquire an image to be detected, where the image to be detected is an image obtained by photographing the bolt to be detected; Crop the bolt area in the image to be detected to obtain the bolt image to be detected; Using a difference model to detect the image of the bolt to be detected, and obtaining a gray value difference between the image of the bolt to be detected and a standard image of the difference model, wherein the difference model is trained based on an original image, wherein the original image is an image obtained by photographing the bolt to be detected in a non-rusted state, wherein the original image and the image to be detected have the same shooting position and angle; If the gray value difference is greater than the first preset difference, it is determined that the bolt to be detected has bolt corrosion, and a bolt corrosion warning is issued.
2. The bolt defect detection method according to claim 1, It is characterized in that After the bolt region in the image to be detected is cropped to obtain the bolt image to be detected, the method includes: Divide the image of the bolt to be detected into multiple areas; Traversing each area, if the difference between the grayscale value of the traversed current area and the grayscale value of each adjacent area within a preset distance is greater than a second preset difference, then determining that the current area is a bolt missing area; The bolt missing area is marked in the image of the bolt to be detected, and a bolt missing warning is issued.
3. The bolt defect detection method according to claim 1, It is characterized in that Before the bolt region in the image to be detected is cropped to obtain the bolt image to be detected, the method includes: The image to be detected is subjected to smoothing filtering, and the image obtained after the smoothing filtering is used as a new image to be detected.
4. The bolt defect detection method according to claim 3, It is characterized in that Before using the difference model to detect the bolt image to be detected and obtaining the gray value difference between the bolt image to be detected and the standard image of the difference model, the method includes: Performing grayscale value high-frequency area enhancement, contrast enhancement and deformity correction on the bolt image to be inspected, wherein the grayscale value high-frequency area is an area where the grayscale value difference between the area and the adjacent area is greater than a third preset difference; The image obtained after grayscale high-frequency area enhancement, contrast enhancement and deformity correction is used as a new bolt image to be detected.
5. The bolt defect detection method according to claim 4, It is characterized in that The grayscale value high frequency area enhancement of the bolt image to be detected includes: For each pixel in the high-frequency region of the grayscale value of the bolt image to be detected, the grayscale value enhancement coefficient is used to calculate the new grayscale value of each pixel through formula 1, and the formula 1 is: New gray value = round ((gray value of the pixel before smoothing filter processing - gray value after smoothing filter processing) * gray value enhancement coefficient) + gray value of the pixel before smoothing filter processing; The gray value of each pixel in the gray value high frequency region is updated using the new gray value of each pixel.
6. A bolt defect detection device, It is characterized in that The bolt defect detection device comprises: An acquisition module, used for acquiring an image to be detected, wherein the image to be detected is an image obtained by photographing the bolt to be detected; A cropping module, used for cropping the bolt area in the image to be detected to obtain the bolt image to be detected; A detection module, used to detect the image of the bolt to be detected using a difference model to obtain a gray value difference between the image of the bolt to be detected and a standard image of the difference model, wherein the difference model is trained based on an original image, wherein the original image is an image obtained by photographing the bolt to be detected in a non-rusted state, wherein the original image and the image to be detected have the same shooting position and angle; The early warning module is used to determine that the bolt to be detected has bolt corrosion if the gray value difference is greater than a first preset difference, and to issue a bolt corrosion early warning.
7. The bolt defect detection device according to claim 6, It is characterized in that The bolt defect detection device further includes a bolt missing detection module, which is used to: Divide the image of the bolt to be detected into multiple areas; Traversing each area, if the difference between the grayscale value of the traversed current area and the grayscale value of each adjacent area within a preset distance is greater than a second preset difference, then determining that the current area is a bolt missing area; The bolt missing area is marked in the image of the bolt to be detected, and a bolt missing warning is issued.
8. The bolt defect detection device according to claim 6, It is characterized in that The bolt defect detection device further includes a smoothing filter module, which is used to: The image to be detected is subjected to smoothing filtering, and the image obtained after the smoothing filtering is used as a new image to be detected.
9. A bolt defect detection device, It is characterized in that The bolt disease detection device includes a processor, a memory, and a bolt disease detection program stored in the memory and executable by the processor, wherein when the bolt disease detection program is executed by the processor, the steps of the bolt disease detection method according to any one of claims 1 to 5 are implemented.
10. A readable storage medium, It is characterized in that The readable storage medium stores a bolt disease detection program, wherein when the bolt disease detection program is executed by the processor, the steps of the bolt disease detection method according to any one of claims 1 to 5 are implemented.
