Image Processing Reference
In-Depth Information
diff x_win =Pascal(x_win, winsize-2)-Pascal(x_win-1, winsize-2)
Code 4.5
Differencing function
4.6 which combines the differencing function along one axis, with smoothing along the
other.
winsize-1
winsize-1
Sobel_x(pic):=
smooth
diff
pic
y win
_
x_win
y_win, x_win
x_win = 0
y_win = 0
(a) Mx
winsize-1
winsize-1
Sobel_y(pic):=
smooth
diff
pic
x win
_
y_win
y_win, x_win
x_win = 0
y_win = 0
(b) My
Code 4.6
Generalised Sobel templates
This generates a template for the Mx template for a Sobel operator, given for 5 ×
5 in
Code 4.7 .
120-2
-1
480-8
-4
Sobel_template_x=
6 20-12
-6
480-8
-4
120-2
-1
Code 4.7
5 ×
5 Sobel template Mx
All template-based techniques can be larger than 5 × 5 so, as with any group operator,
there is a 7 × 7 Sobel and so on. The virtue of a larger edge detection template is that it
involves more smoothing to reduce noise but edge blurring becomes a great problem. The
estimate of edge direction can be improved with more smoothing since it is particularly
sensitive to noise. There are circular edge operators designed specifically to provide accurate
edge direction data.
The Sobel templates can be invoked by operating on a matrix of dimension equal to the
window size, from which edge magnitude and gradient are calculated. The Sobel function
(Code 4.8 ) convolves the generalised Sobel template (of size chosen to be winsize ) with
the picture supplied as argument, to give outputs which are the images of edge magnitude
and direction, in vector form.
The results of applying the 3 × 3 Sobel operator can be seen in Figure 4.11 . The original
face image Figure 4.11 (a) has many edges in the hair and in the region of the eyes. This is
Search WWH ::




Custom Search