Assembly detection method of components inside switch cabinet based on machine vision

Through machine vision-based detection methods, the multi-dimensional characteristics of components inside the switch cabinet are calculated, which solves the problem of difficulty in accurately detecting the installation position of components in the prior art, and realizes accurate judgment of the assembly of components inside the switch cabinet.

CN119323569BActive Publication Date: 2025-02-28SHAANXI QT ELECTRIC ENG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411865369.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-02-28
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately detect the installation locations of multiple components inside the switch cabinet and determine whether the assembly is normal.

Method used

Using machine vision-based detection methods, by obtaining the standard circle in the standard assembly drawing and the detection circle in the real-time assembly drawing, multi-dimensional features such as the center position, circle area, symmetry and wiring characteristics are calculated, and the component assembly results are judged.

Benefits of technology

It realizes accurate detection of the installation positions of multiple components inside the switch cabinet, and can accurately determine whether the assembly of components inside the electrical cabinet is normal, and problems such as misinstallation, missing installation, wiring errors or missing screws are found.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure QLYQS_4
    Figure QLYQS_4
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and in particular to a method for detecting the assembly of components inside a switch cabinet based on machine vision, the method comprising: obtaining standard circles in a standard assembly drawing, taking the circumscribed rectangle containing all standard circles on the same component as the component area of ​​the component, and obtaining the multi-dimensional features of each standard circle; collecting detection circles in a real-time assembly drawing, responding to the number of detection circles in any component area not being equal to the number of standard circles, the assembly result of the component area is abnormal, otherwise, the similarity and similarity threshold of the multi-dimensional features between the detection circles and the standard circles in the component area are compared to obtain the assembly result of the component area. Through the technical solution of the present application, it is possible to accurately determine whether the assembly of components inside an electrical cabinet is normal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method for detecting assembly of components inside a switch cabinet based on machine vision. Background Art

[0002] The switchgear is an important component used to control, protect and monitor electrical equipment in the power system. It plays an important role in opening and closing power lines, protecting lines from faults, and monitoring operating power data. The switchgear contains a large number of components. The installation position and wiring method of each component directly affect the operating status of the switchgear. Therefore, after completing the assembly of components in the switchgear, it is necessary to perform assembly inspection on the internal components to determine whether the assembly is normal.

[0003] At present, a patent application document with publication number CN110247328A discloses a method for position determination in a switch cabinet based on image recognition, the method comprising: using an image capture device to obtain images of the switch cabinet, the position of the chassis vehicle, the position of the valve and the position of the grounding switch; after the obtained images are recognized by image recognition software, it is determined whether the position of the chassis vehicle, the position of the valve and the position of the grounding switch in the switch cabinet are in the specified positions; when the image recognition software determines that one or more of the position of the chassis vehicle, the position of the valve and the position of the grounding switch in the switch cabinet are not in the specified positions, an alarm signal is issued.

[0004] The above method directly uses image recognition software to determine whether the chassis position, valve position and grounding switch position in the switch cabinet are in the specified position. However, no specific judgment method is given. In addition, there are a large number of components in the switch cabinet, and there are electrical connections between them. How to detect the installation positions of multiple internal components of the switch cabinet and accurately determine whether the assembly of the components inside the electrical cabinet is normal is an urgent problem to be solved. Summary of the invention

[0005] In order to solve the technical problem of how to detect the installation positions of multiple internal components of a switch cabinet, the present application provides a switch cabinet internal component assembly detection method based on machine vision, which can obtain the installation positions of multiple internal components of the switch cabinet, and then accurately determine whether the assembly of the internal components of the electrical cabinet is normal.

[0006] In a first aspect of the present application, a method for detecting assembly of components inside a switch cabinet based on machine vision is provided, the method comprising: obtaining standard circles in a standard assembly drawing, taking a circumscribed rectangle containing all standard circles on the same component as a component area of ​​the component, and obtaining multidimensional features of each standard circle, the multidimensional features including a center position, a circle area, symmetry, and wiring features; collecting detection circles in a real-time assembly drawing, and in response to the number of detection circles in any component area not being equal to the number of standard circles, the assembly result of the component area is abnormal, and vice versa, comparing the multidimensional features between the detection circles and the standard circles in the component area. The similarity and similarity threshold of the features are used to obtain the assembly result of the component area; the method for obtaining the symmetry includes: dividing the circular area into multiple sub-areas along the diameter in the vertical direction, calculating the sum of the gradient directions of each pixel in each sub-area, and taking the variance of the sum of the gradient directions as the symmetry; the method for obtaining the wiring feature includes: calculating the area proportion of each preset color in the neighborhood range of the circular area; in response to the area proportion of each preset color being less than the proportion threshold, the wiring feature is unconnected, otherwise, the preset color with the largest area proportion is taken as the wiring feature; the circular area is a standard circle or a detection circle.

[0007] First, the standard assembly drawing after assembly according to the assembly standard is collected, the standard circles in the standard assembly drawing are obtained, the standard circles belonging to the same components are marked, and the circumscribed rectangle containing all the standard circles on the same components is used as the component area of ​​the component to obtain the installation positions of multiple internal components of the switch cabinet; the multi-dimensional features of each standard circle are obtained, and the multi-dimensional features include the center position, circle area, symmetry and wiring features, wherein symmetry is used to indicate the degree of symmetry of the grayscale information in the standard circle, and symmetry can reflect the rotation angle of the screw in the screw hole under the tightening state. Taking symmetry as one of the multi-dimensional features, it can reflect the tightness of the screws in each screw hole in the real-time assembly drawing, and whether there are screws; the wiring feature is used to indicate the wiring method of the standard circle; further, the detection circles in the real-time assembly drawing are collected, if the number of detection circles in a component area is not equal to the number of standard circles, the assembly result of the component area can be directly obtained, otherwise, the multi-dimensional features of the detection circles in the component area are obtained, the similarity of the multi-dimensional features between the detection circles and the standard circles in the component area is calculated, and it is judged whether the real-time assembly drawing in the component area is similar to the standard assembly drawing, and the assembly result of the component area is obtained.

[0008] Preferably, the obtaining of the standard circle in the standard assembly drawing comprises: performing Hough circle detection on the standard assembly drawing, and taking the detected circular contour as the standard circle.

[0009] Preferably, the method of obtaining a standard circle in a standard assembly drawing comprises: performing Hough circle detection on the standard assembly drawing to obtain a plurality of initial contours; calculating the edge strength of each pixel point in a rectangle adjacent to the contour point in the initial contour, and replacing the pixel point with the maximum edge strength with a new contour point, wherein the edge strength is positively correlated with the gradient value; fitting each contour point using the least squares method, using the fitting result as a modified contour, and using all modified contours as a standard circle.

[0010] The accuracy of the standard circle directly affects the accuracy of the assembly results. Considering the influence of noise information in the standard assembly diagram on Hough circle detection, in order to ensure the accuracy of the standard circle, after obtaining the detection results of the Hough circle detection, the initial contour is corrected by replacing the pixel points with the largest edge intensity in the adjacent rectangle with the contour points.

[0011] Preferably, the contour points Edge Strength for: , For contour points The gradient value of For contour points The gradient direction of From the contour point The direction vector pointing to the center of the initial contour circle, is the gradient direction and direction vector The cosine of the angle between them.

[0012] Contour Points The larger the gradient value, the smaller the contour point The greater the probability of being an edge point; when the contour point The gradient direction and direction vector When the angle between the two points approaches 0, it indicates that the contour point The greater the possibility of being a contour point on a true circular contour, the more likely it is that the comprehensive gradient value, as well as the gradient direction and direction vector Calculate the contour point by the angle Edge Strength , edge strength The larger the contour point The greater the probability of being an edge point on a circular contour.

[0013] Preferably, the loss function in the least squares fitting is for:

[0014] , are all the contour points in the initial contour, For contour points The edge strength, is the sum of the edge strengths of all contour points in the initial contour, is the intensity threshold, For contour points The location coordinates of For Center is the modified profile of the radius, for Distance to the corrected contour.

[0015] For contour points If the normalized edge strength is less than the strength threshold, it means that the contour point in the initial contour Points that are not on the true circular contour are not considered in the process of calculating the least squares error fitting correction contour. , improving the accuracy of corrected contour.

[0016] Preferably, taking the circumscribed rectangle containing all standard circles on the same component as the component area of ​​the component includes: obtaining the center coordinates of all standard circles on any component; and constructing the component area of ​​the component according to the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate of all the center coordinates.

[0017] Preferably, dividing the circular area into a plurality of sub-areas along the diameter in the vertical direction comprises: drawing a plurality of line segments perpendicular to the diameter in the vertical direction, and the spacing between the plurality of line segments is equal; and the area between adjacent line segments is a sub-area.

[0018] Preferably, before collecting the detection circle in the real-time assembly drawing, the detection method further comprises: performing a projection transformation on the real-time assembly drawing, and obtaining the real-time assembly drawing after the projection transformation when the projection error is minimized, wherein the projection error is the Euclidean distance between the real-time assembly drawing and the standard assembly drawing.

[0019] There is a difference between the perspective when collecting the real-time assembly drawing and the perspective of the standard assembly drawing. In order to avoid the difference in perspective affecting the accuracy of the assembly result, the real-time assembly drawing is projected and transformed. The projection transformation includes rotation, translation, scaling and perspective transformation. When the projection error is the smallest, it means that the real-time assembly drawing is at the same perspective as the standard assembly drawing.

[0020] Preferably, the method for obtaining the similarity of multi-dimensional features between the detection circle and the standard circle in the component area includes: calculating the center distance between the detection circle and each unmarked standard circle, marking the standard circle corresponding to the minimum center distance and using it as the matching circle of the detection circle; component area Similarity of multidimensional features between inner detection circle and standard circle for:

[0021] , For the component area The number of inner detection circles, To detect the circle The multi-dimensional features of To detect the circle Matching the multi-dimensional features of the circle, represents the Euclidean distance.

[0022] Preferably, the similarity and similarity threshold of the multidimensional features between the detection circle and the standard circle in the component area are compared to obtain the assembly result of the component area, including: in response to the similarity being greater than or equal to the similarity threshold, the assembly result of the component area is normal, otherwise, the assembly result of the component area is abnormal.

[0023] The technical solution of this application has the following beneficial technical effects:

[0024] First, the standard assembly drawing after assembly according to the assembly standard is collected, the standard circles in the standard assembly drawing are obtained, the standard circles on the same components are marked, and the circumscribed rectangle containing all the standard circles on the same components is used as the component area of ​​the components to obtain the installation positions of multiple internal components of the switch cabinet; the multidimensional features of each standard circle are obtained, and the multidimensional features include the center position, circle area, symmetry and wiring features, among which symmetry is used to represent the symmetry degree of grayscale information in the standard circle, and symmetry can reflect the rotation angle of the screw in the screw hole when it is tightened. Taking symmetry as one of the multidimensional features, it can reflect the tightness of the screws in each screw hole in the real-time assembly drawing. and the presence or absence of screws; the wiring features are used to indicate the wiring method of the standard circle; further, the detection circles in the real-time assembly drawing are collected. If the number of detection circles in a component area is not equal to the number of standard circles, the assembly result of the component area can be directly obtained. Otherwise, the multi-dimensional features of the detection circles in the component area are obtained, and the similarity of the multi-dimensional features between the detection circles and the standard circles in the component area is calculated to determine whether the real-time assembly drawing in the component area is similar to the standard assembly drawing, and the assembly result of the component area is obtained. When there are assembly problems such as wrong installation, missing installation, wiring errors or missing screws in the components in the real-time assembly drawing, the assembly result is abnormal, and it can accurately determine whether the assembly of components inside the electrical cabinet is normal. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0026] Figure 1It is a flow chart of a method for detecting assembly of components inside a switch cabinet based on machine vision according to an embodiment of the present application.

[0027] Figure 2 It is a schematic diagram of dividing a circular area into multiple sub-areas according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0029] It should be understood that when the terms "first", "second", etc. are used in the claims, specification and drawings of the present application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0030] According to a first aspect of the present application, the present application provides a method for detecting assembly of components inside a switch cabinet based on machine vision. Figure 1 FIG. 1 is a flow chart of a method for detecting assembly of components inside a switch cabinet based on machine vision according to an embodiment of the present application. Figure 1 As shown, the switch cabinet internal component assembly detection method based on machine vision includes steps S101 to S102, which are described in detail below.

[0031] S101, obtaining standard circles in a standard assembly drawing, taking a circumscribed rectangle containing all standard circles on the same component as a component area of ​​the component, and obtaining multidimensional features of each standard circle, the multidimensional features including center position, circle area, symmetry and wiring features.

[0032] In one embodiment, the types, quantities and connection methods of components in the switch cabinet need to meet assembly standards. The standard assembly drawing is an image of the interior of the switch cabinet assembled according to the assembly standards. The standard assembly drawing is a grayscale image.

[0033] The standard assembly drawing includes multiple components, and each component includes a circular outline of a screw hole, an indicator light, etc. The circular outline in the standard assembly drawing is obtained as a standard circle in the quasi-assembly drawing.

[0034] Specifically, the obtaining of the standard circle in the standard assembly drawing includes: performing Hough circle detection on the standard assembly drawing, and taking the detected circular contour as the standard circle.

[0035] In another embodiment, the accuracy of the standard circle directly affects the accuracy of the assembly result. Considering the influence of noise information in the standard assembly diagram on the Hough circle detection, in order to ensure the accuracy of the standard circle, after obtaining the detection result of the Hough circle detection, the detection result needs to be corrected.

[0036] Specifically, the method for obtaining the standard circle in the standard assembly drawing includes: performing Hough circle detection on the standard assembly drawing to obtain multiple initial contours; calculating the edge strength of each pixel point in the adjacent rectangle of the contour point in the initial contour, and replacing the pixel point with the largest edge strength with a new contour point, wherein the edge strength is positively correlated with the gradient value; fitting each contour point using the least squares method, using the fitting result as the corrected contour, and using all corrected contours as the standard circle. Among them, the gradient value of the contour point can be used as the edge strength. The adjacent rectangle of the contour point is a 3×3 rectangular area centered on the contour point, and the rectangular area contains a total of 9 pixels including the contour point itself.

[0037] Among them, the contour points Edge Strength for: , For contour points The gradient value of For contour points The gradient direction of From the contour point The direction vector pointing to the center of the initial contour circle, is the gradient direction and direction vector The cosine of the angle between them.

[0038] Understandably, when the contour point The gradient direction and direction vector When the angle between the two points approaches 0, it indicates that the contour point The greater the possibility of being a contour point on the true circular contour. The initial contour is corrected by replacing the contour point with the pixel point with the largest edge strength in the adjacent rectangle. The replaced new contour point can be the original contour point or other pixel points outside the original contour point in the adjacent rectangle.

[0039] Among them, the loss function in the least squares fitting is for:

[0040] , are all the contour points in the initial contour, For contour points The edge strength, is the sum of the edge strengths of all contour points in the initial contour, is the intensity threshold, For contour points The location coordinates of For Center is the modified profile of the radius, for The distance to the corrected contour. The value of the intensity threshold is 0.5; thus, For contour points If the normalized edge strength is less than the strength threshold, it means that the contour point in the initial contour Points that are not on the true circular contour are not considered in the process of calculating the least squares error fitting correction contour. , improving the accuracy of corrected contour.

[0041] In other embodiments, the loss function in the least squares fitting method may also directly adopt the mean square error function.

[0042] In this way, multiple standard circles are obtained in the standard assembly diagram.

[0043] In one embodiment, all standard circles are grouped, and the standard circles on the same component belong to the same group, and the circumscribed rectangles of all standard circles in the same group are used as the component area of ​​the corresponding component. That is, one component area contains all standard circles on the corresponding component. Specifically, the center coordinates of all standard circles on any component are obtained, and the component area of ​​the component is constructed according to the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate, and the minimum vertical coordinate of all the center coordinates.

[0044] In one embodiment, a standard circle corresponds to a multi-dimensional feature, and the multi-dimensional feature includes the center position, the area of ​​the circle, symmetry and connection characteristics. The center position and the area of ​​the circle are well-known technologies in the art and will not be described in detail here.

[0045] The symmetry is used to indicate the degree of symmetry of the grayscale information within the standard circle. The standard circle includes a screw hole and an indicator light. The indicator light generally has good symmetry, and the symmetry of the screw hole is related to the state of the screw. Therefore, the symmetry of the standard circle can reflect the rotation angle of the screw in the screw hole when it is tightened. Taking symmetry as one of the multidimensional features, it can reflect the tightness of the screws in each screw hole in the real-time assembly diagram, as well as the presence or absence of screws. Specifically, the method for obtaining the symmetry includes: dividing the circular area into multiple sub-areas along the diameter in the vertical direction, calculating the sum of the gradient directions of each pixel point in each sub-area, and taking the variance of the sum of the gradient directions as the symmetry; the circular area is a standard circle or a detection circle.

[0046] It can be understood that when the variance of the sum of the gradient directions is equal to 0, each sub-region has good symmetry, and the circular region has good symmetry.

[0047] Among them, see Figure 2 , is a schematic diagram of dividing a circular area into multiple sub-areas according to an embodiment of the present application. The dividing of the circular area into multiple sub-areas along the diameter in the vertical direction includes: drawing multiple line segments perpendicular to the diameter in the vertical direction, and the spacing between the multiple line segments is equal; the area between adjacent line segments is a sub-area. In the embodiment of the present application, the spacing between the multiple line segments is 1.

[0048] The wiring feature is used to indicate the wiring method of the standard circle; in the electrical wiring standard, wires of different colors are used to connect different circuits or equipment to facilitate electricians to perform correct wiring and maintenance. For example, blue represents the neutral wire, red represents the live wire, and yellow-green represents the ground wire. In other words, different preset colors correspond to different wiring methods. Specifically, the method for obtaining the wiring feature includes: calculating the area proportion of each preset color in the neighborhood range of the circular area; in response to the area proportion of each preset color being less than the proportion threshold, the wiring feature is unconnected, otherwise, the preset color with the largest area proportion is used as the wiring feature; the circular area is a standard circle or a detection circle.

[0049] The neighborhood range of the circular area is a ring area; the ring area is the range of the circular area enlarged by 1.2 times and then subtracted from the circular area. The proportion threshold is 0.01. When the area proportion of each preset color is less than the proportion threshold, it means that there is no preset color in the neighborhood range of the circular area, the circular area is not connected, and the connection feature is set to any color other than the preset color.

[0050] In this way, the component area of ​​each component in the standard assembly drawing is obtained, and each component area contains multiple standard circles. Each standard circle corresponds to the center position, circle area, symmetry and wiring characteristics, providing a data basis for subsequent judgment of whether the assembly result is normal.

[0051] S102, collecting detection circles in the real-time assembly diagram, in response to the number of detection circles in any component area being not equal to the number of standard circles, the assembly result of the component area is abnormal, otherwise, the similarity and similarity threshold of the multi-dimensional features between the detection circles and the standard circles in the component area are compared to obtain the assembly result of the component area.

[0052] In one embodiment, before collecting the detection circle in the real-time assembly drawing, the detection method further includes: performing a projection transformation on the real-time assembly drawing, and obtaining the real-time assembly drawing after the projection transformation when the projection error is minimized, wherein the projection error is the Euclidean distance between the real-time assembly drawing and the standard assembly drawing.

[0053] It can be understood that there is a difference between the perspective when collecting the real-time assembly drawing and the perspective of the standard assembly drawing. In order to avoid the difference in perspective affecting the accuracy of the assembly result, the real-time assembly drawing is projected and transformed. The projection transformation includes rotation, translation, scaling and perspective transformation. When the projection error is the smallest, it means that the real-time assembly drawing is at the same perspective as the standard assembly drawing.

[0054] In one embodiment, detection circles in the real-time assembly diagram are obtained. Since the component area has been pre-acquired and is fixed, for any component area, if the number of detection circles is not equal to the number of standard circles, it means that the components corresponding to the component area are misassembled or missing, and the assembly result of the component area is abnormal, and the assembly result is directly obtained; if the number of detection circles is equal to the number of standard circles, the multi-dimensional features of the detection circles in the component area are obtained to further determine the assembly result.

[0055] The method for obtaining the similarity of the multi-dimensional features between the detection circle and the standard circle in the component area includes: calculating the center distance between the detection circle and each unmarked standard circle, marking the standard circle corresponding to the minimum center distance and using it as the matching circle of the detection circle; Similarity of multidimensional features between inner detection circle and standard circle for: , For the component area The number of inner detection circles, To detect the circle The multi-dimensional features of To detect the circle Matching the multi-dimensional features of the circle, represents the Euclidean distance.

[0056] It can be understood that, since the number of detection circles is equal to the number of standard circles, one detection circle corresponds to one matching circle.

[0057] In one embodiment, the similarity and similarity threshold of the multi-dimensional features between the detection circle and the standard circle in the component area are compared to obtain the assembly result of the component area, including: in response to the similarity being greater than or equal to the similarity threshold, the assembly result of the component area is normal, otherwise, the assembly result of the component area is abnormal.

[0058] In this way, after the assembly of the switch cabinet is completed, the real-time assembly drawing is collected. When there are assembly problems such as wrong installation, missing installation, wiring error or missing screws in the real-time assembly drawing, the assembly result is abnormal, reminding the personnel to inspect the corresponding component area to ensure the accurate assembly of the switch cabinet.

[0059] The above introduces the technical principles and implementation details of a machine vision-based method for detecting the assembly of internal components of a switch cabinet of the present application through specific embodiments. First, collect the standard assembly drawing after the assembly is completed according to the assembly standard, obtain the standard circles in the standard assembly drawing, mark the standard circles on the same components, and use the circumscribed rectangle containing all standard circles on the same components as the component area of ​​the components to obtain the installation positions of multiple internal components of the switch cabinet; obtain the multidimensional features of each standard circle, which include the center position, circle area, symmetry and wiring features, among which symmetry is used to indicate the degree of symmetry of the grayscale information within the standard circle, and symmetry can reflect the rotation angle of the screw in the screw hole when it is tightened. Taking symmetry as one of the multidimensional features can reflect the tightness of the screws in each screw hole in the real-time assembly drawing. and the presence or absence of screws; the wiring features are used to indicate the wiring method of the standard circle; further, the detection circles in the real-time assembly drawing are collected. If the number of detection circles in a component area is not equal to the number of standard circles, the assembly result of the component area can be directly obtained. Otherwise, the multi-dimensional features of the detection circles in the component area are obtained, and the similarity of the multi-dimensional features between the detection circles and the standard circles in the component area is calculated to determine whether the real-time assembly drawing in the component area is similar to the standard assembly drawing, and the assembly result of the component area is obtained. When there are assembly problems such as wrong installation, missing installation, wiring errors or missing screws in the components in the real-time assembly drawing, the assembly result is abnormal, and it can accurately determine whether the assembly of components inside the electrical cabinet is normal.

[0060] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0061] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.

Claims

1. A switch cabinet internal component assembly detection method based on machine vision, characterized in that: The detection method comprises: Obtaining standard circles in a standard assembly drawing, taking the circumscribed rectangle containing all standard circles on the same component as the component area of ​​the component, and obtaining multi-dimensional features of each standard circle, the multi-dimensional features including the center position, circle area, symmetry and wiring features; Performing projection transformation on the real-time assembly drawing, obtaining the real-time assembly drawing after projection transformation when the projection error is minimum, wherein the projection error is the Euclidean distance between the real-time assembly drawing and the standard assembly drawing, collecting detection circles in the real-time assembly drawing, and responding that the number of detection circles in any component area is not equal to the number of standard circles, the assembly result of the component area is abnormal, otherwise, comparing the similarity of multi-dimensional features between the detection circles and the standard circles in the component area and the similarity threshold, obtaining the assembly result of the component area; The method for obtaining the similarity of the multi-dimensional features between the detection circle and the standard circle in the component area includes: calculating the center distance between the detection circle and each unmarked standard circle, marking the standard circle corresponding to the minimum center distance and using it as the matching circle of the detection circle; Similarity of multidimensional features between inner detection circle and standard circle for: , For the component area The number of inner detection circles, To detect the circle The multi-dimensional features of To detect the circle Matching the multi-dimensional features of the circle, represents the Euclidean distance; The method for acquiring the symmetry includes: dividing the circular area into a plurality of sub-areas along the diameter in the vertical direction, calculating the sum of the gradient directions of each pixel point in each sub-area, and taking the variance of the sum of the gradient directions as the symmetry; the method for acquiring the connection feature includes: calculating the area proportion of each preset color in the neighborhood range of the circular area; in response to the area proportion of each preset color being less than a proportion threshold, the connection feature is unconnected, otherwise, the preset color with the largest area proportion is taken as the connection feature; the circular area is a standard circle or a detection circle; The method for obtaining a standard circle in a standard assembly diagram comprises: performing Hough circle detection on the standard assembly diagram to obtain a plurality of initial contours; calculating the edge strength of each pixel point in a rectangle adjacent to the contour point in the initial contour, and replacing the pixel point with the maximum edge strength with a new contour point, wherein the edge strength is positively correlated with the gradient value; fitting each contour point using the least squares method, taking the fitting result as a modified contour, and taking all the modified contours as a standard circle; Contour Points Edge Strength for: , For contour points The gradient value of For contour points The gradient direction of From the contour point The direction vector pointing to the center of the initial contour circle, is the gradient direction and direction vector The cosine of the angle between The loss function in the least squares fitting for: , are all the contour points in the initial contour, For contour points The edge strength, is the sum of the edge strengths of all contour points in the initial contour, is the intensity threshold, For contour points The location coordinates of For Center is the modified profile of the radius, for distance to the corrected contour; For contour points If the normalized edge strength is less than the strength threshold, it means that the contour point in the initial contour Points that are not on the true circular contour are not considered in the process of calculating the least squares error fitting correction contour. , improving the accuracy of corrected contour.

2. The machine vision-based switch cabinet internal component assembly detection method according to claim 1, characterized in that: The obtaining of the standard circle in the standard assembly drawing comprises: Perform Hough circle detection on the standard assembly image and use the detected circular contour as the standard circle.

3. The method for detecting assembly of components inside a switch cabinet based on machine vision according to claim 1, characterized in that: The method of using the circumscribed rectangle containing all standard circles on the same component as the component area of ​​the component includes: The center coordinates of all standard circles on any component are obtained; and the component area of ​​the component is constructed according to the maximum abscissa, the minimum abscissa, the maximum ordinate and the minimum ordinate of all the center coordinates.

4. The method for detecting assembly of components inside a switch cabinet based on machine vision according to claim 1, characterized in that: The diameter along the vertical direction divides the circular area into a plurality of sub-areas, including: Draw multiple line segments perpendicular to the vertical diameter, and the spacing between the multiple line segments is equal; The area between adjacent line segments is a sub-area.

5. The method for detecting assembly of components inside a switch cabinet based on machine vision according to claim 1, characterized in that: Comparing the similarity and similarity threshold of the multi-dimensional features between the detection circle and the standard circle in the component area to obtain the assembly result of the component area includes: In response to the similarity being greater than or equal to a similarity threshold, the assembly result of the component region is normal; otherwise, the assembly result of the component region is abnormal.

Citation Information

Patent Citations

  • Wafer defect detection method based on characteristic matching

    CN106600600A

  • Position judgment method based on image recognition in switch cabinet

    CN110247328A