| [mmdPcb] [Up] [mmdPotatoes] | Demonstrations |
| User Feedback |
The input image is a binary image typically found in industrial automation applications. It has three types of objects: rings, nails and T-pins. Our procedure for identification of these classes of objects is based on thickening, thinning and reconstruction.
The binary image of the pieces is read.
Image a = mmBinary(mmReadgray("pieces_bw.tif")); mmShow(a);
![]() |
|
| a |
A thickening that preserves the number of connected objects is applied to reduce contour noise.
unsigned char _rA[9] = {0,1,0,1,0,1,0,0,0};
unsigned char _rB[9] = {0,0,0,0,1,0,0,0,0};
Strel seA = mmImg2se(Image(3,3,1,"binary",(char *)_rA));
Strel seB = mmImg2se(Image(3,3,1,"binary",(char *)_rB));
Interval iAB = mmSe2hmt(seA,seB);
printf("%s\n", (char *)mmIntershow(iAB));
Image b = mmThick(a, iAB);
mmShow(b);
. 1 . 1 0 1 . . .
![]() |
|
| b |
The open lines of the skeleton are pruned by the end point thinning. The remaining skeleton components will be loops, identifying the rings.
Image d = mmThin(c,mmEndpoints()); mmShow(c,d);
![]() |
|
| c,d |
It removes sucessively 4 end-points to let T junctions just on T-pins.
Image h = mmThin(g, mmEndpoints(), 4); mmShow(h);
![]() |
|
| h |
It detects triple points, applying the union of matchings with the template rotated 90 degrees. These points will identify (mark) the T-pins.
unsigned char _sA[9] = {0,1,0,1,1,1,0,0,0};
unsigned char _sB[9] = {1,0,1,0,0,0,0,1,0};
Strel seA2 = mmImg2se(Image(3,3,1,"binary",(char *)_sA));
Strel seB2 = mmImg2se(Image(3,3,1,"binary",(char *)_sB));
Image i = mmSupcanon(h, mmSe2hmt(seA2,seB2));
mmShow(h,mmDil(i,mmSedisk(2)));
![]() |
|
| h,mmDil(i,mmSedisk(2)) |
| [mmdPcb] [Up] [mmdPotatoes] | |
| User Feedback | |
| Copyright (c) 1998-2008 by SDC Information Systems |