Image Processing Reference
In-Depth Information
newpic zero(pic)
for x 0..cols(pic)-2
for y 0..rows(pic)-2
newpic y,x
edge(pic) =
|2·pic y,x -pic y,x+1 -pic y+1,x |
newpic
Code 4.1
First-order edge detection
select too much noise. Often, the threshold level is chosen by experience or by experiment,
but it can be determined automatically by considering edge data (Venkatesh, 1995), or
empirically (Haddon, 1988). For the moment, let us concentrate on the development of
edge detection operators, rather than on their application.
4.2.2 Analysis of the basic operators
Taylor series analysis reveals that differencing adjacent points provides an estimate of the
first order derivative at a point. If the difference is taken between points separated by ∆
x
then by Taylor expansion for f ( x + ∆
x ) we obtain:
2
x
3
fx
( +
x
) = (
fx
) +
x f x
(
) +
() + (
f
x Ox
)
(4.5)
2!
By rearrangement, the first-order derivative f ′ ( x ) is:
fx
( +
x
) -
fx
( ) -
2
fx
() =
Ox
(
)
(4.6)
x
This shows that the difference between adjacent points is an estimate of the first-order
derivative, with error O (∆ x 2 ). This error depends on the size of the interval ∆ x and on the
complexity of the curve. When ∆ x is large this error can be significant. The error is also
large when the high-order derivatives take large values. In practice, the close sampling of
image pixels and the reduced high frequency content make this approximation adequate.
However, the error can be reduced by spacing the differenced points by one pixel. This is
equivalent to computing the first-order difference delivered by Equation 4.1 at two adjacent
points, as a new horizontal difference Exx where
Exx x , y = E x +1, y + E x , y = P x +1, y - P x , y + P x , y - P x -1, y = P x +1, y - P x -1, y
(4.7)
This is equivalent to incorporating spacing to detect the edges Exx by:
Exx x , y = | P x +1, y - P x -1, y |
x
2, N - 1; y
1, N
(4.8)
To analyse this, again by Taylor series, we expand f ( x -
x ) as:
2
x
3
fx
( -
x
) = ( ) -
fx
x
fx
+
() - (
f
x Ox
)
(4.9)
2!
By differencing Equation 4.9 from Equation 4.5, we obtain the first-order derivative as:
fx
( +
x
) -
fx
( -
x
)
2
(4.10)
fx
() =
-
Ox
(
)
2
x
Equation 4.10 suggests that the estimate of the first order difference is now the difference
Search WWH ::




Custom Search