Professional Documents
Culture Documents
morphologie mathmatique
1965 :
1973 : (, )
1978 :
1.
(set operation)
N x Mp[0, N
x M-1]column xrow yp = x+Nyp
x = p mod N
y = p/N
AB
aindexA a AaAa A
A B A B
aA
a A a B
AB(Union)
C = AB
AB
C = {p|p A or p B (or both)}
AN M G
p = WHERE(A)
x = p mod N
y = p/N
AB(intersection)
D = AB = {p|p A and p B}
AB
AB =
A(complement)GA:
c
A = {w|w G and w A}
AB(difference)
c
A B = {w|w A and w B} = AB
A(reflection)
A()
A B = U ( A + b)
bB
Minkowski
A B = I ( A + b)
bB
2.
(discrete space)Z2
A :
A = { a|property(a)==TRUE }
AAc (A) :
Ac = { a| a A }
(dilation)
(erosion)
(dilation)(erosion) A
(local window) structuring element(SE) B)
Minkowski (dilation)(erosion)
(dilation)
D( A, B ) = A B = U ( A + b)
bB
(erosion):
E ( A, B ) = A( B ) = I ( A b)
bB
B = {-b| bB}
(dilation)(erosion)
SE 4-connected 8-connected
, N4 N8
(dilation)(erosion):
Commutative
Non-Commutative
Associative
Translation Invariance
Duality
(Opening)(Closing)
dilation erosion
(Opening)
O(AB)= A o B = (A B) B = D(E(AB)B)
(Closing)
C(AB) = A B = ( A B) B =E(D(A, -B),-B)
:
1. A o B is a subset (subimage) of A.
2. If C is subset of D, then C o B is a subset (subimage) of D o B .
3. ( A o B) o B = ( A o B) .
:
1. A is a subset (subimage) of A B .
2. If C is subset of D, then C B is a subset (subimage) of D B .
3. ( A B) B = ( A B) .
(residual)
Residual A
AB =A \ ( A o B )
3.
#include "array.h"
/*-------------------------------------------------------------*/
//
//
MIAT Lab
//
CHEN Ching-Han2004.11.18
/*-------------------------------------------------------------*/
#define OBJ 0
// object
int seX[NumPtSet]={0,-1,0,1,0},seY[NumPtSet]={-1,0,0,0,1};
//-------------------------------------------------------------//
//
//
//-----------------------------------------------------------------//
void binaryDilation(uc2D &im1, uc2D &im2)
{
for(int i=0;i<nr;i++)for(int j=0;j<nc;j++)im2.m[i][j]=im1.m[i][j];
for(int i=1;i<nr-1;i++)for(int j=1;j<nc-1;j++)
{
if(im1.m[i][j]==BG)
for(int k=0;k<NumPtSet;k++)if(im1.m[i+seY[k]][j+seX[k]]==OBJ)
{
im2.m[i][j]=OBJ;
break;
}
}
}
void binaryErosion(uc2D &im1, uc2D &im2)
{
for(int i=0;i<nr;i++)for(int j=0;j<nc;j++)im2.m[i][j]=im1.m[i][j];
for(int i=1;i<nr-1;i++)for(int j=1;j<nc-1;j++)
{
if(im1.m[i][j]==OBJ)
for(int k=0;k<NumPtSet;k++)if(im1.m[i+seY[k]][j+seX[k]]==BG)
{
im2.m[i][j]=BG;
break;
}
}
}
void edgeDetection(uc2D &im1, uc2D &im2)
{
clearImage(im2);
for(int i=1;i<nr-1;i++)for(int j=1;j<nc-1;j++)
{
if(im1.m[i][j]==BG)
for(int k=0;k<NumPtSet;k++)if(im1.m[i+seY[k]][j+seX[k]]==OBJ)
{
im2.m[i][j]=OBJ;
break;
}
}
}
void binaryClosing(uc2D &im1, uc2D &im2)
{
binaryDilation(im1,im2);
binaryErosion(im2,im1);
for(int i=0;i<nr;i++)for(int j=0;j<nc;j++)im2.m[i][j]=im1.m[i][j];
}
1
boundary Image = A-(A B)
(a)(miat400x200.raw)
(b) residual
4. Hit-or-Miss Transform
Hit-or-Miss transform(H-M)
(B1,B2)
B1B2 disjoint(B1 B2 = )
H-M(template matching)B1B2
H-MB1B2
B1B2
(corner)
H-M
H-M OR
(ending point)
0
1
1
1
1
1
1
2finger120x120.rawHit-or-Miss
5.
(skeleton):
i) (one-pixel),
ii) (middle),
iii) (topology)
(skeleton subset )
K Sk(A) B disc
convex, boundedsymmetricSk(A)
(thinning) hit-and-miss :
B1 B2,
:
),
),
).
(i)
(counting)
(ii) (i + ii)
(closed
ring)(i + ii + iii)(complete skeleton)
A
S
S ;
While A
E (A B) ;
S S (A \ ( A B ) );
A E;
End While
3 miat400x200.raw