0% found this document useful (0 votes)
126 views5 pages

Electronic Schematic Recognition

This document discusses an approach for automatically recognizing electronic circuit schematics and converting them into a computer-readable netlist format. The approach involves preprocessing the scanned schematic image to remove background and segment lines and text. It then extracts graphical primitives like lines, circles and arrows. Rules are used to match primitives to electronic components. The final step constructs a netlist listing components and their connections. The approach aims to enable applications like circuit simulation from schematic diagrams.

Uploaded by

Anthony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views5 pages

Electronic Schematic Recognition

This document discusses an approach for automatically recognizing electronic circuit schematics and converting them into a computer-readable netlist format. The approach involves preprocessing the scanned schematic image to remove background and segment lines and text. It then extracts graphical primitives like lines, circles and arrows. Rules are used to match primitives to electronic components. The final step constructs a netlist listing components and their connections. The approach aims to enable applications like circuit simulation from schematic diagrams.

Uploaded by

Anthony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Electronic Schematic Recognition

Donald Bailey1, Andrew Norman2, and Giovanni Moretti2

1Physics Department and 2Computer Science Department


Massey University
Palmerston North

E-mail: D.G.Bailey@massey.ac.nz, G.Moretti@massey.ac.nz

We demonstrate the feasibility of using image analysis for automatically converting from a scanned
electronic circuit schematic to a netlist of the components and their connections. A preprocessing
stage removes non-components from the image (component label and values). The image is then
segmented to produce a set of graphical primitives (lines, circles, and arrows). The recognition stage
uses rule-based templates to match primitives to components. At present, the software will only
recognise a limited range of components, although the rule-based approach allows the system to be
extended to handle a wider range of component types or styles. The final stage constructs a netlist of
components and their connectivity. Netlists are frequently used to represent electronic circuits for
simulation.

Keywords: electronic schematics, circuit recognition, image analysis, circuit netlists.

1. NEED FOR SCHEMATIC 2. RELATED WORK


RECOGNITION
This sort of problem has been considered in various
Circuit diagrams, or schematics, are a standard means forms for just about as long as computers have been
of representing electronic circuits. While this format is used for storing and manipulating documents. Very
excellent for conveying much of the relevant circuit early work was concerned with efficient
details in visual form to scientists, engineers, and representation and processing of line drawings in
hobbyists, it is not able to be readily manipulated or pictorial form [1]. Much of the more recent document
processed by computers. processing work has concentrated on distinguishing
between mixed text and figures in documents, for
Having a circuit in computer useable form is required example [2], with optical character recognition of the
for such applications as automated layout of printed text parts now being a reasonably standard operation.
circuit boards, simulating the electrical characteristics There has been some work done on interpreting
of the circuit, and maintaining a database of circuits or engineering drawings, for example [3] and [4], but
circuit modules. In all of these, a suitable relatively little on processing electronic circuit
representation of the circuit is as a netlist, that is as a diagrams.
list of components and their interconnections.
Most of the work on recognising electronic circuit
This project is examines the feasibility of using image diagrams as concentrated on logic diagrams. There,
analysis for automatically obtaining netlists from the image is broken into graphical primitives which
circuit schematics in printed form. This process are then grouped together to form gates, flip flops, and
involves recognising the various electronic component other logic symbols. Tudhope et al [5] used arcs,
symbols within the schematic and determining their circles, and lines as the primitives, and a recognised
connectivity. the components using a series of production rules.
Fahn et al [6] considered the segments between the
Electronic junction of three or more lines, and used a picture
Image of description language to match the segments forming a
Schematic Output
Circuit component. Okazaki et al [7] recognised logic gates
Recognition Netlist based on the characteristic shape of the closed loops
Schematic
System representing the symbol. The closed loops were
classified based on their projections.

Component Bley [8] segmented electrical schematics using a


Database picture graph approach. The picture graph is then
Figure 1: Circuit schematic recognition. parsed to identify dominant horizontal, vertical and
diagonal lines. Collections of lines conforming to
predefined patterns are then clustered together to give
circuit symbols using production rules.

147
Figure 2. A typical circuit schematic.

between the black and white regions within the image


as a chain of direction codes from one pixel to the
3. OUR APPROACH next around the boundary. This process is shown in
figure 3. Each boundary produces a separate chain. By
The circuit schematic needs to be scanned into the recording the location of the starting pixel with each
computer before it is processed. For many of our chain, the binary image is able to be reconstructed
initial trials, we used a video camera and frame exactly from the chain codes.
grabber. This worked well for small circuits, but had
inadequate resolution for larger diagrams. For these, a
flatbed scanner is more appropriate. The resolution 3 2
1
required depends primarily on the thickness of the
lines within the circuit schematic. There should be at 4 0
least 2 pixels across each line to prevent them from
becoming broken in subsequent processing. This also
allows any text labels to be recognised and processed 5 6 7 0070055544343420001
reliably. Figure 3. Chain coding a boundary

3.1 Preprocessing 3.1.4 Separate the text and drawing. Text is used
within circuit diagrams to label components (Q1, C2,
The scanned image is represented as an array of 8-bit RL), to provide component values (100D, 1W) or part
pixels (figure 2). A significant proportion of the image numbers (2N3055, 2N2102), to annotate the circuit
conveys no useful information (the empty space (13.6V, IL, VO) and describe its operation (current
between the components and interconnecting wires). sensor, regulator). While conveying important
Preprocessing reduces the volume of data by information, this text is not directly related to the
arranging it into a more useful compact form. component symbols. The processing is simplified by
separating the text from the rest of the image [10].
3.1.1 Background removal. The background of the The simplest approach is to use an area threshold. All
image may not be completely uniform because of chains which have an area less than this threshold are
variations in lighting. A background image is formed considered to be text, and are separated for separate
by using a maximum filter [9], selecting the maximum processing. Figure 4 shows the results of chain coding
pixel value within a scanned 15x15 window. This has and sorting the chains into text and circuit parts. Using
the effect of replacing the dark inked areas within the a simple area threshold may also remove parts of
image with adjacent background pixels. The original components, for example polarity dots of
image is subtracted from this to remove the transformers, arrows adjacent to LED, and the insides
background, leaving the lines and text. of terminal nodes. Where necessary, any of these
symbols not recognised as characters may be
3.1.2 Segmentation. The image is then thresholded reclassified as component parts.
using a single global threshold level to segment the
lines and text from the plain paper. After thresholding,
the image is binary with the white pixels representing 3.2 Extract Circuit Primitives
the information and the black pixels representing the
background. The chains represent the boundaries of the component
symbols and interconnecting lines. These need to be
3.1.3 Chain code. Chain coding provides a convenient regrouped into individual circuit symbols and
and compact method of representing binary line interconnecting wires. Our approach is to break the
drawings [1]. It works by coding the boundary pixels chains into a set of graphical primitives which are then
grouped to form the components. The graphical

148
Figure 4. Preprocessed image. Text is shown in grey, with the circuit in black.

primitives that we use are line segments, circles, and


arrowheads. Any segments completely inside a circle are likely to
form part of the same component as the circle. These
3.2.1 Vectorisation. The first step of this process is to segments are therefore associated with the circle to
break the chain into a series of approximately linear simplify the search when the component is identified.
sections. First, each chain is split into two segments at
convenient corners (the points closest to and furthest 3.2.3 Vector optimisation. All lines within the image
from the origin are easy to locate). Each segment is will produce a pair of parallel segments since the
then successively split into two segments until all the chain coding process encodes the boundary on each
resulting segments are straight to within a given side of the line. This could be avoided by first
tolerance. This process is performed as follows. For a thinning the line to a single pixel thickness before
given segment, a straight line between its two end chain coding [3], however, the thinning step would
points is considered. The point on the chain that cause problems with solid regions such as diodes or
deviates the most from this line is found. If the arrows within transistors. The vector optimisation step
deviation is less than the allowed tolerance the replaces each parallel pair with a single segment.
segment is considered straight, otherwise the segment
is split at the point of maximum deviation. This is Long lines may be broken into shorter segments
repeated recursively until all of the segments are because of noise or scanning nonlinearities. Such
straight. A tolerance is necessary to prevent diagonal segments are rejoined if they are collinear to within 5
lines from being broken into very short segments, and degrees.
to provide some noise immunity. We found a
tolerance of 1.5 pixels to be about optimal. 3.2.4 Identification of arrows. To make the
identification of transistors and diodes easier, it is
3.2.2 Circle identification. Many components or necessary to detect arrow heads. Arrows consist of a
circuit parts have circles associated with the symbol. group of three segments forming an acute isosceles
These include transistors, input/output (I/O) nodes, triangle. The set of segments is searched to find all
and junctions. Any circles or circular arcs within the such triangular features. Where the triangle is
image will be broken into a series of line segments by equilateral, the base of the arrow head is defined as
the vectorisation stage. Reconstructing these into the segment which has another segment closest to its
circles simplifies the subsequent component centre. This identification is important, because many
recognition stage. of the arrows are equilateral triangles.

By scanning through the list of segments, for each pair Figure 5 shows the graphical primitives (circles, lines
of adjacent segments the radius and central position of and arrows) that were extracted from the example
the potential arc are calculated. Arcs with improbable image.
radius or and inappropriate angle between the
segments are eliminated. Once all possible arcs have 3.3 Component recognition
been identified, they are grouped into circles based on
centre location and radius. Those circles which are The most complex stage is recognising the
represented by a significant proportion of their components from the primitives. We used a series of
perimeter are retained, while the others revert to their rules to define the configuration of primitives making
linear segments. The linear segments making up the up each component. This approach was chosen
circle are deleted, being replaced by the circle because it allows the rules to be modified or extended
primitive. (to recognise new components) without changing the
recognition software. The rules are stored as a text file
containing multiple component definitions.

149
Figure 5. Graphical primitives extracted from the schematic.

component definition is completely satisfied, the


3.3.1 Component definitions. Each component component is given a unique identifier, and is added
definition starts with the name of the component in to the component output list. After all components
square brackets, followed by a series of rules and an matching that definition have been found, the search
output definition (as illustrated in figure 6). proceeds with the next component definition. The
search continues until every component definition has
[Diode] Component name been examined, or there are no primitives remaining
ARROW (B,P) Critical points to be matched.
ARROW (P) MIDLINE 90 Rule statement
EMIT B P Output definition 3.3.4 Construct the netlist. The component
recognition phase includes component definitions for
Figure 6: An example of a component definition junctions and interconnecting wires. These are
removed and replaced by netlist node numbers in the
Any given component may have multiple component
following manner:
definitions, where each separate definition can be used
1. Two wires connected together are replaced by a
to recognise the component independently of the
single wire.
others. This allows variations in components to be
2. Two junctions connected by a wire are combined
recognised, for example a resistor may be represented
together, and the wire eliminated.
by a rectangular box, or as a series of 7 angled lines.
3. A junction connected to an I/O node is eliminated,
Rules within the set define the following: being replaced by the I/O node.
• length of a line 4. A wire between a junction and a component is
• relationships between pairs of lines eliminated, being replaced directly by the junction.
• radius of a circle 5. A wire between two components is replaced by a
• number of connections to a circle junction.
• direction of an arrow within a circle
This process eliminates all interconnecting wires, and
• relationship between an arrow and a line
replaces interconnected junctions with a single
• relationship between a line and a component
junction or I/O node. The final step is to assign a node
3.3.2 Critical points. Every component in the image number to each junction, and output the netlist. The
has a series of critical points, whether they are the netlist for this example is shown in table 1.
ends of a resistor, or the terminals of a transistor.
Many of the rules have a mechanism for extracting Table 1: The resulting netlist.
these critical points, so that they may be output with I/O nodes: I1 1
the component identifier. During the recognition I2 2
stage, the critical points are simply positions within I3 3
the input image. Resistors: R1 1,4
R2 5,6
3.3.3 Rule search. Each component definition is R3 5,2
checked in turn. When searching for a component, R4 2,3
each rule in turn is matched to the remaining R5 2,3
primitives. If a match is found, those primitives are Capacitors: C1 4,3
added to the component and the next rule is examined. C2 2,3
If any of the rules is unable to be matched for the Transistors: T1 4,1,5
current component, the search backtracks to check for T2 6,4,2
alternative matches to previous rules. When the Zener diodes: Z1 3,4

150
4. EXTENSIONS 6. REFERENCES
In this preliminary study, we have made no attempt to [1] H. Freeman, Computer Processing of Line
process the text associated with the schematic. For the Drawing Images, ACM Computing Surveys, 6,
netlist to be complete, it needs to be augmented with 57-97 1974.
component values and part descriptions. This process
is complex as it not only requires an optical character [2] P.J. Bones, T.C. Griffin, C.M. Carey-Smith, A
recognition stage but also recognising whether an item Projection-based Algorithm for Document
of text is associated with a single component (a Image Segmentation, Proceedings of the 5th NZ
component label, R3; a component modifier, + on Image Processing Workshop, 87-93, 1990.
electrolytic capacitor; a component value 1.2kD), a
group of components, or is a stand-alone annotation. [3] C.C. Han, K.C. Fan, Skeleton Generation of
A rule of associating text to the nearest component Engineering Drawings via Contour Matching,
would work for most schematics, although where Pattern Recognition, 27 (2) 262-275, 1994.
components are drawn close together, this could lead
to errors. [4] Y.H. Yu, A. Samal, S. Seth, Isolating Symbols
from Connection Lines in a Class of Engineering
The current system only has rules for recognising the Drawings, Pattern Recognition, 27 (3) 391-404,
most common components. To be useful, it needs to 1994.
be extended to recognise a wider range of
components. This can be accomplished by adding [5] D.S. Tudhope, J.V. Oldfield, A High-Level
further component definitions to the rule file. Recognizer for Schematic Diagrams, IEEE
Computer Graphics and Applications 3 (3) 33-
The current rule set is not sufficient to be able to 40, 1983.
recognise some classes of component. Rules are
required for combining symbols or components based [6] C.S. Fahn, J.F. Wang, J.Y. Lee, A Topology-
on proximity. This would allow, for example, Based Component Extractor for Understanding
discrimination between related components such as Electronic Circuit Diagrams, Computer Vision
standard diodes, light-emitting diodes, and Graphics and Image Processing 44 (2) 119-138,
photodiodes. 1988.

The rules are very specific in what they allow. [7] A. Okazaki, T. Kondo, K. Mori, S. Tsunekawa,
However, there are a variety of different standards of E. Kawamoto, An Automatic Circuit Diagram
representing many components. For example, a Reader with Loop-Structure-Based Symbol
variety of different transistor symbol styles is shown Recognition, IEEE Transactions on Pattern
in figure 7. To recognise all of the variations, one Analysis and Machine Intelligence, 10 (3) 331-
approach would be to have different component 341, 1988.
definitions for each standard. An alternative is to have
rules which allow the optional inclusion of graphical [8] H. Bley, Segmentation and Preprocessing of
primitives. Electrical Schematics Using Picture Graphs, 28
(3) 271-288, 1984.

[9] Y. Nakagawa and A. Rosenfeld, A Note on the


Use of Local MIN and MAX Operations in
Digital Picture Processing, IEEE Transactions
on Systems, Man and Cybernetics, 8, 632-635,
Figure 7. Transistor symbols from a range of sources. 1978.

[10] R. Kasturi, S.T. Bow, W. El-Masri, J. Shah, J.R.


5. CONCLUSIONS Gattiker, and U.B. Mokate, A System for
Interpretation of Line Drawings, IEEE
Our preliminary study has demonstrated the feasibility Transactions on Pattern Analysis and Machine
of automatically constructing a basic netlist from an Intelligence, 12 (10) 978-992, 1990.
electronic circuit schematic. Further work is required
to augment the netlist with component values, and to
extend the range of components that can be
recognised.

151

You might also like