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.
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.
Detecting square islands
The square islands are detected using an opening by a square of size 17x17.
Detecting circle islands
The circle islands are detected using an opening by an Euclidean disk on a residues image.
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);
|
| (i, m) |
|
|
| (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);
|
| (o, p) |
|
|
| (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);
|
| (r, s) |
|
|
| (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);
|
| (holes, square, circle, rect, thin, thick) |
|
|