Detection Method, Device and Computer Readable Storage Medium

By acquiring the position information and rigid position transformation matrix of the wire-sequence terminal detection image, the accuracy of cable insertion position detection is solved, and the accurate judgment of the cable insertion position and the identification of missing and missed insertion are realized, which improves the accuracy and pass rate of detection.

CN115994895BActive Publication Date: 2025-08-01SUZHOU INOVANCE CONTROL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211611164.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2025-08-01
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

The prior art cannot effectively detect whether there is any missed or missed cable insertion position of the wire sequence terminal, resulting in the inability to accurately determine whether the cable insertion position is correct.

Method used

By obtaining the position information of the cable area and terminal area in the wire-sequence terminal detection image, the rigid position transformation matrix is determined, and the expected position of the cable area is determined based on the initial position information and the rigid position transformation matrix, and combining the cable color and center coordinate distance, it is determined whether the cable insertion position is correct.

Benefits of technology

Accurate detection of the cable insertion position is realized, and it can identify missing or misplug conditions, which improves the accuracy and pass rate of wire-sequence terminal detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115994895B_ABST
    Figure CN115994895B_ABST
Patent Text Reader

Abstract

The present invention discloses a detection method, device and computer-readable storage medium. The method includes: obtaining the first pose information of the cable region in the wire sequence terminal detection image, the reference pose information corresponding to the terminal region in the target template, and the initial pose information corresponding to the cable region in the target template; determining a rigid position transformation matrix according to the second pose information of the terminal region in the wire sequence terminal detection image and the reference pose information; determining the expected position of the cable region according to the initial pose information and the rigid position transformation matrix; and determining the detection result of the wire sequence terminal according to the cable color of the cable region and the distance between the first center coordinate in the first pose information and the expected position. The method of the present invention determines the detection result of the wire sequence terminal according to the cable color of the cable region and the distance between the first center coordinate of the cable region and the expected position, and knows whether there is a situation of missing insertion or wrong insertion of the cable corresponding to the cable insertion position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of detection technologies, and in particular, to a detection method, device, and computer-readable storage medium. Background Art

[0002] Wire sequence terminal detection is an essential step in the process of producing wire harnesses in a wire harness factory. It is necessary to check the wire sequence of the wire sequence terminal, whether there is any missing insertion or incorrect insertion in the wire insertion position, etc., in order to select defective products. Currently, the detection of wire sequence terminals can be based on a machine vision detection method. By collecting images of the wire sequence terminals to be detected and identifying the wire sequence of the wire sequence terminals to be detected based on the images, it is possible to determine whether the wire sequence of the wire sequence terminals to be detected is correct. However, the above detection method for wire sequence terminals does not detect the situation of missing insertion or incorrect insertion of wires in the wire insertion position of the wire sequence terminals to be detected, and it is impossible to know whether the wires corresponding to the wire insertion positions of the wire sequence terminals are inserted accurately.

[0003] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is related art. Summary of the Invention

[0004] The main objective of the present invention is to provide a detection method, device, and computer-readable storage medium, aiming to solve the problem that the current detection method for wire sequence terminals does not detect the situation of missing insertion or incorrect insertion of wires in the wire insertion position of the wire sequence terminals to be detected, and it is impossible to know whether the wires corresponding to the wire insertion positions of the wire sequence terminals are inserted accurately.

[0005] To achieve the above objective, the present invention provides a detection method, and the detection method includes:

[0006] Obtain the first pose information of the wire region in the wire sequence terminal detection image, the reference pose information corresponding to the terminal region in the target template, and the initial pose information corresponding to the wire region in the target template;

[0007] Determine a rigid position transformation matrix according to the second pose information of the terminal region in the wire sequence terminal detection image and the reference pose information;

[0008] Determine the expected position corresponding to the wire region according to the initial pose information and the rigid position transformation matrix;

[0009] Determine the detection result of the wire sequence terminal according to the wire color of the wire region and the distance between the first center coordinate in the first pose information and the expected position.

[0010] Optionally, the step of obtaining the first pose information of the wire region in the wire sequence terminal detection image includes:

[0011] Obtain the second pose information of the terminal area in the detected image of the wire sequence terminal;

[0012] Determine the first pose information of the cable area according to the second pose information.

[0013] Optionally, the step of determining the first pose information of the cable area according to the second pose information includes:

[0014] Determine the translation direction from the terminal area to the cable area of the wire sequence terminal;

[0015] Determine the cable detection area according to the second pose information, the translation direction and a preset moving distance;

[0016] Determine the first pose information of the cable area according to the cable detection area.

[0017] Optionally, the step of determining the first pose information of the cable area according to the cable detection area includes:

[0018] Preprocess the image of the cable detection area;

[0019] Determine the contour arc of the cable in the cable detection area according to the preprocessed image;

[0020] Construct the cable area according to the contour arc, and determine the first pose information based on the cable area.

[0021] Optionally, the step of determining the detection result of the wire sequence terminal according to the cable color of the cable area and the distance between the first center coordinate in the first pose information and the expected position includes:

[0022] Determine the cable sorting of the wire sequence terminal according to the cable color of the cable area;

[0023] Determine the cable sorting detection result of the wire sequence terminal according to the cable sorting and the initial cable sorting corresponding to the cable area in the target template;

[0024] Determine the cable position detection result of the wire sequence terminal according to the distance between the first center coordinate in the first pose information and the expected position;

[0025] Determine the detection result of the wire sequence terminal according to the cable sorting detection result and the cable position detection result.

[0026] Optionally, the step of determining the cable position detection result of the wire sequence terminal according to the distance between the first center coordinate in the first pose information and the expected position includes:

[0027] When the distance between the first center coordinate and the expected position in the first pose information is less than a preset distance, the cable position detection result of the wire sequence terminal is that the cable position is qualified;

[0028] When the distance between the first center coordinate and the expected position in the first pose information is greater than or equal to the preset distance, the cable position detection result of the wire sequence terminal is that there is a situation of missing insertion or wrong insertion in the cable position.

[0029] Optionally, before the step of obtaining the first pose information of the cable area in the wire sequence terminal detection image and the initial pose information corresponding to the cable area in the target template, it further includes:

[0030] Determine the terminal area of the wire sequence terminal according to the wire sequence terminal detection image;

[0031] Determine the target template according to the terminal area and the detection template corresponding to the terminal area.

[0032] In addition, to achieve the above object, the present invention further provides a detection device, the detection device includes: a base, the base is provided with a detection area; and a camera lens module, the camera lens module is arranged on the base and is arranged opposite to the detection area; the detection device further includes: a memory, a processor, and a detection program stored in the memory and operable on the processor, and when the detection program is executed by the processor, it realizes each step of the detection method as described above.

[0033] Optionally, the detection device further includes a driving module, the driving module is arranged on the base, and the camera lens module is movably arranged on the base through the driving module.

[0034] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a detection program is stored, and when the detection program is executed by the processor, it realizes each step of the detection method as described above.

[0035] The detection method, device and computer-readable storage medium proposed by the present invention determine a rigid position transformation matrix according to the second pose information and the reference pose information of the terminal area in the wire sequence terminal detection image, so as to know the position transformation situation of the terminal area moving from the reference pose information to the second pose information through the rigid position transformation matrix. Furthermore, according to the initial pose information and the rigid position transformation matrix, the expected position corresponding to the cable area is determined to clarify the target position where the cable area is located after moving according to the rigid position transformation matrix based on the initial pose information of the cable area. Taking this target position as the expected position of the cable area, according to the cable color of the cable area and the distance between the first center coordinate of the cable area and the expected position, the detection result of the wire sequence terminal is determined, so as to clarify whether the cable color corresponding to the cable insertion position is correct through the cable color of the cable area, and know the position deviation amount corresponding to the cable area through the distance, so as to clarify whether the cable is missed during the cable insertion position through the position deviation amount. Furthermore, the detection result of the wire sequence terminal is jointly determined according to the cable color and the distance, and it can be known whether there is a situation of missing insertion or misalignment of the cable corresponding to the cable insertion position based on the detection result. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic structural diagram of a detection device or a terminal device related to each embodiment of the detection method of the present invention;

[0037] Figure 2 It is a schematic structural diagram of the detection device of the present invention;

[0038] Figure 3 It is a schematic flowchart of the first embodiment of the detection method of the present invention;

[0039] Figure 4 It is a placement schematic diagram of the wire sequence terminal in the wire sequence terminal detection image;

[0040] Figure 5 For Figure 4 an enlarged view of the cable area in;

[0041] Figure 6 It is a sub-process for identifying the terminal area;

[0042] Figure 7 It is a sub-process for cable segmentation;

[0043] Figure 8 It is a sub-process for extracting the cable color;

[0044] Figure 9 It is a sub-process for creating the front and back template contours;

[0045] Figure 10 It is a schematic flowchart of the second embodiment of the detection method of the present invention.

[0046] The implementation, functional features, and advantages of the present invention will be further described with reference to the embodiments and the accompanying drawings. Specific Embodiments

[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0048] The present invention provides a detection method, and the detection method includes:

[0049] Obtain the first pose information of the cable area in the wire sequence terminal detection image, the reference pose information corresponding to the terminal area in the target template, and the initial pose information corresponding to the cable area in the target template;

[0050] Determine a rigid position transformation matrix according to the second pose information of the terminal area in the wire sequence terminal detection image and the reference pose information;

[0051] Determine the expected position corresponding to the cable area according to the initial pose information and the rigid position transformation matrix;

[0052] Determine the detection result of the wire sequence terminal according to the cable color of the cable area and the distance between the first center coordinate in the first pose information and the expected position.

[0053] The detection method of the present invention determines a rigid position transformation matrix according to the second pose information of the terminal area in the wire sequence terminal detection image and the reference pose information, so as to know the position transformation situation of the terminal area moving from the reference pose information to the second pose information through the rigid position transformation matrix. Furthermore, according to the initial pose information and the rigid position transformation matrix, determine the expected position corresponding to the cable area, so as to clarify the target position where the cable area is located after the position movement according to the rigid position transformation matrix based on the initial pose information of the cable area, and use this target position as the expected position of the cable area. Determine the detection result of the wire sequence terminal according to the cable color of the cable area and the distance between the first center coordinate of the cable area and the expected position, so as to clarify whether the cable color corresponding to the cable insertion position is correct through the cable color of the cable area, and know the position deviation amount corresponding to the cable area through the distance, so as to clarify whether there is a missed insertion at the cable insertion position through the position deviation amount. Furthermore, jointly determine the detection result of the wire sequence terminal according to the cable color and the distance, and it can be known whether there is a missed insertion or misalignment of the cable corresponding to the cable insertion position based on the detection result.

[0054] In the subsequent description, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of explaining the present invention, and they have no specific meaning in themselves. Therefore, "module", "component", or "unit" can be used interchangeably.

[0055] The execution entity of the detection method of the present invention is a detection device or a terminal device connected to the detection device. Among them, the terminal device can be implemented in various forms. For example, the terminal device described in the present invention can include mobile terminals such as mobile phones, tablet computers, laptop computers, and palmtop computers.

[0056] Those skilled in the art can understand that, except for elements specifically for mobile purposes, the structure according to the embodiments of the present invention can also be applied to fixed types of mobile terminals.

[0057] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of the detection device or the terminal device involved in each embodiment of the detection method of the present invention.

[0058] As Figure 1 shown, the terminal device may include: a memory 101 and a processor 102. Those skilled in the art can understand that Figure 1 the structural block diagram of the terminal shown does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them, the memory 101 stores an operating system and a detection program. The processor 102 is the control center of the terminal device. The processor 102 executes the detection program stored in the memory 101 to implement the steps of each embodiment of the detection method of the present invention.

[0059] Optionally, the terminal device may further include a display unit 103. The display unit 103 includes a display panel, and the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., for outputting and displaying the interface browsed by the user.

[0060] Optionally, when the execution entity of the detection method of the present invention is a terminal device, the terminal device further includes a communication unit 104. The communication unit 104 establishes data communication with the detection device through a network protocol (the data communication can be IP communication or a Bluetooth channel) to achieve data transmission with the detection device, such as obtaining a wire sequence terminal detection image through the detection device.

[0061] Optionally, please refer to Figure 2 , Figure 2This is a schematic structural diagram of the detection device of the present invention. The detection device includes: a base 1 and a camera lens module 2. The base 1 is provided with a detection area 11 for placing the wire sequence terminals to be detected. The camera lens module 2 is disposed on the base 1 and is oppositely arranged with the detection area 11 to obtain the wire sequence terminal detection image in the detection area 22 through the camera lens module 2.

[0062] Optionally, the detection device further includes a driving module 3. The driving module 3 is disposed on the base 1. The camera lens module 2 is movably disposed on the base 1 through the driving module 3 to adjust the shooting distance between the camera lens module 2 and the detection area 11 through the driving module 3, so as to collect a clear and high-quality wire sequence terminal detection image in the detection area 11 through the camera lens module 2.

[0063] Optionally, a first light source (not shown in the figure) is provided on the backlight side of the detection area 11. When collecting the wire sequence terminal detection image of the wire sequence terminals to be detected through the camera lens module 2, the first light source is lit to make the background of the wire sequence terminal detection image white, so as to highlight the contour of the wire sequence terminals in the wire sequence terminal detection image and obtain a high-quality wire sequence terminal detection image.

[0064] Optionally, the camera lens module 2 includes a camera 21 and a second light source 22 which are oppositely arranged, and the second light source 22 is disposed between the camera 21 and the detection area 11. By lighting the second light source 22, while providing supplementary light for the camera 21, the detection area 11 is irradiated, so that the camera can collect a high-quality wire sequence terminal detection image through the second light source 22.

[0065] Optionally, the driving module 3 includes a driving member 31 and a screw rod moving assembly 32. The driving member 31 is connected to the screw rod moving assembly 32. The camera lens module 2 is disposed on the screw rod moving assembly 32. By driving the screw rod moving assembly 32 to rotate through the driving member 31, the camera lens module 2 is driven to move relative to the detection area 11. For example, when it is assumed that the driving member 31 rotates in the clockwise direction, the camera lens module 2 is driven to approach the detection area 11 to reduce the shooting distance; when the driving member 31 rotates in the counterclockwise direction, the camera lens module 2 is driven to move away from the detection area 11 to increase the shooting distance.

[0066] Optionally, the driving member 31 adopts a stepping motor.

[0067] Optionally, the detection device further includes a terminal baffle 4. The terminal baffle 4 is disposed on the base and on one side of the detection area 11.

[0068] It should be noted that when using the detection device to detect the wire sequence terminals, only need to place the wire sequence terminals to be detected in the detection area 11, and then the driving member 31 drives the screw rod moving assembly 32 to adjust the shooting distance between the camera lens module 2 and the detection area 11, so as to collect the detection image of the wire sequence terminals in the detection area 11 through the camera lens module 2, and then detect whether the wire arrangement of the wire sequence terminals is accurate based on the detection image of the wire sequence terminals, and whether there is any missed inspection or misinsertion in the wire insertion position.

[0069] Optionally, during the process that the driving member 31 drives the screw rod moving assembly 32 to adjust the shooting distance between the camera lens module 2 and the detection area 11, the detection images of the wire sequence terminals can be continuously collected respectively at different shooting distances, and the brightness of the first light source and the second light source can also be adjusted in combination to make the illumination of the wire sequence terminals on the detection area uniform, so as to obtain clear and high-quality detection images of the wire sequence terminals.

[0070] In the actual application process, the wire sequence terminals of different wire sequence models can have different wire arrangements, different wire insertion positions, or different wires corresponding to the wire insertion positions. Optionally, for the wire sequence terminals of different wire sequence models, the template data of the target templates corresponding to the wire sequence terminals can be obtained and stored in advance, and the template data of the target templates corresponding to the wire sequence terminals of different wire sequence models can be stored in the detection device, so that the detection device can be adapted to detect the wire sequence terminals of different wire sequence models, and obtain the detection results of the wire sequence terminals corresponding to the wire sequence models.

[0071] Based on the above structural block diagram of the terminal device, various embodiments of the detection method of the present invention are proposed.

[0072] In the first embodiment, the present invention provides a detection method. Please refer to Figure 3 , Figure 3 which is the flow schematic diagram of the first embodiment of the detection method of the present invention. In this embodiment, the detection method includes the following steps:

[0073] Step S10, obtaining the first pose information of the cable area in the detection image of the wire sequence terminals, the reference pose information corresponding to the terminal area in the target template, and the initial pose information corresponding to the cable area in the target template;

[0074] The first pose information, the reference pose information, and the initial pose information respectively include the center coordinates and the rotation angle. To facilitate the distinction of the center coordinates and the rotation angle respectively included in the first pose information, the reference pose information, and the initial pose information, the first pose information includes the first center coordinates and the first rotation angle. Similarly, the reference pose information includes the reference center coordinates and the reference rotation angle, and the initial pose information includes the initial center coordinates and the initial rotation angle.

[0075] Among them, the first pose information of the cable area includes the first center coordinates and the first rotation angle. The first pose information can be used to determine the placement position and placement posture of the cable area in the cable sequence terminal detection image among the cable sequence terminals to be detected. Among them, the first center coordinates can be used to determine the placement position of the cable area in the cable sequence terminal detection image, and the first rotation angle can be used to determine the placement posture of the cable area in the cable sequence terminal detection image.

[0076] Exemplarily, please refer to Figure 4 and Figure 5 , Figure 4 which is a placement schematic diagram of the cable sequence terminal in the cable sequence terminal detection image, Figure 5 and Figure 4 is an enlarged view of the cable area in . It should be noted that the part of the cable sequence terminal corresponding to A is the terminal area, the part of the cable sequence terminal corresponding to B is the cable detection area, and the area corresponding to the cable in the cable detection area is the cable area, such as the area corresponding to the black rectangle in C. The first center coordinates in the first pose information corresponding to the cable area are the coordinates corresponding to point P, and the first rotation angle is a.

[0077] Optionally, the number of cable areas of the cable sequence terminal can be determined according to the number of cables of the cable sequence terminal. As shown in Figure 4 , if the number of cables of the cable sequence terminal is 4, then the number of cable areas of the cable sequence terminal is 4.

[0078] Optionally, the first pose information of the cable area in the cable sequence terminal detection image includes the pose information of the cable areas corresponding to all the cables of the cable sequence terminal. Exemplarily, the first center coordinates in the first pose information can be represented by a coordinate matrix to clarify the first center coordinates corresponding to each cable of the cable sequence terminal through the coordinate matrix. It can be understood that the first rotation angle corresponding to each cable of the cable sequence terminal is a.

[0079] The template data corresponding to the target template includes the reference pose information corresponding to the terminal area, the center coordinates or position coordinates of the cable detection area, the initial pose information corresponding to the cable area, the cable width, the RGB value of each cable, the color difference threshold, the positive feature data corresponding to the terminal area, and the negative feature data corresponding to the terminal area.

[0080] Among them, the template data corresponding to the target template is determined based on the cable sequence terminals that pass the detection. The cable sequence terminals that pass the detection refer to those with the correct cable sorting and the correct cables inserted at the corresponding insertion positions, and there are no misinserted or missing inserted terminals at the cable insertion positions. The positive feature data corresponding to the terminal area refers to the feature identifier for identifying the front part of the terminal area of the cable sequence terminal. Similarly, the negative feature data corresponding to the terminal area refers to the feature identifier for identifying the back part of the terminal area of the cable sequence terminal.

[0081] Optionally, the template data corresponding to the target template further includes feature data corresponding to the cable area, so as to identify the cable area through the feature data corresponding to the cable area. The feature data corresponding to the cable area is, for example, the number of cables, and the cable area is arranged on one side of the terminal area, etc.

[0082] It can be understood that the template data corresponding to the target template is pre-stored data.

[0083] In the actual application process, for the wire sequence terminals of different wire sequence models, the wire sequences can be different, the insertion positions of the cables can be different, or the cables corresponding to the insertion positions of the cables can be different. Optionally, for the wire sequence terminals of different wire sequence models, the template data corresponding to the wire sequence terminals and the target template can be obtained and pre-stored, so that the detection device can be adapted to detect the wire sequence terminals of different wire sequence models.

[0084] Exemplarily, it is assumed that the template data includes the reference center coordinates (Xs, Ys) and the reference rotation angle Rs of the terminal area, and the center coordinates or position coordinates of the cable detection area ROI (Region Of Interest, the area of interest in the image) are (Xn, Yn). The initial pose information corresponding to the cable area includes the pose information corresponding to the cable area of each cable of the wire sequence terminal. The initial pose information corresponding to the cable area is composed of the position set (Xt, Yt) of the center coordinates formed by all the cable areas of the wire sequence terminal, the cable width Wt, the characteristic RGB value of each cable, the color difference threshold E, and the front and back model feature data. Among them, the front and back model feature data includes the front feature data corresponding to the terminal area and the back feature data corresponding to the terminal area. The front feature data can be used to determine the front of the terminal area. Similarly, the back feature data can be used to determine the back of the terminal area. Generally, the cable sequences corresponding to the front and the back are different.

[0085] It should be noted that the reference center coordinates (Xs, Ys) and the reference rotation angle Rs of the terminal area can be obtained from the "sub-process of identifying the terminal area". Please refer to Figure 6 , Figure 6 which is the sub-process of identifying the terminal area; the position (Xn, Yn) of the cable detection part area can be obtained by frame selection on the software interface, or can be determined based on the reference center coordinates and the reference rotation angle of the terminal area; the position set (Xt, Yt) formed by the cable area and the cable width Wt are obtained from the "sub-process of cable segmentation". Please refer to Figure 7 , Figure 7 which is the sub-process of cable segmentation; the characteristic RGB value of each cable is obtained from the "sub-process of extracting the cable color". Please refer to Figure 8 , Figure 8It is a sub-process for extracting the cable color; the color difference threshold E is a preset value; the front and back model feature data is obtained from the "sub-process for creating the front and back template outlines", please refer to Figure 9 , Figure 9 It is a sub-process for creating the front and back template outlines.

[0086] In the actual application process, the detection of the wire sequence terminals is a necessary step in the process of producing wire harnesses in a wire harness factory. It is necessary to check the wire sequence of the wire sequence terminals, whether there is any missing insertion or wrong insertion in the wire insertion position, etc., so as to select the defective products. At present, the detection of the wire sequence terminals can be based on the machine vision detection method. By collecting the images of the wire sequence terminals to be detected, the wire sequence of the wire sequence terminals to be detected is identified based on the images to determine whether the wire sequence of the wire sequence terminals to be detected is correct. However, the above detection method for the wire sequence terminals does not detect whether there is any missing insertion or wrong insertion of the wires in the wire insertion position of the wire sequence terminals to be detected, and it is impossible to know whether the wires corresponding to the wire insertion positions of the wire sequence terminals are inserted accurately.

[0087] As an optional implementation manner, before step S10, it further includes:

[0088] Determine the terminal area of the wire sequence terminal according to the wire sequence terminal detection image;

[0089] Determine the target template according to the terminal area and the detection template corresponding to the terminal area.

[0090] In the actual application process, the terminal area of the wire sequence terminal has a front side and a back side, and the wire sequences corresponding to the front side and the back side are generally different.

[0091] It should be noted that the detection template corresponding to the terminal area refers to the detection template of the front part determined by the front feature data corresponding to the terminal area in the template data and the detection template of the back part determined by the back feature data corresponding to the terminal area. After determining the terminal area of the wire sequence terminal according to the wire sequence terminal detection image, compare the terminal area with the detection template corresponding to the terminal area to clarify whether the terminal area is the detection template of the front part of the terminal area or the detection template of the back part of the terminal area, and determine the target template according to the comparison result. For example, when it is clear that the terminal area is the detection template of the front part of the terminal area, the target template is the detection template of the front part of the terminal area; when it is clear that the terminal area is the detection template of the back part of the terminal area, the target template is the detection template of the back part of the terminal area.

[0092] As an optional implementation manner, step S10 includes:

[0093] Obtain the second pose information of the terminal area in the wire sequence terminal detection image;

[0094] Determine the first pose information of the cable area according to the second pose information.

[0095] In this embodiment, the terminal area of the wire sequence terminal is determined as the "identification terminal area", and the specific implementation can be referred to similarly Figure 6 For the process of determining the terminal area of the wire sequence terminal according to the wire sequence terminal detection image, the double-threshold binarization method can be used for the wire sequence terminal detection image to extract the terminal area under the white background in the wire sequence terminal detection image, and perform image opening operation on the terminal area. The opening operation uses a circular structuring element with a preset radius to remove the cable part, only the terminal area is retained in the wire sequence terminal detection image, and the minimum bounding rectangle is calculated for the terminal area to obtain the coordinate position of the rectangle in the wire sequence terminal detection image and the rotation angle of the rectangle, as the second center coordinates (Xs1, Ys1) and the second rotation angle Rs1 of the terminal area, so as to obtain the second pose information, as shown in Figure 4 In the figure, the second center coordinates are the coordinate position corresponding to point O, and the second rotation angle is a.

[0096] Optionally, in the double-threshold binarization method, the low threshold is set to 0 and the high threshold is set to 225.

[0097] Optionally, the preset radius is 25.

[0098] Optionally, the step of determining the first pose information of the cable area according to the second pose information includes:

[0099] Determine the translation direction from the terminal area to the cable area of the wire sequence terminal;

[0100] According to the second pose information, the translation direction and a preset moving distance, determine the cable detection area;

[0101] According to the cable detection area, determine the first pose information of the cable area.

[0102] Please refer to Figure 4, since the cable area of the wire sequence terminal is set on one side of the terminal area, to clarify the cable area of the wire sequence terminal, the translation direction from the terminal area to the cable area of the wire sequence terminal can be determined based on the detection image of the wire sequence terminal. Exemplarily, it can be compared with the feature data corresponding to the terminal area in the target template, such as the front feature data or the back feature data, to determine the terminal area, and compared with the feature data corresponding to the cable area in the target template to determine the area where the cable is located, and then determine the translation direction from the terminal area to the cable area of the wire sequence terminal. According to the second pose information, the translation direction, and the preset moving distance, the cable detection area is determined. That is, the third pose information determined by moving the second pose information by the preset moving distance in the translation direction can be used to construct a detection area identical to the terminal area based on the third pose information as the cable detection area. That is to say, the cable detection area is the area where the terminal area is located after moving by the preset moving distance in the translation direction.

[0103] It can be understood that the method for determining the cable detection area of the wire sequence terminal to be detected is the same as that of the cable detection area in the target template. Furthermore, when further comparing the cable area of the wire sequence terminal to be detected with the cable area in the target template based on the cable area determined by the cable detection area, the cable sorting of the wire sequence terminal to be detected and / or whether there is a missing insertion or misalignment of the cable corresponding to the cable insertion position can be more accurately determined according to the comparison result.

[0104] It can be understood that the preset moving distance is a pre-set distance length.

[0105] Optionally, the step of determining the first pose information of the cable area according to the cable detection area includes:

[0106] Preprocess the image of the cable detection area;

[0107] Determine the contour arc of the cable in the cable detection area according to the preprocessed image;

[0108] Construct the cable area according to the contour arc and determine the first pose information based on the cable area.

[0109] Please refer to Figure 4 and Figure 5In order to accurately identify the cable area in the cable detection area, the image of the cable detection area can be preprocessed, and the contour arc of the cable in the cable detection area can be determined based on the preprocessed image. For example, the canny algorithm is used on the image of the cable detection area to extract the cable edge, merge the collinear edge contours, merge the contours with close end points, and use the rectangular height h corresponding to the created cable detection area ROI as an indicator to remove scattered contours with a height of less than 1 / 2H to avoid the interference of noise contours. The cable area is constructed according to the contour arc, that is, the filtered contours are sorted from left to right and from top to bottom according to the position relationship, and the contour arcs with serial numbers 0 and 1 are paired to fit the rectangle, and the contour arcs with serial numbers 2 and 3 are paired to fit the rectangle. The obtained rectangular area is the cable area corresponding to the segmented cable 1. It should be noted that the contour arcs with serial numbers 0, 1, 2 and 3 can be understood as Figure 5 The four sides of the cable area in the middle, among which cables 2, 3, and 4 correspond to the cable areas respectively, and so on. Finally, all the rectangular areas obtained by output are the cable areas corresponding to all cables respectively.

[0110] The first posture information is determined based on the cable area, that is, the posture information corresponding to each cable area is obtained, and the coordinate matrix formed by the center coordinates in the posture information corresponding to each cable area is used as the first center coordinate in the first posture information, and the rotation angle in the posture information corresponding to the cable area is used as the first rotation angle in the first posture information.

[0111] Optionally, an edge smoothing parameter for extracting cable edges adopts α, an edge extraction low threshold adopts l, and a high threshold adopts h as edge screening parameters.

[0112] Step S20, determining a rigid position transformation matrix according to the second pose information of the terminal area in the line sequence terminal detection image and the reference pose information;

[0113] Step S30, determining an expected position corresponding to the cable area according to the initial posture information and the rigid position transformation matrix;

[0114] Step S40 , determining a detection result of the wire sequence terminal according to the cable color of the cable area and the distance between the first center coordinate in the first posture information and the expected position.

[0115] It should be noted that the rigid position change matrix refers to the change position information when the reference pose information corresponding to the terminal area in the target template is moved to the second pose information corresponding to the terminal area of the wire sequence terminal to be detected. Based on this change position information, when the cable area in the target template is moved according to the change position information, it can be determined that when the terminal area in the target template coincides with the terminal area of the wire sequence terminal to be detected, the expected position where the cable area is located. By comparing the expected position of the cable area with the first center coordinates of the cable area of the wire sequence terminal to be detected, it can be determined whether the cable at the cable insertion position is missing or inserted incorrectly.

[0116] Exemplarily, the reference center coordinates (Xs, Ys) and the reference rotation angle Rs of the terminal area of the target template, and the second center coordinates (Xs1, Ys1) and the second rotation angle Rs1 of the terminal area in the wire sequence terminal to be detected can be used to calculate the rigid position transformation matrix M. According to the initial pose information and the rigid position transformation matrix M, the expected position (Xexcpt, Yexcpt) of the template cable area position (Xt, Yt) in the current pose state of the terminal to be detected is calculated, and the Euclidean distance △D between the first center coordinates (Xt1, Yt1) of the cable area of the current wire sequence terminal to be detected and the expected position (Xexcpt, Yexcpt) is calculated as the distance between the first center coordinates and the expected position in the first pose information.

[0117] Optionally, taking the cable width as a measure, 2Wt is used as the threshold of the cable position deviation. That is, if △D < 2Wt, it is considered that the cable insertion position deviation is within a reasonable range and the cable insertion position corresponds to accurate cable insertion. If △D ≥ 2Wt, it is determined that the cable insertion position is incorrect.

[0118] In the technical solution disclosed in this embodiment, according to the second pose information and the reference pose information of the terminal area in the wire sequence terminal detection image, the rigid position transformation matrix is determined to know the position transformation situation when the terminal area moves from the reference pose information to the second pose information through the rigid position transformation matrix. Furthermore, according to the initial pose information and the rigid position transformation matrix, the expected position corresponding to the cable area is determined to clarify the target position where the cable area is located after the position movement according to the rigid position transformation matrix based on the initial pose information of the cable area. This target position is used as the expected position of the cable area. According to the cable color of the cable area and the distance between the first center coordinates of the cable area and the expected position, the detection result of the wire sequence terminal is determined to clarify whether the cable color corresponding to the cable insertion position is correct through the cable color of the cable area, and to know the position deviation amount corresponding to the cable area through the distance, so as to clarify whether the cable is missing at the cable insertion position through the position deviation amount. Furthermore, according to the cable color and the distance together, the detection result of the wire sequence terminal is determined, and it can be known whether there is a situation of missing or misinserting the cable corresponding to the cable insertion position based on the detection result.

[0119] In the second embodiment proposed on the basis of the first embodiment, please refer to Figure 10 , Figure 10 which is a schematic flowchart of the second embodiment of the detection method of the present invention. In this embodiment, step S40 includes:

[0120] Step S41, determining the cable sorting of the wire sequence terminals according to the cable colors in the cable area;

[0121] Step S42, determining the detection result of the cable sorting of the wire sequence terminals according to the cable sorting and the initial cable sorting corresponding to the cable area in the target template;

[0122] Step S43, determining the detection result of the cable position of the wire sequence terminals according to the distance between the first center coordinate in the first pose information and the expected position;

[0123] Step S44, determining the detection result of the wire sequence terminals according to the cable sorting detection result and the cable position detection result.

[0124] Obtain the cable colors in the cable area to determine the cable sorting of the wire sequence terminals, and compare the cable sorting of the wire sequence terminals with the initial cable sorting corresponding to the cable area in the target template. When the cable sorting of the wire sequence terminals is the same as the initial cable sorting in the target template, it indicates that the detection result of the cable sorting of the wire sequence terminals is that the cable sorting is correct. When the cable sorting of the wire sequence terminals is different from the initial cable sorting in the target template, it indicates that the detection result of the cable sorting of the wire sequence terminals is that the cable sorting is incorrect.

[0125] Optionally, obtain the cable colors in the cable area to determine the cable sorting of the wire sequence terminals, and reference can be made to Figure 4 to obtain the cable colors corresponding to cable areas of cables 1, 2, 3, and 4 respectively to obtain the cable sorting of the wire sequence terminals.

[0126] Optionally, to obtain the cable color corresponding to cable 1, the RGB values of each pixel point in the cable area corresponding to cable 1 can be obtained and summed and averaged. By analogy, the cable colors corresponding to cables 2, 3, and 4 can be obtained.

[0127] Optionally, compare the cable sorting of the wire sequence terminal with the initial cable sorting corresponding to the cable area in the target template. Exemplarily, the cable sorting of the wire sequence terminal is that the cable colors corresponding to cables 1, 2, and 3 in the cable area, and the initial cable sorting is that the cable colors corresponding to target cables 1, 2, and 3 in the cable area. Compare the cable color corresponding to cable 1 in the cable area with the cable color corresponding to target cable 1 in the cable area. If the color difference value between the average RGB value of the cable area corresponding to cable 1 and the average RGB value of the cable area corresponding to target cable 1 is less than or equal to the color difference threshold, it indicates that the cable color corresponding to cable 1 in the cable area is the same as or similar to the cable color corresponding to target cable 1 in the cable area.

[0128] It can be understood that the same cable sorting of the wire sequence terminal as the initial cable sorting in the target template indicates that the cable color corresponding to cable 1 in the cable area is the same as or similar to the cable color corresponding to target cable 1 in the cable area, the cable color corresponding to cable 2 in the cable area is the same as or similar to the cable color corresponding to target cable 2 in the cable area, and the cable color corresponding to cable 3 in the cable area is the same as or similar to the cable color corresponding to target cable 3 in the cable area.

[0129] As an optional implementation manner, step S43 includes:

[0130] When the distance between the first center coordinate and the expected position in the first pose information is less than the preset distance, the detection result of the cable position of the wire sequence terminal is that the cable position is qualified;

[0131] When the distance between the first center coordinate and the expected position in the first pose information is greater than or equal to the preset distance, the detection result of the cable position of the wire sequence terminal is that there is a situation of missing insertion or misinsertion of the cable position.

[0132] When the distance between the first center coordinate and the expected position is less than the preset distance, it indicates that the position deviation is within the normal range, and the detection result of the cable position of the wire sequence terminal is that the cable position is qualified. When the distance between the first center coordinate and the expected position is greater than or equal to the preset distance, it indicates that the position deviation is within the abnormal range, and the detection result of the cable position of the wire sequence terminal is that there is a situation of missing insertion or misinsertion of the cable position.

[0133] According to the cable sorting detection result and the cable position detection result, determine the detection result of the wire sequence terminal. The cable sorting detection result determined from the aspect of cable sorting and the cable position detection result determined from the aspect of missing insertion or misinsertion of the cable position together determine the detection result of the wire sequence terminal, so as to clarify whether the wire sequence terminal is qualified based on the detection result and improve the qualification rate of the screened wire sequence terminals.

[0134] Optionally, after step S44, at least two of the output cable sorting detection result, the cable position detection result, and the detection result of the wire sequence terminal are output. By outputting the cable sorting detection result, the cable position detection result, and the detection result of the wire sequence terminal, it is convenient for the tester of the wire sequence terminal to be detected to know the specific situation of the unqualified wire sequence terminal, and then classify and process the unqualified wire sequence terminals. For example, the unqualified wire sequence terminals caused by cable sorting are classified into one category, and the unqualified wire sequence terminals caused by cable position are classified into one category to improve the processing efficiency.

[0135] In the technical solution disclosed in this embodiment, based on the cable position detection result and the cable sorting detection result, the detection result of the wire sequence terminal is jointly determined. It is possible to know whether the cable sorting of the wire sequence terminal is accurate based on the cable sorting detection result, and to know whether there is a missing insertion in the cable insertion position of the wire sequence terminal based on the cable position detection result. Based on the detection result of the wire sequence terminal jointly determined by the cable position detection result and the cable sorting detection result, it is possible to know whether there is a missing insertion or misalignment in the cable insertion position of the wire sequence terminal.

[0136] The present invention also provides a detection device, which includes: a base provided with a detection area; and a camera lens module disposed on the base and opposite to the detection area; the detection device further includes: a memory, a processor, and a detection program stored in the memory and executable on the processor. When the detection program is executed by the processor, the steps of the detection method in any of the above embodiments are implemented.

[0137] The present invention also provides a computer-readable storage medium, on which a detection program is stored. When the detection program is executed by a processor, the steps of the detection method as described in any of the above embodiments are implemented.

[0138] In the embodiments of the terminal device and the computer-readable storage medium provided by the present invention, all the technical features of the above embodiments of the detection method are included. The expansion and explanation content of the specification is basically the same as that of the above embodiments of the detection method, and will not be repeated here.

[0139] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or system including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or system. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or system including said element.

[0140] The serial numbers of the embodiments of the present invention above are only for description and do not represent the superiority or inferiority of the embodiments.

[0141] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a mobile terminal (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of the present invention.

[0142] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A detection method, characterized in that, The detection method includes: Obtaining the first pose information of the cable area in the wire sequence terminal detection image, the reference pose information corresponding to the terminal area in the target template, and the initial pose information corresponding to the cable area in the target template; Determining a rigid position transformation matrix according to the second pose information of the terminal area in the wire sequence terminal detection image and the reference pose information; Determining the expected position corresponding to the cable area according to the initial pose information and the rigid position transformation matrix; Determining the detection result of the wire sequence terminal according to the cable color of the cable area and the distance between the first center coordinate in the first pose information and the expected position.

2. The method according to claim 1, characterized in that, The step of obtaining the first pose information of the cable area in the wire sequence terminal detection image includes: Obtaining the second pose information of the terminal area in the wire sequence terminal detection image; Determining the first pose information of the cable area according to the second pose information.

3. The method according to claim 2, characterized in that, The step of determining the first pose information of the cable area according to the second pose information includes: Determining the translation direction from the terminal area to the cable area of the wire sequence terminal; Determining a cable detection area according to the second pose information, the translation direction, and a preset moving distance; Determining the first pose information of the cable area according to the cable detection area.

4. The method according to claim 3, wherein The step of determining the first pose information of the cable area according to the cable detection area includes: Preprocessing the image of the cable detection area; Determining the contour arc of the cable in the cable detection area according to the preprocessed image; Constructing the cable area according to the contour arc and determining the first pose information based on the cable area.

5. The method according to claim 1, wherein The step of determining the detection result of the wire sequence terminal according to the cable color of the cable area and the distance between the first center coordinate in the first pose information and the expected position includes: Determining the cable sorting of the wire sequence terminal according to the cable color of the cable area; Determining the cable sorting detection result of the wire sequence terminal according to the cable sorting and the initial cable sorting corresponding to the cable area in the target template; Determining the cable position detection result of the wire sequence terminal according to the distance between the first center coordinate in the first pose information and the expected position; Determining the detection result of the wire sequence terminal according to the cable sorting detection result and the cable position detection result.

6. The method according to claim 5, wherein The step of determining the cable position detection result of the wire sequence terminal according to the distance between the first center coordinate in the first pose information and the expected position includes: When the distance between the first center coordinate in the first pose information and the expected position is less than a preset distance, the cable position detection result of the wire sequence terminal is that the cable position is qualified; When the distance between the first center coordinate in the first pose information and the expected position is greater than or equal to the preset distance, the cable position detection result of the wire sequence terminal is that there is a missing insertion situation or a misinsertion situation in the cable position.

7. The method according to claim 1, wherein Before the step of obtaining the first pose information of the cable area in the wire sequence terminal detection image and the initial pose information corresponding to the cable area in the target template, the following steps are further included: Determine the terminal area of the wire sequence terminal according to the wire sequence terminal detection image; Determine the target template according to the terminal area and the detection template corresponding to the terminal area.

8. A detection device, characterized in that, The detection device includes: a base, and a detection area is provided on the base; And a camera lens module, the camera lens module is arranged on the base and is arranged opposite to the detection area; the detection device further includes: a memory, a processor, and a detection program stored in the memory and operable on the processor, and when the detection program is executed by the processor, the steps of the detection method according to any one of claims 1-7 are implemented.

9. The detection device according to claim 8, wherein, The detection device further includes a driving module, the driving module is arranged on the base, and the camera lens module is movably arranged on the base through the driving module.

10. A computer-readable storage medium, characterized in that, A detection program is stored on the computer-readable storage medium, and when the detection program is executed by a processor, the steps of the detection method according to any one of claims 1-7 are implemented.

Citation Information

Patent Citations

  • Wire sequence and terminal insertion in-place detector and method thereof

    CN113125349A

  • Method and device for automatically checking misinsertion of interconnection cable between server and GPU box

    CN113791368A