Image Processing Reference
In-Depth Information
and (f) define the angular function ϕ ( s ). We can observe the typical toroidal form. Once the
curve is greater than 2π there is a discontinuity whilst its value returns to zero. The position
of the discontinuity actually depends on the selection of the starting point. The cumulative
function γ ( s ) shown in Figures 7.11 (c) and (g) inverts the function and eliminates
discontinuities. However, the start and end points are not the same. If we consider that this
function is periodic, then there is a discontinuity at the end of each period. The normalised
form γ *( t ) shown in Figures 7.11 (d) and (h) has no discontinuity and the period is normalised
to 2π .
The normalised cumulative functions are very nice indeed. However, it is tricky to
compute them from images. Additionally, since they are based on measures of changes in
angle, they are very sensitive to noise and difficult to compute at inflexion points (e.g.
corners). Code 7.1 illustrates the computation of the angular functions for a curve given by
a sequence of pixels. The matrices X and Y store the co-ordinates of each pixel. The code
has two important steps. First, the computation of the angular function stored in the matrix
A . Generally, if we use only the neighbouring points to compute the angular function, then
the resulting function is useless due to noise and discretisation errors. Thus, it is necessary
to include a procedure that can obtain accurate measures. For purposes of illustration, in
the presented code we average the position of pixels in order to filter out noise; however,
other techniques such as the fitting process discussed in Section 4.7.2 can provide a
suitable alternative. The second important step is the computation of the cumulative function.
In this case, the increment in the angle cannot be computed as the simple difference
between the current and precedent angular values. This will produce a discontinuous
function. Thus, we need to consider the periodicity of the angles. In the code, this is
achieved by checking the increment in the angle. If it is greater than a threshold, then we
consider that the angle has exceeded the limits of zero or 2π .
Figure 7.12 shows an example of the angular functions computed using Code 7.1 , for a
discrete curve. These are similar to those in Figures 7.11 (a) to (d), but show noise due to
discretisation which produces a ragged effect on the computed values. The effects of noise
will be reduced if we use more points to compute the average in the angular function.
However, this reduces the level of detail in the curve. Additionally, it makes it more
difficult to detect when the angle exceeds the limits of zero or 2π . In a Fourier expansion,
noise will affect the coefficients of the high frequency components, as seen in Figure
7.12 (d).
In order to obtain a description of the curve we need to expand γ *( t ) in Fourier series.
In a straightforward approach we can obtain γ *( t ) from an image and apply the definition
in Equation 7.27 for c ( t ) = γ *( t ). However, we can obtain a computationally more attractive
development with some algebraic simplifications. By considering the form of the integral
in Equation 7.13 we have that
2
2
= 1
= 1
a
*
*( ) cos(
t
kt dt
)
and
b
*
*( ) sin(
t
kt dt
)
(7.30)
k
k
0
0
By substitution of Equation 7.29 we obtain
2
2
= 1
+ 1
*
a
((
L
/ 2
) )
t dt
t dt
0
0
2
2
= 1
+ 1
*
a
((
L
/2
) ) cos(
t
kt dt
)
t
cos(
kt dt
)
(7.31)
0
0
Search WWH ::




Custom Search