Machine vision based testing apparatus and method for fastener surface defects
By designing protective and enclosing mechanisms, the problems of visual sensors being easily damaged and hindering maintenance have been solved, achieving automatic protection and simplified maintenance of visual sensors, and improving the reliability and accuracy of the detection device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ASIA PACIFIC AVIATION TECH CO LTD
- Filing Date
- 2026-06-23
- Publication Date
- 2026-07-31
AI Technical Summary
In existing fastener inspection devices, vision sensors are easily damaged and hinder maintenance operations.
A fastener detection device including a protective mechanism and a closing mechanism was designed. A servo motor drives a vision sensor to be stored in a storage compartment, and a rotation mechanism cleans the sensor surface. The protective plate automatically closes when the sensor stops to prevent accidental contact and dust intrusion.
It effectively protects the vision sensor from damage, simplifies maintenance operations, and improves the reliability and detection accuracy of the sensor in complex environments.
Smart Images

Figure CN122487392A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fastener inspection technology, and more particularly to a testing device and method for fastener surface defects based on machine vision. Background Technology
[0002] Fasteners are basic components used to connect, fix, or seal mechanical parts. Common fasteners include bolts, screws, nuts, washers, pins, rivets, etc. During the fastener production process, due to factors such as uneven material, fluctuations in processing technology, or improper heat treatment, various defects may appear on their surface, such as cracks, rust, pits, scratches, and coating peeling. These defects not only affect the appearance quality of the fasteners but also significantly reduce their mechanical properties. Therefore, it is necessary to test the surface defects of fasteners before they leave the factory.
[0003] Current common inspection devices typically employ automated visual inspection solutions. The core of these solutions involves integrating high-resolution visual sensors (such as industrial cameras) above the conveyor belt. As the conveyor belt transports fasteners at a constant speed through the inspection area, the visual sensors capture high-definition images of the fastener surfaces in real time. The image data is transmitted to a processing unit, where it is analyzed and judged using specialized image processing algorithms. Based on preset quality standards, the system automatically distinguishes between qualified and defective products. After inspection, qualified products continue to be transported to the collection area or the next process via the conveyor belt; fasteners deemed to have surface defects trigger an audible and visual alarm, prompting staff to intercept and re-inspect them, thus achieving efficient online initial screening and quality control.
[0004] However, in existing devices, vision sensors are usually directly fixed above the conveyor belt, operating in an open environment for extended periods. This layout has significant drawbacks: First, the sensors lack physical protection and are easily damaged by accidental collisions, falling objects, or accidental contact with personnel during operations or when not in use. Second, their installation position directly faces critical areas of the conveyor belt, physically hindering workers from performing routine cleaning or maintenance operations. Therefore, this application proposes a machine vision-based testing device and method for fastener surface defects. Summary of the Invention
[0005] The purpose of this invention is to address the problem in the prior art that vision sensors are easily damaged by accidental touches when not in use, and that this hinders the maintenance of other components, by proposing a testing device and method for fastener surface defects based on machine vision.
[0006] In a first aspect, the present invention provides a machine vision-based testing apparatus for fastener surface defects, comprising a conveyor belt, a frame mounted on the outer side of the conveyor belt, and a vision sensor for detecting fasteners disposed at the top end of the conveyor belt, and further comprising: The protective structure includes a storage compartment and a drive assembly, wherein: The storage compartment is fixed to the outside of the frame and is used to house the vision sensor. The drive assembly is connected to the storage compartment and is used to drive the vision sensor to swing so that the vision sensor is inside the storage compartment. The enclosure mechanism includes a shielding component and a control component, wherein: The shielding assembly includes two sets of protective plates, two sets of guide plates, and two sets of guide rods. The two sets of protective plates are slidably connected to the outer side of the storage compartment. The two sets of guide plates are respectively fixedly connected to the two sets of protective plates. Both ends of the two sets of guide rods are fixedly connected to the outer side of the storage compartment, and both sets of guide rods slide through the two sets of guide plates. The control assembly is used to control the two sets of protective plates to close when the drive assembly is running.
[0007] Optionally, the drive assembly includes a servo motor, a transmission rod, and a connecting frame. The servo motor is mounted on the outside of the storage compartment. The transmission rod is connected to the output end of the servo motor, and the end of the transmission rod away from the servo motor is rotatably connected to the inner wall of the storage compartment. The connecting frame is fixed to the outside of the transmission rod, and the end of the connecting frame away from the transmission rod is fixed to the outside of the vision sensor.
[0008] Optionally, the control assembly includes a connecting roller, a traction rope, a transmission rope, and a guide wheel. The connecting roller is fixed to the outside of the transmission rod, the traction rope is fixed to the outside of the connecting roller, the traction rope passes through the storage compartment, the transmission rope is fixed between the two sets of guide plates, the end of the traction rope away from the connecting roller is fixed to the transmission rope, and the guide wheel is fixed to the outside of the storage compartment, with the traction rope in contact with the guide wheel.
[0009] Optionally, a side rod is fixed to the outside of the transmission rod, and the side rod has an L-shaped design.
[0010] Optionally, two sets of side plates are fixedly connected to the outer sides of both sets of guide rods, and springs are fixedly connected between the two sets of side plates and the two sets of guide plates.
[0011] Optionally, a glass plate is provided at the bottom of the vision sensor, and a limiting plate is fixedly connected to one end of the glass plate near the vision sensor. A limiting groove is formed at the bottom of the vision sensor, and the limiting plate is slidably connected inside the limiting groove. A rotating mechanism is provided around the vision sensor to drive the glass plate to rotate at high speed.
[0012] Optionally, the rotating mechanism includes a motor, a first spur gear, and a second spur gear. The motor is connected to the periphery of the vision sensor, the first spur gear is connected to the output end of the motor, and the second spur gear is fixed to the outside of the glass plate. The first spur gear and the second spur gear mesh with each other.
[0013] Optionally, a protective cover is fixed to the outside of the vision sensor, and the first spur gear and the second spur gear are located inside the protective cover.
[0014] Optionally, a sealing strip, made of rubber, is glued to the side of each of the two sets of protective plates that are close to each other.
[0015] Secondly, the present invention provides a machine vision-based method for testing fastener surface defects, applied to the machine vision-based fastener surface defect testing apparatus described in the first aspect, the method comprising the following steps: S1. Start detection, place the fastener on the conveyor belt and transport it. The rotating mechanism causes the glass plate at the bottom of the vision sensor to rotate at high speed for self-cleaning. The vision sensor collects images of the fastener surface and transmits them to the processing unit for analysis and judgment. S2. After the detection is completed, the servo motor of the drive component is started. The servo motor swings the vision sensor into the storage compartment through the transmission rod and the connecting frame. S3. Closed protection: During the storage of the vision sensor, the transmission rod synchronously drives the connecting roller to tighten the traction rope. The traction rope pulls the transmission rope, causing the two guide plates to slide towards each other, thereby driving the two protective plates to close and seal the vision sensor in the storage compartment. The spring is compressed during this process. S4. Reset preparation: When retesting is required, the servo motor reverses, the spring releases its elastic potential energy, and pulls the guide plate and protective plate to reset and open. At the same time, the transmission rod swings the vision sensor back to the working position above the conveyor belt.
[0016] Compared with the prior art, this application includes at least one of the following beneficial technical effects: This invention, through the structural design of the protective mechanism, enables the vision sensor to be automatically stored in the protective chamber when the vision sensor is not in operation, thus removing it from the working area and preventing interference with conveyor belt maintenance. At the same time, the sealing mechanism can synchronously drive the protective plate to close, forming comprehensive protection and effectively preventing accidental contact and dust intrusion.
[0017] Furthermore, by setting a high-speed rotating glass plate at the bottom of the vision sensor, the centrifugal force generated by the rotation is used to automatically remove impurities and water droplets attached to the surface, thereby avoiding contamination interference, ensuring clear and accurate detection, and eliminating the need for manual intervention. This significantly improves the vision sensor's continuous working capability and maintenance convenience in complex environments. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the overall structure of a machine vision-based testing device for fastener surface defects. Figure 2 This is a partial structural diagram of a machine vision-based testing device for fastener surface defects. Figure 3 This is a structural diagram of the servo motor and the connecting frame; Figure 4 This is a cross-sectional view of the storage compartment; Figure 5 This is a schematic diagram of the structure of spur gear one and spur gear two; Figure 6 This is a cross-sectional schematic diagram of the glass plate and the limiting plate; Figure 7 This is a schematic diagram of the protective cover.
[0019] Reference numerals: 1. Conveyor belt; 2. Frame; 3. Vision sensor; 4. Storage bin; 5. Protective plate; 6. Guide plate; 7. Guide rod; 8. Servo motor; 9. Transmission rod; 10. Connecting frame; 11. Connecting roller; 12. Traction rope; 13. Transmission rope; 14. Guide wheel; 15. Side rod; 16. Spring; 17. Glass plate; 18. Limiting plate; 19. Limiting groove; 20. Motor; 21. Spur gear one; 22. Spur gear two; 23. Protective cover; 24. Sealing strip; 26. Side plate. Detailed Implementation
[0020] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0021] In the description of this invention, it should be understood that the terms "upper," "lower," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. It should be noted that when a component is considered to be "connected" to another component, it can be directly connected to the other component or there may be a component positioned centrally in the connection.
[0022] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0023] like Figure 1As shown, the fastener surface defect testing device based on machine vision proposed in this invention includes a conveyor belt 1. As prior art, the conveyor belt 1 is used to place fasteners on its surface. The conveyor belt 1 can transport the fasteners in a preset direction. A frame 2 is installed on the outer side of the conveyor belt 1, providing support. A vision sensor 3 for detecting fasteners is installed at the top of the conveyor belt 1. During the conveyor belt 1's transport of fasteners, the fasteners enter the detection range of the vision sensor 3. The vision sensor 3 acquires high-definition images of the fastener surface in real time. The image data is transmitted to an external processing unit for analysis and judgment using a dedicated image processing algorithm. Based on preset quality standards, the system automatically distinguishes between qualified and defective products, thus completing the fastener testing. It should be noted that both the conveyor belt 1 and the vision sensor 3 are prior art and mature technologies, and will not be elaborated upon further in this embodiment.
[0024] As one implementation method, such as Figure 1 - Figure 4As shown, the testing device also includes a protective mechanism and a sealing mechanism. The protective mechanism includes a storage compartment 4 and a drive assembly. The storage compartment 4 is fixed to the outside of the frame 2 and is used to house the vision sensor 3. The interior of the storage compartment 4 is hollow, providing space for components. The drive assembly is connected to the storage compartment 4 and is used to drive the vision sensor 3 to swing, placing it inside the storage compartment 4. After use, the drive mechanism can drive the vision sensor 3 to swing, eventually placing it inside the storage compartment 4. The storage compartment 4 provides overall protection for the vision sensor 3 and also allows it to move away from the top of the conveyor belt 1, effectively preventing interference with workers maintaining the conveyor belt 1. The sealing mechanism includes a shielding assembly and a control assembly. The shielding assembly includes two sets of protective plates 5, two sets of guide plates 6, and two sets of guide rods 7. The two sets of protective plates 5... The two sets of protective plates 5 are slidably connected to the outer side of the storage compartment 4. When closed, they work together with the storage compartment 4 to provide comprehensive protection for the vision sensor 3, effectively preventing accidental contact and providing dust protection. The two sets of guide plates 6 are fixedly connected to the two sets of protective plates 5 respectively. Both ends of the two sets of guide rods 7 are fixedly connected to the outer side of the storage compartment 4, and the two sets of guide rods 7 slide through the two sets of guide plates 6. The guide plates 6 can move along the outer side of the two sets of guide rods 7, thereby guiding the movement direction of the protective plates 5 and making the movement of the protective plates 5 more stable and smooth. The control component is used to control the two sets of protective plates 5 to close when the drive mechanism drives the vision sensor 3 to swing to the specified position. After the drive mechanism drives the vision sensor 3 to swing to the specified position, the drive mechanism will synchronously drive the control component to run. The control component will then drive the two sets of protective plates 5 to move in the direction of closer proximity. Finally, after the drive mechanism stops running, the two sets of protective plates 5 are in a close fit under the action of the control component, thereby providing protection and dust protection for the vision sensor 3.
[0025] Furthermore, such as Figure 2 and Figure 3 As shown, the drive assembly includes a servo motor 8, a transmission rod 9, and a connecting frame 10. The drive assembly is described in detail below: The servo motor 8 is installed on the outside of the storage compartment 4. The transmission rod 9 is connected to the output end of the servo motor 8. As a prior art technology, the output end of the servo motor 8 can drive the transmission rod 9 to rotate during operation. The end of the transmission rod 9 away from the servo motor 8 is rotatably connected to the inner wall of the storage compartment 4. The connecting frame 10 is fixed to the outside of the transmission rod 9. The rotation of the transmission rod 9 will drive the connecting frame 10 to rotate. The end of the connecting frame 10 away from the transmission rod 9 is fixed to the outside of the vision sensor 3. Finally, the rotation of the connecting frame 10 will drive the vision sensor 3 to swing, thereby swinging the vision sensor 3 into the interior of the storage compartment 4, away from the top of the conveyor belt 1. It should be noted that when the vision sensor 3 swings to the lowest position, there is still a certain gap between it and the inner wall of the storage compartment 4, so the two will not collide.
[0026] Furthermore, such as Figure 2 and Figure 4 As shown, the control assembly includes a connecting roller 11, a traction rope 12, a transmission rope 13, and a guide wheel 14. The control assembly is described in detail below: The connecting roller 11 is fixed to the outside of the transmission rod 9. When the transmission rod 9 rotates, it also drives the connecting roller 11 to rotate synchronously. The traction rope 12 is fixed to the outside of the connecting roller 11. In the initial state, the end of the traction rope 12 near the connecting roller 11 is in a slack state. When the connecting roller 11 rotates 45°, the vision sensor 3 is already inside the storage compartment 4, and the traction rope 12 is in a taut state. At this time, the transmission rod 9 drives the connecting roller 11 to continue rotating, and the traction rope 12 passes through the storage compartment 4. The transmission rope 13 is fixed between the two sets of guide plates 6. The end of the traction rope 12 away from the connecting roller 11 is fixed to the transmission rope 13. When the traction rope 12 is continuously stressed, it will exert force on the middle of the transmission rope 13. When a pulling force is applied, the transmission rope 13 deforms, and its two ends pull the two sets of guide plates 6 to move closer together. When the two sets of guide plates 6 move, they will drive the two sets of protective plates 5 to move, so that the protective plates 5 fit together. Together with the storage compartment 4, they protect the vision sensor 3 inside the storage compartment 4 from dust. It should be noted that the two sets of protective plates 5 will not collide with the vision sensor 3 when they move. The guide wheel 14 is fixed to the outside of the storage compartment 4, and the traction rope 12 is in contact with the guide wheel 14. The traction rope 12 passes through the inside of the guide wheel 14. The guide wheel 14 can guide the traction direction of the traction rope 12, so that the traction rope 12 applies a pulling force to the transmission rope 13 in a preset direction.
[0027] As one implementation method, such as Figure 4As shown, a side rod 15 is fixed to the outside of the transmission rod 9. When the transmission rod 9 rotates, it will drive the side rod 15 to rotate. The side rod 15 has an L-shaped design. When the transmission rod 9 rotates 45°, the side rod 15 just contacts the taut traction rope 12. As the transmission rod 9 continues to rotate, while the transmission rod 9 pulls the traction rope 12 through the connecting roller 11, the end of the side rod 15 that contacts the traction rope 12 will also squeeze the traction rope 12. At this time, the traction rope 12 is subjected to the pulling force of the rotating connecting roller 11 and the squeezing force of the side rod 15. Thus, when the transmission rod 9 rotates, the traction rope 12 can pull the transmission rope 13 further, thereby improving the closing speed of the protective plate 5 and making it suitable for scenarios where the internal space of the storage compartment 4 is limited.
[0028] Furthermore, such as Figure 2 and Figure 4 As shown, two sets of side plates 26 are fixedly connected to the outer sides of both sets of guide rods 7. Springs 16 are fixedly connected between the two sets of side plates 26 and the two sets of guide plates 6. When the transmission rope 13 deforms and pulls the two sets of guide plates 6 closer, the guide plates 6 will cooperate with the side plates 26 to pull the springs 16, causing the springs 16 to deform under force and generate elastic potential energy. When the transmission rod 9 rotates in the opposite direction, that is, after the transmission rope 13 releases the pull on the guide plates 6, the springs 16 will release the elastic potential energy, thereby pulling the guide plates 6 to reset. When the guide plates 6 reset, they will drive the protective plate 5 to reset and open.
[0029] Furthermore, such as Figure 5 and Figure 6 As shown, a glass plate 17 is provided at the bottom of the vision sensor 3. The material of the glass plate 17 does not affect the normal use of the vision sensor 3. A limiting plate 18 is fixed to one end of the glass plate 17 near the vision sensor 3. A limiting groove 19 is formed at the bottom of the vision sensor 3. The limiting plate 18 is slidably connected to the inside of the limiting groove 19. The limiting plate 18 can rotate along the inside of the limiting groove 19, so that the glass plate 17 rotates at the bottom of the vision sensor 3. A rotating mechanism is provided around the vision sensor 3. The rotating mechanism is used to drive the glass plate 17 to rotate at high speed. When the vision sensor 3 is in use, the rotating mechanism can drive the glass plate 17 to rotate at high speed. At this time, the glass plate 17 will generate centrifugal force, thereby throwing away impurities or water droplets attached to the surface of the glass plate 17, thereby avoiding impurities or water droplets from interfering with the detection of the vision sensor 3.
[0030] As one implementation method, such as Figure 5 and Figure 6 As shown, the rotating mechanism includes a motor 20, a first spur gear 21, and a second spur gear 22. The rotating mechanism is described in detail below: The motor 20 is connected to the periphery of the vision sensor 3. The first spur gear 21 is connected to the output end of the motor 20. When the motor 20 is running, its output end will drive the first spur gear 21 to rotate at high speed. The second spur gear 22 is fixed to the outside of the glass plate 17. The first spur gear 21 and the second spur gear 22 mesh with each other. The rotation of the first spur gear 21 will drive the second spur gear 22 to rotate. The rotation of the second spur gear 22 will drive the glass plate 17 to rotate at high speed, causing the glass plate 17 to generate centrifugal force.
[0031] Furthermore, such as Figure 7 As shown, a protective cover 23 is fixed to the outside of the vision sensor 3, and the vision sensor 3 supports the protective cover 23. The first spur gear 21 and the second spur gear 22 are located inside the protective cover 23. The protective cover 23 can shield the first spur gear 21 and the second spur gear 22, thereby effectively preventing the operator from touching the high-speed rotating first spur gear 21 and the second spur gear 22 from above when they are rotating, thus improving the safety of the device during use.
[0032] Furthermore, such as Figure 2 As shown, sealing strips 24 are glued to the side of the two sets of protective plates 5 that are close to each other. The sealing strips 24 are made of rubber. When the two sets of protective plates 5 are closed, the two sets of sealing strips 24 will stick together, thereby increasing the sealing performance and also playing a buffering role.
[0033] A machine vision-based method for testing fastener surface defects includes the following steps: S1. Start detection, place the fastener on the conveyor belt 1 and transport it. The rotating mechanism causes the glass plate 17 at the bottom of the vision sensor 3 to rotate at high speed for self-cleaning. The vision sensor 3 collects images of the fastener surface and transmits them to the processing unit for analysis and judgment. S2. After the detection is completed, the servo motor 8 of the drive component is started. The servo motor 8 swings the vision sensor 3 into the storage compartment 4 through the transmission rod 9 and the connecting frame 10. S3. Closed protection: During the storage of vision sensor 3, transmission rod 9 synchronously drives connecting roller 11 to tighten traction rope 12. Traction rope 12 pulls transmission rope 13, causing two guide plates 6 to slide towards each other, thereby driving two protective plates 5 to close and seal the vision sensor 3 in storage compartment 4. Spring 16 is compressed during this process. S4. Reset preparation: When retesting is required, the servo motor 8 reverses, the spring 16 releases its elastic potential energy, and pulls the guide plate 6 and the protective plate 5 to reset and open. At the same time, the transmission rod 9 swings the vision sensor 3 back to the working position above the conveyor belt 1.
[0034] In this embodiment, fasteners are first placed on conveyor belt 1 and transported by conveyor belt 1. Vision sensor 3 collects surface images in real time for defect detection. During detection, motor 20 of the rotating mechanism drives spur gear 1 21 and spur gear 22 to rotate glass plate 17 at high speed, using centrifugal force to clean its surface. Protective cover 23 provides safety protection for the high-speed rotating spur gear 1 21 and spur gear 22. After detection, servo motor 8 of the drive component starts, driving transmission rod 9 to rotate. Vision sensor 3 is smoothly swung into storage compartment 4 through connecting frame 10, making room for maintenance of conveyor belt 1. At the same time, transmission rod 9 drives the connecting frame on its outer side. As roller 11 rotates, it gradually tightens the wound traction rope 12. Side rod 15 works together to apply pressure to the traction rope 12. After being guided by guide wheel 14, the traction rope 12 pulls the middle of transmission rope 13, thereby pulling the two sets of guide plates 6 to slide steadily towards each other along guide rod 7. Finally, it drives the two sets of protective plates 5 to close completely. The sealing strip 24 on the inner side fits tightly to achieve sealing and buffering, completing the comprehensive protection of the vision sensor 3 in the storage compartment 4. During this process, the spring 16 on the outer side of guide rod 7 is compressed and stores energy. When servo motor 8 reverses and the traction force is released, spring 16 releases elastic potential energy, pulling guide plate 6 and protective plate 5 to reset and open, preparing for the next inspection.
[0035] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A machine vision-based testing device for fastener surface defects, comprising a conveyor belt (1), a frame (2) mounted on the outer side of the conveyor belt (1), and a vision sensor (3) for detecting fasteners disposed at the top end of the conveyor belt (1), characterized in that, Also includes: The protective mechanism includes a storage compartment (4) and a drive assembly, wherein: The storage compartment (4) is fixed to the outside of the frame (2). The storage compartment (4) is used to accommodate the vision sensor (3). The drive assembly is connected to the storage compartment (4). The drive assembly is used to drive the vision sensor (3) to swing so that the vision sensor (3) is inside the storage compartment (4). The enclosure mechanism includes a shielding component and a control component, wherein: The shielding assembly includes two sets of protective plates (5), two sets of guide plates (6), and two sets of guide rods (7). The two sets of protective plates (5) are slidably connected to the outer side of the storage compartment (4). The two sets of guide plates (6) are respectively fixed to the two sets of protective plates (5). Both ends of the two sets of guide rods (7) are fixed to the outer side of the storage compartment (4), and the two sets of guide rods (7) slide through the two sets of guide plates (6). The control assembly is used to control the two sets of protective plates (5) to close when the drive assembly is running.
2. The machine vision-based fastener surface defect testing device according to claim 1, characterized in that, The drive assembly includes a servo motor (8), a transmission rod (9), and a connecting frame (10). The servo motor (8) is installed on the outside of the storage compartment (4). The transmission rod (9) is connected to the output end of the servo motor (8), and the end of the transmission rod (9) away from the servo motor (8) is rotatably connected to the inner wall of the storage compartment (4). The connecting frame (10) is fixed to the outside of the transmission rod (9), and the end of the connecting frame (10) away from the transmission rod (9) is fixed to the outside of the vision sensor (3).
3. The machine vision-based fastener surface defect testing device according to claim 2, characterized in that, The control assembly includes a connecting roller (11), a traction rope (12), a transmission rope (13), and a guide wheel (14). The connecting roller (11) is fixed to the outside of the transmission rod (9). The traction rope (12) is fixed to the outside of the connecting roller (11). The traction rope (12) passes through the storage compartment (4). The transmission rope (13) is fixed between the two sets of guide plates (6). The end of the traction rope (12) away from the connecting roller (11) is fixed to the transmission rope (13). The guide wheel (14) is fixed to the outside of the storage compartment (4), and the traction rope (12) is in contact with the guide wheel (14).
4. The machine vision-based fastener surface defect testing device according to claim 2, characterized in that, A side rod (15) is fixed to the outside of the transmission rod (9), and the side rod (15) is designed in an L shape.
5. The machine vision-based fastener surface defect testing device according to claim 1, characterized in that, Two sets of side plates (26) are fixedly connected to the outer side of each of the two sets of guide rods (7), and springs (16) are fixedly connected between each of the two sets of side plates (26) and the two sets of guide plates (6).
6. The machine vision-based fastener surface defect testing device according to claim 1, characterized in that, The bottom end of the vision sensor (3) is provided with a glass plate (17). A limiting plate (18) is fixed to one end of the glass plate (17) near the vision sensor (3). A limiting groove (19) is opened at the bottom end of the vision sensor (3). The limiting plate (18) is slidably connected to the inside of the limiting groove (19). A rotating mechanism is provided around the vision sensor (3). The rotating mechanism is used to drive the glass plate (17) to rotate at high speed.
7. The machine vision-based fastener surface defect testing device according to claim 6, characterized in that, The rotating mechanism includes a motor (20), a first spur gear (21) and a second spur gear (22). The motor (20) is connected to the periphery of the vision sensor (3). The first spur gear (21) is connected to the output end of the motor (20) for transmission. The second spur gear (22) is fixed to the outside of the glass plate (17). The first spur gear (21) and the second spur gear (22) mesh with each other.
8. The machine vision-based fastener surface defect testing device according to claim 7, characterized in that, A protective cover (23) is fixed to the outside of the vision sensor (3), and the first spur gear (21) and the second spur gear (22) are located inside the protective cover (23).
9. The machine vision-based fastener surface defect testing device according to claim 1, characterized in that, Both sets of protective plates (5) have sealing strips (24) glued to the side of each other, and the sealing strips (24) are made of rubber.
10. A machine vision-based method for testing fastener surface defects, applied to the machine vision-based fastener surface defect testing apparatus according to any one of claims 1-9, characterized in that, The method includes the following steps: S1. Start detection, place the fastener on the conveyor belt (1) and transport it. The rotating mechanism makes the glass plate (17) at the bottom of the vision sensor (3) rotate at high speed for self-cleaning. The vision sensor (3) collects the image of the fastener surface and transmits it to the processing unit for analysis and judgment. S2. After the detection is completed, the servo motor (8) of the drive component is started. The servo motor (8) swings the visual sensor (3) into the storage compartment (4) through the transmission rod (9) and the connecting frame (10). S3, Closed protection: During the storage of the vision sensor (3), the transmission rod (9) synchronously drives the connecting roller (11) to tighten the traction rope (12), and the traction rope (12) pulls the transmission rope (13), causing the two guide plates (6) to slide towards each other, thereby driving the two protective plates (5) to close and seal the vision sensor (3) in the storage compartment (4). The spring (16) is compressed during this process. S4. Reset preparation. When it is necessary to test again, the servo motor (8) reverses, the spring (16) releases elastic potential energy, pulls the guide plate (6) and the protective plate (5) to reset and open. At the same time, the transmission rod (9) swings the vision sensor (3) back to the working position above the conveyor belt (1).