Image Processing Reference
In-Depth Information
(a) Original image
(b) Edge magnitude
313
331
3
3
24
47
298
315
1
2
42
63
273
276
13
43
88
88
dir =
269
268
199
117
91
92
242
225
181
178
133
116
225
210
183
179
155
132
prewitt_vec 0, 1 , prewitt_vec 0, 0
(c) Vector format
(d) Edge direction
Figure 4.9
Applying the Prewitt operator
The Mathcad implementation of these masks is very similar to the implementation of
the Prewitt operator, Code 4.2 , again operating on a 3 × 3 sub-picture. This is the standard
formulation of the Sobel templates, but how do we form larger templates, say for 5 × 5 or
7 × 7. Few textbooks state its original derivation, but it has been attributed (Heath, 1997)
as originating from a PhD thesis (Sobel, 1970). Unfortunately a theoretical basis, which
can be used to calculate the coefficients of larger templates, is rarely given. One approach
to a theoretical basis is to consider the optimal forms of averaging and of differencing.
Gaussian averaging has already been stated to give optimal averaging. The binomial expansion
gives the integer coefficients of a series that, in the limit, approximates the normal distribution.
Pascal's triangle gives sets of coefficients for a smoothing operator which, in the limit,
approach the coefficients of a Gaussian smoothing operator. Pascal's triangle is then:
Window size
2
1
1
3
121
4
1331
5
14641
This gives the (unnormalised) coefficients of an optimal discrete smoothing operator (it
is essentially a Gaussian operator with integer coefficients). The rows give the coefficients
Search WWH ::




Custom Search