Professional Documents
Culture Documents
Morphological Image Processing - Part1
Morphological Image Processing - Part1
a A
a A
The set with no elements is called the null or empty set and is denoted by
the symbol .
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, denoted as
A B
The union of two sets A and B, denoted by C=A B
Is the set of all elements belonging to either A,B or both
The intersection of two sets A and B, denoted by
D=A B;
p AND
q
p OR q
NOT p
Fundamental Definitions
We defined an image as an (amplitude) function of two, real
(coordinate) variables a(x,y) or two, discrete variables a[m,n]. An
alternative definition of an image can be based on the notion that
an image consists of a set (or collection) of either continuous or
discrete coordinates. In a sense the set corresponds to the points
or pixels that belong to the objects in the image. This is illustrated
in Figure which contains two objects or sets A and B. Note that
the coordinate system is required. For the moment we will
consider the pixel values to be binary.
Fundamental Definitions
The object A consists of those pixels a that share some
common property:
Object The background of A is given by Ac (the complement of A) which
is defined as those elements that are not in A:
Background
-
Fundamental Definitions
The fundamental operations associated
with an object are the standard set
operations union, intersection, and
complement plus translation:
Fundamental Definitions
The complement of A is the binary image which interchange the 1s and
0s in A . Thus,
A {pp
and
p A}
and
p B}
or
p B}
Fundamental Definitions
* Translation - Given a vector x and a set A, the translation,
A + x, is defined as:
Note that, since we are dealing with a digital image composed of
pixels at integer coordinate positions (Z2), this implies restrictions
on the allowable translation vectors x.
The basic Minkowski set operations--addition and subtraction--can
now be defined. First we note that the individual elements that
comprise B are not only pixels but also vectors as they have a
clear coordinate position with respect to [0,0]. Given two sets A
and B:
Minkowski addition Minkowski subtraction -
Structuring Elements
The structuring element is sometimes called the kernel, but we
reserve that term for the similar objects used in convolutions.
The structuring element consists of a pattern specified as the
coordinates of a number of discrete points relative to some origin.
Normally Cartesian coordinates are used and so a convenient way
of representing the element is as a small image on a rectangular
grid. Figure 1 shows a number of different structuring elements of
various sizes. In each case the origin is marked by a ring around
that point. The origin does not have to be in the center of the
structuring element, but often it is. As suggested by the figure,
structuring elements that fit into a 33 grid with its origin at the
center are the most commonly seen type.
Structuring Elements
Sstructuring Element
Note that each point in the structuring element may have a value. In the
simplest structuring elements used with binary images for operations
such as erosion, the elements only have one value, conveniently
represented as a one. More complicated elements, such as those used
with thinning or grayscale morphological operations, may have other
pixel values.
The structuring element is already just a set of point coordinates
(although it is often represented as a binary image). It differs from
the input image coordinate set in that it is normally much smaller,
and its coordinate origin is often not in a corner, so that some
coordinate elements will have negative values. Note that in many
implementations of morphological operators, the structuring
element is assumed to be a particular shape (e.g. a 33 square) and
so is hardwired into the algorithm.
Sstructuring Element
The two most common structuring elements
(given a Cartesian grid) are the 4-connected
and 8-connected sets, N4 and N8. They are
illustrated in Figure .
Binary Images
For a binary image, white pixels are normally taken to represent
foreground regions, while black pixels denote background. (Note
that in some implementations this convention is reversed, and so it
is very important to set up input images with the correct polarity
for the implementation being used). Then the set of coordinates
corresponding to that image is simply the set of two-dimensional
Euclidean coordinates of all the foreground pixels in the image,
with an origin normally taken in one of the corners so that all
coordinates have positive elements.
Erosion
The basic effect of the operator on a binary image is to erode
away the boundaries of regions of foreground pixels (i.e.
white pixels, typically). Thus areas of foreground pixels shrink
in size, and holes within those areas become larger
Erosion-How It Works
The erosion operator takes two pieces of data as inputs. The first is the
image which is to be eroded. The second is a (usually small) set of
coordinate points known as a structuring element (also known as a
kernel ). It is this structuring element that determines the precise effect
of the erosion on the input image.
The mathematical definition of erosion for binary images is as
follows:
* Suppose that X is the set of Euclidean coordinates corresponding
to the input binary image, and that K is the set of coordinates for
the structuring element.
* Let Kx denote the translation of K so that its origin is at x.
* Then the erosion of X by K is simply the set of all points x such
that Kx is a subset of X.
Erosion-How It Works
As an example of binary erosion, suppose that the structuring
element is a 33 square, with the origin at its center as shown in
Figure 2. Note that in this and subsequent diagrams, foreground
pixels are represented by 1's and background pixels by 0's.
Figure 2
The erosion of a binary image A by a binary image B is 1 at a
pixel p if and only if every 1 pixel in the translation of B to p is
also 1 in A.
Erosion-How It Works
To compute the erosion of a binary input image by this structuring
element, we consider each of the foreground pixels in the input image
in turn. For each foreground pixel (which we will call the input pixel)
we superimpose the structuring element on top of the input image so
that the origin of the structuring element coincides with the input pixel
coordinates. If for every pixel in the structuring element, the
corresponding pixel in the image underneath is a foreground
pixel, then the input pixel is left as it is. If any of the
corresponding pixels in the image are background, however, the
input pixel is also set to background value.
For our example 33 structuring element, the effect of this operation is
to remove any foreground pixel that is not completely surrounded by
other white pixels (assuming 8-connectedness). Such pixels must lie
at the edges of white regions, and so the practical upshot is that
foreground regions shrink (and holes inside a region grow).
We can also use erosion for edge detection by taking the erosion
of an image and then subtracting it away from the original
image, thus highlighting just those pixels at the edges of objects
that were removed by the erosion.
Finally, erosion is also used as the basis for many other
mathematical morphology operators.
Dilation
The basic effect of the operator on a binary image is to gradually
enlarge the boundaries of regions of foreground pixels (i.e. white
pixels, typically). Thus areas of foreground pixels grow in size while
holes within those regions become smaller.
a)Dilation
b)Erosion
More examples
Finally, dilation is also used as the basis for many
other mathematical morphology operators, often in
combination with some logical operators. A simple
example is region filling which is illustrated using
the image
This image and all the following results were zoomed with a factor of 16
for a better display, i.e. each pixel during the processing corresponds to a
1616 pixel square in the displayed images. Region filling applies
logical NOT, logical AND and dilation iteratively. The process can be
described by the following formula:
where Xk is the region which after convergence fills the boundary, J
is the structuring element and Anot is the negative of the boundary.
This combination of the dilation operator and a logical operator is also
known as conditional dilation.
More examples
Imagine that we know Xo , i.e. one pixel which lies inside the region
shown in the above image, e.g.
which is the
negative of the
boundary.
Dilating the
resulting
image,
More examples
Repeating these two steps until convergence, yields
and finally
Opening
The basic effect of an opening is somewhat like
erosion in that it tends to remove some of the
foreground (bright) pixels from the edges of regions
of foreground pixels. However it is less destructive
than erosion in general. As with other morphological
operators, the exact operation is determined by a
structuring element. The effect of the operator is to
preserve foreground regions that have a similar shape
to this structuring element, or that can completely
contain the structuring element, while eliminating all
other regions of foreground pixels.
Translation For the opening with structuring element B and images A, A1,
and A2, where A1 is a subimage of A2 (A1 A2):
Idempotence
-
Idempotence -
Idempotence
Some operators have the special property that applying them
more than once to the same image produces no further change
after the first application. Such operators are said to be
idempotent. Examples include the morphological operators
opening and closing.
Some of the circles are slightly distorted, but in general, the lines have
been almost completely removed while the circles remain almost
completely unaffected.
Closing
Closing is similar in some ways to dilation in that it tends to
enlarge the boundaries of foreground (bright) regions in an
image (and shrink background color holes in such regions), but
it is less destructive of the original boundary shape. As with
other morphological operators, the exact operation is
determined by a structuring element. The effect of the operator
is to preserve background regions that have a similar shape to
this structuring element, or that can completely contain the
structuring element, while eliminating all other regions of
background pixels.
Closing -
Links
Image Processing Fundamentals - Morphology-based Operations
http://www.mmorph.com/resources.html
http://cmm.ensmp.fr/~beucher/wtshed.html
http://www.cwi.nl/projects/morphology/
http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fipMorpholo.html
http://www.mathworks.com/access/helpdesk/help/toolbox/images
/images.shtml
http://wwwdsv.cea.fr/thema/shfj/web/demo_extraction/english/cerveau.htm