Anda di halaman 1dari 30

Image

Segmentation
Dr. Vipin Tyagi
Dr. Vipin Tyagi
Image improvement low level IP
Improvement of pictorial information for
human interpretation (Improving the visual
appearance of images to a human viewer )
Image analysis high level IP
Processing of scene data for machine
perception (Preparing images for
measurement of the features and structures
present )
2
Dr. Vipin Tyagi
Extracting information form an image
Step 1: segment the image ->objects or
regions
Step 2 : describe and represent the
segmented regions in a form suitable for
computer processing
Step 3 : image recognition and
interpretation
Image analysis HLIP
3
Dr. Vipin Tyagi
Image analysis HLIP
4
Dr. Vipin Tyagi
Definition
Subdivide an image into its constituent regions or
objects
Image segmentation is the process of partitioning the digital
image into multiple regions that can be associated with the
properties of one or more criterion
It is an initial and vital step in pattern recognition-a series of
processes aimed at overall image understanding.
Based on two properties of gray-level image values
Discontinuity
point / line / edge / corner detection
Similarity
thresholding
region growing / splitting / merging
Image segmentation
5
Dr. Vipin Tyagi 6
Dr. Vipin Tyagi
- Segmentation is an image analysis task that
subdivides an image into disjoint regions of interest for
further analysis. It is usually the first step in image
analysis.
- The disjoint regions usually correspond to the
different objects of interest in the image.
- It is an important and usually difficult step in image
processing.
-Accurate segmentation determines the accuracy of
subsequent image analysis steps.


7
Dr. Vipin Tyagi
Detection of discontinuities
- This is usually accomplished by applying a suitable mask to the
image.
(
(
(
(
(
(






9 8 7
6 5 4
3 2 1
f f f
f f f
f f f
w
1
w
2
w
3

w
4
w
5
w
6

w
7
w
8
w
9

D=
D
(
(
(
(
(
(

=
=
9
1 i
i i
w f R f
8
Dr. Vipin Tyagi
- The mask output or response at each pixel is computed by
centering the mask on the pixel location.
- When the mask is centered at a point on the image boundary,
the mask response or output is computed using suitable boundary
condition. Usually, the mask is truncated.
9
Dr. Vipin Tyagi
Point Detection
- This is used to detect isolated spots in an image.
- The gray level of an isolated point will be very different from
its neighbors.
- It can be accomplished using the following mask: 33
(
(
(




1 1 1
1 8 1
1 1 1
- The output of the mask operation is usually thresholded.
10
Dr. Vipin Tyagi
- An isolated point has been detected if
T f f f f f f f f f > + + + + + + + ) ( 8
9 7 6 5 4 3 2 1 8
for some pre-specified non-negative threshold T.
Example:
11
Dr. Vipin Tyagi 12
Dr. Vipin Tyagi
Detection of lines
- This is used to detect lines in an image.
- It can be done using the following four masks:
(
(
(



1 1 1
2 2 2
1 1 1
Detect
Horizontal
line
(
(
(




1 1 2
1 2 1
2 1 1
detect
+45
0

line
(
(
(




1 2 1
1 2 1
1 2 1
Detect
Vertical
line
(
(
(




2 1 1
1 2 1
1 1 2
Detect
+135
0

line
D
0

D
45
D
90

D
135

13
Dr. Vipin Tyagi
-Let , , and , respectively be the response

to masks , , , and , respectively.

R
0
R
45
R
90
R
135

D
0
D
45
D
90
D
135

At a given pixel (m,n), if R
135
is the maximum among {R
0
, R
45

, R
90
, R
135
}, we say that a 135
0
line is most likely passing
through that pixel.
14
Dr. Vipin Tyagi
Results after processing with 135
0

15
Dr. Vipin Tyagi
Edge Detection
- Isolated points and thin lines do not occur frequently in most
practical applications.
- For image segmentation, we are mostly interested in detecting
the boundary between two regions with relatively distinct gray
level properties.
- We assume that the regions in question are sufficiently
homogeneous so that the transition between two regions can be
determined on the basis of gray-level discontinuities alone.
- An edge in an image may be defined as a discontinuity or
abrupt change in gray level.
16
Dr. Vipin Tyagi
Ideal Step Edge Ideal Roof Edge
Combination of Step
and Roof Edges
Ideal Spike Edge
17
Dr. Vipin Tyagi
- These are ideal situations that do not frequently occur in
practice. Also, in two dimensions edges may occur at any
orientation.
- Edges may not be represented by perfect discontinuities.
Therefore, the task of edge detection is much more difficult than
what it looks like.
- A useful mathematical tool for developing edge detectors is the
first and second derivative operators.
18
Dr. Vipin Tyagi
Example:
Gray-level profile
First derivative
Second derivative
19
Dr. Vipin Tyagi
- From the example above it is clear that the magnitude of the
first derivative can be used to detect the presence of an edge
in an image.
- The sign of the second derivative can be used to determine
whether an edge pixel lies on the dark or light side of an edge.
- The zero crossings of the second derivative provide a
powerful way of locating edges in an image.
20
Dr. Vipin Tyagi
- On the other hand, large-sized masks in order to detect coarse
variation in gray-level distribution (i.e., macro-edges) and
filter-out noise and other irregularities.
- Small-sized masks in order to detect fine variation in gray-
level distribution (i.e., micro-edges).
- We therefore need to find a mask size, which is a compromise
between these two opposing requirements, or determine edge
content by using different mask sizes.
21
Dr. Vipin Tyagi
Edges and Noise
- First column: images and
gray level profiles of ramp
edge corrupted by a Gaussian
noise of mean 0 and variance
0, 0.01, 1, and 10
- Second column: first
derivative images and gray
level profiles
- Third column: second
derivative images and gray
level profiles
- Noise is a big problem
in edge detection
22
Dr. Vipin Tyagi
- It is interesting to note that the noise is invisible in the original
image
- However, the noise is pronounced in derivatives
- Second derivative is more sensitive to noise
- A small noise has significant impact on edge detection
- Therefore, image smoothing should be a serious consideration
prior to use of derivatives
- Thresholding is required to declare only significant gray-level
transitions as edge. By this way, we can eliminate some effect of
noise
- We could define a point in an image as edge point if its first
derivative is greater than a specified threshold
23
Dr. Vipin Tyagi
- Most common differentiation operator is the gradient.
(
(
(
(

c
c
c
c
= V
y
y x f
x
y x f
y x f
) , (
) , (
) , (
- The magnitude of the gradient is:
2 / 1
2
2
) , ( ) , (
) , (
|
|
.
|

\
|
|
|
.
|

\
|
c
c
+
|
.
|

\
|
c
c
= V
y
y x f
x
y x f
y x f
- The direction of the gradient is given by :
|
|
.
|

\
|
c
c
c
c
= ZV

x
f
y
f
y x f
1
tan ) , (
24
Dr. Vipin Tyagi
- In practice, we use discrete approximations of the partial
derivatives and , which are implemented using :
y
f
c
c
x
f
c
c
z
1
z
2
z
3

z
4
z
5
z
6

z
7
z
8
z
9

5 9
z z
x
f
=
c
c
6 8
z z
y
f
=
c
c
- Other discrete approximations to the gradient (more precisely, the
appropriate partial derivatives) have been proposed (Roberts,
Prewitt).
- Because derivatives enhance noise, the previous operators may
not give good results if the input image is very noisy.
25
Dr. Vipin Tyagi
- One way to combat the effect of noise is by applying a
smoothing mask. The Sobel edge detector combines this
smoothing operation along with the derivative operation .
- Since the gradient edge detection methodology depends only
on the relative magnitudes within an image, scalar
multiplication by factors such as 1/2 or 1/8 play no essential
role. The same is true for the signs of the mask entries.
Therefore, masks like
(
(
(

1 0 1
2 0 2
1 0 1
(
(
(

1 0 1
2 0 2
1 0 1
(
(
(

1 0 1
2 0 2
1 0 1
* 5 . 0
correspond to the same detector, namely the Sobel edge detector.
26
Dr. Vipin Tyagi 27
Dr. Vipin Tyagi 28
Dr. Vipin Tyagi
- However when the exact magnitude is important, the proper
scalar multiplication factor should be used.
- All masks considered so far have entries that add up to zero.
This is typical of any derivative mask.
29
Dr. Vipin Tyagi 30

Anda mungkin juga menyukai