EE 7730 Morphological Image Processing Bahadir K Gunturk
EE 7730 Morphological Image Processing Bahadir K. Gunturk
Example Two semiconductor wafer images are given. You are supposed to determine the defects based on these images. Bahadir K. Gunturk 2
Example Bahadir K. Gunturk 3
Example Absolute value of the difference Bahadir K. Gunturk 4
Example >> b = zeros(size(a)); >> b(a>100) = 1; >> figure; imshow(b, [ ]); Bahadir K. Gunturk 5
Example >> c = imerode(b, ones(3, 3)); >> figure; imshow(c, []); Bahadir K. Gunturk 6
Example >> d = imdilate(c, ones(3, 3)); >> figure; imshow(d, []); Bahadir K. Gunturk 7
Mathematical Morphology n n We defined an image as a two-dimensional function, f(x, y), of discrete (or real) coordinate variables, (x, y). An alternative definition of an image can be based on the notion that an image consists of a set of discrete (or continuous) coordinates. Bahadir K. Gunturk 8
Morphology A binary image containing two object sets A and B n n B = {(0, 0), (0, 1), (1, 0)} A = {(5, 0), (3, 1), (4, 1), (5, 1), (3, 2), (4, 2), (5, 2)} Bahadir K. Gunturk 9
Morphology n n n Sets in morphology represent the shapes of objects in an image. For example, the set A = {(a 1, a 2)} represents a point in a binary image. The set of all black pixels in a binary image is a complete description of the image. Bahadir K. Gunturk 10
Morphology n n n Morphology can be extended to gray-scale images. In gray-scale images, sets consist of elements whose components are in a 3 D space. For example, the set A = {(a 1, a 2, a 3)} is a point at coordinates (a 1, a 2) with gray-scale intensity (a 3). Bahadir K. Gunturk 11
Mathematical Morphology n n Morphology is a tool for extracting and processing image components based on shapes. Morphological techniques include filtering, erosion, dilation, thinning, pruning. Bahadir K. Gunturk 12
Basic Set Operations Bahadir K. Gunturk 13
Some Basic Definitions n n n Let A and B be sets with components a=(a 1, a 2) and b=(b 1, b 2), respectively. The translation of A by x=(x 1, x 2) is A + x = {c | c = a + x, for a A} The reflection of A is Ar = {x | x = -a for a A} The complement of A is Ac = {x | x A} The union of A and B is A B = {x | x A or x B } The intersection of A and B is A B = {x | x A and x B } Bahadir K. Gunturk 14
Some Basic Definitions n n n The difference of A and B is. A – B = A Bc = {x | x A and x B} A and B are said to be disjoint or mutually exclusive if they have no common elements. If every element of a set A is also an element of another set B, then A is said to be a subset of B. Bahadir K. Gunturk 15
Some Basic Definitions n n Dilation A B = {x | (B + x) A } Dilation expands a region. Bahadir K. Gunturk 17
Some Basic Definitions Bahadir K. Gunturk 18
Some Basic Definitions Bahadir K. Gunturk 19
Some Basic Definitions n n Erosion A B = {x | (B + x) A} Erosion shrinks a region. Bahadir K. Gunturk 20
Some Basic Definitions Bahadir K. Gunturk 21
Some Basic Definitions n n Opening is erosion followed by dilation: A B = (A B) B Opening smoothes regions, removes spurs, breaks narrow lines. Bahadir K. Gunturk 23
Some Basic Definitions Bahadir K. Gunturk 24
Some Basic Definitions n n Closing is dilation followed by erosion: A B = (A B) B Closing fills narrow gaps and holes in a region. Bahadir K. Gunturk 25
Some Basic Definitions Bahadir K. Gunturk 26
Some Basic Definitions Bahadir K. Gunturk 27
Some Morphological Algorithms n Opening followed by closing can eliminate noise: (A B) B Bahadir K. Gunturk 28
Some Morphological Algorithms Bahadir K. Gunturk 29
Some Morphological Algorithms n Boundary of a set, A, can be found by A - (A B) B Bahadir K. Gunturk 30
Some Morphological Algorithms n A region can be filled iteratively by Xk+1 = (Xk B) Ac , where k = 0, 1, … and X 0 is a point inside the region. Bahadir K. Gunturk 31
Some Morphological Algorithms Bahadir K. Gunturk 32
Some Morphological Algorithms n Connected components can be extracted iteratively by Xk+1 = (Xk B) A , where k = 0, 1, … and X 0 is the initial point. Bahadir K. Gunturk 33
Some Morphological Algorithms Application example: Using connected components to detect foreign objects in packaged food. There are four objects with significant size! Bahadir K. Gunturk 34
Some Basic Definitions n Hit-or-miss operation detects shapes A B = (A X) [Ac (W-X) ] where A consists of shape X and other shapes, B consists of shape X only, and W is a window that is larger than X. Bahadir K. Gunturk 35
Some Morphological Algorithms n n Thinning: Thin regions iteratively; retain connections and endpoints. Skeletons: Reduces regions to lines of one pixel thick; preserves shape. Convex hull: Follows outline of a region except for concavities. Pruning: Removes small branches. Bahadir K. Gunturk 36
Skeleton Bahadir K. Gunturk 38
Pruning Bahadir K. Gunturk 39
Summary Bahadir K. Gunturk 40
Summary Bahadir K. Gunturk 41
Summary Bahadir K. Gunturk 42
Summary Bahadir K. Gunturk 43
Summary Bahadir K. Gunturk 44
Extensions to Gray-Scale Images Dilation Bahadir K. Gunturk 45
Extensions to Gray-Scale Images Erosion Bahadir K. Gunturk 46
Extensions to Gray-Scale Images n n Dilation: q Makes image brighter q Reduces or eliminates dark details Erosion: q Makes image lighter q Reduces or eliminates bright details Bahadir K. Gunturk 47
Extensions to Gray-Scale Images Bahadir K. Gunturk 48
Extensions to Gray-Scale Images Opening: Narrow bright areas are reduced. Closing: Narrow dark areas are reduced. Bahadir K. Gunturk 49
Extensions to Gray-Scale Images Opening followed by closing Morphological smoothing operation. Removes or attenuates both bright and dark artifacts/noise. Bahadir K. Gunturk 50
Extensions to Gray-Scale Images Bahadir K. Gunturk 51
Application Example Bahadir K. Gunturk 52
Application Example-Segmentation Bahadir K. Gunturk 53
Application Example-Granulometry Bahadir K. Gunturk 54
- Slides: 51