CN115994895A - Detection method, detection device and computer readable storage medium - Google Patents

Detection method, detection device and computer readable storage medium Download PDF

Info

Publication number
CN115994895A
CN115994895A CN202211611164.9A CN202211611164A CN115994895A CN 115994895 A CN115994895 A CN 115994895A CN 202211611164 A CN202211611164 A CN 202211611164A CN 115994895 A CN115994895 A CN 115994895A
Authority
CN
China
Prior art keywords
cable
terminal
detection
pose information
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211611164.9A
Other languages
Chinese (zh)
Inventor
冯秋歌
韩健磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Huichuan Control Technology Co Ltd
Original Assignee
Suzhou Huichuan Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Huichuan Control Technology Co Ltd filed Critical Suzhou Huichuan Control Technology Co Ltd
Priority to CN202211611164.9A priority Critical patent/CN115994895A/en
Publication of CN115994895A publication Critical patent/CN115994895A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a detection method, a detection device and a computer readable storage medium, wherein the detection method comprises the following steps: acquiring first pose information of a cable region in a cable sequence terminal detection image, reference pose information corresponding to the terminal region in a target template and initial pose information corresponding to the cable region in the target template; determining a rigid position transformation matrix according to second pose information and reference pose information of a terminal area in the line sequence terminal detection image; determining the expected position of the cable area according to the initial pose information and the rigid position transformation matrix; and determining a detection result of the line sequence terminal according to the cable color of the cable area and the distance between the first center coordinate and the expected position in the first pose information. According to the method, 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 line sequence terminal is determined, and whether the cable corresponding to the cable insertion position has the condition of missing or misplug is obtained.

Description

Detection method, detection device and computer readable storage medium
Technical Field
The present invention relates to the field of detection technologies, and in particular, to a detection method, a detection device, and a computer readable storage medium.
Background
The wire sequence terminal detection is a step which is needed to be performed in the wire rod production process of a wire harness factory, and the conditions of cable sequencing of the wire sequence terminal, whether the cable insertion position is in missing insertion, misplug insertion and the like are needed to be checked, so that defective products are selected. At present, the detection of the wire sequence terminal can be based on a machine vision detection method, by collecting images of the wire sequence terminal to be detected, identifying the cable sequence of the wire sequence terminal to be detected based on the images so as to determine whether the cable sequence of the wire sequence terminal to be detected is correct, however, the detection mode of the wire sequence terminal does not detect the situation that the cable insertion position of the wire sequence terminal to be detected has missed cables and wrong cables, and whether the cable corresponding to the cable insertion position of the wire sequence terminal is inserted accurately cannot be known.
The foregoing is provided merely for the purpose of facilitating understanding of the technical scheme of the present invention and is not intended to represent an admission that the foregoing is related art.
Disclosure of Invention
The invention mainly aims to provide a detection method, a detection device and a computer readable storage medium, and aims to solve the problems that the detection mode of a current wire sequence terminal does not detect the situation that a cable with a missing wire or a wrong wire exists at the cable insertion position of the wire sequence terminal, and whether the cable corresponding to the cable insertion position of the wire sequence terminal is inserted accurately or not can not be known.
In order to achieve the above object, the present invention provides a detection method comprising:
acquiring first pose information of a cable region in a line sequence terminal detection image, reference pose information corresponding to a terminal region in a target template and initial pose information corresponding to the cable region in the target template;
determining a rigid position transformation matrix according to second pose information of a terminal area in the line sequence terminal detection image and the reference pose information;
determining an expected position corresponding to the cable area according to the initial pose information and the rigid position transformation matrix;
and determining a detection result of the line sequence terminal according to the cable color of the cable region and the distance between the first central coordinate and the expected position in the first pose information.
Optionally, the step of acquiring the first pose information of the cable area in the line-sequence terminal detection image includes:
acquiring second pose information of a terminal area in the line sequence terminal detection image;
and determining first pose information of the cable region according to the second pose information.
Optionally, the step of determining the first pose information of the cable region according to the second pose information includes:
Determining a translation direction of the terminal region to a cable region of the line-sequential terminal;
determining a cable detection area according to the second pose information, the translation direction and a preset moving distance;
and determining first pose information of the cable region according to the cable detection region.
Optionally, the step of determining the first pose information of the cable region according to the cable detection region includes:
preprocessing the image of the cable detection area;
determining a contour arc line of the cable in the cable detection area according to the preprocessed image;
and constructing the cable region according to the contour arc, and determining the first pose information based on the cable region.
Optionally, the step of determining the detection result of the line-sequence terminal according to the cable color of the cable area and the distance between the first center coordinate and the expected position in the first pose information includes:
determining the cable ordering of the cable ordering terminal according to the cable color of the cable area;
determining a cable ordering detection result of the cable ordering terminal according to the cable ordering and the initial cable ordering corresponding to the cable area in the target template;
Determining a cable position detection result of the line sequence terminal according to the distance between a first center coordinate and the expected position in the first pose information;
and determining the detection result of the wire sequence terminal according to the wire sequence detection result and the wire position detection result.
Optionally, the step of determining the cable position detection result of the line-sequence terminal according to the distance between the first central coordinate and the expected position in the first pose information includes:
when the distance between the first central coordinate and the expected position in the first pose information is smaller than a preset distance, the cable position detection result of the line sequence terminal is that the cable position is qualified;
and when the distance between the first central 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 line sequence terminal is that the cable position has a missing plug condition or the cable position has a misplug plug condition.
Optionally, before the step of obtaining the first pose information of the cable region in the line-sequence terminal detection image and the initial pose information corresponding to the cable region in the target template, the method further includes:
Determining a terminal area of the line-sequence terminal according to the line-sequence terminal detection image;
and determining the target template according to the terminal area and the detection template corresponding to the terminal area.
In addition, in order to achieve the aim, the invention also provides a detection device, which comprises a base, a detection device and a detection device, wherein the base is provided with a detection area; the camera lens module is arranged on the base and is opposite to the detection area; the detection device further includes: the device comprises a memory, a processor and a detection program stored in the memory and capable of running on the processor, wherein the detection program realizes the steps of the detection method when being executed by the processor.
Optionally, the detection device further includes a driving module, the driving module is disposed on the base, and the camera lens module is movably disposed on the base through the driving module.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a detection program which, when executed by the processor, implements the respective steps of the detection method as described above.
According to the detection method, the device and the computer readable storage medium, a rigid position transformation matrix is determined according to second pose information and reference pose information of a terminal area in a line sequence terminal detection image, so that the position transformation condition that the terminal area moves from the reference pose information to the second pose information is obtained through the rigid position transformation matrix, further, the expected position corresponding to the cable area is determined according to initial pose information and the rigid position transformation matrix, the target position where the cable area is located after the initial pose information of the cable area moves according to the rigid position transformation matrix is determined, the target position is taken as the expected position of the cable area, the detection result of the line sequence terminal is determined according to the cable color of the cable area and the distance between the first central coordinate and the expected position of the cable area, whether the cable color corresponding to the cable insertion position is correct or not is determined according to the cable color of the cable area, the position deviation corresponding to the cable area is obtained according to the distance, whether the cable insertion position is missed or not is determined according to the position deviation, further, the detection result of the line sequence terminal is determined according to the cable color and the distance together, and whether the cable insertion position is missed or not is obtained according to the detection result of the cable insertion position.
Drawings
Fig. 1 is a schematic structural diagram of a detection device or a terminal device according to various embodiments of the detection method of the present invention;
FIG. 2 is a schematic diagram of the structure of the detecting device of the present invention;
FIG. 3 is a flow chart of a first embodiment of the detection method of the present invention;
FIG. 4 is a schematic illustration of placement of line sequence terminals in a line sequence terminal detection image;
FIG. 5 is an enlarged view of the cable zone of FIG. 4;
FIG. 6 is a sub-process of identifying terminal areas;
FIG. 7 is a cable splitting sub-process;
FIG. 8 is a extract cable color sub-process;
FIG. 9 is a front and back template profile creation sub-flow;
fig. 10 is a flow chart of a second embodiment of the detection method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a detection method, which comprises the following steps:
acquiring first pose information of a cable region in a line sequence terminal detection image, reference pose information corresponding to a terminal region in a target template and initial pose information corresponding to the cable region in the target template;
Determining a rigid position transformation matrix according to second pose information of a terminal area in the line sequence terminal detection image and the reference pose information;
determining an expected position corresponding to the cable area according to the initial pose information and the rigid position transformation matrix;
and determining a detection result of the line sequence terminal according to the cable color of the cable region and the distance between the first central coordinate and the expected position in the first pose information.
According to the detection method, a rigid position transformation matrix is determined according to second pose information and reference pose information of a terminal area in a wire sequence terminal detection image, so that the situation that the terminal area moves from the reference pose information to the position transformation of the second pose information is obtained through the rigid position transformation matrix, further, the expected position corresponding to the wire cable area is determined according to the initial pose information and the rigid position transformation matrix, the target position where the wire cable area is located after the initial pose information of the wire cable area moves according to the rigid position transformation matrix is clearly determined, the target position is taken as the expected position of the wire cable area, the detection result of the wire sequence terminal is determined according to the wire color of the wire cable area and the distance between the first central coordinate of the wire cable area and the expected position, whether the wire color corresponding to the wire cable insertion position is correct or not is clearly obtained through the wire color of the wire cable area, whether the wire insertion position corresponding to the wire insertion position is inserted or not is clearly obtained through the distance, further, the detection result of the wire sequence terminal is jointly determined according to the wire color and the distance, and whether the wire insertion position corresponding to the wire insertion position or the wire error exists or not can be obtained according to the detection result.
In the following description, suffixes such as "module", "part" or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The detection method of the present invention is executed by a detection device or a terminal device connected to the detection device, wherein the terminal device can be implemented in various forms. For example, the terminal device described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, and a palm computer.
It will be appreciated by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type mobile terminal in addition to an element particularly used for a moving purpose.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a detection apparatus or a terminal device according to various embodiments of the detection method of the present invention.
As shown in fig. 1, the terminal device may include: a memory 101 and a processor 102. It will be appreciated by those skilled in the art that the block diagram of the terminal shown in fig. 1 is not limiting of the terminal, and that the terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. The memory 101 stores therein an operating system and a detection program. The processor 102 is a control center of the terminal device, and the processor 102 executes a detection program stored in the memory 101 to implement the steps of the detection method embodiments of the present invention.
Optionally, the terminal device may further include a display unit 103, where the display unit 103 includes a display panel, and the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like, for outputting and displaying an interface browsed by the user.
Optionally, when the main body of the detection method of the present invention is a terminal device, the terminal device further includes a communication unit 104, and the communication unit 104 establishes data communication (the data communication may be IP communication or bluetooth channel) with the detection device through a network protocol, so as to implement data transmission with the detection device, for example, acquire a line-sequential terminal detection image through the detection device.
Optionally, referring to fig. 2, fig. 2 is a schematic structural diagram of a detection device of the present invention, where the detection device includes a base 1 and a camera lens module 2, the base 1 is provided with a detection area 11, and the detection area 11 is used for placing a line-sequential terminal to be detected; the camera lens module 2 is disposed on the base 1 and opposite to the detection area 11, so as to obtain a line sequence terminal detection image in the detection area 22 through the camera lens module 2.
Optionally, the detecting device further includes a driving module 3, the driving module 3 is disposed on the base 1, and the camera lens module 2 is movably disposed on the base 1 through the driving module 3, so that a shooting distance between the camera lens module 2 and the detection area 11 is adjusted through the driving module 3, and a line sequence terminal detection image in the detection area 11 is acquired through the camera lens module 2, so that the line sequence terminal detection image is clear and has good quality.
Optionally, a first light source (not shown in the figure) is disposed on the backlight surface of the detection area 11, so that when the line-sequence terminal detection image of the line-sequence terminal to be detected is collected by the camera lens module 2, the first light source is turned on to make the background of the line-sequence terminal detection image white, so as to highlight the outline of the line-sequence terminal in the line-sequence terminal detection image, and a line-sequence terminal detection image with good quality is obtained.
Optionally, the camera lens module 2 includes a camera 21 and a second light source 22 disposed opposite to each other, and the second light source 22 is disposed between the camera 21 and the detection area 11, so that the second light source 22 is turned on to illuminate the detection area 11 while supplementing light to the camera 21, so that the camera can collect a good-quality line-sequential terminal detection image through the second light source 22.
Optionally, the driving module 3 includes a driving member 31 and a screw moving assembly 32, where the driving member 31 is connected to the screw moving assembly 32, and the camera lens module 2 is disposed on the screw moving assembly 32, and the driving member 31 drives the screw moving assembly 32 to rotate so as to drive the camera lens module 2 to move relative to the detection area 11, if it is assumed that the driving member 31 rotates clockwise, the camera lens module 2 is driven to approach the detection area 11, so as 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, so as to increase the shooting distance.
Alternatively, the driving member 31 employs a stepping motor.
Optionally, the detecting device further includes a terminal baffle 4, where the terminal baffle 4 is disposed on the base and disposed on one side of the detecting area 11.
It should be noted that, when the detecting device is used to detect the line sequence terminal, only the line sequence terminal to be detected needs to be placed in the detecting 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 detecting area 11, so as to collect the line sequence terminal detection image in the detecting area 11 through the camera lens module 2, and further, whether the cable sequence of the line sequence terminal is accurately ordered based on the line sequence terminal detection image, and whether the condition of missed detection or misplug exists in the cable insertion position.
Optionally, in 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, line sequence terminal detection images can be continuously collected respectively under different shooting distances, and the brightness of the first light source and the second light source can be adjusted in a combined manner, so that the illumination of the line sequence terminals on the detection area is uniform, and the line sequence terminal detection images with clear and good quality can be obtained.
In the practical application process, the wire sequence terminals with different wire sequence types can be different in wire sequence, can be different in wire cable insertion positions, and can be different in wires corresponding to the wire cable insertion positions. Optionally, the template data of the target templates corresponding to the line-sequence terminals with different line-sequence types can be obtained and stored in advance, and the template data of the target templates corresponding to the line-sequence terminals with different line-sequence types are stored in the detection device, so that the detection device can be adapted to detect the line-sequence terminals with different line-sequence types, and the detection result of the line-sequence terminals with corresponding line-sequence types can be obtained.
Based on the above-mentioned block diagram of the terminal device, various embodiments of the detection method of the present invention are presented.
In a first embodiment, the present invention provides a detection method, please refer to fig. 3, fig. 3 is a flow chart of the first embodiment of the detection method of the present invention. In this embodiment, the detection method includes the steps of:
Step S10, acquiring first pose information of a cable region in a line sequence terminal detection image, reference pose information corresponding to the terminal region in a target template and initial pose information corresponding to the cable region in the target template;
the first pose information, the reference pose information, and the initial pose information respectively include a center coordinate and a rotation angle. In order to facilitate distinguishing the first pose information, the reference pose information and the initial pose information respectively comprising the center coordinates and the rotation angles, the first pose information comprises the first center coordinates and the first rotation angles. Similarly, the reference pose information includes a reference center coordinate and a reference rotation angle, and the initial pose information includes an initial center coordinate and an initial rotation angle.
The first pose information of the cable area comprises a first center coordinate and a first rotation angle. The first pose information can be used for determining the placement position and the placement pose of the cable region in the line-sequence terminal detection image of the line-sequence terminal to be detected. The first center coordinates can be used for determining the placement position of the cable region in the line-sequence terminal detection image, and the first rotation angles can be used for determining the placement posture of the cable region in the line-sequence terminal detection image.
For example, please refer to fig. 4 and fig. 5, fig. 4 is a schematic diagram illustrating placement of the line-sequential terminals in the line-sequential terminal detection image, and fig. 5 is an enlarged view of the cable region in fig. 4. It should be noted that, the line sequence terminal portion corresponding to a is a terminal area, the line sequence terminal portion corresponding to B is a cable detection area, the area corresponding to the cable in the cable detection area is a cable area, for example, the area corresponding to the black rectangle in C, the first center coordinate in the first pose information corresponding to the cable area is the coordinate corresponding to the point P, and the first rotation angle is a.
Alternatively, the number of cable areas of the wire sequence terminal may be determined according to the number of cables of the wire sequence terminal, as shown in fig. 4, and if the number of cables of the wire sequence terminal is 4, the number of cable areas of the wire sequence terminal is 4.
Optionally, the first pose information of the cable region in the cable sequence terminal detection image includes pose information of the cable region corresponding to all cables of the cable sequence terminal respectively, and illustratively, a first center coordinate in the first pose information may be represented by a coordinate matrix, so as to determine the first center coordinate corresponding to each cable of the cable sequence terminal through the coordinate matrix. It is understood that the first rotation angle corresponding to each cable of the wire sequence terminal is a.
The template data corresponding to the target template comprises reference pose information corresponding to the terminal area, center coordinates or position coordinates of the cable detection area, initial pose information corresponding to the cable area, cable width, RGB value of each cable, a color difference threshold value, front characteristic data corresponding to the terminal area and back characteristic data corresponding to the terminal area.
The template data corresponding to the target template is determined based on the line sequence terminals which are qualified in detection, wherein the line sequence terminals which are qualified in detection refer to terminals which are correct in cable sequence of the line sequence terminals and correct in cable insertion positions corresponding to inserted cables, and the cable insertion positions are not misplaced or missed. The front characteristic data corresponding to the terminal area refers to the characteristic identifier for identifying the front part of the terminal area of the line-sequential terminal, and the back characteristic data corresponding to the terminal area similarly refers to the characteristic identifier for identifying the back part of the terminal area of the line-sequential terminal.
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, where the feature data corresponding to the cable area, such as the number of cables, the cable area, and the like, is disposed on one side of the terminal area.
It is understood that the template data corresponding to the target template is pre-stored data.
In the practical application process, the wire sequence terminals with different wire sequence types can be different in wire sequence, can be different in wire cable insertion positions, and can be different in wires corresponding to the wire cable insertion positions. Alternatively, the template data of the target templates corresponding to the line-sequence terminals can be obtained and pre-stored for the line-sequence terminals with different line-sequence types, so that the detection device can be suitable for detecting the line-sequence terminals with different line-sequence types.
Illustratively, assuming that the template data includes reference center coordinates (Xs, ys) and reference rotation angles Rs of the terminal regions, center coordinates or position coordinates of the cable detection region ROI (Region Of Interest, image region of interest) are (Xn, yn), the initial pose information corresponding to the cable region includes pose information corresponding to the cable region of each cable of the cable sequence terminal, the initial pose information corresponding to the cable region includes a position set (Xt, yt) of center coordinates formed by all cable regions of the cable sequence terminal, a cable width Wt, a characteristic RGB value of each cable, a color difference threshold E, and front and back model feature data. The front-back model feature data comprises front feature data corresponding to the terminal area and back feature data corresponding to the terminal area, the front feature data can be used for determining the front of the terminal area, and similarly, the back feature data can be used for determining the back of the terminal area, and the cable sequences corresponding to the front and the back are generally different.
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 "identify terminal area sub-process", please refer to fig. 6, fig. 6 is an identify terminal area sub-process; the cable detection part region position (Xn, yn) can be obtained based on frame selection on a software interface, and can also be determined based on the reference center coordinates and the reference rotation angles of the terminal regions; the position set (Xt, yt) and the cable width Wt formed by the cable region are obtained from a cable-splitting sub-process, please refer to fig. 7, fig. 7 is a cable-splitting sub-process; the characteristic RGB value of each cable is obtained from a "cable color extraction sub-process", please refer to fig. 8, fig. 8 is a cable color extraction sub-process; the color difference threshold E is a preset value; the front and back model feature data is obtained from a "front and back template profile creation sub-process", please refer to fig. 9, and fig. 9 is a front and back template profile creation sub-process.
In the practical application process, the wire sequence terminal detection is a step which is needed to be performed in the wire rod production process of a wire harness factory, and the conditions of cable sequencing of the wire sequence terminal, whether the cable insertion position is in missing insertion, misplug insertion and the like are required to be checked, so that defective products are selected. At present, the detection of the wire sequence terminal can be based on a machine vision detection method, by collecting images of the wire sequence terminal to be detected, identifying the cable sequence of the wire sequence terminal to be detected based on the images so as to determine whether the cable sequence of the wire sequence terminal to be detected is correct, however, the detection mode of the wire sequence terminal does not detect the situation that the cable insertion position of the wire sequence terminal to be detected has missed cables and wrong cables, and whether the cable corresponding to the cable insertion position of the wire sequence terminal is inserted accurately cannot be known.
As an alternative embodiment, step S10 further includes, before:
determining a terminal area of the line-sequence terminal according to the line-sequence terminal detection image;
and determining the target template according to the terminal area and the detection template corresponding to the terminal area.
In the practical application process, the terminal area of the wire sequence terminal is provided with a front surface and a back surface, and the cable sequences corresponding to the front surface and the back surface are generally different.
The detection template corresponding to the terminal region refers to a detection template of a front part determined by front characteristic data corresponding to the terminal region in the template data and a detection template of a back part determined by back characteristic data corresponding to the terminal region. After determining the terminal area of the line-sequential terminal according to the line-sequential terminal detection image, comparing the detection templates corresponding to the terminal area to determine 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 determining a target template according to the comparison result, wherein the target template is the detection template of the front part of the terminal area when the terminal area is the detection template of the front part of the terminal area, and the target template is the detection template of the back part of the terminal area when the terminal area is the detection template of the back part of the terminal area.
As an alternative embodiment, step S10 includes:
acquiring second pose information of a terminal area in the line sequence terminal detection image;
and determining first pose information of the cable region according to the second pose information.
In this embodiment, the terminal area of the line sequence terminal is determined to be the "identification terminal area", and the implementation can be similar to the process of fig. 6, the terminal area of the line sequence terminal is determined according to the line sequence terminal detection image, a dual-threshold binarization method can be adopted for the line sequence terminal detection image, the terminal area under the white background in the line sequence terminal detection image is extracted, an image on operation is performed for the terminal area, a circular structural element with a preset radius is adopted for the on operation to remove the cable portion, only the terminal area is reserved in the line sequence terminal detection image, the minimum circumscribed rectangle is calculated for the terminal area, the coordinate position of the rectangle in the line sequence terminal detection image and the rotation angle of the rectangle are obtained, the second central coordinates (Xs 1, ys 1) and the second rotation angle Rs1 of the rectangle are used as the second central coordinates (Xs 1, ys 1) of the terminal area, so as to obtain the second pose information, in fig. 4, the second central coordinates are the coordinates corresponding to the point O, and the second rotation angle is a.
Optionally, the low threshold is set to 0 and the high threshold is set to 225 in the dual threshold binarization method.
Alternatively, the preset radius is 25.
Optionally, the step of determining the first pose information of the cable region according to the second pose information includes:
determining a translation direction of the terminal region to a cable region of the line-sequential terminal;
determining a cable detection area according to the second pose information, the translation direction and a preset moving distance;
and determining first pose information of the cable region according to the cable detection region.
Referring to fig. 4, since the cable region of the line-sequence terminal is disposed at one side of the terminal region, in order to determine the translation direction from the terminal region to the cable region of the line-sequence terminal based on the line-sequence terminal detection image, for example, the terminal region may be determined by comparing feature data such as front feature data or back feature data corresponding to the terminal region in the target template, the region where the cable is located may be determined by comparing feature data corresponding to the cable region in the target template, further, the translation direction from the terminal region to the cable region of the line-sequence terminal may be determined, and the cable detection region may be determined according to the second pose information, the translation direction and the preset movement distance, that is, the third pose information determined after the second pose information is moved by the preset movement distance according to the translation direction may be constructed based on the third pose information, so as to be the cable detection region, that is, where the terminal region is moved by the preset movement distance according to the translation direction.
It can be understood that the determining manner of the cable detection area of the cable sequence terminal to be detected is the same as that of the cable detection area in the target template, and further based on the cable detection area determined by the cable detection area, when the cable area of the cable sequence terminal to be detected is further compared with the cable area in the target template, the situation of whether the cable sequence terminal to be detected is ordered and/or the cable corresponding to the cable insertion position is missed or misplaced can be more accurately determined according to the comparison result.
It is understood that the preset moving distance is a preset distance length.
Optionally, the step of determining the first pose information of the cable region according to the cable detection region includes:
preprocessing the image of the cable detection area;
determining a contour arc line of the cable in the cable detection area according to the preprocessed image;
and constructing the cable region according to the contour arc, and determining the first pose information based on the cable region.
Referring to fig. 4 and fig. 5, in order to accurately identify a cable area in a cable detection area, an image of the cable detection area may be preprocessed, and a contour arc of a cable in the cable detection area may be determined according to the preprocessed image, for example, a canny algorithm is adopted for the image of the cable detection area, cable edges are extracted, collinear edge contours are combined, contours with end points approaching from the front to the rear are combined, a rectangular height h corresponding to the created cable detection area ROI is taken as an index, and a height less than 1% is removed 2 H, constructing cable areas according to contour arcs, namely sorting screened contours from left to right, from top to bottom, matching contour arcs with serial numbers of 0 and 1 with fitting rectangles, matching contour arcs with serial numbers of 2 and 3 with fitting rectangles, so that the obtained rectangular areas are the cable areas corresponding to the segmented cable 1, and it is required to explain that the contour arcs with serial numbers of 0, 1, 2 and 3 can be understood as 4 sides of the cable areas in the cable in the figure 5, wherein the cable areas corresponding to the cables 2, 3 and 4 respectively are pushed up like the former, and finally outputting to obtain all rectangular areas which are the cable areas corresponding to the segmented cables respectively.
And determining first pose information based on the cable regions, namely acquiring pose information corresponding to each cable region, and taking a coordinate matrix formed by central coordinates in the pose information corresponding to each cable region as a first central coordinate in the first pose information, wherein the cable region corresponds to a rotation angle in the pose information as a first rotation angle in the first pose information.
Optionally, the edge smoothing parameter for extracting the cable edge adopts alpha, the edge extracting low threshold adopts l, and the high threshold adopts h as the screening parameter of the edge.
Step S20, determining a rigid position transformation matrix according to second pose information of a terminal area in the line sequence terminal detection image and the reference pose information;
step S30, determining the expected position corresponding to the cable area according to the initial pose information and the rigid position transformation matrix;
and step S40, determining a detection result of the line sequence terminal according to the cable color of the cable area and the distance between the first center coordinate and the expected position in the first pose information.
It should be noted that the rigid position change matrix refers to change position information of reference pose information corresponding to a terminal area in the target template moving to second pose information corresponding to a terminal area of the line sequence terminal to be detected. Based on the change position information, when the cable area in the target template moves according to the change position information, the expected position of the cable area when the terminal area in the target template is overlapped with the terminal area of the cable sequence terminal to be detected can be determined, and whether the cable at the cable insertion position is missed or misplaced can be determined by comparing the expected position of the cable area with the first center coordinate of the cable area of the cable sequence terminal to be detected.
For example, the rigid position transformation matrix M may be calculated by referring to the center coordinates (Xs, ys) and the reference rotation angle Rs of the terminal region of the target template, and the second center coordinates (Xs 1, ys 1) and the second rotation angle Rs1 of the terminal region in the line sequence terminal to be detected, calculating the expected position (Xexcpt, yexcpt) of the template cable region position (Xt, yt) in the current state of the terminal pose to be detected according to the initial pose information and the rigid position transformation matrix M, and calculating the euclidean distance Δd between the first center coordinates (Xt 1, yt 1) and the expected position (Xexcpt, yexcpt) of the cable region of the line sequence terminal to be detected as the distance between the first center coordinates and the expected position in the first pose information.
Optionally, taking the cable width as a measurement and taking 2Wt as a threshold value of the cable position deviation, namely, deltaD <2Wt, considering that the cable insertion position deviation is within a reasonable range, and if deltaD is more than or equal to 2Wt, judging that the cable insertion position is wrong, wherein the cable insertion position corresponds to the cable insertion accurately.
In the technical scheme disclosed in this embodiment, according to the second pose information and the reference pose information of the terminal area in the line sequence terminal detection image, a rigid position transformation matrix is determined, so that the position transformation condition that the terminal area moves from the reference pose information to the second pose information is obtained through the rigid position transformation matrix, further, according to the initial pose information and the rigid position transformation matrix, the expected position corresponding to the cable area is determined, so that the target position where the cable area is located after the initial pose information of the cable area moves according to the rigid position transformation matrix is clearly determined, the 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 central coordinate and the expected position of the cable area, the detection result of the line sequence terminal is determined, so that whether the cable color corresponding to the cable insertion position is correct is clearly obtained through the cable color of the cable area, the position deviation corresponding to the cable insertion position is obtained through the distance, further, the detection result of the line sequence terminal is jointly determined according to the cable color and the distance, and whether the cable insertion position corresponding to the cable insertion position is missed or not is known based on the detection result.
In a second embodiment based on the first embodiment, please refer to fig. 10, fig. 10 is a flowchart illustrating a second embodiment of the detection method of the present invention. In this embodiment, step S40 includes:
step S41, determining the cable sequence of the cable sequence terminal according to the cable color of the cable region;
step S42, determining a cable sorting detection result of the cable sorting terminal according to the cable sorting and the initial cable sorting corresponding to the cable area in the target template;
step S43, determining a cable position detection result of the line sequence terminal according to the distance between the first central coordinate and the expected position in the first pose information;
and step S44, determining the detection result of the wire sequence terminal according to the wire sequence detection result and the wire position detection result.
And obtaining the cable color of the cable region to determine the cable ordering of the cable ordering terminal, and comparing the cable ordering of the cable ordering terminal with the initial cable ordering corresponding to the cable region in the target template, wherein if the cable ordering of the cable ordering terminal is the same as the initial cable ordering in the target template, the cable ordering detection result of the cable ordering terminal is the correct cable ordering, and if the cable ordering of the cable ordering terminal is different from the initial cable ordering in the target template, the cable ordering detection result of the cable ordering terminal is the wrong cable ordering.
Optionally, the cable colors of the cable regions are obtained to determine the cable ordering of the cable sequence terminals, and referring to fig. 4, the cable colors of the cables 1, 2, 3, and 4 corresponding to the cable regions, respectively, may be obtained to obtain the cable ordering of the cable sequence terminals.
Optionally, the cable color of the cable 1 corresponding to the cable area may be obtained by summing RGB values of each pixel point of the cable 1 corresponding to the cable area, obtaining an average value, and so on, and the cable color of the cables 2, 3, and 4 corresponding to the cable area may be obtained.
Optionally, the cable sequence of the cable sequence terminal is compared with the initial cable sequence corresponding to the cable region in the target template, and illustratively, the cable sequence of the cable sequence terminal is the cable color of the cable region corresponding to the cables 1, 2 and 3, and the initial cable sequence is the cable color of the cable region corresponding to the target cable 1, 2 and 3, and the cable color of the cable region corresponding to the cable 1 is compared with the cable color of the cable region corresponding to the target cable 1, and if the color difference value between the RGB value average value of the cable region corresponding to the cable 1 and the RGB value average value of the cable region corresponding to the target cable 1 is less than or equal to the color difference threshold, the cable color of the cable region corresponding to the cable 1 is the same as or similar to the cable color of the cable region corresponding to the target cable 1.
It will be appreciated that the same cable ordering of the cable ordering terminals as the initial cable ordering in the target template means that the cable color of the cable region corresponding to the cable 1 is the same as or similar to the cable color of the cable region corresponding to the target cable 1, and the cable color of the cable region corresponding to the cable 2 is the same as or similar to the cable color of the cable region corresponding to the target cable 2, and the cable color of the cable region corresponding to the cable 3 is the same as or similar to the cable color of the cable region corresponding to the target cable 3.
As an alternative embodiment, step S43 includes:
when the distance between the first central coordinate and the expected position in the first pose information is smaller than a preset distance, the cable position detection result of the line sequence terminal is that the cable position is qualified;
and when the distance between the first central 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 line sequence terminal is that the cable position has a missing plug condition or the cable position has a misplug plug condition.
When the distance between the first center coordinate and the expected position is smaller than a preset distance, the position deviation is indicated to belong to a normal range, the cable position detection result of the line sequence terminal is that the cable position is qualified, when the distance between the first center coordinate and the expected position is larger than or equal to the preset distance, the position deviation is indicated to belong to an abnormal range, and the cable position detection result of the line sequence terminal is that the cable position has a missing plug condition or a misplug condition.
According to the cable sorting detection result and the cable position detection result, the detection result of the cable sequence terminal is determined, the cable sorting detection result which can be determined from the aspect of cable sorting and the cable position detection result which is determined from the aspect of cable position existence of missed cables or misplaced cables are used for jointly determining the detection result of the cable sequence terminal, so that whether the cable sequence terminal is qualified or not is determined based on the detection result, and the qualification rate of the cable sequence terminal obtained through screening is improved.
Optionally, after step S44, at least two of the cable sorting detection result, the cable position detection result and the detection result of the cable sequence terminal are output, so that a detecting person of the cable sequence terminal to be detected can conveniently obtain the specific condition of disqualification of the cable sequence terminal, and further classify the disqualification of the cable sequence terminal, for example, classify the disqualification of the cable sequence terminal caused by cable sorting into one class, and classify the disqualification of the cable sequence terminal caused by cable position into one class, so as to improve the processing efficiency.
In the technical scheme disclosed in this embodiment, according to the cable position detection result and the cable sequencing detection result, the detection result of the cable sequence terminal is determined together, whether the cable sequence of the cable sequence terminal is accurate or not can be obtained based on the cable sequencing detection result, whether the cable insertion position of the cable sequence terminal has a missing plug or not can be obtained based on the cable position detection result, and whether the cable insertion position of the cable sequence terminal has a missing plug or a misplug or not can be obtained based on the cable position detection result and the cable sequencing detection result.
The invention also provides a detection device, which comprises: a base provided with a detection area; the camera lens module is arranged on the base and is opposite to the detection area; the detection device further includes: the device comprises a memory, a processor and a detection program stored in the memory and capable of running on the processor, wherein the detection program is executed by the processor to implement the steps of the detection method in any of the embodiments.
The present invention also proposes a computer-readable storage medium having stored thereon a detection program which, when executed by a processor, implements the steps of the detection method according to any of the above embodiments.
In the embodiments of the terminal device and the computer readable storage medium provided by the present invention, all technical features of each embodiment of the detection method are included, and the expansion and explanation contents of the description are basically the same as those of each embodiment of the detection method, which are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as above, comprising instructions for causing a mobile terminal (which may be a handset, a computer, a server, a controlled terminal, or a network device, etc.) to perform the method of each embodiment of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A method of detection, the method comprising:
acquiring first pose information of a cable region in a line sequence terminal detection image, reference pose information corresponding to a terminal region in a target template and initial pose information corresponding to the cable region in the target template;
determining a rigid position transformation matrix according to second pose information of a terminal area in the line sequence terminal detection image and the reference pose information;
determining an expected position corresponding to the cable area according to the initial pose information and the rigid position transformation matrix;
and determining a detection result of the line sequence terminal according to the cable color of the cable region and the distance between the first central coordinate and the expected position in the first pose information.
2. The method of claim 1, wherein the step of acquiring the first pose information of the cable region in the line-sequential terminal detection image comprises:
acquiring second pose information of a terminal area in the line sequence terminal detection image;
and determining first pose information of the cable region according to the second pose information.
3. The method of claim 2, wherein the step of determining first pose information for the cable region from the second pose information comprises:
Determining a translation direction of the terminal region to a cable region of the line-sequential terminal;
determining a cable detection area according to the second pose information, the translation direction and a preset moving distance;
and determining first pose information of the cable region according to the cable detection region.
4. The method of claim 3, wherein the step of determining first pose information for the cable region from the cable detection region comprises:
preprocessing the image of the cable detection area;
determining a contour arc line of the cable in the cable detection area according to the preprocessed image;
and constructing the cable region according to the contour arc, and determining the first pose information based on the cable region.
5. The method of claim 1, wherein the step of determining the detection result of the line-sequential terminal according to the cable color of the cable region and the distance between the first center coordinate and the expected position in the first pose information comprises:
determining the cable ordering of the cable ordering terminal according to the cable color of the cable area;
determining a cable ordering detection result of the cable ordering terminal according to the cable ordering and the initial cable ordering corresponding to the cable area in the target template;
Determining a cable position detection result of the line sequence terminal according to the distance between a first center coordinate and the expected position in the first pose information;
and determining the detection result of the wire sequence terminal according to the wire sequence detection result and the wire position detection result.
6. The method of claim 5, wherein the step of determining the cable position detection result of the line-sequential terminal according to the distance between the first center coordinate and the expected position in the first pose information comprises:
when the distance between the first central coordinate and the expected position in the first pose information is smaller than a preset distance, the cable position detection result of the line sequence terminal is that the cable position is qualified;
and when the distance between the first central 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 line sequence terminal is that the cable position has a missing plug condition or the cable position has a misplug plug condition.
7. The method of claim 1, wherein the step of obtaining the first pose information of the cable region in the line-sequential terminal detection image and the initial pose information corresponding to the cable region in the target template further comprises:
Determining a terminal area of the line-sequence terminal according to the line-sequence terminal detection image;
and determining the target template according to the terminal area and the detection template corresponding to the terminal area.
8. The detection device is characterized by comprising a base, a detection part and a detection part, wherein the base is provided with a detection area; the camera lens module is arranged on the base and is opposite to the detection area; the detection device further includes: memory, a processor and a detection program stored in the memory and executable on the processor, which detection program, when executed by the processor, implements the steps of the detection method according to any of claims 1-7.
9. The inspection device of claim 8, further comprising a drive module disposed on the base, the camera lens module being movably disposed on the base by the drive module.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a detection program, which when executed by a processor, implements the steps of the detection method according to any of claims 1-7.
CN202211611164.9A 2022-12-14 2022-12-14 Detection method, detection device and computer readable storage medium Pending CN115994895A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211611164.9A CN115994895A (en) 2022-12-14 2022-12-14 Detection method, detection device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211611164.9A CN115994895A (en) 2022-12-14 2022-12-14 Detection method, detection device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115994895A true CN115994895A (en) 2023-04-21

Family

ID=85994696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211611164.9A Pending CN115994895A (en) 2022-12-14 2022-12-14 Detection method, detection device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115994895A (en)

Similar Documents

Publication Publication Date Title
EP1970839B1 (en) Apparatus, method, and program for face feature point detection
CN109142366B (en) Spherical shell defect detection method and device and computer readable storage medium
EP1969993B1 (en) Eyelid detection apparatus
US9594985B2 (en) Date identification apparatus
US20210044756A1 (en) Display and imaging device
TWI428807B (en) Optical coordinate input device and coordinate calculation method thereof
CN113298787B (en) Plate edge sealing defect detection method, controller and computer readable storage medium
CN114627561A (en) Dynamic gesture recognition method and device, readable storage medium and electronic equipment
US10692230B2 (en) Document imaging using depth sensing camera
CN115994895A (en) Detection method, detection device and computer readable storage medium
CN107948392B (en) Terminal and display fault processing method
US7206104B2 (en) Method for automatically determining document position in a scanner window
CN111753791A (en) Detection method and detection equipment
US20180365269A1 (en) Method and apparatus for improving the efficiency of remote diagnosis of electronic and other equipment
CN115797292A (en) Image quality detection method, surface defect detection method, device and storage medium
JP3779229B2 (en) Identification method, identification device, and traffic control system
JP2023046979A (en) Collation device and program
JP2007219899A (en) Personal identification device, personal identification method, and personal identification program
CN109060831B (en) Automatic dirt detection method based on bottom plate fitting
JP5985327B2 (en) Display device
JP2006134339A (en) Identification method, identification device and traffic control system
CN114332063B (en) Wire harness sequence detection method based on background difference
JP2984267B1 (en) Object processing method
CN115908573B (en) Rubber glove opening positioning method, system, electronic equipment and storage medium
CN113112467B (en) Plan drawing labeling system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination