Connector inspection method, electronic device, and storage medium
Patent Information
- Application Number
- CN202111531962.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2041-12-14
AI Technical Summary
但是连接器件上包含多个插针组,多个插针组包含多个插针,这些插针排列比较密集,人工检查容易漏检,且人工检查速度较低,检查标准不统一,不适用于大量的电子产品生产过程
[0008]本申请提出的一种连接器件检测方法、电子设备及存储介质,根据预设的插件信息对连接器件图像进行处理,可针对多种类型的插针自动计算获取插针位置和插针组位置,然后根据预先获取的连接器件角度、插针信息和插针组位置确定每个插针的预期位置,考虑到了连接器件图像拍摄角度的问题,通过获取连接器件旋转角度,可使得本方法适用范围更广,最后根据插针信息、插针位置和插针的预期位置即可完成连接器件的缺陷检测。整个方法对环境要求低,适用范围广,检测效率高。
Smart Images

Figure CN116342456B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and in particular to a method for detecting connection devices, an electronic device, and a storage medium. Background Technology
[0002] The electronics industry requires various connectors to connect different electronic components, forming a cohesive whole. However, defects may occur in these connectors during the manufacturing or assembly process, causing electronic products to malfunction. Some defects may even damage the connectors during assembly, rendering them irreparable. Defective connectors may also affect other components during production and operation, leading to product damage and losses. Therefore, it is necessary to inspect connectors at multiple stages of the production process, identifying and repairing or discarding defective connectors.
[0003] Currently, connectors are mainly inspected manually. However, connectors contain multiple pin groups, and these pin groups contain multiple pins. These pins are arranged quite densely, making it easy to miss some during manual inspection. In addition, manual inspection is slow, and the inspection standards are not uniform, making it unsuitable for large-scale electronic product manufacturing processes. Summary of the Invention
[0004] The main objective of this application is to provide a method for detecting connector devices, an electronic device, and a storage medium that can automatically and efficiently detect defects in connector devices.
[0005] To achieve the above objectives, this application provides a method for detecting a connector device. The connector device includes multiple pin groups, and each pin group includes multiple pins. The method includes: detecting an image of the connector device under test based on preset pin information to obtain pin positions and pin group positions; determining the expected position of the pins based on the pre-acquired image rotation angle, the pin information, and the pin group positions; and performing defect detection on the connector device based on the pin information, the pin positions, and the expected positions of the pins.
[0006] To achieve the above objectives, embodiments of this application also propose an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the connection device detection method described in the above embodiments.
[0007] To achieve the above objectives, embodiments of this application also propose a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the connection device detection method described in the above embodiments.
[0008] This application proposes a method, electronic device, and storage medium for detecting connectors. It processes images of connectors based on pre-set connector information, automatically calculating and obtaining pin positions and pin group positions for various types of pins. Then, based on the pre-acquired connector angle, pin information, and pin group positions, it determines the expected position of each pin. Taking into account the image capture angle of the connector, by obtaining the connector rotation angle, the method's applicability is broadened. Finally, based on the pin information, pin position, and expected pin position, defect detection of the connector can be completed. The entire method has low environmental requirements, wide applicability, and high detection efficiency. Attached Figure Description
[0009] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.
[0010] Figure 1 This is a flowchart of the connection device detection method provided in the embodiments of this application. Figure 1 ;
[0011] Figure 2a This is a schematic diagram of a single-type pin structure of a connector provided in an embodiment of this application;
[0012] Figure 2b This is a schematic diagram of a composite pin structure of a connector provided in an embodiment of this application;
[0013] Figure 3 This is a flowchart of the connection device detection method provided in the embodiments of this application;
[0014] Figure 4 This is a flowchart of the connection device detection method provided in the embodiments of this application. Figure 3 ;
[0015] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0017] Embodiments of this application relate to a method for detecting connection devices, such as... Figure 1 As shown, it includes:
[0018] Step 101: Detect the image of the connector to be tested according to the preset pin information of the connector to obtain the pin position and pin group position.
[0019] In this embodiment, the pin information of the preset connector can be obtained from the image of the connector to be tested, or from the information provided by the connector manufacturer.
[0020] In one embodiment, the pin information of the preset connector includes pin size, pin type, pin group type, pin shape, and pin group size. Pin type includes single type and composite type, pin group type refers to the arrangement of pins, and pin shape includes round pin and flat pin.
[0021] As shown in Figure 2, Figure 2a It is a single type of pin. Figure 2b For composite pins, Figure 2a For example, the pin type is single, the pin group type is 6 horizontal and 9 vertical, the pin shape is flat pin, the pin dimensions are the length and width of each flat pin, and the pin group dimensions are the length and width of a pin group consisting of 54 pins. Figure 2b For example, the pin type is composite, and the pin group type is 6 horizontal and 4 vertical. It should be noted that when the pin type is composite, the pins include the border. Figure 2b The components are the concave section and the center pin (two dots in the border). The pin shape refers to the shape of the center pin, which is a round pin in this case. The pin size includes the overall size of the pin consisting of the border and the center pin, the size of the border, and the size of the center pin. The pin group size is the length and width of the pin group consisting of 24 pins. Of course, this is just a specific example, and the pin information is not limited to the above information. The specific content of each piece of information can be adjusted according to the specific pin type and structure.
[0022] Step 102: Determine the expected position of the pin based on the pre-acquired image rotation angle, pin information, and pin group position.
[0023] In this embodiment, those skilled in the art will understand that during the acquisition of the image of the connector to be tested, the connector may not be perfectly aligned with the imaging device and may have a certain rotation angle, resulting in a skewed position of the connector in the acquired image, affecting the accuracy of subsequent defect detection results. Therefore, it is necessary to pre-determine the image rotation angle. Based on the image rotation angle, pin information, and pin position, the expected position of the pin can be determined. This expected position can be understood as the correct position where the pin should exist according to the production design standard. For example, if the pin type of a connector is determined to be single type, the pin group type is 6 horizontal and 4 vertical, the pins are round pins, the pin size is the diameter of the round pin 2, and the size of the pin group is 10 long and 6 wide, according to the production design standard of this connector, 24 round pins need to be designed in the 10 long and 6 wide pin group, and each pin is evenly arranged. Then the expected position of each pin can be calculated.
[0024] It should be noted that the expected position of the pin can be the coordinates of the pin's center point, the pin's position area, or both. For example, when the pin is a flat pin, the expected position can be the flat pin's position area (the area formed by the flat pin's length and width), or it can be the coordinates of the flat pin's center point.
[0025] Step 103: Perform defect detection on the connecting device based on the pin information, pin position, and expected pin position.
[0026] In this embodiment, defect detection of the connector includes both quantity detection and position detection, i.e., whether the connector is missing pins and whether the pin positions are correct.
[0027] This application proposes a method for detecting connector components. It processes the connector component image based on preset connector information, automatically calculating and obtaining the pin position and pin group position for various types of pins. Then, based on the pre-acquired connector component angle, pin information, and pin group position, it determines the expected position of each pin. Taking into account the image capture angle, by obtaining the image rotation angle, the method's applicability is broadened. Finally, based on the pin information, pin position, and expected pin position, defect detection of the connector component can be completed. The entire method has low environmental requirements, wide applicability, and high detection efficiency.
[0028] Embodiments of this application relate to a method for detecting connection devices, such as... Figure 3 As shown, it includes:
[0029] Step 301: Detect the image of the connection device to be tested based on a preset target detection algorithm to obtain the initial pin group position and the initial pin position.
[0030] In this embodiment, the preset target detection algorithm may include one or any combination of the following: sliding window detector, R-CNN, Fast R-CNN, R-FCN, RetianNet, Cascade RCNN. Of course, those skilled in the art will understand that before detecting the image of the connected device under test, the image may be filtered or otherwise processed to improve detection accuracy.
[0031] Step 302: Based on the preset image segmentation algorithm, process the image of the area where the pin is located in the image of the connection device under test, and extract the pin image mask.
[0032] In this embodiment, after obtaining the initial pin position, the image of the area where the pin is located is further analyzed and processed according to a preset image segmentation algorithm to extract the pin image mask. The preset image segmentation algorithm can be a semantic segmentation algorithm based on deep learning or an instance-based image segmentation algorithm. Specifically, it can include: fully convolutional pixel labeling networks, encoder-decoder architectures, multi-scale and pyramid-based methods, recurrent networks, visual attention models, and generative adversarial models, etc.
[0033] It should be noted that this application employs various image processing algorithms to detect and identify the pins, making the detection method of this application highly adaptable to changes in lighting and highly adaptable to changes in the material shooting effect caused by stains and small foreign objects on the parts.
[0034] Step 303: Correct the initial pin position based on the pin information and pin image mask of the connecting device to determine the pin position.
[0035] In this embodiment, the pin positions are further precisely determined at the pixel level using a pin image mask. The initial pin positions can then be corrected using the pixel coordinates of the pin mask image to obtain accurate pin positions. Once the precise positions of all pins are determined, the precise position of the entire pin group can be quickly determined based on this.
[0036] Step 304: Correct the initial pin group position according to the pin position to determine the pin group position.
[0037] Step 305: Determine the expected position of the pin based on the pre-acquired image rotation angle, pin information, and pin group position.
[0038] In one embodiment, before step 305, the method further includes: determining the vertex position of the pin group from the pin group positions, and determining the image rotation angle through the vertex position; or, determining multiple calibration points of the connector image based on a preset image detection algorithm, and calculating the image rotation angle based on the multiple calibration points.
[0039] It should be noted that the image rotation angle can be calculated based on the vertex position of the pin group, or it can be calculated based on the calibration point. Alternatively, the two methods can be combined, that is, the rotation angles of the connecting devices calculated by the two methods can be averaged to obtain a more accurate value, thereby improving the accuracy of subsequent defect detection.
[0040] In addition, in this embodiment, the image detection algorithm may include object detection algorithms, edge detection algorithms, image filtering algorithms, image segmentation algorithms, Hough transform-based image detection algorithms, etc., and these algorithms are combined to obtain calibration points. In this process, a rough calibration point position can be obtained first, and then further refined to obtain a precise calibration point position.
[0041] In one embodiment, determining the vertex positions of the pin group from the pin group positions and determining the image rotation angle based on the vertex positions includes: when the pin group size is greater than or equal to a preset threshold, determining multiple vertex positions of the pin group based on the pin group positions; calculating the coordinate difference between each vertex based on the vertex positions, and determining the horizontal edge rotation angle and vertical edge rotation angle of the pin group based on the coordinate difference; using the horizontal edge rotation angle and vertical edge rotation angle as initial rotation angles, and averaging the obtained initial rotation angles of multiple pin groups to determine the image rotation angle.
[0042] Specifically, after determining the position of the pin group, the vertex positions of its four vertices can be determined. Two vertical vertices are selected, and the difference between their coordinates is used to calculate the vertical rotation angle. Similarly, two horizontal vertices are selected, and the difference between their coordinates is used to calculate the horizontal rotation angle. These horizontal and vertical rotation angles are then used as the initial rotation angles of the connected devices in the image under test. Furthermore, when the pin group size is small, significant errors can easily occur when calculating the image rotation angle. Therefore, smaller pin groups are excluded beforehand, and calculations are performed only on larger pin groups to improve accuracy.
[0043] It should be noted that since the connector contains multiple pin groups, a rotation angle can be calculated for each pin group. The average of these multiple rotation angles is then used as the final rotation angle of the connector. Alternatively, multiple rotation angle values can be analyzed to determine their variance, median, standard deviation, etc., and a suitable rotation angle can be selected as the final result based on the analysis results.
[0044] Step 306: Perform defect detection on the connector based on the pin information, pin position, and expected pin position.
[0045] This application proposes a method for detecting connector components. It processes connector component images based on pre-defined connector information, automatically calculating and obtaining pin positions and pin group positions for various types of pins. Then, based on the pre-acquired connector component angle, pin information, and pin group positions, it determines the expected position of each pin. Taking into account the image capture angle of the connector component, by acquiring the connector component's rotation angle, this method has a wider range of applications. Finally, based on the pin information, pin position, and expected pin position, defect detection of the connector component can be completed. The entire method has low environmental requirements, wide applicability, and high detection efficiency. Furthermore, this application achieves precise positioning through two-stage localization of pin positions and pin group positions, reducing false detections.
[0046] Embodiments of this application relate to a method for detecting connection devices, such as... Figure 4 As shown, it includes:
[0047] Step 401: Detect the image of the connector to be tested according to the preset pin information of the connector to obtain the pin position and pin group position.
[0048] Step 402: Determine the expected position of the pin based on the pre-acquired image rotation angle, pin information, and pin group position.
[0049] In this embodiment, the specific implementation details of steps 401 and 402 are basically the same as those of steps 301-305, and will not be repeated here.
[0050] Step 403: When the pin type is single type, determine whether the connector has missing pins and / or misaligned pins based on the pin position and the expected pin position.
[0051] Step 404: When the pin type is composite, the image of the connector to be tested is decomposed to obtain the component position of the component in the pin, and the expected position of the component is determined according to the pin information, image rotation angle and pin group position. The connector is then defect-detected by the pin position, the expected position of the pin, the component position and the expected position of the component.
[0052] In one embodiment, defect detection of the connector is performed by means of the pin position, the expected position of the pin, the component position, and the expected position of the component, including: determining whether the connector has missing pins and / or misaligned pins based on the pin position and the expected position of the pin; determining whether the connector has missing borders and / or misaligned borders based on the border position and the expected position of the border; and determining whether the connector has missing intermediate pins and / or misaligned intermediate pins based on the intermediate pin position and the expected position of the intermediate pin.
[0053] In this embodiment, the pin information further includes component information. The components in the pin include a border and a center pin. The component positions include the border position and the center pin position. The expected positions of the components include the expected border position and the expected center pin position. Based on the preset pin information, if the pin is determined to be of a single type, then the presence of missing pins and / or misaligned pins in the connector can be determined based on the pin position and the expected pin position. It should be noted that the expected pin position may include the center point coordinates of the pin and the pin's position area. The position area is used to determine if a pin exists at that location, and the center point coordinates are used to determine if the pin is misaligned.
[0054] In this embodiment, when the pin type is determined to be composite, since composite pins also contain other components, such as borders and center pins, further analysis of the components is required. This involves segmenting the image of the region where the pin is located to obtain the component positions, such as the border position and the center pin position. Then, based on the pin information containing component information, the image rotation angle, and the pin group position, the expected positions of the components are determined, namely the expected border position and the expected center pin position. Of course, the pin information includes the border size, the center pin shape, and the center pin size.
[0055] In one embodiment, the image of the area where the pins are located in the image of the connector to be tested is segmented, specifically including: segmenting the image of the area where the pins are located according to the component information and a preset image segmentation algorithm to obtain the component area of each component; and detecting the component area of each component based on a preset target detection algorithm to determine the component position. For example, once it is determined that the pin type is composite, the component information in the pin information is obtained, including the component shape, component size, and component orientation. Specifically, the component shape may include the border style and the shape of the middle pin; the component size may include the border size and the middle pin size; and the component orientation may include: the border being below the pin area and the middle pin being located in the middle of the pin area. Based on the component information, the image of the pin area can be further segmented to determine the component area of each component, and the precise position of each component is obtained for each component area using a target detection algorithm.
[0056] In addition, the method for obtaining the expected position of the component is similar to the method for obtaining the expected position of the pin, and will not be described in detail here.
[0057] It should be noted that in the process of segmenting the image of the area where the pins are located in the image of the connecting device to obtain the position of the component, multiple image processing algorithms can be used in combination, such as object detection algorithms, edge detection algorithms, and image filtering algorithms, to improve the accuracy of image processing.
[0058] This application proposes a method for detecting connector components. It processes connector component images based on pre-defined connector information, automatically calculating and obtaining pin positions and pin group positions for various types of pins. Then, based on the pre-acquired connector component angle, pin information, and pin group positions, it determines the expected position of each pin. Taking into account the image capture angle of the connector component, by obtaining the connector component's rotation angle, the method's applicability is broadened. Finally, defect detection of the connector component is completed based on the pin information, pin position, and expected pin position. The entire method has low environmental requirements, wide applicability, and high detection efficiency. Furthermore, this application automatically decomposes the pins according to their type, determining the positions of individual components and their expected positions, making it adaptable to different batches of products and possessing excellent practicality.
[0059] Furthermore, it should be understood that the step divisions of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the process, but without changing the core design of the process, are also within the scope of protection of this patent.
[0060] Embodiments of this application relate to a connection device detection apparatus, comprising:
[0061] The information acquisition module is used to detect the image of the connector to be tested based on the pin information of the connector, acquire the pin position and the pin group position, and determine the expected position of the pin based on the pre-acquired image rotation angle, the pin information and the pin group position.
[0062] The defect detection module is used to perform defect detection on the connector based on the pin information, the pin position, and the expected position of the pin.
[0063] It is worth mentioning that all modules involved in this embodiment are logical modules. A logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.
[0064] It is not difficult to see that this embodiment is a device embodiment corresponding to the embodiment of the connection device detection method, and this embodiment can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above method embodiments.
[0065] Embodiments of the present invention relate to an electronic device, such as... Figure 5 As shown, it includes: at least one processor 501; and a memory 502 communicatively connected to the at least one processor 501; wherein the memory 502 stores instructions executable by the at least one processor 501, the instructions being executed by the at least one processor 501 to enable the at least one processor 501 to perform the connection device detection method of the above embodiment.
[0066] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0067] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0068] Embodiments of the present invention relate to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the aforementioned connection device detection method.
[0069] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0070] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. A method for detecting connector devices, characterized in that, The connector includes a pin group, the pin group comprising a plurality of pins, the method comprising: The image of the connecting device under test is detected based on a preset target detection algorithm to obtain the initial pin group position and the initial pin position. Based on a preset image segmentation algorithm, the image of the area where the pins are located in the image of the connection device under test is processed to extract the pin image mask; The initial pin position is corrected based on the pin information of the connecting device and the pin image mask to determine the pin position; the pin information includes: pin group size; The initial pin group position is corrected based on the pin position to determine the pin group position; When the size of the pin group is greater than or equal to a preset threshold, the positions of multiple vertices of the pin group are determined according to the position of the pin group. The coordinate difference between each vertex is calculated based on the vertex position, and the horizontal and vertical edge rotation angles of the pin group are determined based on the coordinate difference. The horizontal edge rotation angle and the vertical edge rotation angle are used as the initial rotation angles, and the initial rotation angles of the multiple pin groups are averaged to determine the image rotation angle. The expected position of the pin is determined based on the pre-acquired image rotation angle, the pin information, and the position of the pin group; Defect detection is performed on the connector based on the pin information, the pin position, and the expected pin position.
2. The connection device detection method according to claim 1, characterized in that, The pin information also includes: pin size, pin type, pin group type, and pin shape.
3. The connection device detection method according to claim 2, characterized in that, When the pin type is composite, the pin information also includes: component information; The defect detection of the connector based on the pin information, the pin position, and the expected position of the pin includes: When the pin type is a single type, determine whether the connector has missing pins and / or misaligned pins based on the pin position and the expected pin position; When the pin type is composite, the image of the area where the pin is located in the image of the connector to be tested is segmented to obtain the component position of the component in the pin, and the expected position of the component is determined according to the pin information, the image rotation angle and the pin group position. The connector is then defect-detected by the pin position, the expected position of the pin, the component position and the expected position of the component.
4. The connection device detection method according to claim 3, characterized in that, The segmentation of the image of the connector device image to be tested, in the region where the pins are located, includes: The image of the area where the pin is located is segmented according to the component information and the preset image segmentation algorithm to obtain the component area of each component; The component regions of each component are detected based on a preset target detection algorithm to determine the component location.
5. The connection device detection method according to claim 3 or 4, characterized in that, The component in the pin includes a border and a middle pin, the component position includes a border position and a middle pin position, and the expected position of the component includes: the expected position of the border and the expected position of the middle pin; The defect detection of the connector by means of the pin position, the expected position of the pin, the component position, and the expected position of the component includes: Determine whether the connector has missing pins and / or misaligned pins based on the pin position and the expected pin position; Determine whether the connecting device has a missing border and / or a skewed border based on the border position and the expected position of the border. Based on the position of the intermediate pin and the expected position of the intermediate pin, determine whether the connecting device has a missing intermediate pin and / or a misaligned intermediate pin.
6. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the connection device detection method as described in any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the connection device detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Automatic detection method and device for surface defects of brake pad
CN110473201A
Fiber optic pin check out test set
CN206113865U