Img Morpho 2
Transcript of Img Morpho 2
-
7/29/2019 Img Morpho 2
1/11
Dr. D. J. Jackson Lecture 15-13Electrical & Computer Engineering
Boundary Extraction
The boundary of a setA, denoted E(A), is obtained by first erodingA by Band then performing the set difference betweenA and its erosion
E(A) =A (A B)
B, as always, is a suitable structuring element
Shaded elements
are 1s and white
elements are 0s
Dr. D. J. Jackson Lecture 15-14Electrical & Computer Engineering
Boundary Extraction
Although a 3x3 structuring element is commonly
used, it is not unique
A 5x5 structuring element of 1s would result in a
boundary between 2 and 3 pixels thick
When the origin of the structuring element, B, is on
the edges of the set, part ofB may be outside the
image
The normal treatment of this condition is to assume thatvalues outside the borders of the image are 0
-
7/29/2019 Img Morpho 2
2/11
Dr. D. J. Jackson Lecture 15-15Electrical & Computer Engineering
Boundary Extraction
Dr. D. J. Jackson Lecture 15-16Electrical & Computer Engineering
Region Filling AssumeA denotes a set containing a subset whose elements are 8-
connected boundary points of a region.
Beginning with a pointp inside the boundary, the object is to fill the entire
region (with 1s)
Adopt the convention that all nonboundary (background) points are
labeled 0 and assign a value of 1 top to begin
The following procedure fills the region with 1s
Xk= (Xk-1 BAc k = 1, 2, 3,
WhereX0=p and B is the symmetric structuring element:
The algorithm terminates at step kifXk=Xk-1
The setXkA contains the filled set and its boundary
010
111
010
B
-
7/29/2019 Img Morpho 2
3/11
Dr. D. J. Jackson Lecture 15-17Electrical & Computer Engineering
Region Filling
Dr. D. J. Jackson Lecture 15-18Electrical & Computer Engineering
Region Filling The dilation process in the algorithm would fill the entire area if left
unchecked
The intersection withAcat each iteration limits the result to inside theregion of interest
This is the first example of how a morphological process can be conditionedto meet a desired property
This process is called conditional dilation
-
7/29/2019 Img Morpho 2
4/11
Dr. D. J. Jackson Lecture 15-19Electrical & Computer Engineering
Extraction of Connected Components
Concepts of connectivity and connected
components are used
Let Yrepresent a connected component in a setA
and assume that a pointp ofYis known
The following expression yields all the elements of
Y
Xk= (Xk-1 BA k = 1, 2, 3,
WhereX0=p and B is a suitable structuring element
IfXk=Xk-1, the algorithm has converged and Y=Xk
Dr. D. J. Jackson Lecture 15-20Electrical & Computer Engineering
Extraction of Connected Components
-
7/29/2019 Img Morpho 2
5/11
Dr. D. J. Jackson Lecture 15-21Electrical & Computer Engineering
Extraction of Connected Components
This process is similar to region filling except that
we useA instead ofAc in the process
The difference arises because all of the elements
sought (the elements of the connected component)
are labeled 1
The intersection withA at each step eliminates
dilations that are centered on elements labeled 0
The shape of the structuring element assumes 8-
connectivity between pixels
Dr. D. J. Jackson Lecture 15-22Electrical & Computer Engineering
Extraction of Connected Components
-
7/29/2019 Img Morpho 2
6/11
Dr. D. J. Jackson Lecture 15-23Electrical & Computer Engineering
Convex Hull
A setA is convexif and only if the straight line
segment joining any two points ofA lie entirely
withinA
The convex hull Hof an arbitrary set S is the
smallest convex set containing S
The set difference H-S is called the convex
deficiency
The convex hull and convex deficiency will be
useful for object description We present an algorithm for obtaining the convex
hull, C(A), of a setA
Dr. D. J. Jackson Lecture 15-24Electrical & Computer Engineering
Convex Hull Let Bi, i=1,2,3,4 represent the four structuring elements shown below
The procedure consists of implementing the following:
AXwith
kandiABXX
i
i
k
i
k
0
1 ,...3,2,14,3,2,1)(
shaded=1, white=0, X=dont care
XXXXXXX
XXXXXX
XXXXXXX
B1 B2 B3 B4
-
7/29/2019 Img Morpho 2
7/11
Dr. D. J. Jackson Lecture 15-25Electrical & Computer Engineering
Convex Hull
Now let Di=Xik, where there is convergence in the sense thatXik= X
ik-1
The convex hull ofA is
In other words, the procedure consists of iteratively applyingthe hit-or-miss transform toA with B1
When no further changes occur, we perform the union with A
and call the set D1 Sets D2, D3 and D4 are generated in a similar manner
The union of the four sets is the convex hull ofA
4
1
)(
i
iDAC
Dr. D. J. Jackson Lecture 15-26Electrical & Computer Engineering
Convex Hull
-
7/29/2019 Img Morpho 2
8/11
Dr. D. J. Jackson Lecture 15-27Electrical & Computer Engineering
Convex Hull
One obvious shortcoming of the procedure is that the convexhull can grow beyond the minimum dimensions required to
guarantee convexity
One approach to reduce this effect is to limit the growth of
the convex hull such that it does not extend beyond the
horizontal and vertical dimensions of the original set
Dr. D. J. Jackson Lecture 15-28Electrical & Computer Engineering
Thinning
The thinningof a setA by a structuring element B, denoted
AB, can be defined in terms of the hit-or-miss transform
A more useful expression for thinningA symmetrically is
based on a sequence of structuring elements:
{B}={B1,B2, B3,,Bn}
cBAA
BAABA
)(
)(
))))((((}{ 21 nBBBABA
-
7/29/2019 Img Morpho 2
9/11
Dr. D. J. Jackson Lecture 15-29Electrical & Computer Engineering
Thinning
The process is to thinA by one pass with B1
Thin the result with one pass ofB2 and so on untilA
is thinned with one pass ofBn
The entire process is repeated until no further
changes occur
Each individual thinning pass is performed using
A (A * B)c
As a post-processing step, the thinned set may be
converted to m-connectivity to eliminate multiplepaths
Dr. D. J. Jackson Lecture 15-30Electrical & Computer Engineering
Thinning
-
7/29/2019 Img Morpho 2
10/11
Dr. D. J. Jackson Lecture 15-31Electrical & Computer Engineering
Thickening
Thickeningis the morphological dual of thinning and isdefined by the expression
A B = A (A * B)
Where B is a structuring element suitable for thickening
As with thinning, thickening can be defined as a sequential
operation
The structuring elements for thickening have the same form
as those for thinning, but with all 1s and 0s interchanged
))))((((}{21 n
BBBABA
Dr. D. J. Jackson Lecture 15-32Electrical & Computer Engineering
Thickening
A separate algorithm for thickening is not absolutely
required
In practice, we can thin the background of the set in
question and complement the result
In other words, to thicken setA, we form C=Ac, thin
C, and then form Cc
Depending on the nature ofA, this procedure may
result in some disconnected points
Therefore, thickening is commonly followed with a
post-processing step to remove disconnected points
-
7/29/2019 Img Morpho 2
11/11
Dr. D. J. Jackson Lecture 15-33Electrical & Computer Engineering
Thickening