Edge Detection 03
Edge Detection 03
Edge Detection
a b
f (i, j ) w * h w(m, n)h(i m, j n)
m a nb
1 2 3
X 4 5 6, w 1 0 1
3 4 1
Image smoothing = image blurring
Averaging of brightness values is a special case of discrete
convolution. For a 3 x 3 neighborhood the convolution mask w is
1 1 1
1
w 1 1 1
9
1 1 1
Applying this mask to an image results in smoothing.
1 1 1 1 2 1
1
1
w 1 2 1 w 2 4 2
10 16
1 1 1 1 2 1
Nonlinear Image Filters
I1 I 2 I 3 ... I N 2
Median is an order filter, it uses order statistics.
Given an NxN window W(x,y) with pixel (x,y) being the
midpoint of W, the pixel intensity values of pixels in W
are ordered from smallest to the largest, as follow:
Median filter selects the middle value as the value of (x,y).
dilation(W ( x, y )) max(W ( x, y ))
erosion (W ( x, y )) min(W ( x, y ))
opening dilation erosion
clo sin g erosion dilation
www.ee.siue.edu/~cvip/CVIPtools_demos/mainframe.shtml
Homework
v = f(x,y)
Edge detectors
•locate sharp changes in the intensity function
•edges are pixels where brightness changes abruptly.
x2 y2 1 y
Edge Magnitude = Edge Direction = tan
x
Sobel Operator
y
1
Edge Magnitude = x y
2 2
Edge Direction =tan x
Kirsch Compass Masks
5 3 3 3 3 3 3 3 3 3 3 5
NW 5 0 3SW 5 0 3SE 3 0 3 NE 3 0 5
5 3 3 5 5 3 5 5 5 3 5 5
1 0 1 0 1 2 1 2 1 2 1 0
NW 2 0 2 SW 1 0 1 SE 0 0 0 NE 1 0 1
1 0 1 2 1 0 1 2 1 0 1 2
•Sometimes we are interested only in edge magnitudes without
regard to their orientations.
•The Laplacian may be used.