A method and system for automatically detecting power strip connections

By using the halcon software to perform image processing on the power strip connection, the problem of low efficiency in cable insertion detection is solved, and automated detection and efficient connection judgment are achieved.

CN115825102BActive Publication Date: 2025-09-05武汉迈威通信股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211645392.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-09-05
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

Existing technologies have difficulty in effectively detecting whether a cable is fully inserted into a power strip connector, resulting in low manual detection efficiency, high error rate, and high cost.

Method used

Halcon software is used for image processing. The image of the power strip connection is obtained through a camera device, and preprocessing, image segmentation and contour selection are performed. The operator is used to calculate the distance and angle of the cable to determine whether the connection is qualified.

Benefits of technology

It realizes automated detection, adapts to different specifications of cable connectors, improves detection efficiency, reduces labor costs and reduces error rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115825102B_ABST
    Figure CN115825102B_ABST
Patent Text Reader

Abstract

The present invention proposes an automated detection method and system for power strip connections, comprising the following steps: S1: image acquisition; S2: image processing; S3: image segmentation; S4: contour selection; S5: result judgment. The cable connector is inspected based on Halcon, the power strip interface to be inspected is placed on a detection platform, a camera is used to take a photo and sample the image, and then the photo is processed using image processing technology. Whether the connection is qualified is determined based on whether there are cables in the image of the power strip interface, the distance between the upper and lower cables, and the angle between the upper and lower contours of the cable connector and the horizontal axis (determined based on pre-set detection parameters). The detection results of the cable connector are read through a human-machine interface. This method has a simple calculation process and can select contours based on set parameters, making it suitable for detecting cable connectors of different specifications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of connector connection detection, and in particular to a method and system for automatically detecting a power strip connection. Background Art

[0002] With the continuous development of the electronics industry, circuit integration has become increasingly high. Various electronic products have adopted flat cables to connect various circuit interfaces, making the circuits more simple and effective. However, the original flat cables between circuit boards were inserted by machines. This resulted in many cables not being inserted properly, causing the product to malfunction. For example, sometimes the cable was not fully inserted, was inserted at an angle, or was not inserted at all. In the past, inspection work required manual operation, which required electronics factories to hire a large number of workers to complete this work. This not only put financial pressure on electronics factories, but also led to low efficiency and high error rates in manual inspection. Faced with this situation, research on machine inspection of power strip connections is extremely important.

[0003] Halcon is a complete set of standard machine vision algorithm packages with a widely used machine vision integrated development environment. Its flexible architecture facilitates the rapid development of machine vision, medical imaging and image analysis applications. For example, Chinese patent CN115063363A discloses a Halcon-based synchronous ring tooth profile symmetry detection method, which uses the Halcon operator to mirror the tooth profile; calculates the point-by-point distance between the original profile and the mirror profile, the difference in point-by-point distance, and the variance of the point-by-point distance. The calculation process is complicated and tedious, and due to the wide variety of power strips and the different numbers of pinholes, this method cannot be well applied to the automated detection of power strip connections. Summary of the Invention

[0004] In view of this, the present invention proposes a method and system for automatically detecting power strip connections to solve the problem that there are many types of power strips with different numbers of pinholes, which makes it difficult to automatically detect power strip connections.

[0005] The technical solution of the present invention is implemented as follows: On the one hand, the present invention provides a method for automatically detecting power strip connections, which includes the following steps:

[0006] S1: Image acquisition: Use a camera to take a real-time photo of the power strip connection, obtain the original image of the power strip connection, and transfer it to a computer;

[0007] S2: Image processing: Use Halcon software to preprocess the original image of the power strip connection to obtain the preprocessed image;

[0008] S3: Image segmentation: Perform image segmentation on the pre-processed image to segment the power strip connection position image;

[0009] S4: Contour selection: Create an XLD contour to surround the segmented image of the power strip connection position. Select the rectangular contour of the segmented image of the power strip connection position using the set parameter 1. Select the line used for judgment and calculation using the set parameter 2 to obtain the upper and lower line images.

[0010] S5: Determine the result: Determine whether the power strip connection is qualified based on the distance between the upper and lower lines and the angle between the lower line and the horizontal axis, and output the result.

[0011] Based on the above technical solution, preferably, in step S1, the photographing device is a CMOS camera.

[0012] On the basis of the above technical solution, preferably, in step S2, the pre-processing includes:

[0013] Use the operator read_image to read the image, use the operator mean_image to reduce the noise of the read image, and use the operator emphasize to increase the image contrast.

[0014] On the basis of the above technical solution, preferably, in step S3, a method of setting a threshold in a single channel is used to perform image segmentation, specifically including:

[0015] Grayscale processing, threshold limiting, and connectivity processing.

[0016] Based on the above technical solution, preferably, in step S4, after creating the XLD profile, the step further includes:

[0017] The operator smooth_contours_xld is used to smooth the contours, and the image is segmented again after smoothing.

[0018] On the basis of the above technical solution, preferably, in step S4, parameter 1 is set according to different shapes of the cable connector.

[0019] On the basis of the above technical solution, preferably, in step S4, the operator select_obj(SortedContours,ObjectSelected1,2) is used to select the lines used for judgment and calculation.

[0020] On the basis of the above technical solution, preferably, in step S5, the angle a between the line and the horizontal and the distance D between the two straight lines are calculated using the operators angle_ll and distance_pl.

[0021] In another aspect, the present invention provides a system that employs the above-described method for automatically detecting power strip connections, wherein the system comprises:

[0022] An image acquisition module uses a camera to take real-time photos of the power strip connection, obtains the original image of the power strip connection, and transmits it to a computer;

[0023] The image processing module uses the Halcon software to pre-process the original image of the power strip connection to obtain the pre-processed image;

[0024] An image segmentation module performs image segmentation on the preprocessed image to extract the image of the power strip connection position;

[0025] The contour selection module creates an XLD contour to surround the segmented image of the power strip connection position. The rectangular contour of the segmented image of the power strip connection position is selected by the set parameter 1. The line used for judgment calculation is selected by the set parameter 2 to obtain the upper and lower line images.

[0026] The judgment result module judges whether the power strip connection is qualified based on the distance between the upper and lower lines and the angle between the lower line and the horizontal axis and outputs the result.

[0027] The method and system for automatically detecting power strip connections of the present invention have the following advantages over the prior art:

[0028] (1) Based on Halcon, the cable connector is inspected. The cable connector to be inspected is placed on the inspection platform. A camera is used to take a photo and sample the photo. The photo is then processed using image processing technology. The connection is judged to be qualified based on whether there is a cable in the image of the cable connector, the distance between the upper and lower cables, and the angle between the upper and lower contours of the cable connector and the horizontal axis (based on the pre-set inspection parameters). The inspection results of the cable connector are read through the human-machine interface. The calculation process of this method is simple, and the contour can be selected according to the set parameters, which is suitable for the inspection of cable connectors of different specifications.

[0029] (2) Through image segmentation, the parts of the image that are useful for detection are cut out and highlighted, and the parts that are interfering and misleading are removed;

[0030] (3) By setting different parameters according to the different shapes of the cable connectors, the rectangular outline (similar to a rectangle) of the segmented image is selected, and the outline of the connecting part of the cable connector is selected through a specific operator. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0032] Figure 1 This is a flow chart of the method for automatically detecting power strip connections of the present invention;

[0033] Figure 2 Schematic diagram of the automatic detection system for power strip connections of the present invention;

[0034] Figure 3 This is a schematic diagram of the automatic detection instrument for power strip connections of the present invention;

[0035] Figure 4 This is the original image of the camera for automatic detection of power strip connections of the present invention;

[0036] Figure 5 This is a pre-processing diagram for automatic detection of power strip connections according to the present invention;

[0037] Figure 6 This is a profile selection diagram for the automatic detection of power strip connections according to the present invention;

[0038] Figure 7 This is a line diagram of the automatic detection contour of the power strip connection of the present invention;

[0039] Figure 8 This is a diagram for judging the pass / fail status of the automatic detection of power strip connections according to the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0041] Example 1

[0042] like Figure 1 As shown, the present invention provides an automatic detection method for power strip connections, which includes the following steps:

[0043] S1: Image acquisition: Use a camera to take a real-time photo of the power strip connection, obtain the original image of the power strip connection, and transfer it to a computer;

[0044] S2: Image processing: Use Halcon software to preprocess the original image of the power strip connection to obtain the preprocessed image;

[0045] S3: Image segmentation: Perform image segmentation on the pre-processed image to segment the power strip connection position image;

[0046] S4: Contour selection: Create an XLD contour to surround the segmented image of the power strip connection position. Select the rectangular contour of the segmented image of the power strip connection position using the set parameter 1. Select the line used for judgment and calculation using the set parameter 2 to obtain the upper and lower line images.

[0047] S5: Determine the result: Determine whether the power strip connection is qualified based on the distance between the upper and lower lines and the angle between the lower line and the horizontal axis, and output the result.

[0048] This method detects cable connectors based on Halcon. The socket to be tested is placed on the detection platform, and samples are taken with a camera. The photos are then processed using image processing technology. Whether the connection is qualified is determined based on whether there is a cable in the image of the socket, the distance between the upper and lower cables, and the angle between the upper and lower contours of the cable connector and the horizontal axis (based on pre-set detection parameters). The detection results of the cable connector are read through the human-computer interface. This method has a simple calculation process and can select contours according to the set parameters, making it suitable for detecting cable connectors of different specifications.

[0049] Wherein, in step S1, the photographing device is a CMOS camera.

[0050] A high-definition camera is used to capture the connection part of the cable connector, and then the photos are transferred to the computer via a 100M network cable.

[0051] Wherein, in step S2, the preprocessing includes:

[0052] Use the operator read_image to read the image, use the operator mean_image to reduce the noise of the read image, and use the operator emphasize to increase the image contrast.

[0053] In order to improve the quality of the picture, before the captured photo is detected, the original image needs to be preprocessed with a series of noise removal, edge enhancement, automatic white balance, automatic exposure, gamma correction, contrast adjustment, etc. After the preprocessing, the image can be segmented more accurately.

[0054] Wherein, in the step S3, the image segmentation is performed by using a single-channel threshold setting method, which specifically includes:

[0055] Grayscale processing, threshold limiting, and connectivity processing.

[0056] After the image is processed, it is necessary to perform image segmentation. The principle is to highlight the part of the image that is useful for detection and remove the interfering and misleading parts. In image segmentation, single-channel threshold segmentation is used, and the operator threshold(Image:Region:MinGray:Maxgray) can be used to segment the image of the power strip connection position. In the halcon software, the operator threshold is used for grayscale processing, and the threshold range is set to 128-255. After eliminating multiple interferences, the general outline of the cable connector is obtained; then the operator union is used to combine the various areas of the image, and the operator fill_up_shape is used to fill the area; finally, the operator sort_contours_xld is used to sort the contour area to obtain the required straight line.

[0057] Wherein, in said step S4, after creating the XLD profile, the method further comprises:

[0058] The operator smooth_contours_xld is used to smooth the contours, and the image is segmented again after smoothing.

[0059] Because the created contour will have some burrs, the contour needs to be smoothed, and the image is segmented again after smoothing.

[0060] Wherein, in the step S4, parameter 1 is set according to different shapes of the cable connector.

[0061] In this way, the contour can be selected according to the set parameters to adapt to the detection of cable connectors of different specifications. Different parameters are set according to the different shapes of the cable connectors to select the rectangular contour (similar to a rectangle) of the segmented image, and the contour of the connection part of the cable connector is selected through a specific operator.

[0062] In step S4, the operator select_obj(SortedContours,ObjectSelected1,2) is used to select the lines used for judgment and calculation.

[0063] In this way, the upper and lower contours (the upper and lower lines) used for judgment and comparison are selected, and the part of the lines required for the judgment calculation is selected through the operator parameter setting. After a series of processes such as creating XLD contours, selecting contours, and selecting specific objects, the final result is a picture of the upper and lower lines.

[0064] In step S5, the angle a between the line and the horizontal and the distance D between the two straight lines are calculated using the operators angle_ll and distance_pl.

[0065] After obtaining the images of the upper and lower contours, the operators angle_ll and distance_pl can be used to easily calculate the angle a between the line and the horizontal and the distance D between the two lines.

[0066] Angle_ll(::Row1,Column1,Row2,Column2:Angle) The meanings of each parameter are as follows:

[0067] Row1(in): Row coordinate of the starting point of the line.

[0068] Column1(in): The column coordinate of the starting point of the line.

[0069] Row2(in): Row coordinate of the end point of the line.

[0070] Column2(in): The column coordinate of the end point of the line.

[0071] Angle(out): The angle between the line and the horizontal axis.

[0072] distance_pl(::Row, Column, Row1, Column1, Row2, Column2:Distance) The meaning of each parameter is as follows:

[0073] Row(input_control): row coordinates of the point

[0074] Column(input_control); column coordinates of the point.

[0075] Row1 (input_control): row coordinate of the first point of the line.

[0076] Column1 (input_control): Column coordinate of the first point of the line.

[0077] Row2 (input_control): row coordinate of the second point of the line.

[0078] Column2 (input_control): The column coordinate of the second point of the line.

[0079] Distance(output_control): The distance between the point and the line.

[0080] Based on the previously set qualified parameters, and then compared with the parameters obtained after a series of image processing, the parameters set for the strip connector in the picture are as follows: height_min: = 300.0 height_max: = 350.0 detection range, and angle value theta_max: = 1.0; if it is within the qualified parameters, it means that the strip connection is qualified.

[0081] Because the distance between the upper and lower contours of a standard cable connector is d, and the upper and lower contours are parallel to the horizontal axis, the angle between the resulting line and the horizontal axis is a. The maximum distance between the upper and lower contours is distance_max, and the minimum distance is distance_min. If distance_min is greater than height_min and distance_max is less than height_max, the cable connector passes the test; otherwise, it fails the test.

[0082] In this way, the method in this embodiment detects the cable connector based on Halcon, places the position of the power strip interface to be detected on the detection platform, takes pictures and samples through the camera, and then processes the pictures through image processing technology. The connection is judged whether there is a cable in the image of the power strip interface, the distance between the upper and lower cables, and the angle between the upper and lower contours of the cable connector and the horizontal axis (judgment is made based on the pre-set detection parameters), and the detection results of the cable connector are read through the human-computer interface. The calculation process of this method is simple, and the contour can be selected according to the set parameters, which is suitable for the detection of cable connectors of different specifications.

[0083] Example 2

[0084] A system is provided, which adopts the automatic detection method of the power strip connection as described in the first embodiment, such as Figure 2 As shown, wherein the system includes:

[0085] An image acquisition module uses a camera to take real-time photos of the power strip connection, obtains the original image of the power strip connection, and transmits it to a computer;

[0086] The image processing module uses the Halcon software to pre-process the original image of the power strip connection to obtain the pre-processed image;

[0087] An image segmentation module performs image segmentation on the preprocessed image to extract the image of the power strip connection position;

[0088] The contour selection module creates an XLD contour to surround the segmented image of the power strip connection position. The rectangular contour of the segmented image of the power strip connection position is selected by the set parameter 1. The line used for judgment calculation is selected by the set parameter 2 to obtain the upper and lower line images.

[0089] The judgment result module judges whether the power strip connection is qualified based on the distance between the upper and lower lines and the angle between the lower line and the horizontal axis and outputs the result.

[0090] like Figure 3 As shown, the power strip connection automated testing instrument includes a stage, a testing platform, a CMOS camera and a computer. The testing platform is located on the stage. The power strip to be tested is placed on the testing platform, and the camera lens of the CMOS camera is facing the power strip to be tested. The photos taken are transmitted to the computer (digital graphics processor) via a 100M network cable. The photos are processed using the halcon software and the results are output. Figure 4-8 They are camera original image, pre-processing image, contour selection image, contour detection line image, and qualified judgment image.

[0091] In this way, the system in this embodiment detects the cable connector based on Halcon, places the power strip interface to be detected on the detection platform, takes pictures with a camera to take samples, and then processes the pictures through image processing technology. It judges whether the connection is qualified based on whether there is a cable in the image of the power strip interface, the distance between the upper and lower cables, and the angle between the upper and lower contours of the cable connector and the horizontal axis (judgment is based on the pre-set detection parameters), and reads the detection results of the cable connector through the human-computer interface. The system only requires simple equipment (a camera, a computer) to realize automatic detection, greatly increasing detection efficiency and reducing production costs.

[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for automatically detecting power strip connections, characterized in that: The steps include: S1: Image acquisition: Use a camera to take a real-time photo of the power strip connection, obtain the original image of the power strip connection, and transfer it to a computer; S2: Image processing: Use Halcon software to preprocess the original image of the power strip connection to obtain the preprocessed image; S3: Image segmentation: Perform image segmentation on the pre-processed image to segment the power strip connection position image; S4: Contour selection: Create an XLD contour to surround the segmented image of the power strip connection position, select the rectangular contour of the segmented image of the power strip connection position, select the lines used for judgment and calculation, and obtain the upper and lower line images; S5: Determine the result: Determine whether the power strip connection is qualified based on the distance between the upper and lower lines and the angle between the lower line and the horizontal axis, and output the result.

2. The method for automatically detecting power strip connections according to claim 1, wherein: In step S1, the photographing device is a CMOS camera.

3. The method for automatically detecting power strip connections according to claim 1, wherein: In step S2, the pre-processing includes: Use halcon software to read the image, reduce the noise of the read image, and increase the image contrast.

4. The method for automatically detecting power strip connections according to claim 1, wherein: In step S3, image segmentation is performed using a single-channel threshold setting method, specifically including: Grayscale processing, threshold limiting and connectivity processing.

5. The method for automatically detecting power strip connections according to claim 1, wherein: In the step S4, after creating the XLD profile, the following steps are further included: The contour is smoothed, and the image is segmented again after smoothing.

6. The method for automatically detecting power strip connections according to claim 1, wherein: In step S5, the angle a between the line and the horizontal axis and the distance D between the two straight lines are calculated.

7. A system using the method for automatically detecting power strip connections according to any one of claims 1 to 6, characterized in that: The system comprises: An image acquisition module uses a camera to take real-time photos of the power strip connection, obtains the original image of the power strip connection, and transmits it to a computer; The image processing module uses the Halcon software to pre-process the original image of the power strip connection to obtain the pre-processed image; An image segmentation module performs image segmentation on the preprocessed image to extract the image of the power strip connection position; The contour selection module creates an XLD contour to surround the segmented image of the power strip connection position, selects the rectangular contour of the segmented image of the power strip connection position, selects the lines used for judgment and calculation, and obtains the upper and lower line images; The judgment result module judges whether the power strip connection is qualified based on the distance between the upper and lower lines and the angle between the lower line and the horizontal axis and outputs the result.

Citation Information

Patent Citations

  • Synchronizing ring tooth profile symmetry detection method based on halcon

    CN115063363A

  • Visual detection method for screw assembly

    CN111640104A

  • Appearance detection equipment for PDU (Power Distribution Unit) extension socket

    CN214953066U