Reference - Unit-V PDF
Reference - Unit-V PDF
Christophoros Nikou
[email protected]
Constant intensity
(edge-based
segmentation)
Textured region
(region-based
segmantation)
Observations:
• Second derivative produces
two values for an edge
(undesirable).
• Its zero crossings may be
used to locate the centres of
thick edges.
C. Nikou – Digital Image Processing
13 Edge model and noise
f ( x, y )
f ( x, y 1) f ( x, y )
y
Roberts operators
Integrates image
smoothing
Diagonal edges
Image smoothed
prior to edge
detection.
The wall bricks are
smoothed out.
2
f 2
f
f ( x, y ) 2 2
2
x y
G( x, y)* f ( x, y) G( x, y)* f ( x, y)
2 2
2
2
G ( x, y ) 2 2 G ( x, y )
2
x y
x2 y 2 x2 y 2
2 2
x y 2
2 2 2
2 2 e
2 2
2 2
e
x y 4
x y 2
2 2 2
• Fundamental ideas
– The Gaussian blurs the image. Iτ reduces the
intensity of structures at scales much smaller than σ.
– The Laplacian is isotropic and no other directional
mask is needed.
• The zero crossings of the operator indicate edge
pixels. They may be computed by using a 3x3
window around a pixel and detect if two of its
opposite neighbors have different signs (and
their difference is significant compared to a
threshold).
C. Nikou – Digital Image Processing
28 The LoG operator (cont.)
Image LoG
Zero crossings
Zero with a threshold
crossings of 4% of the
image max
2
1
2
2
2
2
ln 2
1 2
1 2 2
2
original image
C. Nikou – Digital Image Processing
38 Canny edge detector (cont.)
Gradient magnitude
C. Nikou – Digital Image Processing
39 Canny edge detector (cont.)
Interpolation provides
these values.
LoG Canny
C. Nikou – Digital Image Processing
46 Canny vs LoG
Image Thresholded gradient
LoG Canny
C. Nikou – Digital Image Processing
47 Edge Linking
• Even after hysteresis thresholding, the detected
pixels do not completely characterize edges
completely due to occlusions, non-uniform
illumination and noise. Edge linking may be:
– Local: requiring knowledge of edge points in
a small neighborhood.
– Regional: requiring knowledge of edge
points on the boundary of a region.
– Global: the Hough transform, involving the
entire edge image.
1 M ( x, y) TM and a( x, y ) [ A TA , A TA ]
g ( x, y )
0 otherwise
3. Scan the rows of g(x,y) (for Α=0) and fill (set to 1) all
gaps (zeros) that do not exceed a specified length K.
4. To detect gaps in any other direction Α=θ, rotate g(x,y)
by θ and apply the horizontal scanning.
Accumulator
array
• We only know the orientation of the runway (around 0 deg) and the
observer’s position relative to it (GPS, flight charts etc.).
• We look for the peak at the accumulator array around 0 deg and join
gaps below 20% of the image height.
• Applications in autonomous navigation.
T=125
P1 (k )[1 P1 (k )]
• The value of k is selected by sequential
search as the one maximazing:
k max { (k )}
* 2
B
0 k L 1
Image Histogram
We wish to extract
the bright spots
(nuclei) of the cells
k1=80, k2=177
More accurate
nuclei extraction.
Subdivision
C. Nikou – Digital Image Processing
81 Variable Thresholding (cont.)
Moving averages.
• Generally used along lines, columns or in zigzag .
• Useful in document image processing.
• Let zk+1 be the intensity of a pixel in the scanning sequence
at step k+1. The moving average (mean intensity) at this
point is:
1 k 1 1
m(k 1)
n i k 2 n
zi m(k ) ( zk 1 zk n )
n
n is the number of points used in the average
• Segmentation is then performed at each point comparing
the pixel value to a fraction of the moving average.
The weld is very bright. The predicate used for region growing is to
compare the absolute difference between a seed point and a pixel
to a threshold. If the difference is below it we accept the pixel as
crack. C. Nikou – Digital Image Processing
86 Region Growing (cont.)
Merging examples:
• R2 may be merged with R41.
• R41 may be merged with R42.
C. Nikou – Digital Image Processing
91
Region Splitting and Merging
(cont.)
• Image of the Cygnus Loop. We want to
segment the outer ring of less dense
matter.
• Characteristics of the region of interest:
• Standard deviation grater than the
background (which is near zero) and
the central region (which is
smoother).
• Mean value greater than the mean of
background and less than the mean
of the central region.
true AND 0 m b
• Predicate: Q
false otherwise
C. Nikou – Digital Image Processing
92
Region Splitting and Merging
(cont.)
Varying the size of the smallest allowed quadregion.
Larger quadregions
lead to block-like
segmentation.
Smaller quadregions
lead to small black
regions. 32x32
16x16 seems to be
the best result.
16x16 8x8
C. Nikou – Digital Image Processing
93 Morphological Watersheds
• Visualize an image topographically in 3D
– The two spatial coordinates and the intensity (relief
representation).
• Three types of points
– Points belonging to a regional minimum.
– Points ta which a drop of water would fall certainly to
a regional minimum (catchment basin).
– Points at which the water would be equally likely to
fall to more than one regional minimum (crest lines
or watershed lines).
• Objective: find the watershed lines.
• Before flooding.
• To prevent water from spilling through the image
borders, we consider that the image is surrounded
by dams of height greater than the maximum image
intensity. C. Nikou – Digital Image Processing
98 Morphological Watersheds (cont.)
Short dam
• Further flooding.
• The water from the left basin overflowed into the
right basin.
• A short dam is constructed to prevent water from
merging. C. Nikou – Digital Image Processing
102 Morphological Watersheds (cont.)
• Further flooding.
• The effect is more pronounced.
• The first dam is now longer.
• New dams are created.
C. Nikou – Digital Image Processing
103 Morphological Watersheds (cont.)
Final watershed lines
superimposed on the
image.
q
Cn-1(M1) Cn-1(M2)
Watersheds Watersheds
on the image
C. Nikou – Digital Image Processing
110 Morphological Watersheds (cont.)
• Each region defined by the external marker has a single internal marker
and part of the background.
• The problem is to segment each of these regions into two segments: a
single object and background.
• The algorithms we saw in this lecture may be used (including watersheds
applied to each individual region).
C. Nikou – Digital Image Processing
114 Morphological Watersheds (cont.)
Final segmentation.
C. Nikou – Digital Image Processing
115 Morphological Watersheds (cont.)
• Positive ADI:
Pk 1 ( x, y ) 1 if R( x, y) f ( x, y, tk ) T
Pk ( x, y )
Pk 1 ( x, y ) otherwise
• Negative ADI:
N k 1 ( x, y ) 1 if R( x, y) f ( x, y, tk ) T
N k ( x, y )
N k 1 ( x, y ) otherwise
• The nonzero area of the positive ADI gives the size of the object.
• The location of the positive ADI gives the location of the object in the
reference frame.
• The direction and speed may be obtained fom the absolute and
negative ADIs.
• The absolute ADI contains both the positive and negative ADIs.
C. Nikou – Digital Image Processing
121 Accumulative differences (cont.)
• To establish a reference image in a non
stationary background.
– Consider the first image as the reference image.
– When a non stationary component has moved out of
its position in the reference frame, the corresponding
background in the current frame may be duplicated
in the reference frame. This is determined by the
positive ADI:
• When the moving object is displaced completely with
respect to the reference frame the positive ADI stops
increasing.
d 2 Re g x (t , 1 ) d 2 Im g x (t , 1 )
S1x 2
S2 x
dt t n
dt 2 t n