CN118135294A - Method, system, device and medium for identifying circuit connection relationship - Google Patents
Method, system, device and medium for identifying circuit connection relationship Download PDFInfo
- Publication number
- CN118135294A CN118135294A CN202410206019.5A CN202410206019A CN118135294A CN 118135294 A CN118135294 A CN 118135294A CN 202410206019 A CN202410206019 A CN 202410206019A CN 118135294 A CN118135294 A CN 118135294A
- Authority
- CN
- China
- Prior art keywords
- wire
- terminal
- terminals
- experimental
- ratio
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000001514 detection method Methods 0.000 claims abstract description 27
- 238000012216 screening Methods 0.000 claims abstract description 16
- 238000004590 computer program Methods 0.000 claims description 9
- 230000006870 function Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 239000004020 conductor Substances 0.000 description 4
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000010223 real-time analysis Methods 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003990 capacitor Substances 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Medical Informatics (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Tests Of Electronic Circuits (AREA)
- Testing Or Measuring Of Semiconductors Or The Like (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及电路检测领域,特别涉及一种电路连接关系的识别方法、系统、设备和介质。The present invention relates to the field of circuit detection, and in particular to a method, system, device and medium for identifying circuit connection relations.
背景技术Background technique
在电学实验中,实验器件的布置往往较为随机,有时这些实验器件会被放置得很近。再加上导线可能相对较长,这就导致长导线在视觉上会穿过多个实验器件,增加了判断导线两端所连接实验器件的难度,也就是确定实验器件间的连接关系变得更加困难。目前对这一问题的解决方法是从导线识别框内识别出的多个接线柱中,选择距离最远的一对接线柱,将其确定为与导线实际相连的接线柱。然而,这种方法存在局限性:当两个实验器件摆放得非常近时,错误的接线柱可能与导线识别框相交,导致它被错误地识别为与导线另一端所连接的接线柱,从而造成误判。因此,需要提供一种电路连接关系的识别方法、系统、设备和介质。In electrical experiments, the arrangement of experimental devices is often relatively random, and sometimes these experimental devices are placed very close to each other. In addition, the wire may be relatively long, which causes the long wire to visually pass through multiple experimental devices, increasing the difficulty of judging the experimental devices connected to the two ends of the wire, that is, it becomes more difficult to determine the connection relationship between the experimental devices. The current solution to this problem is to select the farthest pair of terminals from the multiple terminals identified in the wire identification frame, and determine them as the terminals actually connected to the wire. However, this method has limitations: when two experimental devices are placed very close, the wrong terminal may intersect with the wire identification frame, causing it to be mistakenly identified as the terminal connected to the other end of the wire, resulting in a misjudgment. Therefore, it is necessary to provide a method, system, device and medium for identifying circuit connection relationships.
发明内容Summary of the invention
本发明提供一种电路连接关系的识别方法。以解决现有技术中实验电路图像中各个实验器件的连接识别不准确的问题。The present invention provides a method for identifying circuit connection relationships, so as to solve the problem of inaccurate connection identification of various experimental devices in an experimental circuit image in the prior art.
本发明提供的一种电路连接关系的识别方法,包括:获取实验电路图像;将所述实验电路图像输入至目标检测模型,识别出所述实验电路图像中出现的各个实验器件、导线以及与导线连接的接线柱;其中,每个实验器件上至多有两个与导线连接的接线柱,所述目标检测模型为YOLO系列模型;对于每个导线:计算导线和各个接线柱的交并比,并依据计算的交并比筛选出与导线连接的接线柱;基于筛选的接线柱,确定与接线柱连接的实验器件;将识别出的各个接线柱、实验器件和导线依据各自的连接关系进行连接,形成电路回路。The present invention provides a method for identifying circuit connection relationships, comprising: acquiring an experimental circuit image; inputting the experimental circuit image into a target detection model to identify various experimental devices, wires, and terminals connected to the wires that appear in the experimental circuit image; wherein each experimental device has at most two terminals connected to the wires, and the target detection model is a YOLO series model; for each wire: calculating the intersection-and-joint ratio of the wire and each terminal, and screening out the terminals connected to the wire based on the calculated intersection-and-joint ratio; determining the experimental device connected to the terminal based on the screened terminals; and connecting the identified terminals, experimental devices, and wires according to their respective connection relationships to form a circuit loop.
于本发明一实施例中,所述计算导线和各个接线柱的交并比,并依据计算的交并比筛选出与导线连接的接线柱,包括:计算导线和每个接线柱的交并比,筛选出交并比大于预设的交并比阈值对应的接线柱,判断筛选出的接线柱的数量:若接线柱的数量等于2,则将筛选出的所有接线柱作为与导线连接的接线柱;若接线柱的数量大于2,则基于筛选出的每个接线柱相对于识别出的导线的位置,筛选出和导线连接的接线柱。In one embodiment of the present invention, the method of calculating the intersection-and-parallel ratio of the wire and each terminal, and screening out the terminals connected to the wire based on the calculated intersection-and-parallel ratio, includes: calculating the intersection-and-parallel ratio of the wire and each terminal, screening out the terminals corresponding to the intersection-and-parallel ratio greater than a preset intersection-and-parallel ratio threshold, and judging the number of the screened terminals: if the number of terminals is equal to 2, all the screened terminals are used as the terminals connected to the wire; if the number of terminals is greater than 2, based on the position of each screened terminal relative to the identified wire, the terminals connected to the wire are screened out.
于本发明一实施例中,所述基于筛选出的每个接线柱相对于识别出的导线的位置,筛选出和导线连接的接线柱,包括:遍历筛选出的所有接线柱,根据所述导线的位置,筛选出所有关于所述导线的中心相对称的一个或多个接线柱组合;判断接线柱组合的数量:若接线柱组合的数量为一,则将所述接线柱组合内的两个接线柱作为与导线连接的接线柱;若接线柱组合的数量不为一,则针对每一接线柱组合:依据两个接线柱和导线的交集,以及接线柱之间的距离,计算接线柱组合的权重;选择权重最大的接线柱组合内的两个接线柱作为与导线连接的接线柱。In one embodiment of the present invention, the filtering out of the terminals connected to the wire based on the position of each filtered terminal relative to the identified wire includes: traversing all the filtered terminals, and filtering out one or more terminal combinations that are symmetrical about the center of the wire according to the position of the wire; judging the number of terminal combinations: if the number of terminal combinations is one, then using two terminals in the terminal combination as terminals connected to the wire; if the number of terminal combinations is not one, then for each terminal combination: calculating the weight of the terminal combination according to the intersection of the two terminals and the wire, and the distance between the terminals; and selecting two terminals in the terminal combination with the largest weight as terminals connected to the wire.
于本发明一实施例中,所述依据各个接线柱和导线的交集,以及接线柱之间的距离,计算接线柱组合的权重,包括:分别计算两个接线柱和导线的交集;计算交集与对应接线柱的比值,作为接线柱组合的第一比值和第二比值;计算两个接线柱之间的距离;将第一比值、第二比值和距离的乘积作为接线柱组合的权重。In one embodiment of the present invention, the weight of the terminal combination is calculated based on the intersection of each terminal and the wire, and the distance between the terminals, including: calculating the intersection of two terminals and the wires respectively; calculating the ratio of the intersection to the corresponding terminal as the first ratio and the second ratio of the terminal combination; calculating the distance between the two terminals; and taking the product of the first ratio, the second ratio and the distance as the weight of the terminal combination.
于本发明一实施例中,所述基于筛选的接线柱,确定与接线柱连接的实验器件,包括:遍历所有识别到的实验器件,对于每个实验器件:计算实验器件与筛选的各个接线柱的交并比,判断计算的各个交并比是否大于预设阈值,并分析大于所述阈值的交并比数量:若大于预设阈值的交并比有一个,则确定实验器件和对应的接线柱连接;若大于预设阈值的交并比有多个,则确定实验器件和交并比最大的两个接线柱连接。In one embodiment of the present invention, the method of determining the experimental device connected to the terminal based on the screened terminal includes: traversing all identified experimental devices, and for each experimental device: calculating the intersection and conjunction ratios of the experimental device and each screened terminal, determining whether each calculated intersection and conjunction ratio is greater than a preset threshold, and analyzing the number of intersection and conjunction ratios greater than the threshold: if there is one intersection and conjunction ratio greater than the preset threshold, determining that the experimental device is connected to the corresponding terminal; if there are multiple intersection and conjunction ratios greater than the preset threshold, determining that the experimental device is connected to the two terminals with the largest intersection and conjunction ratios.
于本发明一实施例中,所述目标检测模型为YOLOv5模型。In one embodiment of the present invention, the target detection model is a YOLOv5 model.
于本发明一实施例中,所述形成电路回路之后,还包括:将所述电路回路标记在所述实验电路图像中。In an embodiment of the present invention, after forming the circuit loop, the method further includes: marking the circuit loop in the experimental circuit image.
于本发明一实施例中,还提供了一种电路连接关系的识别系统,所述系统包括:图像获取模块,用于获取实验电路图像;器件识别模块,用于将所述实验电路图像输入至目标检测模型,识别出所述实验电路图像中出现的各个实验器件、导线以及与导线连接的接线柱;其中,每个实验器件上至多有两个与导线连接的接线柱,所述目标检测模型为YOLO系列模型;接线柱筛选模块,用于对于每个导线:计算导线和各个接线柱的交并比,并依据计算的交并比筛选出与导线连接的接线柱;实验器件筛选模块,用于基于筛选的接线柱,确定与接线柱连接的实验器件;电路连接模块,用于将识别出的各个接线柱、实验器件和导线依据各自的连接关系进行连接,形成电路回路。In one embodiment of the present invention, a circuit connection relationship recognition system is also provided, the system comprising: an image acquisition module, used to acquire an experimental circuit image; a device recognition module, used to input the experimental circuit image into a target detection model, and identify each experimental device, wire, and terminal connected to the wire appearing in the experimental circuit image; wherein each experimental device has at most two terminals connected to the wire, and the target detection model is a YOLO series model; a terminal screening module, used to calculate the intersection-and-joint ratio of the wire and each terminal for each wire, and screen out the terminals connected to the wire based on the calculated intersection-and-joint ratio; an experimental device screening module, used to determine the experimental device connected to the terminal based on the screened terminals; a circuit connection module, used to connect the identified terminals, experimental devices, and wires according to their respective connection relationships to form a circuit loop.
于本发明一实施例中,还提供一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述电子设备实现上述任一项所述的电路连接关系的识别方法。In one embodiment of the present invention, an electronic device is also provided, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements any of the above-mentioned methods for identifying circuit connection relationships.
于本发明一实施例中,还提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序被计算机的处理器执行时,使计算机执行上述任一项所述的电路连接关系的识别方法。In one embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes any of the above-mentioned methods for identifying a circuit connection relationship.
本发明提出的一种电路连接关系的识别方法、系统、设备及介质,将实验电路图像输入至目标检测模型,能够精确识别出图像中出现的所有接线柱、实验器材和导线。通过计算导线和接线柱之间的交并比,能够有效的筛选出和导线实际有连接关系的接线柱,并通过分析这些接线柱和对应实验器件之间的连接关系,能够进一步确定电路的连接方式。根据各个接线柱、实验器件和导线之间的连接关系,实现了各个实验器件连接关系的构建,从而显著提高了电路连接关系识别的准确率。The present invention proposes a method, system, device and medium for identifying circuit connection relationships. By inputting an experimental circuit image into a target detection model, all terminals, experimental equipment and wires appearing in the image can be accurately identified. By calculating the intersection-and-union ratio between the wires and the terminals, the terminals that are actually connected to the wires can be effectively screened out, and by analyzing the connection relationship between these terminals and the corresponding experimental devices, the connection mode of the circuit can be further determined. According to the connection relationship between each terminal, experimental device and wire, the connection relationship of each experimental device is constructed, thereby significantly improving the accuracy of circuit connection relationship identification.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明实施例提供的电路连接关系的识别方法的一个流程示意图;FIG1 is a schematic flow chart of a method for identifying a circuit connection relationship provided by an embodiment of the present invention;
图2显示为本发明实施例提供的实验电路图像的示意图;FIG2 is a schematic diagram showing an experimental circuit image provided by an embodiment of the present invention;
图3显示为本发明实施例提供的实验电路图像中标识有各种实验器件的示意图;FIG3 is a schematic diagram showing various experimental devices marked in an experimental circuit image provided by an embodiment of the present invention;
图4显示为本发明一实施例提供的电路连接关系的识别系统的结构框图;FIG4 is a block diagram showing a circuit connection relationship recognition system according to an embodiment of the present invention;
图5显示为本发明一实施例电子设备的一结构示意图。FIG. 5 is a schematic diagram showing a structure of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
以下通过特定的具体实例说明本发明的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本发明的其他优点与功效。本发明还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本发明的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
需要说明的是,以下实施例中所提供的图示仅以示意方式说明本发明的基本构想,遂图式中仅显示与本发明中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
在下文描述中,探讨了大量细节,以提供对本发明实施例的更透彻的解释,然而,对本领域技术人员来说,可以在没有这些具体细节的情况下实施本发明的实施例是显而易见的,在其他实施例中,以方框图的形式而不是以细节的形式来示出公知的结构和设备,以避免使本发明的实施例难以理解。In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
在电学实验中常会出现多条导线和各种实验器件,为了判断电路的连接关系,核心在于精确地确定实验器件之间导线的连接关系及方向。但是在现实场景中,由于导线的长度不一,较长的导线更容易发生导线重叠的情况,这种情况大大增加了区分各个实验器件之间导线连接关系的难度。发明人发现,通常只有电压表上的接线柱可以作为并联点,在一根接线柱上实现两根导线的连接。除电压表外,其他实验器件上的接线柱通常只能与单条导线相连。现有的电路分析方法只能验证电压表是否并联的情况,无法判别出多种多样错误的连接方式。进一步地,当一条导线与超过两个接线柱相交时,目前的电路分析方式常倾向于选取距离最远的接线柱组合,作为与导线连接的接线柱。然而,如果相交区域与接线柱面积的比例较小,则表示该接线柱实际上并未与导线连接,这种判断方式容易导致误判。In electrical experiments, there are often multiple wires and various experimental devices. In order to determine the connection relationship of the circuit, the core is to accurately determine the connection relationship and direction of the wires between the experimental devices. However, in real scenarios, due to the different lengths of the wires, longer wires are more likely to overlap, which greatly increases the difficulty of distinguishing the connection relationship between the wires of various experimental devices. The inventor found that usually only the terminal on the voltmeter can be used as a parallel point to achieve the connection of two wires on one terminal. In addition to the voltmeter, the terminals on other experimental devices can usually only be connected to a single wire. The existing circuit analysis method can only verify whether the voltmeter is connected in parallel, and it is impossible to distinguish a variety of wrong connection methods. Furthermore, when a wire intersects with more than two terminals, the current circuit analysis method often tends to select the terminal combination with the farthest distance as the terminal connected to the wire. However, if the ratio of the intersection area to the terminal area is small, it means that the terminal is not actually connected to the wire, and this judgment method is prone to misjudgment.
为解决上述问题,本发明提供一种电路连接关系的识别方法,将实验电路图像输入至目标检测模型,能够精确识别出图像中出现的所有接线柱、实验器材和导线。利用导线和接线柱之间的交并比,得到多种可能的接线柱组合,并从中筛选出和导线真实连接的接线柱组合。通过分析这些接线柱和对应实验器件之间的连接关系,能够进一步确定电路的连接方式。根据各个接线柱、实验器件和导线之间的连接关系,实现了各个实验器件连接关系的构建,极大提高了电路连接关系识别的准确率。无论是在常规还是非常规的实验器件布局中,本发明的推断机制都能准确地推断出导线两端的正确接线柱组合,打破了传统上仅限电压表接线柱能连接两根导线的约束,实现了任何接线柱都可以与两根导线连接,能够还原电路连接的多种可能性。To solve the above problems, the present invention provides a method for identifying circuit connection relationships. The experimental circuit image is input into the target detection model, and all the terminals, experimental equipment and wires appearing in the image can be accurately identified. By using the intersection-and-joint ratio between the wires and the terminals, a variety of possible terminal combinations are obtained, and the terminal combinations that are actually connected to the wires are screened out. By analyzing the connection relationship between these terminals and the corresponding experimental devices, the connection mode of the circuit can be further determined. According to the connection relationship between each terminal, experimental device and wire, the construction of the connection relationship of each experimental device is realized, which greatly improves the accuracy of circuit connection relationship recognition. Whether in conventional or unconventional experimental device layouts, the inference mechanism of the present invention can accurately infer the correct terminal combination at both ends of the wire, breaking the traditional constraint that only the voltmeter terminal can be connected to two wires, and realizing that any terminal can be connected to two wires, and can restore multiple possibilities of circuit connection.
请参见图1,电路连接关系的识别包括如下步骤:Referring to FIG. 1 , the identification of the circuit connection relationship includes the following steps:
S1、获取实验电路图像。S1. Obtain the experimental circuit image.
实验电路图像是指实验器件上的接线柱和导线之间相互连接构成的电路实景图像。示例性地,如图2所示,实现电路图像可包括依次相连的电源、滑动变阻器、电流表、灯泡、电压表和开关。实验电路图像可通过图像拍摄设备(如高分辨率相机)或视频拍摄设备(如摄像头)获得,在此不做限定。优选地,为了实现对图像的实时分析,本发明中,使用视频拍摄设备获取实验电路图像,并使用目标检测模型对视频流进行实时分析,从而实时识别出各个实验器件的连接关系。使用图像拍摄设备时,可直接捕捉电路的高清图片以获取实验电路图像。使用视频拍摄设备时,需要从拍摄的视频中提取出所需的视频帧以得到实验电路图像。其中,视频帧可通过从视频中逐帧提取的方式得到,也可以通过关键帧提取、特定时间间隔采样等方式获得,在此不做限定。The experimental circuit image refers to the real-life image of the circuit formed by the interconnection between the terminals and the wires on the experimental device. Exemplarily, as shown in Figure 2, the circuit image can include a power supply, a sliding rheostat, an ammeter, a light bulb, a voltmeter and a switch connected in sequence. The experimental circuit image can be obtained by an image capture device (such as a high-resolution camera) or a video capture device (such as a camera), which is not limited here. Preferably, in order to realize real-time analysis of the image, in the present invention, a video capture device is used to obtain the experimental circuit image, and a target detection model is used to perform real-time analysis on the video stream, so as to identify the connection relationship of each experimental device in real time. When using an image capture device, a high-definition picture of the circuit can be directly captured to obtain the experimental circuit image. When using a video capture device, it is necessary to extract the required video frame from the captured video to obtain the experimental circuit image. Among them, the video frame can be obtained by extracting it frame by frame from the video, or it can be obtained by extracting key frames, sampling at specific time intervals, etc., which is not limited here.
S2、将所述实验电路图像输入至目标检测模型,识别出所述实验电路图像中出现的各个实验器件、导线以及与导线连接的接线柱;其中,每个实验器件上至多有两个与导线连接的接线柱,所述目标检测模型为YOLO系列模型。S2. Input the experimental circuit image into the target detection model to identify each experimental device, wire, and terminal connected to the wire that appear in the experimental circuit image; wherein each experimental device has at most two terminals connected to the wire, and the target detection model is a YOLO series model.
将实验电路图像输入至训练好的目标检测模型中,通过分析整个实验电路图像,能够识别出实验电路图像中呈现的各种预先定义的实验器件、与导线连接的接线柱以及导线,识别出的对象用识别框和对应的类别标签进行表示。其中,识别框用于界定图像中识别对象的具体位置和范围,识别框常以矩形框的形式圈出每个识别对象。进一步地,本发明中实验器件的类别标签包括但不限于电压表、电流表、电源、滑动变阻器、电阻、电容等。接线柱是指实验器件上的电气连接点,其类别标签包括但不限于红接线柱、黑接线柱、电表的大量程和小量程接线柱、滑动变阻器的上连接和下连接接线柱等。本发明中,假设每个实验器件上至多有两个与导线连接的接线柱。需要说明的是,本发明中,提及的所有接线柱均为已经与导线连接的接线柱。导线是用于连接不同接线柱的电气导体。本发明中,目标检测模型适配于所有YOLO框架下训练的模型,包括但不限于YOLOv5、YOLOv8、YOLOX等。优选地,为了提升电路图像分析的效率和准确性,适应各种特定的电路实验器件和配置的识别需求,在本发明一实施例中,所述目标检测模型为YOLOv5模型。The experimental circuit image is input into the trained target detection model. By analyzing the entire experimental circuit image, various predefined experimental devices, terminals connected to the wires, and wires presented in the experimental circuit image can be identified. The identified objects are represented by identification boxes and corresponding category labels. Among them, the identification box is used to define the specific position and range of the identified object in the image, and the identification box often circles each identified object in the form of a rectangular frame. Further, the category labels of the experimental devices in the present invention include but are not limited to voltmeters, ammeters, power supplies, sliding rheostats, resistors, capacitors, etc. The terminal refers to an electrical connection point on the experimental device, and its category label includes but is not limited to red terminals, black terminals, large-range and small-range terminals of the meter, upper and lower connection terminals of the sliding rheostat, etc. In the present invention, it is assumed that there are at most two terminals connected to the wires on each experimental device. It should be noted that in the present invention, all the terminals mentioned are terminals that have been connected to the wires. The wire is an electrical conductor used to connect different terminals. In the present invention, the target detection model is suitable for all models trained under the YOLO framework, including but not limited to YOLOv5, YOLOv8, YOLOX, etc. Preferably, in order to improve the efficiency and accuracy of circuit image analysis and adapt to the recognition requirements of various specific circuit experimental devices and configurations, in one embodiment of the present invention, the target detection model is a YOLOv5 model.
示例性地,将图2输入至目标检测模型,得到图3所示标识有各种识别对象的结果。具体地,目标检测模型识别出图2中存在的实验器件有电源、滑动变阻器、灯泡、开关、电流表和电压表,导线为L1、L2、L3、L4、L5、L6、L7,与导线连接的各个接线柱为a、b、c、d、e、f、g、h、i、j、k、m。Exemplarily, FIG2 is input into the target detection model, and the result with various identification objects shown in FIG3 is obtained. Specifically, the target detection model recognizes that the experimental devices in FIG2 are power supply, sliding rheostat, light bulb, switch, ammeter and voltmeter, the wires are L1, L2, L3, L4, L5, L6, L7, and the terminals connected to the wires are a, b, c, d, e, f, g, h, i, j, k, m.
S3、对于每个导线:计算导线和各个接线柱的交并比,并依据计算的交并比筛选出与导线连接的接线柱。S3. For each conductor: calculate the intersection-and-parallel ratio between the conductor and each terminal, and select the terminal connected to the conductor based on the calculated intersection-and-parallel ratio.
通过目标检测模型,从实验电路图像中识别出各个导线以及各个接线柱,对于识别出的每个导线的识别框:计算当前导线的识别框和各个接线柱的识别框的交并比(Intersection over Union,IoU),这个交并比用于表示导线与接线柱之间在空间上的重叠程度。然后基于计算的交并比筛选出与导线可能存在连接关系的接线柱,其中,导线的识别框和接线柱的识别框的交并比是指:导线的识别框与接线柱的识别框的交集面积,与导线的识别框和接线柱的识别框的并集面积的比值。需要说明的是,筛选完毕后,若有多条导线同时与同一个接线柱相连,则表示该接线柱为并联点。通过这种方式,不仅提高了电路连接关系识别的准确性,还能够更加清晰地理解电路中的并联与串联配置关系。Through the target detection model, each wire and each terminal are identified from the experimental circuit image. For each wire identification frame identified: the intersection over union (IoU) of the current wire identification frame and the identification frame of each terminal is calculated. This IoU is used to indicate the degree of overlap between the wire and the terminal in space. Then, based on the calculated IoU, the terminals that may have a connection relationship with the wire are screened out, where the IoU of the wire identification frame and the terminal identification frame refers to the ratio of the intersection area of the wire identification frame and the terminal identification frame to the union area of the wire identification frame and the terminal identification frame. It should be noted that after the screening is completed, if multiple wires are connected to the same terminal at the same time, it means that the terminal is a parallel point. In this way, not only the accuracy of circuit connection relationship identification is improved, but also the parallel and series configuration relationship in the circuit can be more clearly understood.
示例性地,对于导线的识别框A,设其面积为SA,接线柱的识别框B,设其面积为SB,则两者的交集面积S交集面积为两个识别框重叠区域的面积。两者的并集面积为各自识别框的面积与交集面积的差值,即SA+SB-S交集面积。计算交集面积与并集面积的比值,该比值即为导线的识别框和接线柱的识别框的交并比。显然,若两者不重叠,则交集面积为0,表明导线与该接线柱之间没有直接的连接关系。相反,如果交集面积较大,则交并比会相应增加,表示导线与接线柱有较高的空间重叠,从而表明它们之间可能存在连接关系。通过计算交并比,能够初步筛选出和导线可能存在连接关系的各个接线柱。Exemplarily, for the identification frame A of the wire, let its area be SA , and for the identification frame B of the terminal, let its area be SB , then the intersection area S of the two is the area of the overlapping area of the two identification frames. The union area of the two is the difference between the area of each identification frame and the intersection area, that is, SA + SB - S intersection area . Calculate the ratio of the intersection area to the union area, which is the intersection-to-union ratio of the identification frame of the wire and the identification frame of the terminal. Obviously, if the two do not overlap, the intersection area is 0, indicating that there is no direct connection relationship between the wire and the terminal. On the contrary, if the intersection area is large, the intersection-to-union ratio will increase accordingly, indicating that the wire and the terminal have a higher spatial overlap, thereby indicating that there may be a connection relationship between them. By calculating the intersection-to-union ratio, each terminal that may have a connection relationship with the wire can be preliminarily screened out.
在本发明一实施例中,所述计算导线和各个接线柱的交并比,并依据计算的交并比筛选出与导线连接的接线柱,包括:In one embodiment of the present invention, the calculating of the intersection-and-parallel ratios of the wires and the respective terminals, and selecting the terminals connected to the wires according to the calculated intersection-and-parallel ratios, includes:
计算导线和每个接线柱的交并比,筛选出交并比大于预设的交并比阈值对应的接线柱,判断筛选出的接线柱的数量:Calculate the I/O ratio of the wire and each terminal, filter out the terminals whose I/O ratio is greater than the preset I/O ratio threshold, and determine the number of filtered terminals:
若接线柱的数量等于2,则将筛选出的所有接线柱作为与导线连接的接线柱;If the number of terminals is equal to 2, all the selected terminals are used as terminals connected to the wires;
若接线柱的数量大于2,则基于筛选出的每个接线柱相对于识别出的导线的位置,筛选出和导线连接的接线柱。If the number of the terminals is greater than 2, the terminals connected to the wires are screened out based on the position of each screened terminal relative to the identified wires.
对于每个导线,通过计算该导线的识别框与各个接线柱的识别框的交并比,分析并筛选出交并比大于交并比阈值(如0)的若干个接线柱,从而在所有识别出的接线柱中,挑选出与导线可能存在实际连接的几个接线柱。判断筛选出的接线柱的数量,若筛选出的接线柱的数量为1,则表示导线只连接了一个接线柱,或者导线虽然连接了两个接线柱,但只有一个接线柱被识别到,此情况不作为有效的导线连接组合。若筛选出两个接线柱,则认为这两个接线柱直接与导线相连。若筛选出的接线柱的数量超过两个,则表示实验器件放置位置接近,致使一根导线经过若干个相对紧密排列的接线柱,在这种情况下,需要根据每个接线柱相对于导线的位置,确定哪些接线柱实际和导线连接。For each wire, by calculating the intersection-and-division ratio of the wire's identification frame and the identification frame of each terminal, several terminals whose intersection-and-division ratio is greater than the intersection-and-division ratio threshold (such as 0) are analyzed and screened out, so that among all the identified terminals, several terminals that may be actually connected to the wire are selected. The number of screened terminals is determined. If the number of screened terminals is 1, it means that the wire is only connected to one terminal, or although the wire is connected to two terminals, only one terminal is identified. This situation is not considered as a valid wire connection combination. If two terminals are screened out, it is considered that these two terminals are directly connected to the wire. If the number of screened terminals exceeds two, it means that the experimental devices are placed close to each other, causing a wire to pass through several relatively closely arranged terminals. In this case, it is necessary to determine which terminals are actually connected to the wire based on the position of each terminal relative to the wire.
在本发明一实施例中,所述基于筛选出的每个接线柱相对于识别出的导线的位置,筛选出和导线连接的接线柱,包括:In one embodiment of the present invention, the step of selecting the binding posts connected to the wires based on the positions of each selected binding post relative to the identified wires includes:
遍历筛选出的所有接线柱,根据所述导线的位置,筛选出所有关于所述导线的中心相对称的一个或多个接线柱组合;Traversing all the selected binding posts, and selecting all one or more binding post combinations that are symmetrical about the center of the wire according to the position of the wire;
判断接线柱组合的数量:Determine the number of terminal combinations:
若接线柱组合的数量为一,则将所述接线柱组合内的两个接线柱作为与导线连接的接线柱;If the number of the terminal combination is one, two terminals in the terminal combination are used as terminals connected to the wires;
若接线柱组合的数量不为一,则针对每一接线柱组合:依据两个接线柱和导线的交集,以及接线柱之间的距离,计算接线柱组合的权重;选择权重最大的接线柱组合内的两个接线柱作为与导线连接的接线柱。If the number of terminal combinations is not one, for each terminal combination: calculate the weight of the terminal combination based on the intersection of two terminals and the wires, and the distance between the terminals; and select two terminals in the terminal combination with the largest weight as the terminals connected to the wires.
当筛选出的接线柱(即交并比大于交并比阈值的接线柱)的数量超过两个时,这种情况下,首先遍历筛选出的所有接线柱,根据每个接线柱的识别框与导线的识别框的相对位置,将接线柱划分为:位于导线左上、位于导线左下、位于导线右上、位于导线右下,四种不同区域。其中,接线柱的识别框与导线的识别框的相对位置,是通过计算接线柱的识别框的中心坐标与导线的识别框的中心坐标确定的。从中选出位于对角线区域(即左上与右下或右上与左下)的两个接线柱,形成一个接线柱组合。判断接线柱组合的数量:若接线柱组合只有一个,则表示只有一对接线柱满足与导线直接连接的条件,可将这一对接线柱作为与导线相连接的接线柱。反之,若存在多个接线柱组合,则需要进一步分析以确定哪个组合实际上与导线相连。具体地,对于每个接线柱组合:根据两个接线柱与导线的交集以及接线柱之间的距离,计算一个权重。这个权重旨在评估接线柱组合与导线连接的可能性,其中接线柱和导线的交集反映了接线柱与导线的空间关系,而接线柱之间的距离能够准确评估组合的合理性。最后,选择具有最大权重的接线柱组合,确定组合内的两个接线柱为与导线直接相连的接线柱。本发明中,考虑到与导线真正连接的接线柱在空间上往往不会紧邻彼此,而是分布在导线两侧的不同区域,因此选择对角线分布的接线柱,可以有效减少因导线与多个接线柱紧密邻近而导致的误判,从而提高连接识别的精确度。When the number of the selected binding posts (i.e., the binding posts whose intersection-and-parallel ratio is greater than the intersection-and-parallel ratio threshold) exceeds two, in this case, first traverse all the selected binding posts, and divide the binding posts into four different areas: located at the upper left of the wire, located at the lower left of the wire, located at the upper right of the wire, and located at the lower right of the wire according to the relative position of the identification frame of each binding post and the identification frame of the wire. Among them, the relative position of the identification frame of the binding post and the identification frame of the wire is determined by calculating the center coordinates of the identification frame of the binding post and the center coordinates of the identification frame of the wire. Select two binding posts located in the diagonal area (i.e., the upper left and lower right or the upper right and lower left) to form a binding post combination. Determine the number of binding post combinations: If there is only one binding post combination, it means that only one pair of binding posts meets the condition of direct connection with the wire, and this pair of binding posts can be used as the binding posts connected to the wire. On the contrary, if there are multiple binding post combinations, further analysis is required to determine which combination is actually connected to the wire. Specifically, for each binding post combination: a weight is calculated based on the intersection of the two binding posts and the wire and the distance between the binding posts. This weight is intended to evaluate the possibility of a terminal combination being connected to a wire, wherein the intersection of a terminal and a wire reflects the spatial relationship between the terminal and the wire, and the distance between the terminals can accurately evaluate the rationality of the combination. Finally, the terminal combination with the largest weight is selected, and the two terminals in the combination are determined to be the terminals directly connected to the wire. In the present invention, considering that the terminals that are actually connected to the wire are often not close to each other in space, but are distributed in different areas on both sides of the wire, the selection of diagonally distributed terminals can effectively reduce the misjudgment caused by the close proximity of the wire to multiple terminals, thereby improving the accuracy of connection identification.
在本发明一实施例中,所述依据各个接线柱和导线的交集,以及接线柱之间的距离,计算接线柱组合的权重,包括:In one embodiment of the present invention, the weight of the binding post combination is calculated based on the intersection of each binding post and the wire, and the distance between the binding posts, including:
分别计算两个接线柱和导线的交集;Calculate the intersection of the two terminals and the wire separately;
计算交集与对应接线柱的比值,作为接线柱组合的第一比值和第二比值;Calculate the ratio of the intersection to the corresponding terminal as the first ratio and the second ratio of the terminal combination;
计算两个接线柱之间的距离;Calculate the distance between two binding posts;
将第一比值、第二比值和距离的乘积作为接线柱组合的权重。The product of the first ratio, the second ratio and the distance is used as the weight of the terminal combination.
分析每一个接线柱组合:计算组合中每一个接线柱和导线的交集,其中,交集是指接线柱的识别框和导线的识别框重叠区域的面积。然后计算每一个接线柱的交集和其自身识别框的比值,生成两个比值:第一比值和第二比值,这两个比值对应于组合内的两个接线柱。计算两个接线柱识别框中心点之间的直线距离,以确定两者的物理距离。将第一比值、第二比值和接线柱之间的距离相乘,得到的乘积作为整个接线柱组合的权重。本发明中,考虑到导线两端的接线柱一般位于导线识别框的斜对角线上,且这些接线柱相对于导线识别框具有较大的重合面积。这种情况下,根据权重筛选出的接线柱组合基本与实际情况保持一致。通过这种方式,计算出的权重结合了接线柱与导线之间的交互程度和接线柱之间的距离,从而为每个接线柱组合提供了一个综合的评估指标,以判定哪个接线柱组合最有可能是实际连接到导线上的。Analyze each terminal combination: calculate the intersection of each terminal and wire in the combination, where the intersection refers to the area of the overlapping area of the identification frame of the terminal and the identification frame of the wire. Then calculate the ratio of the intersection of each terminal and its own identification frame to generate two ratios: a first ratio and a second ratio, which correspond to the two terminals in the combination. Calculate the straight-line distance between the center points of the two terminal identification frames to determine the physical distance between the two. Multiply the first ratio, the second ratio and the distance between the terminals, and the product obtained is used as the weight of the entire terminal combination. In the present invention, it is considered that the terminals at both ends of the wire are generally located on the diagonal of the wire identification frame, and these terminals have a large overlap area relative to the wire identification frame. In this case, the terminal combination screened according to the weight is basically consistent with the actual situation. In this way, the calculated weight combines the degree of interaction between the terminal and the wire and the distance between the terminals, thereby providing a comprehensive evaluation index for each terminal combination to determine which terminal combination is most likely to be actually connected to the wire.
示例性地,接线柱组合中的两个接线柱分别为A和B,设Atotal为接线柱A的总面积,Btotal为接线柱B的总面积,DAB为接线柱A和接线柱B之间的距离,将接线柱A和导线的交集面积记为S’A,接线柱B和导线的交集面积记为S’B。则接线柱组合的第一比值RatioA为S’A/Atotal,第二比值RatioB为S’B/Btotal,该接线柱组合的权重W为RatioA*RatioB*DAB。Exemplarily, the two terminals in the terminal combination are A and B, A total is assumed to be the total area of the terminal A, B total is assumed to be the total area of the terminal B, D AB is assumed to be the distance between the terminal A and the terminal B, the intersection area of the terminal A and the wire is recorded as S' A , and the intersection area of the terminal B and the wire is recorded as S' B . Then the first ratio Ratio A of the terminal combination is S' A /A total , the second ratio Ratio B is S' B /B total , and the weight W of the terminal combination is Ratio A *Ratio B *D AB .
作为一个具体示例,如图3所示,以导线L6为例,接线柱j、k位于导线L6左上区域,接线柱h位于导线L6右下区域,且导线L6和这三个接线柱j、k、h的交并比均大于交并比阈值。因此,构成导线L6的接线柱组合为(j,h)和(k,h)。分析(j,h):计算接线柱j的识别框面积和导线L6的识别框面积的交集S1,以及接线柱h的识别框面积和导线L6的识别框面积的交集S2,两个接线柱j、h的距离D1。进一步地,基于上述计算结果,计算交集面积S1与接线柱j的识别框面积的比值为Rj,交集面积S1与接线柱h的识别框面积的比值为Rh,则该组合的权重为Rj*Rh*D1。同理,接线柱组合(k,h)的权重为Rk*Rh*D2,其中,D2为接线柱k、h之间的距离。由于接线柱j和导线L6的交集大于接线柱k和导线L6的交集,因此(j,h)的权重大于(k,h)的权重,故选择(j,h)作为与导线L6连接的接线柱。显然,通过这种方式,可以降低导线经过某个接线柱,但未与该接线柱真实连接时,误判为导线与接线柱连接的概率。As a specific example, as shown in FIG3 , taking the wire L6 as an example, the terminals j and k are located in the upper left area of the wire L6, the terminal h is located in the lower right area of the wire L6, and the intersection-and-parallel ratio of the wire L6 and the three terminals j, k, and h are all greater than the intersection-and-parallel ratio threshold. Therefore, the terminal combinations constituting the wire L6 are (j, h) and (k, h). Analysis (j, h): Calculate the intersection S1 of the identification box area of the terminal j and the identification box area of the wire L6, as well as the intersection S2 of the identification box area of the terminal h and the identification box area of the wire L6, and the distance D1 between the two terminals j and h. Further, based on the above calculation results, the ratio of the intersection area S1 to the identification box area of the terminal j is calculated as Rj, and the ratio of the intersection area S1 to the identification box area of the terminal h is calculated as Rh, then the weight of the combination is Rj*Rh*D1. Similarly, the weight of the terminal combination (k, h) is Rk*Rh*D2, where D2 is the distance between the terminals k and h. Since the intersection of terminal j and wire L6 is greater than the intersection of terminal k and wire L6, the weight of (j, h) is greater than the weight of (k, h), so (j, h) is selected as the terminal connected to wire L6. Obviously, in this way, the probability of misjudging that the wire is connected to a terminal when the wire passes through a terminal but is not actually connected to the terminal can be reduced.
S4、基于筛选的接线柱,确定与接线柱连接的实验器件。S4. Based on the screened terminals, determine the experimental devices connected to the terminals.
具体地,在本发明一实施例中,所述基于筛选的接线柱,确定与接线柱连接的实验器件,包括:Specifically, in one embodiment of the present invention, the step of determining the experimental device connected to the terminal based on the screened terminal includes:
遍历所有识别到的实验器件,对于每个实验器件:Traverse all identified experimental devices, and for each experimental device:
计算实验器件与筛选的各个接线柱的交并比,判断计算的各个交并比是否大于预设阈值,并分析大于所述阈值的交并比数量:Calculate the I/O ratio of the experimental device and each screened terminal, determine whether each calculated I/O ratio is greater than a preset threshold, and analyze the number of I/O ratios greater than the threshold:
若大于预设阈值的交并比有一个,则确定实验器件和对应的接线柱连接;If there is an intersection-to-parallel ratio greater than a preset threshold, it is determined that the experimental device is connected to the corresponding terminal;
若大于预设阈值的交并比有多个,则确定实验器件和交并比最大的两个接线柱连接。If there are multiple cross-parallel ratios greater than the preset threshold, it is determined that the experimental device is connected to the two terminals with the largest cross-parallel ratios.
遍历实验电路图像中识别到的所有实验器件,对于每个实验器件:计算该实验器件的识别框和每个筛选的接线柱的识别框之间的交并比,以实现实验器件和接线柱之间空间重叠程度的评估。判断计算的交并比是否大于预设阈值(如0),并分析所有大于该阈值的交并比数量,其中,阈值用于确定哪一种程度的空间重叠视为有效的连接。当大于阈值的交并比数量为一时,则表示该实验器件与这个接线柱连接。若有多个接线柱的交并比大于阈值,由于本发明中,已经假设每个实验器材中至多有两个接线柱,因此会筛选出交并比最大的两个接线柱,作为与该实验器件的连接。需要说明的是,本发明中,建立各个实验器件和导线、接线柱之间的连接关系是基于下述假设:在导线两端皆有实验器件的情况下,导线两端分别连接两个不相同的接线柱。Traverse all experimental devices identified in the experimental circuit image, and for each experimental device: calculate the intersection and parallel ratio between the identification frame of the experimental device and the identification frame of each screened terminal, so as to realize the evaluation of the degree of spatial overlap between the experimental device and the terminal. Determine whether the calculated intersection and parallel ratio is greater than a preset threshold (such as 0), and analyze the number of all intersection and parallel ratios greater than the threshold, wherein the threshold is used to determine which degree of spatial overlap is considered to be a valid connection. When the number of intersection and parallel ratios greater than the threshold is one, it means that the experimental device is connected to this terminal. If the intersection and parallel ratio of multiple terminals is greater than the threshold, since it is assumed in the present invention that there are at most two terminals in each experimental equipment, the two terminals with the largest intersection and parallel ratio will be screened out as the connection with the experimental device. It should be noted that in the present invention, the connection relationship between each experimental device and the wire and terminal is established based on the following assumption: when there are experimental devices at both ends of the wire, two different terminals are connected at both ends of the wire.
S5、将识别出的各个接线柱、实验器件和导线依据各自的连接关系进行连接,形成电路回路。S5. Connect the identified terminals, experimental devices and wires according to their respective connection relationships to form a circuit loop.
从电源开始,将识别出的各个接线柱、实验器件和导线根据各自的连接关系,将各个器件连接,以形成一个完整的电路回路。若导线连接只有一端,或实验器件上只有一个接线柱时,路径终止。从路径中得出连入电路的实验器件,从而实现对该实验电路图像中实验器件的准确识别。为了便于表征,在本发明一实施例中,所述形成电路回路之后,还包括:将所述电路回路标记在所述实验电路图像中。Starting from the power supply, the identified terminals, experimental devices and wires are connected according to their respective connection relationships to form a complete circuit loop. If the wire is connected to only one end, or there is only one terminal on the experimental device, the path ends. The experimental device connected to the circuit is obtained from the path, thereby realizing accurate identification of the experimental device in the experimental circuit image. For the convenience of characterization, in one embodiment of the present invention, after forming the circuit loop, it also includes: marking the circuit loop in the experimental circuit image.
请参见图4,该电路连接关系的识别系统100包括:图像获取模块110、器件识别模块120、接线柱筛选模块130、实验器件筛选模块140和电路连接模块150。其中,上述图像获取模块110用于获取实验电路图像。器件识别模块120所述实验电路图像输入至目标检测模型,识别出所述实验电路图像中出现的各个实验器件、导线以及与导线连接的接线柱;其中,每个实验器件上至多有两个与导线连接的接线柱,所述目标检测模型为YOLO系列模型。接线柱筛选模块130用于对于每个导线:计算导线和各个接线柱的交并比,并依据计算的交并比筛选出与导线连接的接线柱。实验器件筛选模块140于筛选的接线柱,确定与接线柱连接的实验器件。电路连接模块150识别出的各个接线柱、实验器件和导线依据各自的连接关系进行连接,形成电路回路。Please refer to FIG. 4 , the circuit connection relationship recognition system 100 includes: an image acquisition module 110, a device recognition module 120, a terminal screening module 130, an experimental device screening module 140 and a circuit connection module 150. The image acquisition module 110 is used to acquire an experimental circuit image. The device recognition module 120 inputs the experimental circuit image into the target detection model to identify each experimental device, wire and terminal connected to the wire appearing in the experimental circuit image; wherein each experimental device has at most two terminals connected to the wire, and the target detection model is a YOLO series model. The terminal screening module 130 is used for each wire: calculating the intersection and union ratio of the wire and each terminal, and filtering out the terminal connected to the wire according to the calculated intersection and union ratio. The experimental device screening module 140 determines the experimental device connected to the terminal based on the screened terminals. The terminals, experimental devices and wires identified by the circuit connection module 150 are connected according to their respective connection relationships to form a circuit loop.
关于电路连接关系的识别系统的具体限定可以参见上文中对于电路连接关系的识别方法的限定,在此不再赘述。上述电路连接关系的识别系统中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件格式内嵌于或独立于计算机设备中的处理器中,也可以以软件格式存储于计算机设备中的存储器中,以便于处理器调用以上各个模块对应的操作。The specific definition of the circuit connection relationship identification system can be found in the above definition of the circuit connection relationship identification method, which will not be repeated here. Each module in the above circuit connection relationship identification system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware format, or can be stored in the memory of the computer device in software format, so that the processor can call the operations corresponding to the above modules.
需要说明的是,为了突出本发明的创新部分,本实施例中并没有将与解决本发明所提出的技术问题关系不太密切的模块引入,但这并不表明本实施例中不存在其它的模块。It should be noted that, in order to highlight the innovative part of the present invention, the present embodiment does not introduce modules that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other modules in the present embodiment.
请参见图5,述电子设备1可以包括存储器12、处理器13和总线,还可以包括存储在所述存储器12中并可在所述处理器13上运行的计算机程序,例如电路连接关系的识别程序。Please refer to FIG. 5 , the electronic device 1 may include a memory 12 , a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13 , such as a circuit connection relationship recognition program.
其中,存储器12至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器12在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。存储器12在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,存储器12还可以既包括电子设备1的内部存储单元也包括外部存储设备。存储器12不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如电路连接关系的识别的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 12 can be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 12 can also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as codes for identifying circuit connection relationships, etc., but can also be used to temporarily store data that has been output or is to be output.
处理器13在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。处理器13是所述电子设备1的控制核心(Control Unit),利用各种接口和线路连接整个电子设备1的各个部件,通过运行或执行存储在所述存储器12内的程序或者模块(例如电路连接关系的识别程序等),以及调用存储在所述存储器12内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect the various components of the entire electronic device 1, and executes or executes programs or modules (such as circuit connection relationship recognition programs, etc.) stored in the memory 12, and calls the data stored in the memory 12 to execute various functions of the electronic device 1 and process data.
所述处理器13执行所述电子设备1的操作系统以及安装的各类应用程序。所述处理器13执行所述应用程序以实现上述电路连接关系的识别方法中的步骤。The processor 13 executes the operating system and various installed application programs of the electronic device 1. The processor 13 executes the application programs to implement the steps in the above-mentioned circuit connection relationship identification method.
示例性的,所述计算机程序可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器12中,并由所述处理器13执行,以完成本申请。所述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在所述电子设备1中的执行过程。例如,所述计算机程序可以被分割成图像获取模块110、器件识别模块120、接线柱筛选模块130、实验器件筛选模块140和电路连接模块150。Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into an image acquisition module 110, a device identification module 120, a terminal screening module 130, an experimental device screening module 140, and a circuit connection module 150.
上述以软件功能模块的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中,所述计算机可读存储介质可以是非易失性,也可以是易失性。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、计算机设备,或者网络设备等)或处理器(processor)执行本申请各个实施例所述电路连接关系的识别方法的部分功能。The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the circuit connection relationship identification method described in each embodiment of the present application.
综上所述,本发明公开的一种电路连接关系的识别方法、系统、设备及介质,将实验电路图像输入至目标检测模型,能够精确识别出图像中出现的所有接线柱、实验器材和导线。通过计算导线和接线柱之间的交并比,能够有效的筛选出和导线实际有连接关系的接线柱,并通过分析这些接线柱和对应实验器件之间的连接关系,能够进一步确定电路的连接方式。根据各个接线柱、实验器件和导线之间的连接关系,实现了各个实验器件连接关系的构建,从而显著提高了电路连接关系识别的准确率。本发明有效克服了现有技术中的种种缺点而具高度产业利用价值。In summary, the present invention discloses a method, system, device and medium for identifying circuit connection relationships. By inputting an experimental circuit image into a target detection model, all terminals, experimental equipment and wires appearing in the image can be accurately identified. By calculating the intersection-and-union ratio between the wires and the terminals, the terminals that are actually connected to the wires can be effectively screened out, and by analyzing the connection relationship between these terminals and the corresponding experimental devices, the connection mode of the circuit can be further determined. According to the connection relationship between each terminal, experimental device and wire, the connection relationship of each experimental device is constructed, thereby significantly improving the accuracy of circuit connection relationship identification. The present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.
上述实施例仅例示性说明本发明的原理及其功效,而非用于限制本发明。任何熟悉此技术的人士皆可在不违背本发明的精神及范畴下,对上述实施例进行修饰或改变。因此,举凡所属技术领域中具有通常知识者在未脱离本发明所揭示的精神与技术思想下所完成的一切等效修饰或改变,仍应由本发明的权利要求所涵盖。The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410206019.5A CN118135294B (en) | 2024-02-26 | 2024-02-26 | Method, system, device and medium for identifying circuit connection relationship |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410206019.5A CN118135294B (en) | 2024-02-26 | 2024-02-26 | Method, system, device and medium for identifying circuit connection relationship |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118135294A true CN118135294A (en) | 2024-06-04 |
CN118135294B CN118135294B (en) | 2024-11-22 |
Family
ID=91244959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410206019.5A Active CN118135294B (en) | 2024-02-26 | 2024-02-26 | Method, system, device and medium for identifying circuit connection relationship |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118135294B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170084038A1 (en) * | 2015-09-18 | 2017-03-23 | Qualcomm Incorporated | Systems and methods for non-obstacle area detection |
CN114677586A (en) * | 2022-03-15 | 2022-06-28 | 南京邮电大学 | An automatic identification method of physical circuit experiment |
CN114708486A (en) * | 2022-04-07 | 2022-07-05 | 太原智林信息技术股份有限公司 | Automatic judging method for physical and electrical experiment operation circuit connection |
US20230085518A1 (en) * | 2021-09-14 | 2023-03-16 | Mediatek Inc. | Video processing method for detecting location, pixels, and skeleton of object, and associated video processing circuit |
CN116363076A (en) * | 2023-03-10 | 2023-06-30 | 上海锡鼎智能科技有限公司 | Method and device for judging current flow direction of experimental circuit |
CN116503719A (en) * | 2023-03-10 | 2023-07-28 | 上海锡鼎智能科技有限公司 | Method and device for identifying connection relation of circuit experimental device |
CN117392372A (en) * | 2023-10-11 | 2024-01-12 | 上海锡鼎智能科技有限公司 | Power supply node number calculation method, calculation equipment and storage medium of access circuit |
-
2024
- 2024-02-26 CN CN202410206019.5A patent/CN118135294B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170084038A1 (en) * | 2015-09-18 | 2017-03-23 | Qualcomm Incorporated | Systems and methods for non-obstacle area detection |
US20230085518A1 (en) * | 2021-09-14 | 2023-03-16 | Mediatek Inc. | Video processing method for detecting location, pixels, and skeleton of object, and associated video processing circuit |
CN114677586A (en) * | 2022-03-15 | 2022-06-28 | 南京邮电大学 | An automatic identification method of physical circuit experiment |
CN114708486A (en) * | 2022-04-07 | 2022-07-05 | 太原智林信息技术股份有限公司 | Automatic judging method for physical and electrical experiment operation circuit connection |
CN116363076A (en) * | 2023-03-10 | 2023-06-30 | 上海锡鼎智能科技有限公司 | Method and device for judging current flow direction of experimental circuit |
CN116503719A (en) * | 2023-03-10 | 2023-07-28 | 上海锡鼎智能科技有限公司 | Method and device for identifying connection relation of circuit experimental device |
CN117392372A (en) * | 2023-10-11 | 2024-01-12 | 上海锡鼎智能科技有限公司 | Power supply node number calculation method, calculation equipment and storage medium of access circuit |
Non-Patent Citations (1)
Title |
---|
蒋夕平;吴芳;王琦;刘桂玲;: "运用等价接线柱对仿真电学实验电路建模", 实验技术与管理, no. 06, 20 June 2011 (2011-06-20) * |
Also Published As
Publication number | Publication date |
---|---|
CN118135294B (en) | 2024-11-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110795809B (en) | Method, system and medium for substation electrical secondary circuit connection relationship based on automatic pick-up of CAD drawings | |
CN109299675B (en) | Electrical drawing based distribution box identification method and device | |
CN111612855B (en) | Object color recognition method, device and electronic equipment | |
CN108229418A (en) | Human body critical point detection method and apparatus, electronic equipment, storage medium and program | |
CN115909059A (en) | Natural resource sample library establishing method and device | |
CN109461133A (en) | Bridge bolt dropping detection method and terminal device | |
CN109949306A (en) | Reflecting face deviation detecting method, terminal device and storage medium | |
CN113255499A (en) | Digital automatic modeling method for secondary circuit of transformer substation cable | |
CN118135294A (en) | Method, system, device and medium for identifying circuit connection relationship | |
CN116188962B (en) | Error identification method and device for electric energy metering device and computer equipment | |
CN118858292A (en) | A motherboard detection method, device, equipment, and storage medium | |
CN110598704B (en) | License plate recognition non-inductive payment system based on deep learning | |
JP2014134409A (en) | Inspection method of electric wire and inspection device of electric wire | |
CN116993654B (en) | Camera module defect detection method, device, equipment, storage medium and product | |
CN115115919B (en) | Power grid equipment thermal defect identification method and device | |
CN116645502A (en) | Power transmission line image detection method and device and electronic equipment | |
CN117392372A (en) | Power supply node number calculation method, calculation equipment and storage medium of access circuit | |
CN116776404A (en) | Automatic drawing method and device for secondary circuit of power system and electronic equipment | |
CN109326324A (en) | A kind of detection method of epitope, system and terminal device | |
CN115965646A (en) | Region division method and device, computer equipment and computer readable storage medium | |
CN116503719A (en) | Method and device for identifying connection relation of circuit experimental device | |
CN116363076A (en) | Method and device for judging current flow direction of experimental circuit | |
CN115131546A (en) | Tail fiber occupation port detection method and device, electronic equipment and storage medium | |
CN115774982A (en) | Wiring quality detection method and device and storage medium | |
CN112257490A (en) | Embedded pedestrian density statistical system and method based on FPGA |
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 |