Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
7-1-1994
Heuristics for selecting gray scale morphological
structuring elements
Paul Fetter
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion in Theses by an authorized administrator of RIT Scholar Works. For more information, please [email protected].
Recommended Citation
Heuristics for Selecting Gray Scale
Morphological Structuring Elements
by
Paul
Fetter
A Thesis Submitted
ill
Partial Fulfillment of the
Requirements for the Degree of
MASTER OF SCIENCE
ill
Computer Engineering
Approved by:
Graduate Advisor - Roy S. Czemikowski, Professor and Department Head
Ronald G. Matteson, Professor
Tony H. Chang, Professor
Department of Computer Engineering
College of Engineering
Rochester Institute of Technology
Rochester, New York
THESIS RELEASE PERMISSION FORM
ROCHESTER INSTITUTE OF TECHNOLOGY
COLLEGE OF ENGINEERING
Title: Heuristics for Selecting Gray Scale Morphological Structuring Elements
I, Paul Fetter, hereby grant pennission to the Wallace Memorial Library to
reproduce my thesis in whole or part.
Signature:
Date:
7~.2f}
/2f'f
ABSTRACT
This
thesis explores someheuristics
for
choosing
8
bit
gray
scalemorphological
structuring
elementsfor reducing
noise.The
variables of size,shape and volume that enter
into
the choice ofstructuring
elements create avery
large
number ofpossiblestructuring
elements.Some
generalheuristics
toguide the choice of an appropriate
structuring
element will make the taskeasier.
Both
the absolute error oftheimage
and the appearance oftheimage
will
be
used tojudge
the results.The
experiments were performed on3
images.
Each
of theimages had
noise addedbefore
processing; one set ofdata had 10
percent ofthe pixelsdisturbed
by
noise, the otherhad 20
percentof the pixels
disturbed
by
noise.The
resulting 6 images
were thenfiltered
with
10
different structuring
elements and theresulting images
were thencompared against the respective
baseline image.
The
conclusions wereguided
by
theresulting
absolute error values.This
document
was producedusing
Microsoft
Windows
version3.1,
Microsoft
Word for Windows
version6.0a,
andMathcad
version4.0 for
Windows.
The
C
program wasdeveloped using
Borland
C
version3.1.
AH
oftheprograms were run on a
Gateway
2000 486/33
PC
clone.The
following
names usedhere
andin
the remainder of thedocument
areregisteredtrademarks ofthe respective companies:
Windows
Word
for
Windows
Mathcad
Quattro
IPro
Borland
C
Microsoft Corporation
Microsoft Corporation
Mathsoft Corporation
Borland International
Borland International
Copyright
1994
by
Paul Fetter
All
rights
reservedTable
of
Contents
THESIS RELEASE PERMISSION FORM
ii
ABSTRACT
jjj
TABLE OF
CONTENTS
vLIST OF FIGURES
viiiLIST
OF TABLES
xxiiLIST
OF EQUATIONS
xxiiiGLOSSARY
xxiv1.
BINARY MORPHOLOGY
1
1.1. Input 1
1.2.Dilation 2
1.3.Erosion 2
1.4. Open 4
1.5. Close 4
2.
GRAY SCALE
MORPHOLOGY
5
2.1.1. Umbra Transform 5
2.2. MorphologicalDilation 7
2.3.Morphological Erosion 10
2.4. Morphological
Opening
122.5. Morphological
Closing
122.6. Common Transformsandfilters 13
3. EXPERIMENTAL
PROCEDURE
15
3.1. Basics 15
3.2. Noise 15
3.3. Input Images 15
3.4.
Structuring
Elements 153.5.
Naming
Scheme 284. RESULTS
29
4.1. CokeImages 31
4.2.Girl Images 45
4.3.
Roy
Images59
5. CONCLUSIONS
73
5.1. NumericalResults 73
5.2.VisualResults 78
6.
LITERATURE
CITED
78
List
of
Figures
FIGURE2-1 GRAPHOF ANARBITRARYFUNCTION
6
FIGURE 2-2 GRAPH OFANUMBRA 7
FIGURE 3-1BASELINECOKEIMAGE 16
FIGURE 3-2 COKEIMAGE WITH 10 PERCENT ERROR 17
FIGURE3-3 COKEIMAGE WITH20PERCENT ERROR 18
FIGURE3-4BASELINE GIRLIMAGE 19
FIGURE3-5 GIRLIMAGE WITH 10 PERCENT ERROR 20
FIGURE3-6 GIRLIMAGE WITH20PERCENT ERROR 21
FIGURE3-7BASELINE ROY IMAGE 22
FIGURE3-8ROY IMAGE WITH 10 PERCENT ERROR 23
FIGURE 3-9ROY IMAGE WITH20PERCENT ERROR 24
FIGURE4-1 20 PCT.ERR. DILATED BY FLAT SEOF SIZE 3 31
FIGURE4-220PCT. ERR. DILATED BY FLATSE OF SIZE 5 31
FIGURE 4-3 20PCT. ERR. DILATED BY FLATSEOF SIZE 7 31
FIGURE 4-410PCT. ERR. DILATED BY FLATSEOFSIZE3 31
FIGURE 4-5 10PCT. ERR. DILATED BY FLATSE OF SIZE 5 32
FIGURE 4-6 10 PCT. ERR.DILATED BY FLAT SEOF SIZE 7 32
FIGURE4-7 20PCT. ERR. ERODED BY FLATSE OF SIZE 3 32
FIGURE4-8 20PCT. ERR. ERODED BY FLATSE OF SIZE5 32
FIGURE4-9 20 PCT.ERR. ERODED BY FLATSE OF SIZE 7 32
FIGURE4-10 10PCT. ERR. ERODEDBYFLAT SE OF SIZE 3 32
FIGURE 4-1110 PCT.ERR. ERODED BY FLAT SE OF SIZE5 33
FIGURE4-12 10PCT. ERR.ERODED BYFLAT SEOFSIZE7 33
FIGURE4-13 20 PCT.ERR.OPENED BY FLATSE OF SIZE 3 33
FIGURE 4-1420PCT. ERR.OPENED BY FLAT SE OF SIZE5 33
FIGURE4-15 20PCT. ERR.OPENEDBY FLAT SE OF SIZE7 33
FIGURE4-16 10PCT. ERR. OPENEDBY FLATSEOF SIZE3 33
FIGURE4-17 10PCT.ERR. OPENED BY FLAT SE OF SIZE5 34
FIGURE4-18 10 PCT. ERR.OPENEDBY FLATSE OF SIZE 7 34
FIGURE4-19 20 PCT.ERR.CLOSEDBY FLAT SE OF SIZE3 34
FIGURE4-2020PCT.ERR. CLOSED BY FLATSEOF SIZE5 34
FIGURE4-21 20PCT.ERR.CLOSED BY FLATSE OF SIZE 7 34
FIGURE 4-22 10 PCT. ERR. CLOSED BY FLAT SE OF SIZE3 34
FIGURE4-23 10 PCT. ERR. CLOSED BY FLAT SE OF SIZE5 35
FIGURE 4-24 10PCT.ERR. CLOSEDBY FLATSE OF SIZE 7 35
FIGURE4-25 20 PCT.ERR. DILATED BY PYRAMIDSE OF SIZE 3 35
FIGURE4-2620PCT. ERR. DILATED BY PYRAMID SE OF SIZE 5 35
FIGURE4-27 20 PCT. ERR.DILATED BY PYRAMID SE OF SIZE7 35
FIGURE4-28 10PCT. ERR.DILATED BY PYRAMIDSE OF SIZE 3 35
FIGURE
4-29
10PCT.ERR. DILATED BY PYRAMIDSE OF SIZE 5 36FIGURE4-30 10 PCT. ERR.DILATED BY PYRAMIDSE OF SIZE 7
36
FIGURE4-3120 PCT.ERR. ERODED BY PYRAMIDSE OFSIZE3 36
FIGURE4-32 20 PCT.ERR. ERODED BYPYRAMID SE OFSIZE5 36
FIGURE4-33 20 PCT.ERR. ERODED BY PYRAMID SE OFSIZE7 36
FIGURE4-34 10 PCT. ERR. ERODED BYPYRAMID SEOF SIZE3 36
FIGURE4-35 10PCT. ERR. ERODED BY PYRAMID SE OF SIZE5 37
FIGURE4-36 10PCT. ERR. ERODED BY PYRAMID SE OF SIZE 7 37
FIGURE4-37 20 PCT.ERR.OPENEDBY PYRAMID SEOF SIZE3 37
FIGURE4-38 20PCT. ERR. OPENED BY PYRAMID SE OF SIZE5 37
FIGURE 4-39 20PCT. ERR. OPENED BY PYRAMID SEOF SIZE 7 37
FIGURE4-40 10 PCT. ERR. OPENED BY PYRAMID SE OFSIZE 3 37
FIGURE4-41 10PCT. ERR. OPENED BY PYRAMID SE OF SIZE5 38
FIGURE4-42 10 PCT.ERR. OPENED BY PYRAMID SEOF SIZE 7 38
FIGURE4-43 20PCT.ERR.CLOSED BY PYRAMID SE OF SIZE 3 38
FIGURE 4-4420PCT. ERR. CLOSED BY PYRAMID SE OF SIZE5 38
FIGURE4-45 20PCT. ERR. CLOSED BY PYRAMIDSEOF SIZE 7 38
FIGURE4-46 10 PCT. ERR. CLOSED BY PYRAMID SE OF SIZE 3 38
FIGURE4-47 10PCT. ERR.CLOSED BY PYRAMID SEOFSIZE 5
39
FIGURE4-48 10 PCT.ERR. CLOSED BY PYRAMID SE OFSIZE 7
39
FIGURE
4-49
20PCT. ERR. DILATED BY DOMESE OF SIZE 539
FIGURE4-50 20PCT. ERR. DILATED BY DOMESEOFSIZE 7
39
FIGURE 4-51 10 PCT. ERR.DILATEDBY DOME SE OF SIZE 5
39
FIGURE4-53 20 PCT.ERR. ERODED BY DOME SEOFSIZE5 40
FIGURE 4-5420 PCT.ERR. ERODED BY DOMESEOF SIZE 7 40
FIGURE4-55 10 PCT. ERR. ERODED BY DOME SE OF SIZE5 40
FIGURE4-56 10PCT. ERR. ERODED BY DOMESE OF SIZE7 40
FIGURE4-57 20PCT. ERR. OPENEDBY DOMESE OF SIZE 5 40
FIGURE4-58 20PCT.ERR. OPENEDBY DOME SEOF SIZE7 40
FIGURE4-59 10PCT. ERR.OPENED BY DOME SE OF SIZE5 41
FIGURE4-60 10 PCT.ERR. OPENEDBY DOMESE OF SIZE7 41
FIGURE4-61 20PCT. ERR. CLOSED BY DOME SE OF SIZE5 41
FIGURE 4-6220 PCT. ERR.CLOSED BY DOME SE OF SIZE7 41
FIGURE 4-63 10 PCT. ERR. CLOSED BY DOME SE OFSIZE 5 41
FIGURE 4-6410 PCT.ERR.CLOSED BY DOMESE OF SIZE7 41
FIGURE4-65 20PCT. ERR. DILATED BY CONCAVE SE OF SIZE5 42
FIGURE4-66 10 PCT. ERR. DILATED BYCONCAVE SE OF SIZE 5 42
FIGURE4-67 20 PCT. ERR.DILATED BYCONCAVE SE OF SIZE 7 42
FIGURE4-68 10PCT. ERR. DILATED BYCONCAVE SE OF SIZE 7 42
FIGURE4-69 20PCT.ERR.ERODED BY CONCAVESE OF SIZE 5 42
FIGURE4-70 10PCT.ERR.ERODED BYCONCAVE SE OF SIZE 5 42
FIGURE 4-71 20PCT. ERR. ERODED BYCONCAVE SE OF SIZE7 43
FIGURE4-72 10PCT. ERR. ERODED BYCONCAVE SE OF SIZE 7 43
FIGURE 4-7320 PCT.ERR.OPENEDBYCONCAVE SE OF SIZE 5 43
FIGURE 4-7410PCT.ERR.OPENED BYCONCAVE SE OF SIZE 5
43
FIGURE4-75 20PCT. ERR.OPENEDBYCONCAVE SE OF SIZE7 43
FIGURE4-76 10 PCT.ERR. OPENEDBYCONCAVE SE OF SIZE7 43
FIGURE4-77 20 PCT. ERR. CLOSED BYCONCAVESE OF SIZE5 44
FIGURE4-78 10 PCT. ERR.CLOSEDBYCONCAVE SE OFSIZE5 44
FIGURE4-79 20 PCT. ERR.CLOSED BYCONCAVE SE OFSIZE 7 44
FIGURE4-80 10PCT. ERR. CLOSED BYCONCAVE SE OFSIZE 7 44
FIGURE 4-81 20PCT. ERR. DILATED BY FLAT SE OF SIZE3 45
FIGURE 4-82 20PCT.ERR.DILATED BY FLATSEOFSIZE5 45
FIGURE 4-8320 PCT.ERR. DILATED BY FLAT SEOFSIZE 7 45
FIGURE 4-84 10 PCT. ERR. DILATED BY FLATSE OFSIZE3 45
FIGURE4-85 10PCT.ERR. DILATED BY FLAT SEOF SIZE 5 45
FIGURE4-86 10 PCT. ERR. DILATED BY FLAT SE OF SIZE 7 45
FIGURE4-87 20PCT. ERR. ERODED BY FLAT SE OF SIZE 3 46
FIGURE4-88 20PCT.ERR. ERODED BY FLATSE OF SIZE 5 46
FIGURE4-89 20PCT. ERR. ERODED BY FLAT SE OF SIZE 7 46
FIGURE4-90 10 PCT. ERR. ERODED BY FLATSE OF SIZE 3 46
FIGURE4-91 10 PCT. ERR. ERODED BY FLATSEOFSIZE 5 46
FIGURE 4-92 10PCT. ERR. ERODED BY FLATSE OF SIZE7 46
FIGURE 4-9320PCT. ERR. OPENED BY FLATSE OF SIZE 3 47
FIGURE 4-9420PCT. ERR. OPENED BY FLATSE OF SIZE 5 47
FIGURE4-95 20 PCT.ERR. OPENED BY FLATSE OF SIZE 7 47
FIGURE4-96 10 PCT.ERR. OPENEDBYFLATSEOF SIZE
3
47FIGURE4-97 10 PCT. ERR. OPENED BY FLATSEOF SIZE5 47
FIGURE 4-98 10PCT.ERR. OPENEDBY FLAT SE OF SIZE 7 47
FIGURE
4-99
20 PCT. ERR. CLOSEDBY FLATSE OFSIZE3 48FIGURE4-100 20PCT.ERR.CLOSEDBY FLAT SE OF SIZE5 48
FIGURE4-101 20 PCT.ERR.CLOSEDBY FLAT SE OF SIZE7 48
FIGURE 4-102 10 PCT.ERR.CLOSEDBY FLAT SE OF SIZE3 48
FIGURE4-103 10 PCT. ERR. CLOSED BY FLAT SEOF SIZE5 48
FIGURE 4-104 10 PCT. ERR. CLOSED BY FLAT SE OF SIZE 7 48
FIGURE4-105 20 PCT.ERR. DILATED BY PYRAMID SEOFSIZE3 49
FIGURE4-10620PCT. ERR. DILATED BY PYRAMID SE OF SIZE5 49
FIGURE4-107 20PCT. ERR. DILATED BY PYRAMID SE OF SIZE 7
49
FIGURE4-108 10PCT. ERR. DILATED BY PYRAMIDSE OF SIZE 3 49
FIGURE4-109 10 PCT. ERR. DILATED BY PYRAMID SE OFSIZE 5 49
FIGURE4-110 10PCT. ERR. DILATED BY PYRAMID SE OF SIZE 7 49
FIGURE4-111 20PCT. ERR. ERODED BY PYRAMID SE OF SIZE3 50
FIGURE4-112 20PCT. ERR. ERODED BY PYRAMID SE OF SIZE 5 50
FIGURE4-113 20 PCT.ERR. ERODED BY PYRAMIDSE OF SIZE 7 50
FIGURE 4-114 10PCT. ERR. ERODED BY PYRAMIDSE OF SIZE 3 50
FIGURE4-115 10PCT. ERR. ERODED BY PYRAMTDSE OF SIZE 5 50
FIGURE 4-116 10PCT. ERR. ERODED BY PYRAMIDSE OF SIZE 7 50
FIGURE 4-117 20 PCT.ERR. OPENEDBYPYRAMIDSE OF SIZE 3 51
FIGURE4-118 20 PCT. ERR.OPENED BY PYRAMIDSE OF SIZE 5 51
FIGURE 4-119 20 PCT.ERR.OPENEDBYPYRAMID SE OFSIZE7 51
FIGURE 4-120 10PCT.ERR.OPENEDBY PYRAMID SEOF SIZE 3 51
FIGURE 4-121 10PCT.ERR.OPENEDBY PYRAMIDSEOF SIZE5 51
FIGURE 4-122 10 PCT. ERR. OPENED BY PYRAMID SEOF SIZE7 51
FIGURE4-123 20PCT. ERR. CLOSEDBY PYRAMIDSE OFSIZE3 52
FIGURE 4-12420 PCT.ERR.CLOSEDBY PYRAMIDSE OF SIZE5 52
FIGURE4-125 20PCT.ERR.CLOSED BY PYRAMID SE OF SIZE 7 52
FIGURE4-126 10PCT.ERR.CLOSED BY PYRAMIDSE OF SIZE3 52
FIGURE 4-127 10 PCT. ERR.CLOSEDBY PYRAMID SE OF SIZE5 52
FIGURE 4-128 10 PCT. ERR. CLOSED BY PYRAMID SE OF SIZE 7 52
FIGURE4-129 20PCT. ERR. DILATED BY DOMESE OF SIZE 5 53
FIGURE4-130 20 PCT. ERR. DILATED BY DOME SEOF SIZE 7 53
FIGURE 4-131 10 PCT. ERR. DILATED BY DOME SE OF SIZE 5 53
FIGURE 4-132 10 PCT. ERR. DILATED BY DOMESE OF SIZE 7 53
FIGURE 4-13320PCT.ERR. ERODED BY DOME SE OF SIZE5 53
FIGURE 4-13420PCT. ERR. ERODED BY DOME SEOF SIZE 7 53
FIGURE4-135 10 PCT. ERR. ERODED BY DOMESE OF SIZE 5 54
FIGURE4-136 10 PCT. ERR. ERODED BY DOMESE OF SIZE 7 54
FIGURE4-137 20PCT. ERR. OPENED BY DOMESE OFSIZE5 54
FIGURE4-138 20PCT. ERR. OPENED BY DOMESEOFSIZE 7 54
FIGURE 4-139 10 PCT. ERR. OPENED BY DOMESE OF SIZE 5 54
FIGURE 4-140 10 PCT. ERR. OPENED BY DOMESEOF SIZE 7 54
FIGURE4-141 20 PCT.ERR. CLOSED BY DOMESEOFSIZE 5 55
FIGURE 4-14220 PCT. ERR. CLOSEDBY DOME SE OF SIZE 7 55
FIGURE4-143 10 PCT.ERR. CLOSED BY DOME SEOFSIZE5 55
FIGURE 4-144 10PCT. ERR. CLOSEDBY DOME SE OF SIZE 7 55
FIGURE4-145 20 PCT. ERR.DILATED BY CONCAVE SE OF SIZE5 55
FIGURE4-146 10PCT. ERR. DILATED BY CONCAVE SE OFSIZE 5 55
FIGURE4-147 20PCT. ERR. DILATED BY CONCAVE SE OF SIZE 7 56
FIGURE4-148 10 PCT. ERR. DILATED BYCONCAVESE OF SIZE 7 56
FIGURE4-149 20PCT.ERR.ERODED BY CONCAVE SE OF SIZE 5 56
FIGURE4-150 10PCT. ERR. ERODED BY CONCAVE SE OF SIZE5 56
FIGURE 4-151 20PCT.ERR.ERODED BY CONCAVE SE OF SIZE 7 56
FIGURE4-152 10 PCT.ERR. ERODED BY CONCAVE SEOF SIZE7 56
FIGURE4-153 20PCT.ERR.OPENED BY CONCAVESE OF SIZE5 57
FIGURE 4-154 10PCT. ERR. OPENED BY CONCAVE SEOF SIZE 5 57
FIGURE4-155 20PCT. ERR. OPENED BY CONCAVESE OF SIZE 7 57
FIGURE4-156 10 PCT. ERR. OPENED BY CONCAVE SEOFSIZE 7 57
FIGURE4-157 20PCT. ERR.CLOSEDBY CONCAVE SEOFSIZE5 57
FIGURE4-158 10PCT. ERR. CLOSED BY CONCAVE SE OF SIZE5 57
FIGURE4-159 20PCT. ERR.CLOSEDBYCONCAVE SE OF SIZE 7 58
FIGURE4-160 10PCT. ERR.CLOSEDBYCONCAVESEOF SIZE 7 58
FIGURE 4-161 20 PCT. ERR.DILATED BY FLATSE OF SIZE 3 59
FIGURE 4-16220PCT.ERR.DILATEDBY FLATSE OF SIZE 5
59
FIGURE4-163 20 PCT.ERR.DILATEDBYFLAT SE OF SIZE7 59
FIGURE 4-164 10PCT.ERR. DILATED BYFLAT SE OF SIZE 3 59
FIGURE4-165 10 PCT.ERR.DILATED BYFLAT SE OF SIZE5 59
FIGURE4-166 10PCT. ERR.DILATED BY FLAT SE OFSIZE7 59
FIGURE4-167 20 PCT. ERR. ERODED BY FLAT SE OFSIZE 3 60
FIGURE4-168 20PCT. ERR. ERODED BY FLAT SE OF SIZE 5 60
FIGURE 4-169 20PCT.ERR.ERODED BY FLAT SE OF SIZE 7 60
FIGURE 4-170 10 PCT.ERR.ERODED BY FLAT SE OFSIZE 3 60
FIGURE 4-171 10 PCT. ERR. ERODED BY FLAT SE OF SIZE 5 60
FIGURE 4-172 10 PCT. ERR. ERODED BY FLAT SE OFSIZE7 60
FIGURE 4-173 20 PCT. ERR.OPENED BY FLAT SE OF SIZE3 61
FIGURE 4-17420PCT. ERR. OPENED BY FLAT SE OF SIZE5 61
FIGURE 4-175 20PCT. ERR. OPENED BY FLAT SE OFSIZE7 61
FIGURE 4-176 10 PCT. ERR. OPENED BY FLAT SE OF SIZE3 61
FIGURE 4-177 10 PCT. ERR. OPENED BY FLAT SE OFSIZE 5 61
FIGURE 4-178 10 PCT. ERR. OPENED BY FLAT SE OF SIZE7 61
FIGURE 4-179 20PCT. ERR. CLOSED BY FLAT SEOFSIZE3 62
FIGURE 4-18020PCT. ERR. CLOSED BY FLAT SEOF SIZE 5 62
FIGURE 4-181 20PCT. ERR. CLOSED BY FLAT SE OFSIZE 7 62
FIGURE 4-182 10PCT.ERR.CLOSED BYFLATSE OF SIZE 3 62
FIGURE 4-183 10 PCT. ERR.CLOSED BY FLAT SE OFSIZE 5
62
FIGURE 4-18410 PCT. ERR. CLOSED BY FLATSE OF SIZE 7
62
FIGURE 4-185 20 PCT. ERR. DILATEDBY PYRAMID SEOFSIZE3
63
FIGURE4-186 20 PCT. ERR. DILATEDBY PYRAMID SE OF SIZE5
63
FIGURE4-187 20 PCT. ERR. DILATEDBY PYRAMID SEOFSIZE 7 63
FIGURE4-188 10 PCT. ERR. DILATEDBY PYRAMID SE OFSIZE 3 63
FIGURE4-189 10PCT. ERR.DILATED BY PYRAMIDSE OFSIZE5 63
FIGURE4-190 10 PCT. ERR.DILATED BY PYRAMID SEOFSIZE 7 63
FIGURE4-191 20 PCT. ERR.ERODED BY PYRAMID SE OF SIZE3 64
FIGURE4-192 20 PCT. ERR.ERODED BY PYRAMIDSE OFSIZE 5 64
FIGURE4-193 20 PCT. ERR.ERODED BY PYRAMID SE OF SIZE 7 64
FIGURE4-194 10 PCT. ERR. ERODED BY PYRAMID SE OF SIZE3 64
FIGURE4-195 10PCT. ERR. ERODED BY PYRAMID SE OF SIZE5 64
FIGURE4-196 10PCT. ERR. ERODED BY PYRAMIDSE OF SIZE7 64
FIGURE4-197 20PCT. ERR.OPENEDBY PYRAMIDSEOF SIZE 3 65
FIGURE4-198 20 PCT.ERR. OPENED BY PYRAMID SE OF SIZE5 65
FIGURE4-199 20PCT. ERR. OPENED BY PYRAMIDSE OF SIZE7 65
FIGURE4-200 10PCT. ERR. OPENED BY PYRAMID SEOF SIZE 3 65
FIGURE 4-201 10 PCT. ERR. OPENED BY PYRAMIDSE OF SIZE 5
65
FIGURE 4-202 10 PCT. ERR. OPENED BY PYRAMIDSE OF SIZE 7 65
FIGURE 4-203 20PCT. ERR. CLOSED BY PYRAMIDSE OF SIZE 3 66
FIGURE 4-20420PCT. ERR. CLOSED BY PYRAMID SE OFSIZE 5
66
FIGURE 4-205 20PCT. ERR. CLOSED BY PYRAMIDSE OF SIZE 7
66
FIGURE4-206 10 PCT. ERR. CLOSED BY PYRAMIDSE OF SIZE 3
66
FIGURE4-207 10 PCT. ERR. CLOSEDBYPYRAMID SE OF SIZE5 66
FIGURE4-208 10PCT. ERR. CLOSEDBYPYRAMIDSEOFSIZE7
66
FIGURE4-209 20 PCT. ERR.DILATED BY DOME SE OF SIZE5 67
FIGURE4-210 20 PCT. ERR. DILATED BY DOME SE OF SIZE7 67
FIGURE 4-211 10PCT. ERR. DILATED BY DOME SE OF SIZE5 67
FIGURE 4-212 10 PCT. ERR. DILATED BY DOME SE OF SIZE7 67
FIGURE4-213 20 PCT.ERR. ERODED BY DOMESE OF SIZE 5 67
FIGURE4-21420PCT. ERR. ERODED BY DOME SE OF SIZE7 67
FIGURE4-215 10 PCT. ERR. ERODED BY DOME SE OF SIZE 5 68
FIGURE4-216 10 PCT. ERR. ERODED BY DOME SE OFSIZE7
68
FIGURE4-21720 PCT. ERR. OPENED BY DOME SE OFSIZE 5 68
FIGURE4-218 20PCT.ERR.OPENED BY DOME SE OF SIZE 7
68
FIGURE4-219 10 PCT.ERR. OPENED BY DOME SE OF SIZE5 68
FIGURE4-220 10PCT. ERR. OPENED BY DOMESE OFSIZE 7
68
FIGURE 4-221 20PCT. ERR. CLOSED BY DOME SE OF SIZE5
69
FIGURE 4-22220PCT. ERR. CLOSED BY DOMESE OF SIZE 7
69
FIGURE 4-223 10PCT. ERR. CLOSED BY DOMESE OF SIZE5
69
FIGURE 4-22410PCT. ERR. CLOSED BY DOME SE OFSIZE 7
69
FIGURE 4-225 20PCT. ERR. DILATED BY CONCAVE SE OF SIZE 5
69
FIGURE 4-226 10PCT. ERR. DILATED BYCONCAVE SE OF SIZE 5
69
FIGURE 4-227 20PCT. ERR. DILATED BYCONCAVESEOF SIZE 7 70
FIGURE4-228 10PCT. ERR. DILATED BYCONCAVE SE OF SIZE 7 70
FIGURE
4-229
20 PCT. ERR. ERODEDBYCONCAVESEOFSIZE5 70FIGURE4-230 10 PCT. ERR. ERODED BYCONCAVE SE OFSIZE5 70
FIGURE 4-231 20 PCT. ERR.ERODED BYCONCAVESE OF SIZE 7 70
FIGURE 4-232 10 PCT. ERR.ERODED BYCONCAVESE OF SIZE7 70
FIGURE 4-233 20 PCT. ERR. OPENEDBYCONCAVESE OF SIZE5 71
FIGURE 4-234 10 PCT. ERR.OPENED BYCONCAVESE OF SIZE5 71
FIGURE 4-235 20 PCT. ERR.OPENED BY CONCAVESE OFSIZE 7 71
FIGURE 4-236 10 PCT.ERR.OPENED BYCONCAVESE OF SIZE7 71
FIGURE 4-237 20 PCT.ERR.CLOSEDBYCONCAVE SE OF SIZE 5 71
FIGURE 4-238 10 PCT.ERR. CLOSED BYCONCAVE SE OFSIZE5 71
FIGURE 4-239 20PCT. ERR.CLOSEDBYCONCAVESE OF SIZE 7 72
FIGURE4-240 10 PCT. ERR. CLOSED BY CONCAVE SE OF SIZE 7 72
FIGURE 5-1 DILATIONRESULTS 10 PERCENT ERROR 75
FIGURE 5-2 WIDE DILATION RESULTS 10 PCT. ERR 75
FIGURE 5-3DILATIONRESULTS20PERCENT ERROR 75
FIGURE 5-4 WIDE DILATION RESULTS 20PCT. ERR 75
FIGURE5-5EROSIONRESULTS 10PERCENTERROR 76
FIGURE 5-6WIDE EROSION RESULTS 10PCT. ERR 76
FIGURE5-7 EROSION RESULTS 20PERCENT ERROR 76
FIGURE5-8WIDE EROSION RESULTS20PCT. ERR 76
FIGURE5-9 OPENRESULTS 10PERCENT ERROR 77
FIGURE 5-10 OPEN RESULTS 20PERCENT ERROR 77
FIGURE 5-11 CLOSE RESULTS 10 PERCENTERROR 77
FIGURE 5-12 CLOSE RESULTS 20 PERCENTERROR 77
FIGURE 5-13 IMAGE CLOSEDBY3X3FLAT SE 80
FIGURE5-1420 PCT. ERR. CLOSEDBY FLAT SEOF SIZE 3 80
FIGURE5-15 10 PCT. ERR. CLOSEDBY FLAT SE OF SIZE3NARROW GRAPH 80
FIGURE5-16COKE IMAGECLOSEDBY 7X7 FLAT SE 81
FIGURE5-17 20 PCT. ERR. CLOSED BY FLAT SEOF SIZE7 81
FIGURE5-18 10 PCT.ERR.CLOSED BY FLAT SE OF SIZE 7 NARROW GRAPH 81
FIGURE5-19COKE IMAGE DILATED BY3X3FLATSE 82
FIGURE5-20 20 PCT. ERR. DILATED BY FLAT SEOF SIZE 3 82
FIGURE 5-21 20 PCT.ERR. DILATED BY FLATSE OF SIZE 3 NARROWGRAPH82
FIGURE 5-22COKEIMAGE DILATED BY 7X7 FLAT SE 83
FIGURE5-23 20PCT. ERR. DILATED BY FLAT SE OF SIZE7 83
FIGURE 5-2420PCT. ERR. DILATED BY FLAT SEOF SIZE7 NARROWGRAPH83
FIGURE 5-25 COKE IMAGE DILATED BY 7X7 FLAT SE SHIFTED DOWN
60
LEVELS 84
FIGURE5-26COKE IMAGE ERODED BY 3X3FLATSE 85
FIGURE5-27 20 PCT.ERR. ERODED BY FLAT SEOF SIZE 3 85
FIGURE5-2820PCT. ERR. ERODED BY FLATSE OFSIZE3NARROWGRAPH 85
FIGURE5-29COKE IMAGE ERODED BY7X7FLATSE 86
FIGURE 5-3020PCT. ERR. ERODED BY FLATSE OFSIZE7
86
FIGURE5-31 20PCT. ERR. ERODED BY FLATSE OF SIZE7 NARROW
GRAPH
86FIGURE5-32COKEIMAGE ERODED BY 7X7 FLAT SE SHIFTED UP55LEVELS87
FIGURE5-33 COKEIMAGEOPENED BY3X3FLATSE 88
FIGURE5-3420PCT. ERR. OPENED BY FLAT SE OF SIZE3 88
FIGURE5-3520 PCT. ERR. OPENEDBY FLATSE OF SIZE3NARROW GRAPH88
FIGURE5-36COKE IMAGEOPENEDBY 7X7 FLATSE 89
FIGURE 5-3720PCT. ERR. OPENED BY FLAT SE OF SIZE 7 89
FIGURE5-3820PCT. ERR. OPENED BY FLAT SE OF SIZE 7 NARROW GRAPH89
List
of
Tables
TABLE 1-1 EXAMPLEOPERATIONS 1
TABLE 1-2 EXAMPLE OF BINARY MORPHOLOGY 3
TABLE2-1 EXAMPLE OF GRAY SCALE MORPHOLOGY 11
TABLE3-1TABLEDECODING 28
TABLE 5-1 DECODING GRAPH LABELS 74
List
of
Equations
EQ. 1-1 2
EQ. 1-2 2
EQ. 1-3 2
EQ. 1-4 2
EQ. 1-5 3
EQ. 1-6 4
EQ. 1-7 4
EQ.2-8 8
EQ.2-9 10
EQ.2-10 13
EQ.2-11 13
Glossary
Binary
Morphology
is
Morphology
performed onbi-level images.
See
"Binary
Morphology"on page
1.
Binary Morphology
Close
The closing is
a morphological operationthat
is
composed of an erosionfollowed
by
adilation.
The
samestructuring
element mustbe
used withboth
the erosion and thedilation.
See
"0086"page4.
DC
Shift
The
entireimage is
shiftedin
amplitude.It
can
be
thought of asshifting
the color(gray)
oftheimage.
Dilation
The dilation
is
adual
to erosion.It
is
computed as
eroding
the complement oftheimage. See
"Dilation"on page
1.
Erosion
In
the simplest case the erosionis
a subset operation.See
"Erosion"on page2.
Gray
Scale
Morphology
Gray-scale
Morphology
is
Morphology
performed on
gray
scaleimages. See
"Gray
Scale
Morphology" onpage5.
Open
The opening is
a morphological operationthat
is
composed of adilation
followed
by
an erosion.The
samestructuring
element mustbe
used withboth
thedilation
and the erosion.See
"Open"
on page
3.
Mathematical
Morphology
The
type of nonlinearimage processing
discussed in
thispaper.Morphing
Morphology
The
image
processing
thatis
usedin
Michael Jackson
music videos, automobile commercials.It has nothing
todo
with this paper.From
thedictionary
A
branch
ofBiology
dealing
with theform
and structure of organisms.In
other words the shape.Umbra
The
shadow of afunction.
Transform"
onpage
5.
See "Umbra
A
The
image
used.The
images
used were256
by
256
pixels.B
The
structuring
element used.Structuring
elements of3
by
3
pixels,5
by
5
pixels, and7
by
7
pixels were used.a,b
A
specific pixelin
theimage
orstructuring
elementrespectively.0
The dilation
operator.*
The
erosion operator.This
notationis
not common to theliterature,
but
was madebecause
the standard notation could notbe
inserted into
thisdocument.
0
The
open operator.The
close operator.C
The
complement of the set, usedin
thebinary
case.The
pixels that are set are cleared, and the pixels that are not set areset.
u
The
set unionoperator.n
The
setintersection
operator.V
B
Denotes
rotation of the
structuring
elementB
aboutthe origin.-
Also
denotes
rotation of thestructuring
element aboutthe origin.
1
.Binary Morphology
1.1.
Input
In
this paper theinput images
that are operated on are square matrices offinite
size.Binary Morphology
operates on2-valued
pixels.The
tablein
theglossary
onpagexxvdescribes
the notation usedin
this paper.The
following
tableprovides some examples ofthe operations used.The
cellthat
is italicized is
the origin oftheimage.
Operation
Example
A
1110
0
10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Ac
0
0
0
11
0
1111
117
11
11111
11111
-A
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
111
1.2.
Dilation
Dilation
is dual
to erosionbecause
it is found
by
eroding
the complement ofan
image. This formulation
canbe
expressedasAB
= [AC*(-B)]CEq.l-l
(Dougherty, eq 1.10,p.7)
The
character * represents morphological erosion.This
substitution wasmade
because
oflimitations for
characters to represent the operation.Another
formulation for dilation is
A@B
={J[A
+b:beB]
Eq
A_2(Dougherty,eq1.12,p.7)
This
is
a union of theinput image
shiftedby
all elementsin
thestructuring
element.
Dilation
is
associative and commutative1.3.
Erosion
Erosion
is
the otherprimary
operationin
morphology.As
seen earlier,dilation
canbe
expressed as adual
to erosion.One formulation for
erosionusing
setsis:
A*B
=[x:B
+x^A]
Eq
j_3(Dougherty,eq.1.3,p.3)
Another formulation
for
erosion which willbe
usedlater
is:
X*B
=n[Xblb<=B
EqA_4
The
intersection is
composed ofX
translatedby
the elements ofB.
Each
ofthose elements,
beB,
willbe
added to the point xeX, the sum x+bis in
X
iff
thepoint xis in X.h. The resulting
setofthe erosion canbe
expressed as:Y
={x.BxczX}=
fl
X-y
yeBO
v
=
fl
Xy=X*B
-yeBO
Eq. 1-5
(Serra,eq. H-4,p.43).
where
B
is
B
reflected about the origin.This
reflection about the origin comes about as a result of the needfor opening
andclosing
(which
aredefined
later)
tobe idempotent.
If
neither erosion, nordilation
used a rotatedstructuring
element,ashiftwouldbe built into
theimage for
those casesusing
a non-symmetricalstructuring
element.As
an example:Origin
is
Underlined
-3-2-10
1
2
3
I
X X XS
X XV
X X
IS
X X X X*
I*S
X XI*S
X XX X X
X X X
close X X X
1
.4.Open
The
morphologicalopening is
an operation composed of erosionfollowed
by
dilation.
AoB
=(A*B)@B
EqU6
(Dougherty,eq..2.1,p.17)
Opening
animage
with astructuring
elementis
used to truncate protrusionson the outside ofthe
image.
The
initial
erosion will"cut
off'Those
externalfeatures
that thestructuring
element cannotfit into.
The
dilation willexpandthe
image
tonearly
theoriginal size.1.5.
Close
The
morphologicalclosing is
an operation composed ofdilation
followed
by
erosion.
Afl
=[A0(-S)]*(-B)
EqA_7
(Dougherty,eq.2.4,p.18)
Closing
animage
willfill in
gaps on theinside
of theimage
that thestructuring
elements canbridge.
The
initial
dilation
willfill in
theinternal
gaps and the subsequent erosion will return the
image
tonearly
the original2.
Gray
Scale
Morphology
2.1.
Input
Gray
scalemorphology is
an extension ofbinary
morphology
toimages
with shades ofgray, orin
other wordsfrom
two to threedimensions. Eight-bit
per pixelimages,
256
shades, are a commonform,
but
thatis
not a theoreticalrestriction.
Minus
infinity
is
also a value that theimages
cantake,
andis
reservedtoindicate
thelack
of a value.Minus
infinity
is
used whenthe valueis
undefined(not in
thedomain
of theimage.)
The
dilation
operator cancreate values
for
those pixels(expand
thedomain),
sinceit is defined
as amaximum.
The
erosion operatordoes
not expandthedomain
oftheimage.
2.1.1.
Umbra
Transform
The Umbra Transform
was usedfor
theearly development
ofgray
scalemorphology.
Although
newerliterature does
not useit
much,it
stillprovidesan
easily
visualizedway
oflooking
atgray
scale morphology.The Umbra
can
be
thoughtofas the shadow createdby
thefunction
(Dougherty,
pp.Figure2-1 Graph ofan
Arbitrary
FunctionLooking
at thefunction,
it only defines
the surface.The
umbraincludes
thevolume underneath the surface all the
way
to minusinfinity.
One
important
distinction between
binary
and gray-scalemorphology is
that the concept ofthe complement ofa picture needs to
be
examinedvery
closely, sincein
they-w:;.:
Figure 2-2 GraphofanUmbra
2.2.
Morphological Dilation
d(x,
y)
=max/,
j[a(x-i,y-j)+b(i,
j)]
Eq. 2-8A
=TtlXJTl (Dougherty,eq.6.22,p.103)B
= nxnx=
0...m
v =
0...m
'
= --
0
-2
2
n n
j
=/
2
2
=
A@B
To
determine
the value of each pixelin
theresulting
image,
it is necessary
totake the sum of the
corresponding
elementfrom
thestructuring
element andthe pixel
from
theinput image
thatis
overlaid.For
example given thefollowing
input
image
A
fl(0,0)
=l
0(0,4)
=5
a(2,2)
=\3
a(4,0)
=2l
a(4,4)
=25
andthe
structuring
element centered aboutthemiddle element.12
3
4
5
6
7
8
9
The
value of the element(1,1)
wouldbe determined from
the maximum ofthe sums
12
3
4 56
7
8
9
1011 12 13 14 15
16 17 18 19 20
21 22
23
24 251+1 2+2
3
+3
6
+47
+5
8
+6
11+7
12+8
13+9
In
this case the value of the pixel(1,1)
wouldbe 22.
The
pixel(1,1)
wouldtake the sum ofthepixel
from
thestructuring
element(2,2)
andfrom
theinput
image (2,2).
A
special caseis
thehandling
ofthe edge conditions where part ofthestructuring
elementis
not over thedomain
oftheinput image.
Since
the
image is
treated as minusinfinity
when notin its
domain,
the out ofdomain
valuesfrom
theinput image
arejust
set to minusinfinity. The
value ofthepixel(0,0)
wouldbe
-oo+1 -oo+2 -oo+
3
-oo+4 1+5 2+6
-oo+76
+8 7+9or
16. The
origin ofthestructuring
elementis
the center ofinterest.
Another
important
caseis
where the pixel ofinterest is
out ofthedomain
oftheinput
image,
but
atleast
one pixelis in
thedomain
of theinput image.
One
example would
be
the value of the pixel(5,5)
25+1 -00+2 -00+3
0O+4 o+
5
+6 -co+7
-o+8
-~+9In
this case the value wouldbe 26.
The
only
restriction on thisis
some realimplementations. In
someimplementations,
thedomain is
restricted suchthat thedomain
of the resultantimage
cannot exceed the size oftheinput
image,
which
includes
minusinfinity
pixelsin
theimage.
This
restrictionis
an2.3.
Morphological
Erosion
Gray
scale erosion canbe
expressed asd(x,
y)
= min,-,j[a(x
-i,y-j)
-b(-i,
-j)]
Eg. 2-9= **A*MJR
(Dougherty,eq.6.6,p.97)
One important
point that canbe
seenfrom
the above equationis
that thestructuring
elementis
rotated around the origin.This
is
important
toremember
for
implementation,
althoughin many
of the common cases(structuring
elements that are symmetrical around the origin)it
will notchange
any
oftheresults.The
following
is
a1
dimensional
example of whathappens in
the cases wherethe
structuring
elementis
not rotated.The
rows that are marked with thesuperscript asterisk are where the
structuring
element was not rotated aboutthe origin.
The incorrect definition does
nothave
theidempotence
property.Opening
andclosing
areboth
idempotent
operations; no openings or closingsafter the
first opening
orclosing
respectively
will produce a changein
theimage.
Origin is
emboldened-3-2-10123
J oo oo oo
1
2
3
ooS
0
1
2
V
S
2
1
0
I@S
oo3
4
5
4
3
oo7*5*
oo oo oo
1
oo oo ooI*S
oo oo oo oo 00 oo ooopen oo
3
2
1
oo oo oo3
2
1
OO oo ooclose oo oo oo
1
2
3
ooTable2-1Exampleof
Gray
ScaleMorphology
Erosion
reduces thedomain in
theboundary
cases where the offset of thestructuring
elementdoes
notinclude
an elementin
thedomain
off.
Using
theimage
andstructuring
element that was used earlier the pixel(1,1)
oftheoutput
image
wouldbe
1-9 2-8 3-7
6-6
7-5
8-4=-8=>-11-3 12-2 13-1
In
this case, wehave
a number of valuesless
than zero whichmap
to -.In
anothercase,the value ofthe output pixel
(3,3)
wouldbe
13-9
14-815-7
18-6
19-520-4
23-3
24-225-1
Since
erosion uses the minimum of thedifferences
the result wouldbe
13
-9=4.
Another
caseis
where thestructuring
element extends past thedomain
oftheinput image. The
pixel(0,0)
wouldbe
19-9
20-8
-oo-724-6
25-5
-oo-4oo
3
oo 2 oo1Since
there are a number of values at- the output pixel willbe
-oo.
2.4.
Morphological
Opening
In
thegray
scale case, thebasic definition
of morphologicalopening is
thesame: erosion
followed
by
dilation
(Dougherty,
p.111.)
The
effects are alsosimilar.
The
initial
erosion will remove those protrusions on the surface of theimage
that thestructuring
element cannotfit
into,
the edges oftheimage
will
become
smaller as the erosion will set thedomain
boundary
pixels to -.The dilation
will addback
to theimage both
theboundary
pixels and some ofthe "height"ofthepixels.
2.5.
Morphological
Closing
The
morphologicalclosing is dilation followed
by
erosion(Dougherty,
p.111.)
The dilation fills in
some voids on theimage
and expands thedomain
ofthe
image if it
can.Some implementations
restrict the size oftheresulting
image
toits initial
size.The
erosion thenmakestheimage
nearer toits initial
shape,
but
theinternal
voids that werefilled in
by
thedilation
cannotbe
restored.
One
special casefor
someimplementations
is
where thedilation
could not expand the
domain because
of animage
sizelimit
and the erosionreducesthe
domain
oftheimage.
2.6.
Common Transforms
andfilters
Two
ofthe common transformsare the top-hatf
-(f
openg)
(Dougherty,
pp.119-120,)
andvalley
detector (f
closeg)
-f(Dougherty,
p.120.)
One
specialcase
is
when thestructuring
elementis flat
with a value of0
along
its
domain.
Then
-g =g
and theduality
of open andclosing
becomes
(f
closeg)
-f
= -f-[(-f)
open g].One
way
todetect both
the peaks andvalleys
is
touse(f
closeg)
-(f
open g).
Two
otherfilters
are theiteration
ofopening followed
by
closing
orclosing
followed
by
opening.The
filters
are referredto,
respectively
as:CLOSEOPEN,
andOPENCLOSE.
CLOSEOPEN(f)
=(f
close(-g))
openg)Eq
2-io(Dougherty,eq.7.5,p.127)
OPENCLOSE(f)
=(f
openg) close
(-g))
Eq
2-n(Dougherty,eq.7.4,p.127)
One
simplification to the aboveis
to restrict thesefilters
toflat structuring
elements with value
0
sog
=-g.Another
type offiltering
that canbe
usedis
to start with a smallstructuring
element and alternate
opening
and closings and thenincrease
thefilter
size toremove
successively
larger
noise particles.It
is
important
to note thatin
thedigital
case that the orderin
which theopening
and closings aredone is
important.
Since
aclosing
reduces thedomain
and anopening may
increase
the
domain
if
possiblein
adigital
setting,theopening
needs tobe done
before
the
closing
to avoiddiminishing
thedomain.
3.
Experimental Procedure
3.1.
Basics
This
experiment was setup
tojudge
the results ofdifferent
sizes ofstructuring
elements anddifferent
shapes onrestoring
images
(noise
reduction.)
The
procedure was to take animage,
add noise toit,
and thenuse the noised
image
as thestarting
point.The
basic
operations(dilate,
erode, open, or
close)
were then used and the effect oftheprocessing
on theimage
couldbe
calculated.It
was also observed that the minimal errorfor
agiven
image
andstructuring
element was notnecessarily
givenby
the originalprocessing.
In
many
cases the error was miriimizedby
shifting
the entireimage
by
a constant amount orDC
shift.3.2.
Noise
The
noise that was applied to theimage
wasuniformly distributed
with arange of64.
In
the cases where the noise wouldhave
extendedbeyond
theavailable
gray
scalerange, theresulting
value wastruncated attheboundary.
3.3.
Input Images
The
following
figures
are theimages
thatwere usedfor
the experiments.The
images
are256
by
256
pixels.The
threebase
images
were chosen toprovidea
variety
ofinput
sources.The
cokeimage has
thesharply
defined
lines
andcurves.
The
image
ofthe girlhas
the softer shadings ofaface
andhair. The
image
ofRoy
combines some ofboth
with thebackground
providing
somesharp
edges.Figure 3-1 Baseline CokeImage
Figure 3-2CokeImagewith10Percent Error
Figure3-3Coke Imagewith20 Percent Error
ffiyyy''.yyyyyyy/'''.:yy,-';rV.y
&y>&y-\^y.yyyyy...y
Aw.-.
:::..:::.-.
,y\-y-.-\.. ,,.":-...
Figure3-4Baseline Girl Image
Figure 3-5 Girl Imagewith10 Percent Error
Figure3-6Girl Imagewith20PercentError
Figure3-7 Baseline
Roy
ImageFigure3-8
Roy
Imagewith10 Percent ErrorFigure 3-9
Roy
Image with20 Percent Error3.4.
Structuring
Elements
The structuring
elements usedfor
the experiment canbe divided into
4
categories;
flat,
pyramidal, concave, anddome
shaped.All structuring
elements used were square;
3, 5,
or7
units on a side.Each category
ofstructuring
elementshas 2
or3 different
sizes.There
are3 flat
stmcturing
elements of sizes
3, 5,
and7.
The
values of the pixels are all zero valued.The
The
The
flat
structuring
0
0
0
0
0
0
0
0
0
flat
structuring
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
flat
structuring
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
element of size
3
has
the values:element of size
5
has
the values:The
pyramidalstructuring
element of size0
1
0
1
2
1
0
1
0
The
pyramidalstructuring
element of size0
0
1
0
0
0
1
2
1
0
1
2
3
2
1
0
1
2
1
0
0
0
1
0
0
The
pyramidalstructuring
element of size0
0
0
1
0
0
0
0
0
1
2
1
0
0
0
1
2
3
2
1
0
1
2
3
4
3
2
1
0
1
2
3
2
1
0
0
0
1
2
1
0
0
0
0
0
1
0
0
0
The
concavestructuring
element of size0
0
1
0
0
0
0
1
0
0
1
1
3
1
1
0
0
1
0
0
0
0
1
0
0
3
has
the values:5
has
the values:7
has
the values:5
has
the values:The
concavestructuring
element of size7
has
the values0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
1
2
1
0
0
1
1
2
4
2
1
1
0
0
1
2
1
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
The
dome
structuring
element of size5
has
the values:0
0
1
0
0
0
2
3
2
0
1
3
3
3
1
0
2
3
2
0
0
0
1
0
0
The
dome
structuring
element of size7
has
the values:0
0
0
1
0
0
0
0
0
1
2
1
0
0
0
1
3
4
3
1
0
1
2
4
4
4
2
1
0
0
1
0
3
1
4
2
3
1
1
0
0
0
0
0
0
10
0
0
3.5.
Naming
Scheme
The
results generatedlater in
thisdocument
oftenlabel
theresults with acodethat
identifies
theimage
used, the amount of noise added to thebaseline
image,
and themorphological operation applied.In
section4
the tracesin
thegraphs
have
anaming
scheme thatincludes
the operation.The naming
scheme
for
the tracesis
explainedin
thefollowing
table.Character
Description
1
The
input image.
This
canbe
either'c'
for
theimage
of the coke can, 'g'for
theimage
of theyoung
girl,V
for
theimage
ofDr.
Czernikowski
in
theengineerhat.
2
The
amountof noiseappliedto theimage.
' 1'for
10
percenterror, or '2'for 20
percent error.3
The
morphological operation applied.The
valuescan
be
'c\ 'd', 'e',
'o'for
close,dilate,
erode,open respectively.
4
The
type ofstructuring
element applied.The
values can
be
'c',
'd', 'f,
'p'for
concave,dome,
flat,
pyramid respectively.5
The
size ofthe squarestructuring
element.This
can take the values of
3, 5,
7.
The
concave anddome structuring
elements are restricted to sizes of5
and7.
6-7
The
traceonthe graph.This
takes thevalue'vl'
or 'v2'
which
is
not significant ofitself.
The
trace
labeled
'vl' willbe
above or equal to thetrace
labeled
'v2.'The
'vl'trace
is
the absoluteerror
for
the wholeimage
at the variousDC
offsets, the
'v2'
trace
is
the absolute errorfor
asubset oftheentire
image.
Table 3-1 Table
Decoding
4.
Results
The
rest of this sectionis divided into 3
sections that contains graphs thatshow the
initial
results of theinvestigation.
Each
sectionfocuses
on aspecific
input image
and the results that thedifferent
structuring
elementsprovide.
One
parameter of specificinterest is
whatDC
shift will rriinimizethe absolute error overtheentire
image.
A DC
shiftis just
a shift ofthe entireimage
by
a constant value.Each
graphis
composed of the absolute error ofthe
image
atthedifferent DC
shifts.The
two traces on the graphs are the absolute errorfor
two cases.The
first
case
is
the absolute error computedusing
the entire resultantimage
againsttheentire
baseline
image. The
second trace on the graphis
the absolute errorcomputed with a
border
ofthree pixels aroundboth
theinput image
and theresultant
image.
The
border
was chosen so that the edge effects couldbe
ignored for
erosionandclosing.
As
described
earlier, thereductionin
thedomain for
erosion andclosing
willframe
theimage in black (0
valued) pixels.Reducing
thedomain
of the absolute error allows
for
comparing
the results without that problem,although the graphs
in
this sectiondo
not show thedomain
reduction as agreat problem.
The
title of each graph tells more of thedetails
ofhow
eachimage
wasprocessed.
The first
part ofthe graphtitle will eithersay 20 Pet
Err,
or10 Pet
Err.
Those
twophrasesindicate how
much errorwasintroduced
into
thebase
image. The
rest ofthe graph title willindicate
what morphological operationwas performed on the
image
and with whatstructuring
element.For
exampleDilated
by
Flat
SE
ofSize
3,
the operation wasdilation
and thestructuring
element
(SE)
was asquareflat structuring
element3
units on each side.The
x-axis of the results graphsis
centered at aDC
offset of0.
The label
i-20
at this pointis
an artifact ofthe creation ofthe graphs.The
data
pointswere read out of a
file
and werelabeled starting
at0.
The
i-20
termis
anoffset togetthe correct x-axis values.
The
marks under the -20 and20
on thex-axis are also artifacts ofthe package usedto createthe graphs.
4.1.
Coke Images
600000C 600000C 1
c2df7vl. 1
c2df7v2. 1
0 1
i-20 ..-2Q, i-20 .20,
Figure4-1 20Pet.Err. Dilated
by
Flat SE Figure4-3 20 Pet. Err. Dilatedby
Flat SEofsize3 ofsize 7
600000C
T~
-c2dfSvl. i
c2df5v2. l
^r*
'
0 1
t-2Q, i-20 .20.
600000C
cldf3vl. i
cldf3v2
0
.-20,
-L
i-20 ?0
Figure 4-2 20 Pet. Err. Dilated
by
FlatSE Figure 4-4 10 Pet. Err. Dilatedby
FlatSE600000C 1 cldf5vl. 1 cldf5v2. 1 ,-^ --^-^ 0 1 600000C 1 c2ef5vl. i "^Y" ^""^" T^"-c2ef5v2. i * "^ 0 I
t-2Q, i-20 ,20, .-2Q, i-20 20.
Figure4-5 10 Pet. Err. Dilated
by
FlatSE Figure4-8 20 Pet. Err. Erodedby
Flat SEofsize5 ofsize5
600000C 1 -cldf7vl. l cldf7v2. i 0 1 600000C 1 c2ef7vl. l "
-^
c2ef7v2. l 0 1t-2Q, i-20 20. 1.-24 i-20 20.
Figure 4-6 10 Pet.Err.Dilated
by
FlatSE Figure4-9 20Pet.Err. Erodedby
Flat SEofsize 7 ofsize7
600000C -2Q, i-20 6000000] clefivl clef3v2. 0 ..-20, J_ i-20 ,20,
Figure 4-7 20 Pet. Err. Eroded
by
FlatSE Figure 4-10 10 Pet. Err. Erodedby
Flatofsize3 SEofsize3
600000C Ol _L 600000C c2of5vl c2of5v2. 1 0
-2Q, i-20 .20, .-20, i-20 .20,
Figure 4-11 10 Pet. Err. Eroded
by
Flat Figure 4-14 20 Pet. Err. Openedby
FlatSEofsize5 SEofsize5
600000C 1 clef7vl. l clef7v2. l ' -^Y^~-^
^Y^~-~_
0 600000C 1 c2of7vl. l c2of7v2. i^^>-^_^
"^"^-"s ^-_ 0 1-20, i-20 ,20, -20, i-20 20,
Figure 4-12 10 Pet. Err. Eroded
by
Flat Figure 4-15 20 Pet. Err. Openedby
FlatSEofsize7 SEofsize 7
600000C 600000C
clof3vl. l
clof3v2.
-2Q, i-20 i-20
Figure 4-13 20 Pet. Err. Opened
by
Flat Figure 4-16 10 Pet. Err. Openedby
FlatSEofsize3 SEofsize3
[image:59.535.53.472.46.650.2]600000C 600000C
c2cf5vl
c2cf5v2.
i-20
Figure 4-17 10 Pet. Err. Opened
by
Flat Figure4-20 20 Pet. Err. Closedby
Flat SESE ofsize5 ofsize5
600000C 1
clof7vl. l
clof7v2. l
""^^^^
0 '
600000C
.-20, i-20 20, i-20
Figure 4-18 10 Pet. Err. Opened
by
Flat Figure 4-21 20 Pet. Err. Closedby
FlatSESEofsize7 ofsize7
600000C
-2Q, i-20
600000C
i-20
Figure 4-19 20 Pet.Err. Closed
by
FlatSE Figure 4-22 10 Pet. Err. Closedby
Flat SEofsize3 ofsize3
600000C 1 -clc5vl. 1 clcf5v2. 1 ^"t 0
-2Q, i-20 20,
600000C 1
-c2dp5vl.
c2dp5v2.
0
-20, i-20 20,
Figure4-23 10Pet. Err. Closed
by
Flat SE Figure 4-26 20 Pet. Err. Dilatedby
ofsize5 PyramidSE ofsize5
600000C 1 -clcf7vl. l clcf7v2. l _ j """"**"Y " -Y^-' 0 i
-2Q, i-20 .20.
600000C 1
c2dp7vl.
c2dp7v2.
0 1
-2Q, i-20 .20,
Figure4-24 10Pct.Err. Closed
by
FlatSE Figure 4-27 20 Pet. Err. Dilatedby
ofsize 7 Pyramid SE ofsize7
600000C 1
c2dp3vl.
c2dp3v2.
0 '
600000C
-2Q, i-20 .20, i-20
Figure 4-25 20 Pet. Err. Dilated
by
Figure 4-28 10 Pet. Err.Dilated
by
PyramidSEofsize3 PyramidSEofsize3
600000C
-cldp5vl.
cldp5v2.
0
600000C 1
-c2ep5vl.
c2ep5v2.
"
-^^Y-r
0
-20, i-20 .20, -2Q, i-20 ,20,
Figure 4-29 10 Pet. Err. Dilated
by
Figure 4-32 20 Pet. Err. Erodedby
PyramidSE ofsize5 Pyramid SEofsize5
600000C 1
-cldp7vl.
^c-t^ ^^
cldp7v2.
0 1
600000C
-2Q. i-20 .20. i-20
Figure 4-30 10 Pet. Err. Dilated
by
Figure 4-33 20 Pet. Err. Erodedby
PyramidSE ofsize 7 Pyramid SEofsize7
600000C
-20, i-20
600000C
i-20
Figure 4-31 20 Pet. Err. Eroded
by
Figure 4-34 10 Pet. Err. Erodedby
PyramidSEofsize3 Pyramid SE ofsize3
600000C 600000C 1
c2op5vl.
c2op5v2.
t~>-;^^
0 1
i-20 -2Q, i-20 20,
Figure 4-35 10 Pet. Err. Eroded
by
Figure 4-38 20 Pet. Err. Openedby
PyramidSEofsize5 Pyramid SE ofsize5
600000C 600000C
-20, i-20
Figure 4-36 10 Pet. Err. Eroded
by
Figure 4-39 20 Pet. Err. Openedby
PyramidSEofsize 7 Pyramid SE ofsize7
600000C 600000C
-2Q, i-20
Figure 4-37 20 Pet. Err. Opened
by
Figure 4-40 10 Pet. Err. Openedby
PyramidSEofsize3 PyramidSEofsize3
600000C 600000C
i-20 i-20
Figure 4-41 10 Pet. Err. Opened
by
Figure 4-44 20 Pet. Err. Closedby
Pyramid SEofsize5 PyramidSE ofsize5
600000C 600000C 1
c2cp7vl.
c2cp7v2. '
"Y^"
0
-2Q. i-20 .20,
Figure 4-42 10 Pet. Err. Opened
by
Figure 4-45 20 Pet. Err. Closedby
PyramidSEofsize7 PyramidSEofsize7
600000C
-2Q, i-20
600000C
i-20
Figure 4-43 20 Pet. Err. Closed
by
Figure 4-46 10 Pet. Err.Closed
by
PyramidSEofsize3 Pyramid SEofsize3
600000C 600000C 1 c2dd7vl. i c2dd7v2. 1 "" 0 1
i-20 -2Q, i-20 .20.
Figure 4-47 10 Pet. Err. Closed
by
Figure4-50 20Pet. Err.Dilatedby
DomePyramidSE ofsize5 SE ofsize7
600000C 1 -clcp7vl. clcp7v2. ' - - - -" 0 I
-2Q. i-20 20,
600000C 1 -clddSvl. i cldd5v2. 0
.-20, i-20 20,
Figure 4-48 10 Pet. Err. Closed
by
Figure 4-51 10Pet. Err.Dilatedby
DomePyramidSEofsize 7 SEofsize5
600000C
01
-20, i-20 JO,
600000C
cldd7vl
cldd7v2.r<r-*
i-20
Figure4-49 20Pet. Err. Dilated
by
Dome Figure4-52 10Pet. Err. Dilatedby
Dome
SEofsize5 SEofsize7
600000C
0 -L
600000C
0 _L
-2Q. i-20 JO, -20, i-20 20,
Figure 4-53 20Pet. Err. Eroded
by
Dome Figure 4-56 10 Pet. Err. Erodedby
DomeSE ofsize5 SE ofsize7
600000C ol -2Q, -L i-20 JO, 600000C 1 c2od5vl. l c2od5v2. i 0 1
.-20, i-20 JO,
Figure 4-54 20Pet. Err.Eroded
by
Dome Figure4-57 20 Pet. Err. Openedby
DomeSEofsize 7 SE ofsize5
600000C ol .-20, _L i-20 JO, 600000C 1 c2od7vl. l c2od7v2. l *
'"^^^^
= ="-;. 0 '-2Q. i-20 JO,
Figure 4-55 10Pet. Err. Eroded
by
Dome Figure4-58 20Pet. Err.Opened
by
DomeSEofsize5 SEofsize7
600000C clodSvl. i clod5v2 Ol J-6000000 1 c2cd7vl. 1 c2cd7v2. i -' 0
fc-20. i-20 JO, .-20, i-20 JO,
Figure4-59 10Pet. Err. Opened
by
Dome Figure 4-62 20 Pet. Err. Closedby
DomeSE ofsize5 SEofsize7
600000C 1 clod7vl. l clod7v2. i
^>>>-.
^-^s^^^
0 1 600000C 1 clcd5vl. i clcd5v2. l <^^ _ _ _ -0 1-2Q. i-20 JO, -2Q, i-20 JO,
Figure 4-60 10Pet. Err. Opened
by
Dome Figure 4-63 10 Pet. Err. Closedby
DomeSEofsize 7 SEofsize5
600000C 1
c2cd5vl. l
c2cd5v2. l
.... - - - "
0 1
600000C
clcd7vl.
clcd7v2.
-2Q, i-20 JO, i-20
Figure 4-61 20 Pet. Err. Closed
by
Dome Figure 4-64 10Pet. Err. Closedby
DomeSEofsize5 SEofsize7
600000C
Ol
-2Q, i-20 JO,
6000000 1
cldc7vl. 1
"
cldc7v2.
i
0 1
-20, i-20 JO,
Figure 4-65 20 Pet. Err. Dilated
by
Figure 4-68 10 Pet. Err. Dilatedby
Concave SEofsize5 Concave SEofsize7
600000C
0
-2Q, i-20 JO,
600000C
i-20
Figure 4-66 10 Pet. Err. Dilated
by
Figure 4-69 20 Pet. Err. Erodedby
Concave SEofsize5 ConcaveSE ofsize5
600000C 1
-<r^
c2dc7vl. l
c2dc7v2. l
0 1.
-20, i-20 JO,
600000C
ol
-20,
J.
i-20 JO,
Figure 4-67 20 Pet. Err. Dilated
by
Figure 4-70 10 Pet. Err. Erodedby
Concave SEofsize 7 Concave SEofsize5
600000C
"
c2ec7vl.
1
~ *T ~*~*-^^_ * ^""^^ c2ec7v2. 1 0
-20, i-20 JO,
600000C
i-20
Figure 4-71 20 Pet. Err. Eroded
by
Figure 4-74 10 Pet. Err. Openedby
ConcaveSE ofsize7 ConcaveSE ofsize5
600000C 1 -clec7vl. l ~^Y~t.. -T^*"" clec7vZ l -0 i -2Q, i-20 600000C 1 c2oc7vl. i c2oc7v2. i
r~v~^r--^^
^=^_^_^ 0 1JO, -2Q, i-20 JO,
Figure 4-72 10 Pet. Err. Eroded
by
Figure 4-75 20 Pet. Err. Openedby
Concave SEofsize7 Concave SEofsize7
600000C
c2oc5vl. i
c2oc5v2.
Ol
-2Q, i-20 JO,
600000C 1 -cloc7vl. cloc7v2. l
:^>v^^^
0-2Q. i-20 JO,
Figure 4-73 20 Pet. Err. Opened
by
Figure 4-76 10 Pet. Err.Opened
by
Concave SEofsize5 Concave SEofsize7
600000C 600000C 1
-c2cc7vl. 1
c2cc7vZ
1
-^
0 1
-2Q, i-20 JO,
Fzgwre 4-77 20 Pet. Err. Closed
by
Figure 4-79 20 Pet. Err. Closedby
ConcaveSE ofsize5 ConcaveSE ofsize7
600000C 1
clcc5vl. l
clcc5v2. l
^*
0 '
-2Q, i-20 JO,
60ooooq
clcc7vl
cloc7v2.
Ol
-2Q, i-20 JO,
Figure 4-78 10 Pet. Err. Closed
by
Figure 4-80 10 Pet. Err. Closedby
Concave SEofsize5 Concave SE ofsize 7
4.2.
Girl Images
6000000
g2df3vl.
g2df3v2
r
-20,
I
i 20 20,
600000C
i-20
Figure 4-81 20 Pet. Err. Dilated
by
Flat Figure 4-84 10 Pet. Err. Dilatedby
FlatSEofsize3 SE ofsize3
6000000 1
g2df5vl.
g2df5v2.
0 '
600000C
-2Q, i-20 JO, i-20
Figure 4-82 20 Pet. Err. Dilated
by
Flat Figure 4-85 10 Pet. Err. Dilatedby
FlatSEofsize5 SEofsize5
600000C
-2Q, i-20
6000000 1
gldf7vl.
gldf7v2.
0
-2Q, i-20 JO,
Figure 4-83 20 Pet. Err. Dilated
by
Flat Figure 4-86 10 Pet. Err. Dilatedby
FlatSEofsize 7 SEofsize7
600000C 600000C
i-20
Figure 4-87 20 Pet. Err. Eroded
by
Flat Figure 4-90 10 Pet. Err. Erodedby
FlatSEofsize3 SE ofsize3
600000C 600000C
i-20
Figure 4-88 20 Pet. Err. Eroded
by
Flat Figure 4-91 10 Pet. Err. Erodedby
FlatSEofsize5 SEofsize5
600000C 600000C 1
glef7vl.
glef7v2.
'
^">^.
^Y-^---.
0 1
-2Q. i-20 JO,
Figure 4-89 20 Pet. Err. Eroded
by
Flat Figure 4-92 10 Pet. Err. Erodedby
FlatSE ofsize 7 SEofsize7
600000C 600000C 1
-glof3vl.
glof3v2.
0 '
-20, i-20 JO,
Figure 4-93 20 Pet. Err. Opened
by
Flat Figure 4-96 10 Pet. Err. Openedby
FlatSEofsize3 SE ofsize3
600000C 1
-g2o5vl.
g2o5v2.
'^^v^^^
0
600000C
.-20, i-20 JO, i-20
Figure 4-94 20 Pet. Err. Opened
by
Flat Figure 4-97 10 Pet. Err. Openedby
FlatSEofsize5 SE ofsize5
6000000 1
g2of7vl.
g2of7v2.
""^v,^^
0 1
600000C
-2Q, i-20