A chain pin detection method, system and storage medium

Image processing technology is used to automatically identify and detect the length, diameter, area and parallel relationship of chain pins, solving the problems of low manual detection efficiency and poor accuracy in the existing technology, and achieving efficient and accurate pin quality detection.

CN117346661BActive Publication Date: 2024-09-13HANGZHOU QIANJIANG CHAIN TRANSMISSION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311459356.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-04
Publication Date
2024-09-13
Estimated Expiration
2043-11-04

AI Technical Summary

Technical Problem

The existing quality inspection of chain pins relies on manual comparison, which is inefficient and inaccurate.

Method used

Using image processing technology, the verification image of the pin is obtained through the camera, the reference features are identified to determine the shooting direction, and the corresponding determination content is selected based on different shooting directions, including length, diameter, area, and parallel relationship, for fully automated detection.

Benefits of technology

The efficiency and accuracy of pin quality inspection have been improved, and the inspection results are faster and more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117346661B
    Figure CN117346661B
Patent Text Reader

Abstract

The present application relates to the technical field of chain pin processing, and in particular to a chain pin detection method, system and storage medium, which includes: obtaining a verification image containing a pin to be tested; obtaining a reference feature corresponding to the verification image, and judging the shooting direction corresponding to the verification image based on the reference feature, wherein the reference feature is characterized by the display feature of the placement base for placing the pin to be tested in the verification image; selecting corresponding judgment content according to the shooting direction, and performing detection and judgment on the pin to be tested based on the judgment content, wherein the judgment content includes length, diameter, area, and parallel relationship; obtaining a judgment result corresponding to the judgment content, and judging whether the pin to be tested is qualified based on the judgment result. The present application has the effect of achieving high-efficiency and high-precision pin quality detection and judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of chain pin processing, and in particular to a chain pin detection method, system and storage medium. Background Art

[0002] The chain is a mechanical structure commonly used in current industrial production and daily machinery. It is composed of outer link plates, inner link plates, pins, sleeves, rollers and other components. It is mainly used in various transmission mechanisms, such as cranes, bicycles, etc.

[0003] The pin is a solid metal cylinder with a smooth surface. The quality inspection of the pin after production and processing is currently mainly based on manual inspection. The inspection content includes the length and diameter of the pin. The inspection method is to place the pin on a tooling with several semicircular grooves. The diameter of the semicircular groove on the tooling is the same as that of the pin. Multiple pins are arranged head to tail on a semicircular groove, and the number and overall length are used to make the judgment.

[0004] However, this method requires staff to manually compare the length, diameter and other data of the pin shaft. On the one hand, the detection efficiency is low, and secondly, the detection accuracy is poor. Summary of the invention

[0005] The purpose of this application is to achieve high-efficiency and high-precision pin shaft quality detection and judgment.

[0006] In the first aspect, the present application provides a chain pin detection method, which adopts the following technical solution:

[0007] A chain pin detection method comprises the following steps:

[0008] Acquire a verification image containing the pin to be tested;

[0009] Acquire a reference feature corresponding to the verification image, and determine a shooting direction corresponding to the verification image based on the reference feature, wherein the reference feature is characterized by a display feature of a placement base for placing the pin to be tested in the verification image;

[0010] Selecting corresponding determination content according to the shooting direction, and performing detection and determination on the pin shaft to be tested based on the determination content, wherein the determination content includes length, diameter, area, and parallel relationship;

[0011] A determination result corresponding to the determination content is obtained, and whether the pin shaft to be tested is qualified is determined based on the determination result.

[0012] In some other embodiments, obtaining a verification image including a pin to be tested includes the following steps:

[0013] Determine whether a trigger signal is obtained, wherein the trigger signal indicates that the pin shaft to be tested is at the target position and needs to be photographed to obtain a signal corresponding to the image;

[0014] If yes, then obtain the image to be confirmed sent by the camera that is triggered by the trigger signal to shoot;

[0015] Determine whether there is a complete pin shaft image to be tested in the image to be confirmed, wherein the completed pin shaft image to be tested is characterized in that in the verification image, both side edges of the pin shaft to be tested do not overlap with the image edges of the image to be confirmed;

[0016] If yes, the image to be confirmed is used as the final verification image;

[0017] If not, the image to be confirmed sent by the camera that is triggered by the trigger signal is re-acquired until a complete image of the pin shaft to be tested exists in the image to be confirmed, and the image to be confirmed is confirmed as the verification image.

[0018] In some other embodiments, obtaining a reference feature corresponding to the verification image, and determining a shooting direction corresponding to the verification image based on the reference feature, includes the following steps:

[0019] Determining the positional relationship between the reference feature in the verification image and the pin to be tested;

[0020] If, in the verification image, the reference feature is located below the pin to be tested, the shooting direction is forward shooting, and the verification image is represented as a front view;

[0021] If, in the verification image, the reference feature covers the pin shaft to be tested, the shooting direction is a top view, and the verification image is represented as a top view.

[0022] In some other embodiments, selecting corresponding determination content according to the shooting direction includes:

[0023] If the shooting direction is forward shooting, then obtaining the length corresponding to the pin shaft to be tested in the verification image;

[0024] If the shooting direction is a downward shooting direction, one or more of the length, diameter, area, and parallel relationship corresponding to the pin to be tested in the verification image is obtained.

[0025] In some other embodiments, if the shooting direction is forward shooting, the pin shaft to be tested is detected and determined based on the determination content, including the following steps:

[0026] Acquire a first edge line corresponding to an end of the pin shaft to be measured away from the reference feature in the verification image, and use the first edge line as a length reference line to acquire its corresponding length;

[0027] or,

[0028] Obtain the second edge lines corresponding to the two sides of the pin axis to be tested perpendicular to the length direction in the verification image, and obtain any connecting line between the two second edge lines, the two ends of the connecting line are respectively located on the two second edge lines, and the connecting line is perpendicular to the two second edge lines, and the connecting line is used as a length reference line to obtain its corresponding length;

[0029] It is determined whether the length corresponding to the length reference line matches the length of the qualified part uploaded in advance, and whether the pin shaft to be tested is qualified according to the matching result.

[0030] In other embodiments, if the shooting direction is a downward shooting, the pin shaft to be tested is detected and determined based on the determination content, including the following steps:

[0031] Acquire two third edge lines in the length direction of the pin shaft to be measured and two fourth edge lines perpendicular to the length direction of the pin shaft to be measured in the verification image;

[0032] Select any one of the third edge lines or any one of the connecting lines between the two fourth edge lines as a length reference line to obtain a corresponding length, wherein both ends of the connecting line are respectively located on the two fourth edge lines and are perpendicular to the two fourth edge lines;

[0033] Determine whether the length corresponding to the length reference line matches the length of the qualified part uploaded in advance, and determine whether the pin to be tested is qualified according to the matching result;

[0034] and / or,

[0035] Select any fourth edge line or any connecting line between two third edge lines as a diameter reference line, wherein both ends of the connecting line are respectively located on the two third edge lines and are perpendicular to the two third edge lines;

[0036] Determine whether the diameter corresponding to the diameter reference line matches the length of the qualified part uploaded in advance, and determine whether the pin shaft to be tested is qualified according to the matching result;

[0037] and / or,

[0038] Calculate the area of ​​the pin to be measured according to the length reference line and the diameter reference line;

[0039] Determine whether the area matches the area of ​​the qualified part uploaded in advance, and determine whether the pin to be tested is qualified according to the matching result;

[0040] and / or,

[0041] Calculating the angle between the adjacent third edge lines and the fourth edge lines, and obtaining the parallel relationship between the two third edge lines and the two fourth edge lines according to the angles;

[0042] Whether the pin to be tested is qualified is determined based on the parallel relationship.

[0043] In some other embodiments, the determination content further includes concave-convex detection, and the detection and determination of the pin shaft to be tested based on the determination content further includes:

[0044] Determine whether the edge line corresponding to the pin shaft to be tested in the forward shooting or the downward shooting is a straight line, and determine whether the pin shaft to be tested has an edge concave-convex according to the determination result;

[0045] Obtaining a reference pixel grayscale value in a reference image of the preset qualified part photographed under uniform illumination, wherein the uniform illumination is characterized by a fixed illumination intensity and illumination direction in a photographing area of ​​the pin to be tested;

[0046] The grayscale value corresponding to each pixel of the pin shaft to be tested under uniform illumination in the verification image is obtained, and compared with the grayscale value of the reference pixel, and it is determined whether the pin shaft to be tested has surface unevenness according to the comparison result.

[0047] In some other embodiments, after obtaining a determination result corresponding to the determination content and judging whether the pin to be tested is qualified based on the determination result, the method further includes:

[0048] Generate a corresponding result label according to whether the pin to be tested is qualified;

[0049] The pin shaft to be tested is sent to a corresponding processing partition based on the result tag.

[0050] In the second aspect, the present application provides a chain pin detection system, which adopts the following technical solution:

[0051] A chain pin detection system, comprising:

[0052] A placement base is used to place the pin shaft to be tested and to transfer the pin shaft to be tested;

[0053] A camera assembly, comprising a plurality of cameras for photographing the pin to be tested at different angles, wherein the cameras generate corresponding verification images after photographing the pin to be tested;

[0054] A processing terminal, used for obtaining a verification image including the pin to be tested, obtaining a reference feature corresponding to the verification image, and determining a shooting direction corresponding to the verification image based on the reference feature, wherein the reference feature is characterized by a display feature of the placement base in the verification image;

[0055] It is also used to select corresponding judgment contents according to the shooting direction, and perform detection and judgment on the pin shaft to be tested based on the judgment contents, wherein the judgment contents include length, diameter, area, and parallel relationship; obtain the judgment result corresponding to the judgment content, and judge whether the pin shaft to be tested is qualified based on the judgment result.

[0056] In a third aspect, the present application provides a chain pin detection system, which adopts the following technical solution:

[0057] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the chain pin shaft detection method described above is implemented.

[0058] In summary, this application includes the following beneficial technical effects:

[0059] The method of detecting whether the pin shaft is qualified has changed from manual visual inspection or comparison with mechanical comparison equipment to fully automated detection through image features. The comparison accuracy of image processing has been greatly improved compared with manual inspection, making the quality inspection of the pin shaft faster and more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a schematic diagram of the overall process of the chain pin detection method in this application;

[0061] Figure 2 It is the verification image corresponding to the forward direction shooting in this application;

[0062] Figure 3 It is the verification image corresponding to the downward shooting in this application;

[0063] Figure 4 It is a schematic diagram of detecting and determining the length when shooting in the forward direction in this application;

[0064] Figure 5 It is a schematic diagram of detecting and determining the length when shooting from a low angle in this application;

[0065] Figure 6 It is a schematic diagram of detecting and determining the diameter when shooting from a downward direction in this application;

[0066] Figure 7 It is a schematic diagram of the overall structure of the chain pin detection system in this application;

[0067] Figure 8 It is a front view of the chain pin detection system in this application.

[0068] In the figure, 1. the pin to be tested; 2. the placement base; 3. the first edge line; 4. the second edge line; 5. the connecting line; 6. the third edge line; 7. the fourth edge line; 8. the camera assembly. DETAILED DESCRIPTION

[0069] The following is combined with Figure 1 -Attached Figure 8 , further details of this application are given.

[0070] like Figure 1 As shown, the present application discloses a chain pin detection method, comprising the following steps:

[0071] S100, obtaining a verification image including the pin shaft 1 to be tested.

[0072] The verification image is taken by a camera, and the pin shaft 1 to be tested is in the verification image.

[0073] S200, obtaining a reference feature corresponding to a verification image, and determining a shooting direction corresponding to the verification image based on the reference feature.

[0074] The reference feature is represented by the display feature of the placement base 2 used to place the pin shaft 1 to be tested in the verification image. Normally, when the pin shaft 1 to be tested is photographed, the pin shaft 1 to be tested must be placed on a certain placement medium and photographed, then the component used to provide a placement position for the pin shaft 1 to be tested is the corresponding reference feature, such as a conveyor belt, a table, a disc, a workbench, etc., all of which are represented as the placement base 2.

[0075] Then, when shooting in this case, the corresponding reference features in the frame of the verification image will definitely be captured, and the shooting direction can be determined based on the positional relationship between the reference features and the pin shaft 1 to be tested.

[0076] S300, selecting corresponding determination content according to the shooting direction, and performing detection and determination on the pin shaft 1 to be detected based on the determination content, wherein the determination content includes length, diameter, area, and parallel relationship.

[0077] When shooting in different shooting directions, the overall image of the pin shaft obtained is similar as a whole, because the pin shaft itself is a cylindrical component, and the shapes of its top view, bottom view and front view are generally similar. However, due to the different camera installation positions corresponding to different shooting directions, the image of the pin shaft 1 to be tested may be blocked to a certain extent by the reference features in the verification image in certain directions. Therefore, the judgment content is also different in different shooting directions.

[0078] The length refers to the overall length of the pin in the length direction, the diameter is a necessary detection feature of the cylindrical pin, the area represents the overall surface area of ​​the pin 1 to be tested, and it can also be the area corresponding to the image of the pin 1 to be tested displayed in the verification image, and the parallel relationship indicates whether the two side edges of the pin 1 to be tested in the length direction and the two side edges of the pin 1 to be tested perpendicular to the length direction are parallel to each other.

[0079] S400, obtaining a determination result corresponding to the determination content, and determining whether the pin shaft 1 to be tested is qualified based on the determination result.

[0080] One or more of the above-mentioned determination contents are tested and determined, and a determination result is obtained, and whether the pin shaft 1 to be tested is qualified is determined based on the determination result.

[0081] Through the above steps, the method of detecting whether the pin shaft is qualified is changed from manual visual inspection or comparison with mechanical comparison equipment to fully automated detection through image features. The comparison accuracy of image processing has been greatly improved compared with manual inspection, making the quality inspection of the pin shaft faster and more accurate.

[0082] In other embodiments, obtaining a verification image including the pin shaft 1 to be tested comprises the following steps:

[0083] S110, determining whether a trigger signal is obtained.

[0084] The trigger signal is characterized by a signal that confirms that the pin shaft 1 to be tested is at the target position so that the pin shaft 1 to be tested needs to be photographed to obtain an image corresponding to the signal.

[0085] The transmitting end of the trigger signal in the application is an infrared detection head, which emits infrared light in the direction of the medium where the pin 1 to be tested is placed. When the pin appears at the corresponding position, it determines the existence of the pin based on the change of the infrared light and generates a corresponding trigger signal to the corresponding camera.

[0086] In this way, when there is no pin shaft 1 to be tested at the target position, the camera will not capture the image. However, when the pin shaft 1 to be tested passes through the target position corresponding to the infrared detection head or the staff places the pin shaft at the target position, the infrared detection head will generate a trigger signal to the camera to capture the pin shaft 1 to be tested.

[0087] S120: If yes, then obtain the image to be confirmed sent by the camera that is triggered by the trigger signal and takes the image.

[0088] If a trigger signal is obtained, the camera shoots according to the trigger signal, and an image captured by the camera is obtained, and the image is defined as an image to be confirmed.

[0089] S130, determining whether there is a complete image of the pin shaft 1 to be tested in the image to be confirmed.

[0090] The completed image of the pin shaft 1 to be tested is characterized in that in the verification image, the two side edges of the pin shaft 1 to be tested do not overlap with the image edges of the image to be confirmed.

[0091] In some cases, the pin shaft 1 to be tested may be driven by a conveyor belt or a conveying mechanism, first passing through an infrared detection head and then moving to the target area corresponding to the camera. In this case, there is generally a certain error between the time interval from when the infrared detection head detects the existence of the pin shaft to when it sends a trigger signal to the camera so that the camera takes a picture and the time interval between when the pin shaft 1 to be tested moves from the position of the infrared detection head to the target position.

[0092] Then, in the image obtained after the camera takes the picture, the pin shaft to be tested may not be fully displayed, and the subsequent judgment process cannot be carried out accurately. Therefore, it is necessary to determine whether the image to be confirmed contains a complete pin shaft 1 to be tested to determine whether this image can be used as the final verification image.

[0093] For example Figure 2 In 2-A, the right end of the pin shaft 1 to be tested in the image overlaps with the right side of the display area of ​​the image to be confirmed. At this time, it is impossible to confirm whether the current right side of the pin shaft 1 to be tested is its own rightmost edge or the edge overlap caused by part of the pin shaft 1 to be tested not entering the camera frame. Therefore, in order to reduce the judgment errors of subsequent length and other data, it is considered that there is no complete image of the pin shaft 1 to be tested in the image to be confirmed.

[0094] Figure 2 In 2-B, if any side edge of the pin shaft 1 to be tested does not overlap with the image edge of the image to be confirmed, then it is considered that the pin shaft 1 to be tested appears completely in the image to be confirmed.

[0095] S140: If yes, the image to be confirmed is used as the final verification image.

[0096] S150, if not, then reacquire the image to be confirmed sent by the camera that is triggered by the trigger signal, until a complete image of the pin shaft 1 to be tested exists in the image to be confirmed, and confirm the image to be confirmed as the verification image.

[0097] If there is a complete image of the pin shaft 1 to be tested in the image to be confirmed, such as Figure 2 If the state is in 2-B, the image to be confirmed is used as the final verification image.

[0098] If there is no complete pin 1 image to be tested in the image to be confirmed, such as Figure 2If the state in 2-A is reached, a trigger signal needs to be regenerated to the camera so that the camera can re-shoot the pin shaft 1 to be tested. Because there is a certain time interval between the camera shooting for the first time, processing the image, and then shooting for the second time, during this time interval, the pin shaft 1 to be tested will move a certain distance with the conveying mechanism, and it may appear completely in the image to be confirmed in the second shot.

[0099] It should be noted that when there is no complete pin shaft 1 image to be tested in the image to be confirmed, there is another case, for example Figure 2 2-C, at this time, the edge of the other side of the pin shaft 1 to be tested has overlapped with the other edge of the image to be confirmed along its forward direction, which means that the distance moved by the pin shaft 1 to be tested is too large when the camera is shooting. If it is shot again at this time, the distance moved by the pin shaft 1 to be tested is farther, and the display area of ​​the pin shaft 1 in the image to be confirmed will be smaller. Therefore, the subsequent judgment work cannot be completed in this case, and the judgment result is directly set to unknown. The pin shaft 1 to be tested that is judged as unknown needs to go to a separate area and be re-shot and judged in subsequent work.

[0100] In some other embodiments, obtaining a reference feature corresponding to a verification image, and determining a shooting direction corresponding to the verification image based on the reference feature, includes the following steps:

[0101] S210, determining the positional relationship between the reference feature in the verification image and the pin shaft 1 to be tested.

[0102] The reference feature is represented by the object on which the pin shaft 1 to be tested is placed. Therefore, the positional relationship between the pin shaft 1 to be tested and the object on which the pin shaft 1 to be tested is placed can indicate the direction from which the verification image is taken by the camera.

[0103] S220, if in the verification image, the reference feature is located below the pin shaft 1 to be tested, the shooting direction is forward shooting, and the verification image is represented as a front view.

[0104] like Figure 2 As shown in the figure, if the reference feature is located below the pin 1 to be tested in the verification image, it means that the camera is shooting from the side of the reference feature and the side of the entire pin 1 to be tested. It should be noted that the "below" here refers to the up-down relationship of the verification image itself, and does not refer to the up-down relationship in actual conditions.

[0105] S230: If, in the verification image, the reference feature covers the pin shaft 1 to be tested, the shooting direction is a top view, and the verification image is represented as a top view.

[0106] like Figure 3As shown, if the overall size of the reference feature covers the pin shaft 1 to be tested in the verification image, the shooting direction in the actual situation is located above the pin shaft 1 to be tested and the reference feature, and the shooting is done at a top-down angle toward the pin shaft 1 to be tested and the reference feature. The coverage here is characterized by the imaging of the pin shaft 1 to be tested in the verification image being in the imaging of the reference feature, and the imaging of the reference feature in the verification image corresponds to the top surface of the placement object corresponding to the reference feature.

[0107] In the method of the embodiment of the present application, it is only necessary to obtain verification images corresponding to the forward and downward directions, while in some other embodiments, it may be necessary to obtain verification images corresponding to the lateral direction. At this time, in addition to comparing the positional relationship between the reference feature and the pin shaft 1 to be tested, it is also necessary to judge based on the actual imaging shape of the pin shaft 1 to be tested in the verification image.

[0108] Specifically, if the reference feature is located below the pin shaft 1 to be measured and the imaging representation of the pin shaft 1 to be measured is a rectangle, then the shooting direction is considered to be forward; if the reference feature is located below the pin shaft 1 to be measured and the imaging representation of the pin shaft 1 to be measured is a circle, then the shooting direction is considered to be sideways.

[0109] However, when shooting from the side, the feature determination of the pin shaft 1 to be measured can only be achieved for its diameter, and the number of determined features is relatively small. Therefore, the present application preferably only obtains reference images corresponding to the forward and downward directions.

[0110] In some other embodiments, selecting corresponding shooting content according to the shooting direction includes:

[0111] S310: If the shooting direction is forward shooting, then obtain the length corresponding to the pin shaft 1 to be tested in the verification image.

[0112] S320: If the shooting direction is a downward shooting direction, one or more of the length, diameter, area, and parallel relationship corresponding to the pin shaft 1 to be tested in the verification image is obtained.

[0113] If the shooting direction is forward shooting, due to the inconsistency between the height of the camera and the parallax of its imaging range and the horizontal height of the reference feature, a certain height of the pin shaft 1 to be tested may be blocked by the reference feature. Therefore, it is only judged by the corresponding points, lines, and surfaces in the verification image, which will lead to inaccurate judgment content, such as diameter, area, etc. Therefore, the verification image shot in the forward direction only needs to determine the corresponding length of the pin shaft. Even if the bottom of the pin shaft 1 to be tested is blocked by the reference feature, its top is not blocked and is displayed relatively completely.

[0114] If the shooting direction is a downward shooting direction, the image of the pin shaft 1 to be tested is relatively complete, because from the downward viewing angle, the reference features will not cause any obstruction to the pin shaft 1 to be tested. Therefore, at this time, all contents of the pin shaft 1 to be tested with complete imaging and relatively complete features can be judged.

[0115] The judgment contents include length, diameter, area, and parallel relationship. However, in some cases, if the manufacturing error of the corresponding machine for production and processing is very small, the quality of the pin shaft produced is also relatively reliable. In this case, it is not necessary to judge a large number of judgment contents, and only one or a small number of judgment contents can be selected; but if the manufacturing error of the corresponding machine for production and processing is very large, then more or all judgment contents are required for judgment. The judgment contents for the pin shaft 1 to be tested can be adaptively adjusted by the staff.

[0116] Secondly, the judgment process of certain judgment contents itself requires the use of certain characteristics corresponding to the judgment contents. For example, when judging the area of ​​the pin shaft 1 to be tested, it is necessary to obtain information on its length and diameter. Then the judgment of the length and diameter will be detected and judged in the judgment content of "area", so there is no need to re-detect and judge the judgment contents corresponding to the length and diameter. Therefore, although the judgment contents such as length, diameter, and area are all tested in essence, the only judgment content actually performed is the area.

[0117] like Figure 4 As shown, in other embodiments, if the shooting direction is forward shooting, the pin shaft 1 to be tested is detected and determined based on the determination content, including the following steps:

[0118] S311, obtaining a first edge line 3 corresponding to an end of the pin shaft 1 to be tested away from the reference feature in the verification figure, and using the first edge line 3 as a length reference line to obtain its corresponding length.

[0119] As disclosed above, when shooting in the forward direction, the bottom of the pin shaft 1 to be tested may be partially blocked by the reference feature. Therefore, when selecting the corresponding length judgment object, it is necessary to select the end of the pin shaft 1 to be tested away from the reference feature, that is, to verify the edge line of the top of the pin shaft 1 to be tested in the image.

[0120] After the edge line is acquired, the first edge line 3 is used as a length reference line, which may correspond to the length of the pin shaft 1 to be measured.

[0121] or,

[0122] S312 obtains the second edge lines 4 corresponding to the two sides of the pin shaft 1 to be tested in the verification image that are perpendicular to the length direction, and obtains any connecting line 5 between the two second edge lines 4, the two ends of the connecting line 5 are respectively located on the second edge lines 4, and the connecting line 5 is perpendicular to the two second edge lines 4, and the connecting line 5 is used as a length reference line to obtain its corresponding length.

[0123] In addition to selecting the edge line of the pin shaft 1 to be measured away from the end of the reference feature, you can also select the edge lines on both sides perpendicular to the length direction of the pin shaft 1 to be measured. After obtaining the two second edge lines 4, any one of the two edge lines that meets the requirement that the endpoints are on the two second edge lines 4 and the connecting line 5 that is perpendicular to the two second edge lines 4 can be used as the length reference line. Among them, the connecting line 5 that meets the requirements also includes the first edge line 3 away from the end of the reference feature.

[0124] Since the pin itself is a long cylindrical body, the longer direction line of the pin 1 to be tested can be used as the length direction.

[0125] It should be noted that, when the pin shaft 1 to be tested meets the qualification requirements, the two second edge lines 4 must be parallel to each other, so it is possible to find several connecting lines 5 that are perpendicular to the two second edge lines 4. If they cannot be found, it means that the two second edge lines 4 are not parallel, and the pin shaft 1 to be tested is considered to be unqualified.

[0126] At the same time, in the embodiment of the present application, each time the detection is performed, the position of the pin shaft 1 to be tested at the corresponding reference feature is the same, and when taking the verification image in the forward direction, the distance between the pin shaft 1 to be tested and the camera remains fixed.

[0127] S313, judging whether the length corresponding to the length reference line matches the length of the qualified part uploaded in advance, and judging whether the pin shaft 1 to be tested is qualified according to the matching result.

[0128] The corresponding information of the pre-uploaded qualified parts can be uploaded by the staff directly in the form of specific values, or the staff can first place one or more qualified parts at the target location for image capture detection and judgment, and then upload the data corresponding to the obtained judgment results for subsequent comparison and analysis.

[0129] If the length corresponding to the acquired length reference line matches or does not match the length corresponding to the qualified part, whether the pin is qualified is determined based on the corresponding determination result.

[0130] like Figure 5-Figure 6 As shown, in other embodiments, if the shooting direction is a downward shooting, the pin shaft 1 to be tested is detected and determined based on the determination content, including the following steps:

[0131] S321, obtaining two third edge lines 6 in the length direction of the pin shaft 1 to be tested and two fourth edge lines 7 perpendicular to the length direction of the pin shaft 1 to be tested in the verification pattern.

[0132] By obtaining two third edge lines 6 in the length direction and two fourth edge lines 7 perpendicular to the length direction, the edges of the pin shaft 1 to be measured in the verification image can be extracted when there is no obstruction to the pin shaft 1 to be measured from a top-down angle. Ideally, the two third edge lines 6 and the two fourth edge lines 7 form a rectangle.

[0133] S322 , selecting any connecting line 5 between any third edge line 6 or any fourth edge line 7 as a length reference line to obtain a corresponding length, wherein both ends of the connecting line 5 are respectively located on the two fourth edge lines 7 and are perpendicular to the two fourth edge lines 7 .

[0134] S323, judging whether the length corresponding to the length reference line matches the length of the qualified part uploaded in advance, and judging whether the pin shaft 1 to be tested is qualified according to the matching result.

[0135] The length of the pin shaft 1 to be tested at the downward angle is obtained by selecting the same length reference line as when the shooting angle is in the positive direction, and is matched and compared with the length of the preset qualified part to determine whether it is qualified.

[0136] and / or,

[0137] S324 , selecting any fourth edge line 7 or any connecting line 5 between two third edge lines 6 as a diameter reference line, wherein both ends of the connecting line 5 are respectively located on the two third edge lines 6 and are perpendicular to the two third edge lines 6 .

[0138] S325, determining whether the diameter corresponding to the diameter reference line matches the length of the qualified part uploaded in advance, and determining whether the pin shaft 1 to be tested is qualified based on the matching result.

[0139] Different from determining the length, the determination of the diameter is to select any one of the connecting lines 5 within the two third edge lines 6, wherein the connecting line 5 includes any one of the fourth edge lines 7, and the connecting line 5 is used as a diameter reference line.

[0140] From the verification image, the length reference line and the diameter reference line are perpendicular to each other, the length reference line is the long side, and the diameter reference line is the short side.

[0141] The diameter is matched and compared with the preset qualified parts to determine whether it is qualified.

[0142] and / or,

[0143] S326, calculating the area of ​​the pin shaft 1 to be measured according to the length reference line and the diameter reference line.

[0144] S327, judging whether the area matches the area of ​​the qualified part uploaded in advance, and judging whether the pin shaft 1 to be tested is qualified according to the matching result.

[0145] After obtaining the length and diameter information, the area of ​​the pin 1 to be measured can be obtained according to the surface area formula of the cylinder, where the surface area of ​​the cylinder = the bottom area of ​​the cylinder * 2 + the side area of ​​the cylinder = 2πr² + πRh. Among them, r represents the radius of the pin 1 to be measured, R represents the diameter of the pin 1 to be measured, and h represents the height of the pin 1 to be measured, that is, its length.

[0146] After the area of ​​the pin shaft 1 to be tested is calculated, the calculated area is matched with the area of ​​the qualified part to determine whether the pin shaft 1 to be tested is qualified.

[0147] and / or,

[0148] S328, calculating the included angle between adjacent third edge lines 6 and fourth edge lines 7, and obtaining the parallel relationship between two third edge lines 6 and between two fourth edge lines 7 according to the included angles.

[0149] S329, judging whether the pin shaft 1 to be tested is qualified according to the parallel relationship.

[0150] There must be an angle between the third edge line 6 and the fourth edge line 7. Ideally, the two-dimensional image of the cylinder at a certain angle is a rectangle, and the angles between its adjacent sides must be ninety degrees. Therefore, whether the relative third edge lines 6 or the relative fourth edge lines 7 are parallel can be determined by judging whether the angles between adjacent third edge lines 6 and fourth edge lines 7 are all ninety degrees.

[0151] The parallel relationship determined above is used to determine whether the pin shaft 1 to be tested is qualified.

[0152] It should be noted that when shooting in a downward direction, one or more of the above determinations may be selected for determination.

[0153] If only one item is determined, the pin 1 to be tested is judged to be qualified based on the result of this item combined with the result of the determination in the forward direction. At this time, in order to improve the accuracy and precision of the detection, the determination on the tilt angle is generally not the length determination, but other determination contents are selected. Only when the determination contents in the forward direction and the tilt direction are satisfied, the pin 1 to be tested is determined to be qualified.

[0154] If multiple determinations are made, the pin shaft 1 to be tested is determined to be qualified based on the multiple determination results in the downward direction combined with the determination results in the forward direction. The pin shaft 1 to be tested is determined to be qualified only when all determination contents are satisfied.

[0155] At the same time, in order to achieve detection accuracy of the pin shaft 1 to be detected, generally speaking, images corresponding to the two shooting directions need to be detected and determined.

[0156] In some other embodiments, the determination content also includes concave-convex detection, which is characterized by being used to detect whether there is a concave or convex on the pin shaft 1 to be tested by verifying the image, and the pin shaft 1 to be tested is detected and determined based on the determination content, and further includes:

[0157] S330, determining whether the edge line corresponding to the pin shaft 1 to be tested in the forward shooting or the downward shooting is a straight line, and determining whether the pin shaft 1 to be tested has an edge concave-convex according to the determination result.

[0158] Firstly, whether the edge of the pin shaft 1 to be tested has concave and convex edges is determined by determining whether the edge lines at different shooting angles are straight lines.

[0159] The edge convexity is characterized by the depression or convexity on the pin shaft 1 to be tested being displayed at the edge position of the image of the pin shaft 1 to be tested after being photographed. When a depression or convexity appears at the edge position, a corresponding depression or convex arc will also appear on its edge line, so that its edge line is no longer a straight line.

[0160] S331, obtaining a reference pixel grayscale value in a reference image of a preset qualified part photographed under uniform lighting.

[0161] The uniform illumination is characterized by fixed illumination intensity and illumination direction in the shooting area of ​​the pin shaft 1 to be tested.

[0162] S332, obtaining the grayscale value corresponding to each pixel of the pin shaft 1 to be tested under uniform illumination in the verification image, and comparing it with the grayscale value of the reference pixel, and judging whether the pin shaft 1 to be tested has surface unevenness according to the comparison result.

[0163] First, a reference image of a qualified part at the same position and under uniform lighting is obtained, and image processing is performed on the reference image to obtain the grayscale value corresponding to each pixel on the qualified part.

[0164] Because even under uniform lighting, because the pin itself is a cylinder with a curved side, the albedo of light at different positions is different after shooting, so the grayscale value corresponding to each pixel is also different.

[0165] After obtaining the grayscale value corresponding to each pixel point on the qualified part, obtain the grayscale value of each pixel point in the verification image of the pin shaft 1 to be tested at the same position and under the same lighting, and compare it with the grayscale value of the reference pixel. According to the comparison result, determine whether there is a depression or a bulge, and determine whether there is a depression or a bulge.

[0166] In other embodiments, after obtaining the determination result corresponding to the determination content and determining whether the pin shaft 1 to be tested is qualified based on the determination result, the following further includes:

[0167] S500, generating a corresponding result label according to whether the pin shaft 1 to be tested is qualified.

[0168] S510: Send the pin shaft 1 to be tested to a corresponding processing partition based on the result tag.

[0169] The result labels include qualified, unqualified, and unknown, and the processing partitions include qualified area, unqualified area, and unknown area.

[0170] After detection and judgment, if the judgment result of the pin shaft 1 to be tested is determined to be qualified, then a qualified label is generated accordingly, and the pin shaft 1 to be tested is sent to the qualified partition according to the qualified label; if the judgment result of the pin shaft 1 to be tested is determined to be unqualified, then an unqualified label is generated accordingly, and the pin shaft 1 to be tested is sent to the unqualified partition according to the qualified label; if the judgment result of the pin shaft 1 to be tested is determined to be unknown, an unknown label is generated, and the pin shaft 1 to be tested is sent to the unknown area, and the pin shaft in the unknown area needs to be repeatedly detected and judged later.

[0171] like Figure 7 and Figure 8 As shown, the present application also discloses a chain pin detection system, comprising:

[0172] The base 2 is placed to place the pin shaft 1 to be tested and to transport the pin shaft 1 to be tested.

[0173] In the present application, the placement base 2 is a disc that rotates in a fixed direction, one end of which can be connected to a corresponding pin conveying device. When the pin passes through the pin conveying device and falls onto the disc, the rotation of the disc drives the pin to move to the corresponding camera shooting area.

[0174] The camera assembly 8 includes a plurality of cameras for photographing the pin shaft 1 to be tested at different angles. The camera generates a corresponding verification image after photographing the pin shaft 1 to be tested.

[0175] In the embodiment of the present application, two cameras are provided, one is arranged along the horizontal direction for taking a front view image of the pin shaft 1 to be tested, and the other is arranged along the vertical direction with the shooting direction facing downward for taking a top view of the pin shaft 1 to be tested.

[0176] A processing terminal is used to obtain a verification image containing the pin shaft 1 to be tested, obtain a reference feature corresponding to the verification image, and determine a shooting direction corresponding to the verification image based on the reference feature, wherein the reference feature is characterized by a display feature of the placement base 2 in the verification image;

[0177] It is also used to select corresponding judgment contents according to the shooting direction, and to detect and judge the pin shaft 1 to be tested based on the judgment contents, wherein the judgment contents include length, diameter, area, and parallel relationship; obtain the judgment result corresponding to the judgment content, and judge whether the pin shaft 1 to be tested is qualified based on the judgment result.

[0178] In other embodiments, the chain pin detection system also includes an infrared detection head, which is placed on one side of the camera assembly 8. When the pin moves with its rotation on the placement base 2, the pin first passes through the infrared detection head. After the infrared detection head detects the pin, it sends a trigger signal to the two cameras. The two cameras take pictures after receiving the trigger signal.

[0179] The implementation principle of the embodiment of the present application is:

[0180] The method of detecting whether the pin shaft is qualified has changed from manual visual inspection or comparison with mechanical comparison equipment to fully automated detection through image features. The comparison accuracy of image processing has been greatly improved compared with manual inspection, making the quality inspection of the pin shaft faster and more accurate.

[0181] The embodiments of this specific implementation are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. The same components are represented by the same figure marks. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A chain pin detection method, characterized in that: The following steps are involved: Acquire a verification image containing the pin shaft (1) to be tested. Specifically, Determining whether a trigger signal is obtained, wherein the trigger signal indicates that the pin shaft (1) to be tested is at a target position and that the pin shaft (1) to be tested needs to be photographed to obtain a signal corresponding to the image; If yes, then obtain the image to be confirmed sent by the camera that is triggered by the trigger signal to shoot; Determine whether there is a complete image of the pin shaft (1) to be tested in the image to be confirmed, wherein the complete image of the pin shaft (1) to be tested is characterized by that in the verification image, the two side edges of the pin shaft (1) to be tested do not overlap with the image edges of the image to be confirmed; If yes, the image to be confirmed is used as the final verification image; If not, then reacquire the image to be confirmed sent by the camera that is triggered by the trigger signal, until a complete image of the pin shaft (1) to be tested exists in the image to be confirmed, and confirm the image to be confirmed as the verification image; A reference feature corresponding to the verification image is obtained, and a shooting direction corresponding to the verification image is determined based on the reference feature, wherein the reference feature is characterized by a display feature of a placement base (2) for placing the pin shaft (1) to be tested in the verification image, specifically, Determining the positional relationship between the reference feature in the verification image and the pin shaft (1) to be tested; If, in the verification image, the reference feature is located below the pin shaft (1) to be tested, the shooting direction is forward shooting, and the verification image is represented as a front view; If, in the verification image, the reference feature covers the pin shaft (1) to be tested, the shooting direction is a top-down shooting, and the verification image is represented as a top view; Selecting corresponding determination content according to the shooting direction, and performing detection and determination on the pin shaft (1) to be tested based on the determination content, wherein the determination content includes length, diameter, area, and parallel relationship; If the shooting direction is forward shooting, then obtaining the length corresponding to the pin shaft (1) to be tested in the verification image; If the shooting direction is a downward shooting direction, one or more of the length, diameter, area, and parallel relationship corresponding to the pin shaft (1) to be tested in the verification image is obtained; Obtaining a determination result corresponding to the determination content, and judging whether the pin shaft (1) to be tested is qualified based on the determination result, wherein if one of the determination results in the overhead shooting is used in combination with the determination result in the frontal shooting, the length is not selected in the overhead shooting; If the shooting direction is forward shooting, the pin shaft (1) to be tested is detected and determined based on the determination content, including the following steps: Acquire a first edge line (3) corresponding to an end of the pin shaft (1) to be tested away from the reference feature in the verification image, and use the first edge line (3) as a length reference line to acquire its corresponding length; or, Obtain the second edge lines (4) corresponding to the two sides of the pin shaft (1) to be tested in the verification image that are perpendicular to the length direction, and obtain any connecting line (5) between the two second edge lines (4), wherein the two ends of the connecting line (5) are respectively located at the two second edge lines (4), and the connecting line (5) is perpendicular to the two second edge lines (4), and the connecting line (5) is used as a length reference line to obtain its corresponding length; Determining whether the length corresponding to the length reference line matches the length of the qualified part uploaded in advance, and determining whether the pin shaft (1) to be tested is qualified according to the matching result; If the shooting direction is a downward shooting, the pin shaft (1) to be tested is detected and determined based on the determination content, including the following steps: Acquire two third edge lines (6) in the length direction of the pin shaft (1) to be measured, and two fourth edge lines (7) perpendicular to the length direction of the pin shaft (1) to be measured in the verification image; Select any one of the third edge lines (6) or any one of the connecting lines (5) between the two fourth edge lines (7) as a length reference line to obtain a corresponding length, wherein both ends of the connecting line (5) are respectively located on the two fourth edge lines (7) and are perpendicular to the two fourth edge lines (7); Determining whether the length corresponding to the length reference line matches the length of the qualified part uploaded in advance, and determining whether the pin shaft (1) to be tested is qualified according to the matching result; and / or, Select any fourth edge line (7) or any connecting line (5) between two third edge lines (6) as a diameter reference line, wherein both ends of the connecting line (5) are respectively located on the two third edge lines (6) and are perpendicular to the two third edge lines (6); Determining whether the diameter corresponding to the diameter reference line matches the length of the qualified part uploaded in advance, and determining whether the pin shaft (1) to be tested is qualified according to the matching result; and / or, Calculating the area of ​​the pin shaft (1) to be measured according to the length reference line and the diameter reference line; Determining whether the area matches the area of ​​a pre-uploaded qualified part, and determining whether the pin shaft (1) to be tested is qualified based on the matching result; and / or, Calculating the size of the angle between the adjacent third edge lines (6) and fourth edge lines (7), and obtaining the parallel relationship between the two third edge lines (6) and between the two fourth edge lines (7) according to the size of the angle; Whether the pin shaft (1) to be tested is qualified is judged according to the parallel relationship.

2. The chain pin detection method according to claim 1, characterized in that: The determination content also includes concave-convex detection, and based on the determination content, the pin shaft (1) to be tested is detected and determined, and further includes: Determine whether the edge line corresponding to the pin shaft (1) to be tested in the forward shooting or the downward shooting is a straight line, and determine whether the pin shaft (1) to be tested has an edge concave-convex according to the determination result; Obtaining a reference pixel grayscale value in a reference image of a preset qualified part photographed under uniform lighting, wherein the uniform lighting is characterized by a fixed lighting intensity and lighting direction in a photographing area of ​​the pin shaft (1) to be tested; The grayscale value corresponding to each pixel of the pin shaft (1) to be tested under uniform illumination in the verification image is obtained, and compared with the grayscale value of the reference pixel, and it is determined whether the pin shaft (1) to be tested has surface unevenness according to the comparison result.

3. The chain pin detection method according to claim 1, characterized in that: After obtaining a determination result corresponding to the determination content and judging whether the pin shaft (1) to be tested is qualified based on the determination result, the method further comprises: Generating a corresponding result label according to whether the pin shaft (1) to be tested is qualified; The pin shaft (1) to be tested is sent to a corresponding processing partition based on the result tag.

4. A chain pin detection system, using the chain pin detection method according to any one of claims 1 to 3, characterized in that: include: A placement base (2) is used to place the pin shaft (1) to be tested and to transport the pin shaft (1) to be tested; A camera assembly (8) comprising a plurality of cameras for photographing the pin shaft (1) to be tested at different angles, wherein the cameras generate corresponding verification images after photographing the pin shaft (1) to be tested; A processing terminal, used for obtaining a verification image containing the pin shaft (1) to be tested, obtaining a reference feature corresponding to the verification image, and determining a shooting direction corresponding to the verification image based on the reference feature, wherein the reference feature is characterized by a display feature of the placement base (2) in the verification image; It is also used to select corresponding determination content according to the shooting direction, and perform detection and determination on the pin shaft (1) to be tested based on the determination content, wherein the determination content includes length, diameter, area, and parallel relationship; A determination result corresponding to the determination content is obtained, and whether the pin shaft (1) to be tested is qualified is determined based on the determination result.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the chain pin detection method described in any one of claims 1 to 3 is implemented.