CN114882520B - Method, system and equipment for detecting circuit diagram and readable storage medium - Google Patents

Method, system and equipment for detecting circuit diagram and readable storage medium Download PDF

Info

Publication number
CN114882520B
CN114882520B CN202210799761.2A CN202210799761A CN114882520B CN 114882520 B CN114882520 B CN 114882520B CN 202210799761 A CN202210799761 A CN 202210799761A CN 114882520 B CN114882520 B CN 114882520B
Authority
CN
China
Prior art keywords
information
electrical component
wire
circuit diagram
connection relation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210799761.2A
Other languages
Chinese (zh)
Other versions
CN114882520A (en
Inventor
周永乐
袁豪
张志鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Xijiao Zhihui Big Data Technology Co ltd
Original Assignee
Chengdu Xijiao Zhihui Big Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Xijiao Zhihui Big Data Technology Co ltd filed Critical Chengdu Xijiao Zhihui Big Data Technology Co ltd
Priority to CN202210799761.2A priority Critical patent/CN114882520B/en
Publication of CN114882520A publication Critical patent/CN114882520A/en
Application granted granted Critical
Publication of CN114882520B publication Critical patent/CN114882520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/42Document-oriented image-based pattern recognition based on the type of document
    • G06V30/422Technical drawings; Geographical maps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/1444Selective acquisition, locating or processing of specific regions, e.g. highlighted text, fiducial marks or predetermined fields
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/15Cutting or merging image elements, e.g. region growing, watershed or clustering-based techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19107Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Supply And Installment Of Electrical Components (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method, a system, equipment and a readable storage medium for detecting a circuit diagram, wherein the method comprises the steps of obtaining image information, wherein the image information comprises a circuit image of at least one lead and at least two electrical components; extracting first information according to the image information, wherein the first information comprises position information of each wire and coordinate information of a boundary frame of the position of each electrical component; determining effective connection linearity between the wires and the electric components corresponding to the wires according to the position information of each wire and the coordinate information of the boundary box of the position of each electric component to obtain effective connection information of the wires; the connection relation matrix of the electrical components is generated according to the effective connection information of each wire, whether the circuit diagram is connected correctly or not is judged according to the connection relation matrix of the electrical components, and whether the circuit diagram is connected correctly or not is judged by generating the connection relation matrix of the electrical components, so that automatic judgment is realized, and manpower and material resources are reduced.

Description

Method, system and equipment for detecting circuit diagram and readable storage medium
Technical Field
The present invention relates to the field of circuit detection technologies, and in particular, to a method, a system, a device, and a readable storage medium for detecting a circuit diagram.
Background
In the prior art, when students take junior high school physics experimental examinations, a plurality of teachers are often needed to judge and grade the circuit connection conditions of a large number of students, a large amount of manpower physics is wasted, in addition, manual grading has high subjectivity, and the fairness and justness of examination grading can not be effectively guaranteed, so that a method for detecting a circuit diagram connected with the students is needed, and the purpose of improving the accuracy of student grading is achieved by guaranteeing the objectivity of student grading.
Disclosure of Invention
It is an object of the present invention to provide a method, system, device and readable storage medium for detecting a circuit diagram to improve the above-mentioned problems. In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, the present application provides a method of detecting a circuit diagram, the method comprising:
acquiring image information, wherein the image information comprises circuit images of at least one lead and at least two electrical components;
extracting first information according to the image information, wherein the first information comprises position information of each wire and coordinate information of a boundary box of the position of each electrical component;
determining effective connection lines between the wires and the electric components corresponding to the wires according to the position information of each wire and the coordinate information of the boundary box of the position of each electric component to obtain effective connection information of the wires;
and generating an electrical component connection relation matrix according to the effective connection information of each wire, and judging whether the circuit diagram connection is correct or not according to the electrical component connection relation matrix.
In a second aspect, the present application further provides a system for detecting a circuit diagram, the system comprising:
the acquisition module is used for acquiring image information, wherein the image information comprises circuit images of at least one lead and at least two electrical components;
the extraction module is used for extracting first information according to the image information, wherein the first information comprises position information of each wire and coordinate information of a boundary frame of the position of each electrical component;
the determining module is used for determining the effective connection line between the lead and the electric component corresponding to the lead according to the position information of each lead and the coordinate information of the boundary box of the position of each electric component to obtain the effective connection information of the lead;
and the judging module is used for generating an electrical component connection relation matrix according to the effective connection information of each wire and judging whether the circuit diagram connection is correct or not according to the electrical component connection relation matrix.
In a third aspect, the present application further provides a system for detecting a circuit diagram, including:
a memory for storing a computer program;
a processor for implementing the steps of the method of detecting a circuit diagram when executing the computer program.
In a fourth aspect, the present application further provides a readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the above-mentioned method based on detecting a circuit diagram.
The beneficial effects of the invention are as follows:
1. according to the invention, image acquisition is carried out on a circuit diagram connected by students, the target detection model is used for detecting the electric components in the image information to determine the coordinate information of a boundary frame of the positions of the electric components, all pixel points of leads in the image information are obtained through the image segmentation model, interference pixel points in all the pixel points are filtered and guided through the clustering model to obtain a set of the pixel points of the leads, the accuracy of the detection circuit image is ensured, finally, the connection relation between the leads and the components is determined according to the set of the pixel points of the leads and the coordinate information of the boundary frame of the positions of the electric components, and whether the connection of the student middle school physics experiment is correctly detected is realized through an algorithm.
2. The invention can judge whether the connection relation between the electrical component and the lead is correct or not through the working state information of the electrical component, provides a standby detection method for the inevitable prediction error after the lead is sent into the segmentation model, and improves the fault tolerance rate of the method.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flow chart of a method for detecting a circuit diagram according to an embodiment of the present invention;
FIG. 2 is a system diagram of a detection circuit according to an embodiment of the present invention;
fig. 3 is a system structure diagram of the detection circuit diagram according to the embodiment of the present invention.
The labels in the figure are: 701. an acquisition module; 702. an extraction module; 703. a determining module; 704. a judgment module; 7021. a first transmitting unit; 7022. a second transmitting unit; 7023. a first determination unit; 7031. a comparison unit; 7032. a second determination unit; 7033. a first judgment unit; 7041. a first generation unit; 7042. an adjustment unit; 7043. a second generation unit; 7044. a second judgment unit; 70221. a first processing unit; 70222. a second processing unit; 70223. a third processing unit; 800. a device for detecting a circuit diagram; 801. a processor; 802. a memory; 803. a multimedia component; 804. an I/O interface; 805. and a communication component.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not construed as indicating or implying relative importance.
Example 1:
the embodiment provides a method for detecting a circuit diagram, which is used for detecting a scene of a junior middle school physics experiment circuit diagram of a student.
Referring to fig. 1, it is shown that the method comprises step S1, step S2, step S3 and step S4.
S1, obtaining image information, wherein the image information comprises circuit images of at least one lead and at least two electrical components;
it can be understood that the operation desktop of the student is shot by looking down the camera from top to bottom, so that the circuit diagrams connected by the student are all displayed in the shot picture of the camera, one frame of image information acquired by the camera contains the requirement of the image of the lead to be detected to be clear enough, if the lead image is blurred and deformed due to lens shaking or other factors, or the lead cannot be identified by human eyes due to dim shooting conditions, or the state between the lead and the lead is not consistent with the actual state due to severe inclination of the lens, the frame of image needs to be discarded, and whether the image meets the detection requirement or not needs to be judged by means of the total brightness, the ambiguity, the chromatic aberration and the like of the image, so that the frame of image information is selected to be used or discarded.
S2, extracting first information according to the image information, wherein the first information comprises position information of each wire and coordinate information of a boundary frame of the position of each electrical component;
it can be understood that the target detection is performed on the connected circuit diagram through the target detection model Yolov4, and position coordinates of all the components are obtained. And if the target detection model cannot detect all the components, discarding the frame of image, and acquiring another frame of image containing all the components from the camera, wherein the Yolo (You Only Look one) is a neural network target detection algorithm based on the anchor and is trained by methods such as CutMix, mosaic and Self-adaptive. Specifically, the picture may be adjusted to a preset size, for example, 416 × 416 pixels, and then the trained Yolov4 target detection model is input, so as to obtain a rectangular frame with x1, y1, x2, and y2 boundaries of each component, that is, coordinate information of a boundary frame of a position where the electrical component is located, so that the coordinate information of the boundary frame of the position where each electrical component is located is obtained.
It should be understood that Yolov4 used in one embodiment of the present invention is only one of the target detection models, and the target detection algorithm may be classified into one-stage algorithm, such as Yolo algorithm, SSD algorithm, etc., and two-stage algorithm, such as R-CNN algorithm, etc. In multiple tests of an actual environment, yolov4 is enough to cope with complex scene detection in a physical experiment, and specific parameters such as selection of a feature extraction trunk network, a threshold value of non-maximum suppression, a priori box and the like in the Yolov4 can be adjusted to an ideal value by an experimenter, and no specific requirement is made here.
S3, determining effective connection linearity between the conducting wire and the electric component corresponding to the conducting wire according to the position information of each conducting wire and the coordinate information of the boundary box of the position of each electric component to obtain effective connection information of the conducting wire;
it can be understood that whether the conducting wire intersects with the boundary frame of the position of the electrical component or not can be judged according to the position information of each conducting wire and the coordinate information of the boundary frame of the position of each electrical component, if the intersection point exists, the conducting wire is cut at the boundary frame of the position of the electrical component, the intersection point of the conducting wire and the boundary frame is used as an end point, when two end points of one conducting wire are respectively located at the boundary frames of the positions of two different electrical components, the two end points are judged to be effective end points, and therefore effective connection linearity between the conducting wire and the electrical component is determined.
And S4, generating an electrical component connection relation matrix according to the effective connection information of each wire, and judging whether the circuit diagram connection is correct or not according to the electrical component connection relation matrix.
It can be understood that the wires with effective linearity are screened out according to the effective end points after all the effective end points are screened out, the connection relation between the wires and the components can be obtained through the wires with effective linearity, the connection relation is abstracted to obtain an electrical component connection relation matrix, the relation between each electrical component can be visually judged through the electrical component connection relation matrix, and therefore the technical scheme that a teacher needs to subjectively judge to obtain the student experiment scores in the prior art is replaced.
According to the characteristics, the embodiment can realize automatic detection of the junior middle school physical experiment circuit diagram connected by the student, and judges whether the circuit diagram is correctly connected to serve as the basis for scoring by the teacher, so that the problem that the teacher judges whether the circuit diagram is correctly connected to have inevitable subjectivity is effectively avoided.
In a specific embodiment of the present disclosure, the step S2 may further include a step S21, a step S22, and a step S23.
Step S21, inputting the image information into an image segmentation model to obtain a first pixel point set, wherein the first pixel point set comprises a pixel point set of each wire and an interference point pixel set;
s22, sending the first pixel point set to a clustering model to filter the interference point pixel set, and obtaining a second pixel point set;
and S23, obtaining position information corresponding to each wire based on the second pixel point set.
In this embodiment, all pixel points of a wire in an image are acquired through an image segmentation model Unet, specifically, the image segmentation model Unet predicts a background pixel point as 0 and a guide pixel point as 1, and then segmentation of the pixel points of the wire in a circuit diagram can be realized, wherein Unet is a U-shaped structure image segmentation model using skip-connection, is mainly used for medical image segmentation, and is good in image performance with simple image semantics and a fixed structure, and the circuit diagram wire to be segmented just conforms to the applicable scene of Unet.
It should be understood that the Unet used in one embodiment of the present invention is only one of the image segmentation models, and that other image segmentation models such as pspnet, ocrnet, etc. may be adopted by the experimenter depending on the scene complexity and the number and state of the leads to be detected. Specific parameters such as selection of a backbone network, selection of segmentation categories and selection of the number in the Unet are automatically adjusted to ideal values by experimenters, and no specific requirements are made here.
In a specific embodiment of the present disclosure, the step S22 may further include a step S221, a step S222, and a step S223.
Step S221, performing binarization on the circuit image before the image segmentation model is input;
step S222, inputting the binarized circuit diagram into a clustering model for clustering to obtain clustering information, wherein the clustering information comprises first cluster information and second cluster information, the first cluster information is pixel points with the same numerical values and more quantity, and the second cluster information is pixel points with the same numerical values and less quantity;
step S223, filtering second cluster information included in the cluster information to obtain the second pixel set.
In this embodiment, since the image segmentation model Unet predicts the background pixel points as 0 and predicts the conducting wire pixel points as 1, all the pixel points of the conducting wire need to be set to 255 first, and the background pixel points are set to 0, that is, the circuit diagram is binarized; and judging the type with the largest quantity as a wire through a DBSCAN clustering model, judging the other types as noise points, and setting the pixel points to be 0, namely filtering the noise points.
It is understood that DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a Density-Based Clustering algorithm, i.e., points with close distances are classified into one cluster, points with too far distances are classified into another cluster, and points that are not classified into any cluster are isolated points and Noise points.
In this embodiment, when the wire to be detected is located on the paper surface, the Unet image segmentation model predicts that the pixel points of the wire may be the edge of the paper surface, and false detection of impurities on the table, but since the false pixel points are distributed sparsely, the dbss clustering model can be used as noise points to filter out the noise points, and if objects such as pencils are summarized into a cluster of categories by the dbss, which type of wire is determined and which type of false detection is determined according to the number of pixel points in each cluster of categories.
In a specific embodiment of the present disclosure, the step S3 may further include a step S31, a step S32, and a step S33.
S31, comparing the position information of each wire with the coordinate information of the boundary frame of the position of each electrical component to obtain a comparison result;
s32, obtaining endpoint information of the position of the lead and the position of the electrical component corresponding to the lead at the boundary frame according to the comparison result;
and S33, judging whether two end points of the wire are positioned in the boundary frames of the positions of the different electrical components according to the end point information to obtain effective connection information of the wire.
In this embodiment, the convolution kernel of the circuit image is expanded, corroded and refined to obtain a continuous and slender wire, so that the comparison between each pixel point of the wire and the coordinate information of the bounding box of the position of the electrical component is conveniently performed by traversing, and the position of the endpoint is searched to obtain the endpoint information, in addition, when a student has a condition of cross-connecting the wires, for example: the total number of the electrical components A and B is two; the two wires are connected between the electrical components A and B in a cross mode, coordinate information of a boundary frame of positions of the electrical components A and B cannot be influenced, but after the wires are divided, all pixel points of the obtained wires are in a cross and connected distribution, so that after the division, the two wires are actually clustered to be regarded as one wire, and effective endpoints M1, M2, N1 and N2 are judged to be N1, N2, N3 and N4 at the moment. Interpretation as readable language is: the component A is connected with the component A once through N, the component B is connected with the component B once through B, and the component A is connected with the component B twice through N. If the result is output, the wiring diagram matrix of the electrical component is invalid in practice, when one wire has two effective end points and is positioned on different components, the wire can be screened as an effective wiring line, and therefore the crossing condition can be filtered out logically; when students have the condition of connecting wires across electrical components, the wires are divided into two types of conditions, and 1, the long wires are divided and clustered to be judged as two wires; 2. the long wires are divided and clustered to be judged as one wire, and no matter which type of the long wires meets the conditions that only two effective end points exist and the long wires are located on two different components, the long wires can be logically filtered.
In a specific embodiment of the present disclosure, the step S4 may further include a step S41, a step S42, and a step S43.
S41, generating a connection relation series table diagram of the electrical components according to the electrical components;
s42, adjusting the connection relation table diagram of the electrical components according to the effective connection information of each wire;
and S43, generating an electrical component connection relation matrix according to the adjusted electrical component connection relation list chart.
In this embodiment, the first row and the first column of the electrical component connection relation list chart are names corresponding to the electrical components, and the arrangement sequence of the electrical components in the first row is the same as the arrangement sequence of the electrical components in the first column, and according to the effective connection information of each wire, whether a connection relation exists between the electrical components and the electrical components can be obtained, wherein if the connection relation exists once, 1 is added to the corresponding position, and if the connection relation exists twice, 2 is added, after the electrical component connection relation list chart is filled, the connection relation can be abstracted into an electrical component connection relation matrix, the connection relation between the electrical components and the electrical components is displayed through the form of the electrical component connection relation matrix, and whether the circuit diagram of the student is correctly connected can be judged visually and quickly.
In a specific embodiment of the present disclosure, the step S4 may further include a step S44.
Step S44, judging whether the connection relation matrix of the electrical components is a symmetric matrix, wherein if the connection relation matrix of the electrical components is the symmetric matrix, judging whether the connection relation matrix of the electrical components is correct, and judging whether the circuit image connection is correct according to the connection relation matrix of the electrical components; and if the connection relation matrix of the electrical components is not a symmetric matrix, acquiring the state information of the electrical components, and judging whether the circuit image is correctly connected or not according to the working state information of the electrical components.
In this embodiment, the electrical component image set may be obtained by cutting the circuit image according to the coordinate information of the bounding box of the position of each electrical component, and then sending the electrical component image set to the classification model, to obtain the operating state information of each electrical component, and determining whether the circuit image is correctly connected according to the operating state information, where the classification model is a Resnet18 classification model, specifically: the position frames of a current meter are obtained as x1, x2, y1 and y2, and the current value information displayed on the LED screen is extracted by cutting the current frame from the original image and sending the cut current frame to an image recognition Resnet18 classifier. All components have position coordinate information and working state information, wherein the working state information comprises the on-off state of a bulb, the closing state of a switch, voltage value reading information of a voltmeter and current value information of an ammeter.
It can be understood that, because the model has unavoidable prediction error after the wires are sent into the segmentation, and also has the influence of illumination, wire crossing or other linear objects in the lens, it does not exclude that we cannot obtain effective segmentation results of all wires, and under such a condition, we cannot directly obtain the connection condition of the electrical components in place, so a standby method is needed to document the middle school physics experimental circuit diagram connected by students, the invention judges whether the key connection in the circuit image is correct or not according to the working state information of the electrical components, specifically, the known power specification and bulb specification are prepared in advance, so that the ideal current value and voltage value after the bulb is connected into the power supply are calculated in advance, and then the readings of the electronic LED ammeter and voltmeter are continuously read, because the classification model still has errors on the readings of the LED, the readings will "jump", therefore, the condition that the ammeter and the bulb are connected in series is judged: in the case of a light bulb turned on and a switch closed, the reading of the ammeter in more than half of the given opportunity frame is within the previously calculated tolerance interval around the ideal current value, and the bulb is considered to be in series. The condition for judging the parallel connection of the voltmeter and the bulb is as follows: in the case where the bulb is on and the switch is closed, the voltmeter reading in more than half of the given opportunity frame is within the previously calculated tolerance interval around the ideal voltage value, and it is considered as a parallel state. Therefore, whether key connection in the circuit image is correct or not can be judged according to the working state information of the electrical component, the circuit image which cannot be effectively segmented by the lead can be judged through the method, and the fault tolerance rate of the detection circuit diagram is effectively improved.
Example 2:
as shown in fig. 2, the present embodiment provides a system for detecting a circuit diagram, where the system includes an obtaining module 701, an extracting module 702, a determining module 703, and a determining module 704.
The obtaining module 701 is configured to obtain image information, where the image information includes a circuit image of at least one conducting wire and at least two electrical components;
the extracting module 702 is configured to extract first information according to the image information, where the first information includes position information of each wire and coordinate information of a bounding box where each electrical component is located;
the determining module 703 is configured to determine, according to the position information of each wire and the coordinate information of the bounding box of the position where each electrical component is located, an effective connection linearity between the wire and the electrical component corresponding to the wire, so as to obtain effective connection information of the wire;
the determining module 704 is configured to generate an electrical component connection relation matrix according to the effective connection information of each wire, and determine whether the circuit diagram connection is correct according to the electrical component connection relation matrix.
In a specific embodiment of the present disclosure, the extracting module 702 includes a first sending unit 7021, a second sending unit 7022, and a first determining unit 7023.
The first sending unit 7021 is configured to input the image information into an image segmentation model to obtain a first pixel point set, where the first pixel point set includes a pixel point set of each wire and an interference point pixel set;
the second sending unit 7022 is configured to send the first pixel point set to a clustering model to filter the interference point pixel set, so as to obtain a second pixel point set;
the first determining unit 7023 is configured to obtain, based on the second pixel point set, position information corresponding to each conducting wire.
In a specific embodiment of the present disclosure, the second sending unit 7022 includes a first processing unit 70221, a second processing unit 70222, and a third processing unit 70223.
The first processing unit 70221 is configured to binarize the circuit image to which the image segmentation model is input;
the second processing unit 70222 is configured to input the binarized circuit diagram into a clustering model for clustering, so as to obtain clustering information, where the clustering information includes first cluster information and second cluster information, the first cluster information is pixel points with the same numerical values and a large number, and the second cluster information is pixel points with the same numerical values and a small number;
the third processing unit 70223 is configured to filter second cluster information included in the clustering information to obtain the second pixel set.
In a specific embodiment of the present disclosure, the determining module 703 includes a comparing unit 7031, a second determining unit 7032, and a first determining unit 7033.
The comparison unit 7031 is configured to compare the position information of each wire with the coordinate information of the boundary box at the position of each electrical component, so as to obtain a comparison result;
the second determining unit 7032 is configured to obtain, according to the comparison result, end point information of the boundary frame where the lead and the electrical component corresponding to the lead are located;
the first determining unit 7033 is configured to determine, according to the endpoint information, whether two endpoints of the wire are located in a boundary frame of a location where the different electrical component is located, so as to obtain effective connection information of the wire.
In a specific embodiment of the present disclosure, the determining module 704 includes a first generating unit 7041, an adjusting unit 7042, and a second generating unit 7043.
The first generating unit 7041 is configured to generate an electrical component connection relation table diagram according to an electrical component;
the adjusting unit 7042 is configured to adjust the electrical component connection relation table diagram according to the effective connection information of each of the wires;
the second generating unit 7043 is configured to generate an electrical component connection relation matrix according to the adjusted electrical component connection relation list diagram.
In an embodiment of the present disclosure, the determining module 704 further includes a second determining unit 7044.
The second determining unit 7044 is configured to determine whether the electrical component connection relationship matrix is a symmetric matrix, where if the electrical component connection relationship matrix is a symmetric matrix, the electrical component connection relationship matrix is determined to be correct, and whether the circuit image connection is correct is determined according to the electrical component connection relationship matrix; and if the connection relation matrix of the electrical components is not a symmetric matrix, acquiring the state information of the electrical components, and judging whether the circuit image is correctly connected or not according to the working state information of the electrical components.
It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Example 3:
corresponding to the above method embodiment, an apparatus for detecting a circuit diagram is also provided in this embodiment, and the apparatus for detecting a circuit diagram described below and the method for detecting a circuit diagram described above may be referred to correspondingly.
Fig. 3 is a block diagram of an apparatus 800 illustrating a detection circuit diagram according to an exemplary embodiment. As shown in fig. 3, the apparatus 800 of the detection circuit diagram may include: a processor 801, a memory 802. The device 800 of the detection circuit diagram may further include one or more of a multimedia component 803, an I/O interface 804, and a communication component 805.
The processor 801 is configured to control the overall operation of the apparatus 800 for detecting circuit diagram, so as to complete all or part of the steps in the method for detecting circuit diagram. The memory 802 is used to store various types of data to support the operation of the device 800 for detecting circuit diagrams, such as instructions for any application or method operating on the device 800 for detecting circuit diagrams, and application-related data, such as contact data, messaging, pictures, audio, video, and the like. The Memory 802 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically Erasable Programmable Read-Only Memory (EEPROM), erasable Programmable Read-Only Memory (EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 803 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 802 or transmitted through the communication component 805. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the device 800 of the detection circuit diagram and other devices. Wireless communication, such as Wi-Fi, bluetooth, near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding communication component 805 may include: wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the apparatus 800 for detecting a Circuit diagram may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for performing the above method for detecting a Circuit diagram.
In another exemplary embodiment, a computer readable storage medium comprising program instructions is also provided, which when executed by a processor implement the steps of the method of detecting a circuit diagram described above. For example, the computer readable storage medium may be the memory 802 described above comprising program instructions executable by the processor 801 of the apparatus 800 for detecting circuit diagrams to perform the method for detecting circuit diagrams described above.
Example 4:
corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment, and a readable storage medium described below and a method for detecting a circuit diagram described above may be referred to in correspondence with each other.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of detecting a circuit diagram of the above-mentioned method embodiment.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various readable storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method of detecting a circuit pattern, comprising:
acquiring image information, wherein the image information comprises circuit images of at least one lead and at least two electrical components; extracting first information according to the image information, wherein the first information comprises position information of each wire and coordinate information of a boundary frame of the position of each electrical component;
determining effective connection lines between the wires and the electric components corresponding to the wires according to the position information of each wire and the coordinate information of the boundary box of the position of each electric component to obtain effective connection information of the wires;
generating an electrical component connection relation matrix according to the effective connection information of each wire, and judging whether the circuit diagram connection is correct or not according to the electrical component connection relation matrix;
judging whether the conducting wire has an intersection point with the boundary frame of the position of the electrical component according to the position information of each conducting wire and the coordinate information of the boundary frame of the position of each electrical component, if so, cutting off the conducting wire at the boundary frame of the position of the electrical component, taking the intersection point with the boundary frame as an end point, and judging that the two end points are effective end points when the two end points of one conducting wire are respectively positioned at the boundary frames of the positions of two different electrical components, thereby determining the effective connection line between the conducting wire and the electrical component;
the extracting of the first information according to the image information includes:
inputting the image information into an image segmentation model to obtain a first pixel point set, wherein the first pixel point set comprises a pixel point set of each wire and an interference point pixel set;
sending the first pixel point set to a clustering model to filter the interference point pixel set, and obtaining a second pixel point set;
and obtaining the position information corresponding to each wire based on the second pixel point set.
2. The method of claim 1, wherein generating a matrix of electrical component connections from the active connection information for each of the conductive lines comprises:
generating a connection relation series table diagram of the electrical components according to the electrical components;
adjusting the connection relation series table diagram of the electrical components according to the effective connection information of each wire;
and generating an electrical component connection relation matrix according to the adjusted electrical component connection relation list chart.
3. The method for detecting a circuit diagram according to claim 1, wherein the determining effective connection between the conducting wire and the electrical component corresponding to the conducting wire according to the position information of each conducting wire and the coordinate information of the bounding box of the position of each electrical component to obtain the effective connection information of the conducting wire comprises:
comparing the position information of each wire with the coordinate information of the boundary frame of the position of each electrical component to obtain a comparison result;
obtaining the end point information of the position of the lead and the position of the electrical component corresponding to the lead at the boundary frame according to the comparison result;
and judging whether two end points of the wire are positioned in the boundary frames of the positions of the different electrical components according to the end point information to obtain effective connection information of the wire.
4. A system for detecting a circuit diagram, comprising:
the acquisition module is used for acquiring image information, wherein the image information comprises circuit images of at least one lead and at least two electrical components;
the extraction module is used for extracting first information according to the image information, wherein the first information comprises position information of each wire and coordinate information of a boundary frame of the position of each electrical component;
the determining module is used for determining the effective connection line between the lead and the electric component corresponding to the lead according to the position information of each lead and the coordinate information of the boundary box of the position of each electric component to obtain the effective connection information of the lead;
the judging module is used for generating an electrical component connection relation matrix according to the effective connection information of each wire and judging whether the circuit diagram is connected correctly or not according to the electrical component connection relation matrix;
judging whether the conducting wire and the boundary frame of the position of the electrical component have intersection points or not according to the position information of each conducting wire and the coordinate information of the boundary frame of the position of each electrical component, if the intersection points exist, the conducting wire is cut off at the boundary frame of the position of the electrical component, the intersection points with the boundary frame are used as end points, and when two end points of one conducting wire are respectively located at the boundary frames of the positions of two different electrical components, the two end points are judged to be effective end points, so that the effective connection linearity between the conducting wire and the electrical component is determined;
the extraction module comprises:
the first sending unit is used for inputting the image information into an image segmentation model to obtain a first pixel point set, and the first pixel point set comprises a pixel point set of each wire and an interference point pixel set;
the second sending unit is used for sending the first pixel point set to a clustering model to filter the interference point pixel set, so as to obtain a second pixel point set;
and the first determining unit is used for obtaining the position information corresponding to each wire based on the second pixel point set.
5. The system for detecting circuit diagrams according to claim 4, wherein the judging module comprises:
the first generation unit is used for generating an electrical component connection relation series table diagram according to the electrical components;
the adjusting unit is used for adjusting the connection relation table diagram of the electrical component according to the effective connection information of each lead;
and the second generating unit is used for generating an electrical component connection relation matrix according to the adjusted electrical component connection relation list chart.
6. The system for detecting a circuit diagram according to claim 4, wherein said determining module comprises:
the comparison unit is used for comparing the position information of each wire with the coordinate information of the boundary frame of the position of each electrical component to obtain a comparison result;
the second determining unit is used for obtaining the end point information of the position of the lead and the position of the electrical component corresponding to the lead at the boundary frame according to the comparison result;
and the first judgment unit is used for judging whether two end points of the wire are positioned in the boundary frames of the positions of the different electrical components according to the end point information to obtain the effective connection information of the wire.
7. A detection circuit diagram device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of detecting a circuit diagram as claimed in any one of claims 1 to 3 when executing the computer program.
8. A readable storage medium, characterized in that a computer program is stored on the readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of detecting a circuit diagram according to any one of claims 1 to 3.
CN202210799761.2A 2022-07-08 2022-07-08 Method, system and equipment for detecting circuit diagram and readable storage medium Active CN114882520B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210799761.2A CN114882520B (en) 2022-07-08 2022-07-08 Method, system and equipment for detecting circuit diagram and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210799761.2A CN114882520B (en) 2022-07-08 2022-07-08 Method, system and equipment for detecting circuit diagram and readable storage medium

Publications (2)

Publication Number Publication Date
CN114882520A CN114882520A (en) 2022-08-09
CN114882520B true CN114882520B (en) 2022-11-11

Family

ID=82683519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210799761.2A Active CN114882520B (en) 2022-07-08 2022-07-08 Method, system and equipment for detecting circuit diagram and readable storage medium

Country Status (1)

Country Link
CN (1) CN114882520B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833353A (en) * 2020-07-16 2020-10-27 四川九洲电器集团有限责任公司 Hyperspectral target detection method based on image segmentation
CN114594520A (en) * 2022-03-21 2022-06-07 深圳市迈测科技股份有限公司 Foreign matter detection device and method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106355592B (en) * 2016-08-19 2020-06-16 上海葡萄纬度科技有限公司 Educational toy set, circuit element thereof and wire identification method
US20200005468A1 (en) * 2019-09-09 2020-01-02 Intel Corporation Method and system of event-driven object segmentation for image processing
CN111312023B (en) * 2020-03-20 2022-02-08 上海中科教育装备集团有限公司 Device and method for automatically drawing middle school physics circuit experiment circuit diagram
US11244188B2 (en) * 2020-04-10 2022-02-08 Inception Institute of Artificial Intelligence, Ltd. Dense and discriminative neural network architectures for improved object detection and instance segmentation
CN114004267A (en) * 2020-07-28 2022-02-01 重庆邮电大学 Medical image segmentation algorithm based on level set and fuzzy clustering
CN112651984A (en) * 2020-12-31 2021-04-13 深圳开立生物医疗科技股份有限公司 Blood vessel lumen intimal contour extraction method and device, ultrasonic equipment and storage medium
CN114240928B (en) * 2021-12-29 2024-03-01 湖南云箭智能科技有限公司 Partition detection method, device and equipment for board quality and readable storage medium
CN114549993B (en) * 2022-02-28 2022-11-11 成都西交智汇大数据科技有限公司 Method, system and device for grading line segment image in experiment and readable storage medium
CN114677586B (en) * 2022-03-15 2024-04-05 南京邮电大学 Automatic identification method for physical circuit experiment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833353A (en) * 2020-07-16 2020-10-27 四川九洲电器集团有限责任公司 Hyperspectral target detection method based on image segmentation
CN114594520A (en) * 2022-03-21 2022-06-07 深圳市迈测科技股份有限公司 Foreign matter detection device and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
视频中运动电车电线的实时自动检测跟踪算法;刘见昕等;《纳米技术与精密工程》;20170515(第03期);51-57 *

Also Published As

Publication number Publication date
CN114882520A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN111160335B (en) Image watermark processing method and device based on artificial intelligence and electronic equipment
CN110378420A (en) A kind of image detecting method, device and computer readable storage medium
CN109377445B (en) Model training method, method and device for replacing image background and electronic system
CN110517246B (en) Image processing method and device, electronic equipment and storage medium
CN114549993B (en) Method, system and device for grading line segment image in experiment and readable storage medium
CN111598164B (en) Method, device, electronic equipment and storage medium for identifying attribute of target object
CN109344864B (en) Image processing method and device for dense object
CN109951635A (en) It takes pictures processing method, device, mobile terminal and storage medium
CN110348522A (en) A kind of image detection recognition methods and system, electronic equipment, image classification network optimized approach and system
CN110796069B (en) Behavior detection method, system, equipment and machine readable medium
CN112381104A (en) Image identification method and device, computer equipment and storage medium
JP2016191589A (en) Defect classification device defect classification method
EP3852007A2 (en) Method, apparatus, electronic device, readable storage medium and program for classifying video
CN106778670A (en) Gesture identifying device and recognition methods
CN108520263B (en) Panoramic image identification method and system and computer storage medium
CN111967490A (en) Model training method for map detection and map detection method
CN109241962A (en) A kind of character identifying method and device
CN110275820B (en) Page compatibility testing method, system and equipment
CN114882520B (en) Method, system and equipment for detecting circuit diagram and readable storage medium
CN114463197A (en) Text recognition method and equipment for power equipment
CN113127628A (en) Method, device, equipment and computer-readable storage medium for generating comments
CN112052730A (en) 3D dynamic portrait recognition monitoring device and method
JP4993678B2 (en) Interactive moving image monitoring method, interactive moving image monitoring apparatus, and interactive moving image monitoring program
CN108229281A (en) The generation method and method for detecting human face of neural network, device and electronic equipment
CN111274447A (en) Target expression generation method, device, medium and electronic equipment based on video

Legal Events

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