Image Processing Reference
In-Depth Information
The second-order differential can be implemented as an estimate of the curvature between
the next and previous contour points, v s+ 1 and v s − 1 , respectively, and the point in the local
neighbourhood of the currently inspected snake point v s :
2
d
ds
2
v
s
2
= | (
v
- 2
v
+
v
) |
s
+1
s
s
-1
2
(6.14)
2
2
= (
x
- 2
x
+
x
) + (
y
- 2
y
+
y
)
s
+1
s
s
-1
s
+1
s
s
-1
This is implemented by a function Ecur in Code 6.3 , whose arguments again are the x and
y co-ordinates of the point currently being inspected, x and y , the index of the contour
point currently under consideration, s , and the contour itself, cont .
Ecur(x,y,s,con) :=
s1 mod(s-1+rows(con),rows(con))
s3 mod(s+1,rows(con))
[(con ) -2 x+(con ) ] +[(con ) -2 y+(con ) ]
s1 0
2
2
s3 0
s1 1
s3 1
Code 6.3
Evaluating the contour curvature
E edge can be implemented as the magnitude of the Sobel edge operator at point x , y . This
is normalised to ensure that its value lies between zero and unity. This is also performed
for the elastic and curvature energies in the current region of interest and is achieved by
normalisation using Equation 3.2 arranged to provide an output ranging between 0 and 1.
The edge image could also be normalised within the current window of interest, but this
makes it more possible that the result is influenced by noise. Since the snake is arranged
to be a minimisation process, the edge image is inverted so that the points with highest
edge strength are given the lowest edge value (0) whereas the areas where the image is
constant are given a high value (1). Accordingly, the snake will be attracted to the edge
points with greatest magnitude. The normalisation process ensures that the contour energy
and curvature and the edge strength are balanced forces and eases appropriate selection of
values for α , β and γ .
The Greedy algorithm then uses these energy functionals to minimise the composite
energy functional, Equation 6.12, given in the function grdy in Code 6.4 . This gives a
single iteration in the evolution of a contour wherein all snake points are searched. The
energy for each snake point is first determined and is stored as the point with minimum
energy. This ensures that if any other point is found to have equally small energy, then the
contour point will remain in the same position. Then, the local 3 × 3 neighbourhood is
searched to determine whether any other point has a lower energy than the current contour
point. If it does, then that point is returned as the new contour point.
A verbatim implementation of the Greedy algorithm would include three thresholds.
One is a threshold on tangential direction and another on edge magnitude. If an edge point
were adjudged to be of direction above the chosen threshold, and with magnitude above its
corresponding threshold, then β can be set to zero for that point to allow corners to form.
This has not been included in Code 6 . 4 , in part because there is mutual dependence
between α
and β
. Also, the original presentation of the Greedy algorithm proposed to
Search WWH ::




Custom Search