Professional Documents
Culture Documents
M o R P H o L o G I C A L I M A G e P R o C e S S I N G
M o R P H o L o G I C A L I M A G e P R o C e S S I N G
- Morphology
A branch of biology that deals with the form and structure of
animals and plants
- Mathematical morphology
A tool to extract image components for representing and describing
region shapes
y E.g.: boundary, skeleton, convex hull
y Union of A and B: A B
y Intersection of A and B: A B
y Difference of A and B: A B = {w | w A, w B} = A Bc
y Reflection of B: B = {w | w = b, for b B}
y Translation of A by point z = (z1, z2): (A)z = {c | c = a + z, for a A}
- MATLAB set operations on binary images
Set Operation
A B
A B
c
A
A B
MATLAB Expression
A&B
A|B
~A
A & ~B
Name
AND
OR
NOT
DIFFERENCE
(b) Dilation
- Dilation: grow or thicken an object in a binary image
y Extent of thickening controlled by a structuring element
9-2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
1
0
0
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
0
0
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
When the structuring element overlaps 1-valued pixels, the pixel at the
origin is marked 1
y Commutative: A B = B A
9-3
y Associative: A (B C) = (A B) C
* If B = (B1 B2), then A B = A (B1 B2) = (A B1) B2
Dilate A by B1, and then dilate the result by B2 (decomposition)
* E.g., decomposing a structuring element saves computational cost
MATLAB decomposes structuring element automatically
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1 1 1 1 1 1
1
1
9-4
(c) Erosion
- Erosion: shrink or thin an object in a binary image
y Extent of shrinking controlled by a structuring element
y Erosion of image A and structuring element B: A \ B
c
A \ B = {z | (B)z A }
c
The set of all points z such that the intersection of (B)z with A is
nonempty
0
0
0
0
0
0
1
1
1
0
0
1
1
1
0
0
1
1
1
0
0
1
1
1
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
9-5
When the structuring element overlaps only 1-valued pixels, the pixel at
the origin is marked 1 (i.e., does not overlap background)
A1
A2
MATLAB: imopen( )
- Closing: smooths the contour, fuses narrow breaks and long thin gulfs, and
eliminates small holes
(A B) = (A B) \B = {z | (B)z A }
Dilation followed by erosion, MATLAB: imclose( )
9-7
y E.g., identify
0 1 0
1 1 1
0 1 0
1
1 1 1
1
B2 1
A \ B1:
A:
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
1
1
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
1
1
0
0
0
1
0
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
Ac:
1
1
1
1
1
1
1
B1
1
1
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
1
1
1
0
1
0
1
0
1
0
0
0
0
0
0
1
0
0
1
0
1
0
1
0
0
0
0
1
0
1
0
0
0
0
0
0
1
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
0
1
0
1
Ac \ B2:
1
0
0
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
0
0
0
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
0
0
1
1
1
0
1
0
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
0
0
0
0
0
0
1
1
1
0
1
0
1
1
0
0
0
0
0
0
1
A B1:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
9-8
- Region filling
Xk = (Xk1 B) Ac
k = 1, 2, 3
y MATLAB
A = im2bw(imread('eye.tif')); B = [0 1 0; 1 1 1; 0 1 0];
Xk = zeros(size(A)); Xk1 = Xk; Xk(85, 70) = 1;
while any(Xk(:) ~= Xk1(:))
Xk1 = Xk;
Xk = imdilate(Xk1, B) & ~A;
end
A1 = Xk | A;
eye.tif
Region filled
* Problem: need to find the initial point
Solution?
Xk = (Xk1 B) A
k = 1, 2, 3
a.tif
- Convex hull
y A set A is convex if the straight line segment joining any two points
in A lies entirely within A
y Convex hull H of set S is the smallest convex set containing S
y H S: convex deficiency of S
1
B
2
B
B3
B4
D =X
i
i
conv
C ( A) = U D i
i =1
- Thinning
A ~ B = A (A B) = A (A B)c
2
B
B1
B3
B4
B5
6
B
B7
B8
9-13
(a) 2 N(p1) 6
(b) T(p1) = 1
(c) p2 p4 p6 = 0
(d) p4 p6 p8 = 0
p9
p2
p3
p8
p1
p4
p7
p6
p5
N ( p1 ) = i = 2 pi
9
(d') p2 p6 p8 = 0;
y Description:
p1
p1
9-16
p2
p4
p8
p6
p4
p6
(Def. 1)
(Def. 2)
9-17
y E.g.:
Image
Thinning
9-18
or bwmorph(bw, operation, n)
Opening
Closing
9-21
9-22
Fig. 1
Fig. 2
Fig. 4
Fig. 5
Fig. 3
9-23