[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmdpcb - Decompose a printed circuit board in its main parts.


Description
The input image is a binary image of a printed circuit board. The decomposition is created mainly using openings by structural elements that depends on the geometry of the circuit board.

Reading

The binary image of a printed circuit board is read.

a = mmreadgray('pcb1bin.tif');
mmshow(a);
image
(a)

Detecting holes

A new image is created by filling the holes. The input image is subtracted from this new image with holes. The resulting residues are the holes.

b = mmclohole(a);
holes = mmsubm(b,a);
mmshow(b);
mmshow(a, holes);
image
(b)
image
(a, holes)

Detecting square islands

The square islands are detected using an opening by a square of size 17x17.

c = mmopen(b,mmsebox(8));
square = mmcdil(c, a);
mmshow(b, c);
mmshow(holes, square);
image
(b, c)
image
(holes, square)

Detecting circle islands

The circle islands are detected using an opening by an Euclidean disk on a residues image.

f = mmsubm(b, c);
g = mmopen(f, mmsedisk(8));
circle = mmcdil(g,a);
mmshow(f, g);
mmshow(holes, square, circle);
image
(f, g)
image
(holes, square, circle)

Detecting rectangular islands

The rectangular islands are detected using a composition of two opening by line segments on a residues image.

i = mmsubm(f, g);
m = mmopen(mmopen(i,mmseline(8,90)), mmseline(25));
rect = mmcdil(m,a);
rect = mmedgeoff(rect);
mmshow(i, m);
mmshow(holes, square, circle, rect);
image
(i, m)
image
(holes, square, circle, rect)

Detecting thick connections

The thick connections are detected using an opening by a square on a residues image.

o = mmsubm(i,m);
p = mmopen(o, mmsebox(2));
thin = mmcdil(p,a);
mmshow(o, p);
mmshow(holes, square, circle, rect, thin);
image
(o, p)
image
(holes, square, circle, rect, thin)

Detecting thin connections

The thin connections are detected using an opening by a square on a residues image.

r = mmsubm(o,p);
s = mmopen(r, mmsebox);
thick = mmcdil(s,a);
mmshow(r, s);
mmshow(holes, square, circle, rect, thin, thick);
image
(r, s)
image
(holes, square, circle, rect, thin, thick)

Displaying all together

The main components of the circuit are overlayed and presented in a single image.

mmshow(holes, square, circle, rect, thin, thick);
image
(holes, square, circle, rect, thin, thick)

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems