You are on page 1of 56

41

Chapter 3


Edge Localization by
Second Derivative Filters





In our research we study the location error of curved edges in two and three
dimensional images after analog and digital low-pass filtering. The zero crossing
of a second derivative filter is a well-known edge localization criterion. The
second derivative in gradient direction (SDGD) produces a predictable bias in
edge location towards the centers of curvature while the linear Laplace filter
produces a shift in the opposite direction. Their sum called PLUS (PLUS =
Laplace + SDGD) leads to an edge detector that finds curved edges one order
more accurately than its constituents. This argument holds irrespective of the
dimension. The influence of commonly used low-pass filters (such as the PSF
originated from diffraction limited optics using incoherent light (2D), the
Gaussian filter with variable cutoff point (DD), and Tepee filters or a-fold pillball
filtering (DD)) has been studied.



42 SECOND DERIVATIVE FILTERS
3.1. Introduction
In industrial and biomedical applications of digital image processing accurate
determination of edge position is a key issue. Edge definitions based on zero
crossings of some second derivative of the grey values are common. We have
studied how edge locations according to such definitions are affected by low-pass
filtering.

The zero crossing of a second derivative is basically defined in the analog
domain. The actual processing is digital (using a sampled version of the image)
and is designed to approximate optimally the analog results. Our error analysis
will be done in the analog domain; the domain where the object actually exist.
Only edge detectors that can be digitally implemented are considered.

Low-pass filtering plays a role at two stages of image analysis. First, analog low-
pass filtering produces the bandwidth limitation that allows sampling; second,
digital low-pass filtering is applied to combat noise. As far as the edge location
error is concerned, the second type of filtering can be reduced to the first: digital
low-pass filtering on a sampled bandlimited signal is equivalent to analog low-
pass filtering just before sampling. Therefore we shall first investigate how analog
low-pass filtering affects the accuracy of edge location.
Fully aware of its insufficiency as a bandlimiting filter and its sub-optimality as a
noise reducer, we shall start our analysis with the 2D analogy of the 1D spatial
window filter: the pillbox filter. At a later stage we shall build stacks of pillboxes
to form Gaussian or Tepee filters. We refer to Chapter 2 (section 2.5) for an
impression of the spatial support and the corresponding frequency response of the
low-pass filters mentioned above.

In this chapter we start summarizing the most important results from the literature
about derivative-based edge detectors. Section 3 starts with a simple edge model
filtered by a single pillbox filter. Other filter shapes such as the Gaussian filter are
constructed using a stack of pillboxes. We analyze the location error of curved
edges after low-pass filtering in 2D images. Section 4 extends the edge model
from a step edge to a Gaussian edge slope. Section 5 extends the theory of section
3 to D-dimensions. Explicit formulas are presented for 2D and 3D. Section 6
deals with the sampling of analog signals. The various edge detectors have
different sampling requirements. The experiments and results reported in section
7 test the presented theory and determine the applicability of the operators in the
presence of noise.

SECOND DERIVATIVE FILTERS 43

3.2. Second Derivative Filters
Gradient based edge detectors use the fact that the modulus of the first derivative
is maximal at the position of the steepest ascent or descent, defined to be the edge
location. Seeking a maximum of the gradient is equivalent to finding the zero
crossing of a second derivative. Both methods being very sensitive to noise they
are usually accompanied by some kind of low-pass filtering which its turn may
introduce a localization error or mixing of neighboring edges. At the same time
this low-pass filtering justifies digital implementation. Edge finding through
Gaussian smoothing and second derivative filtering followed by zero crossings
detection has become commonplace. Marr (Marr and Poggio 1979; Marr and
Hildreth 1980; Hildreth 1983) based his filter choice upon Difference-of-
Gaussians (DOG) functions hypothesized in low level human vision. Most
authors have considered the problem of straight step edge detection, which is
essentially 1D and has edge confusion as the main problem.

Gaussian low-pass filtering
Canny (Canny 1983; Canny 1986) has proven that based upon three criteria the
derivative of a Gaussian is a very good approximation to the numerically optimal
edge detector for 1D step edges disturbed by additive Gaussian noise. The three
performance criteria are: 1) Good detection. There should be a low probability of
failing to mark real edge points, and a low probability of falsely marking nonedge
points. Since both these probabilities are monotonically decreasing functions of
the output signal-to-noise ratio (SNR), this criterion corresponds to maximizing
the SNR. 2) Good localization. The position of the detected edge should be as
close as possible to the position the true edge. 3) A single response to a single
edge.
Lunscher (Lunscher and Peddoes 1986) shows that according to the Dickey and
Shanmugam criterion (Dickey and Shamugan 1977) the optimal filter is equal to
the second derivative of a Gaussian up to a suitable cutoff frequency. Xu (Xu
1986) studied the error probabilities of the same operator along a straight edge in
the presence of noise. With a new localization criterion Tagare (Tagare and
DeFigueiredo 1990) shows that the derivative of a Gaussian is the optimal edge
detector for 1D step edges. Recently, Sarkar and Boyer (Sarkar and Boyer 1991 a;
Sarkar and Boyer 1991 b) presented optimal infinite impulse response filters for
gradient and zero crossing based edge detectors that are similar to first and second
derivatives of Gaussians. All these methods are similar to a second derivative
with Gaussian low-pass filtering. We can easily understand the Gaussian
optimality realizing that high SNR asks a narrow frequency width while edge
confusion is prevented by a spatially narrow width. A Gaussian filter minimizes
the product of spatial and frequency widths (Papoulis 1977).
44 SECOND DERIVATIVE FILTERS
Extension of second derivative edge detection to two or higher dimensions offers
the choice among different second derivatives such as the Laplace operator and
the second derivative in gradient direction (SDGD, also called the second
directional derivative). Due to its mathematical properties (linearity, simple
Fourier description, intrinsic rotation invariance) and simple digital
approximation, the Laplace is popular in image processing (Huertas and Medioni
1986; Chen et al. 1987).

Laplace
Berzins (Berzins 1984), considering the Laplace operator as a simple and practical
approximation of the SDGD, has studied the accuracy of Laplacian-of-Gaussian
edge detectors in relation to spatial features such as the size of the edge, the
curvature of the edge and sharp corners. He remarks that the SDGD is robust with
respect to second order illumination nonuniformity along the edge.

Second Derivative in Gradient Direction
The SDGD, a nonlinear operator, can be expressed in first and second derivatives.
Haralick (Haralick 1984) approximated the SDGD using derivatives of a cubic
polynomial model approximation of the underlying grey level surface. The cubic
fit is equivalent to different low-pass filters for different derivatives, so that
Haralicks result cannot be interpreted as the SDGD of some linear shift-invariant
low-pass filtered image. Clark (Clark 1989) and Torre (Torre and Poggio 1986)
used the SDGD in its analytical description (c.f. Appendix IX). Very fast
approximations of the SDGD can be obtained using local maximum and
minimum filters (grey-scale dilation and grey-scale erosion) (Beckers 1986;
Bernsen 1986; van Vliet et al. 1988; van Vliet et al. 1989 a). A quantitative
evaluation between an analytical SDGD, a nonanalytical SDGD and the Marr-
Hildreth operator (van Vliet et al. 1989 a) shows comparable performance on
synthetic test images heavily disturbed by Gaussian noise.
To use the Laplace or the SDGD makes a difference in the edge position
measured in the case of low-pass filtered curved edges (Torre and Poggio 1986)
especially near corners (Berzins 1984).

PLUS operator
We will show that both the SDGD and Laplace give off-edge (biased) zero
crossings on low-pass filtered curved edges, but on opposite sides of the true edge
such that the sum (PLUS) of SDGD and Laplace changes sign much closer to the
true edge location.

We will derive estimates for the relative location error of the Laplace, the SDGD,
and their sum PLUS as functions of the edge curvature and size of the
SECOND DERIVATIVE FILTERS 45

smoothing filter. We give limits for the size of the smoothing filter with respect to
the edge radius. Outside these limits (e.g. in the case of zero-radius corners) the
accuracy cannot be guaranteed. Gaussian smoothing (Berzins 1984), and indeed
any bandlimiting smoothing necessary for digital analysis always exceeds the
zero-radius limit. For straight edges SDGD, Laplace and their sum all have on-
edge zero crossing.


3.3. Step-Edge Objects
We start out our investigations studying step edge objects. Later we will drop this
limitation. In order to calculate the overlap area between a pillbox filter and a step
edge object we use the concept of integrated chord length. The chord length
c(,l,R) is a function of the overlap thickness , the radius of the pillbox l, and the
radius of the object R. For straight objects we write c(,l) = c(,l,).

A(x,y) describes the analog image before low-pass filtering and B(x,y) describes
the image after low-pass filtering. Our notation for derivatives of the image B(x,y)
is:

x
B
B
x


2
2
xx
B
B
x



g
B
B
g

( )
2 2
grad
x y g
B B B B +
where g is the local gradient direction.

3.3.1. Zero-curvature edge, straight object

3.3.1.1. Smoothing by a single pillbox
The location of a straight step edge is a 1D problem. Take the edge along the y-
axis, given by A(x, y) = u(x) (u() is the unit step function, u(x) = 0 if x < 0,
u(x) = 1 if x > 0). Smoothing with a pillbox of radius l and height 1 gives a
smoothed image B(x, y); if x < l (pillbox in 0-domain) B(x, y) = 0, if x>l (pillbox
in 1-domain) B(x, y) = l
2
. If the pillbox lies over the edge (l < x < l), B(x, y)
equals the overlap area O(x,l) which can be written in a general way as the
integrated chord length c(,l) (cf. figure 3.1)
46 SECOND DERIVATIVE FILTERS

( ) ( ) ( )
0
, , ,
l x
B x y O x l c l d
+

for l < x < l (3.1)


For the circular pillbox intersecting a straight object the chord length is given by
( ) ( )
2
2
, 2 c l l l (3.2)
making the edge image B(x, y) for l < x < l
( ) ( )
2 2 2
, arccos B x y l x l x l x + (3.3)
The first derivative in the x-direction is the chord length
B
x
c(l+x, l) (3.4)
The first derivative in the y-direction B
y
is 0 everywhere. The gradient direction g
is the x-direction. Hence the second derivative in the gradient direction (SDGD)
= 0
0 < < l+x
= l+x
l
A(x,y) = U(x)
B(x,y)
x
x
l
l
c/2

l x

Figure 3.1: Smoothing of a straight step edge by a single pillbox filter.
SECOND DERIVATIVE FILTERS 47

B
gg
is identical to the second derivative in the x-direction

( ) ,
gg xx
c l x l
SDGD B B
x

+
(3.5)
The second derivative in the y-direction B
yy
is everywhere 0. Hence in this case
the Laplace is also identical to the second derivative in the x-direction
Laplace + B
xx
+ B
yy
= B
xx
(3.6)
and there is no difference between Laplace and SDGD. The chord length c(, l) is
maximal for

= l, when the center of the pillbox is right on-edge and the chord
length is equal to its diameter. Hence cc(l+x,l)/cx has its zero crossing in that
situation: the zero crossings of both SDGD and Laplace are on-edge. This
argument holds irrespective of the pillbox radius l.

Figure 3.2: Smoothing of a straight step edge by a stack of pillboxes. The small circle
inside the larger one denotes the pillbox that touches the step edge object.

3.3.1.2. Smoothing by a stack of pillboxes
Isotropic filters h
2D
(l,m) other than pillbox filters can be handled as a stack of
concentric pillboxes. The cross section h
2D
(l,0) + h(l) will also be called the stack
shape. Now consider a stack of concentric pillboxes with height dh and monotonic
radius distribution l(h). The inverse function h(l) is the stack shape; there is an
l
max
such that h(l) = 0 for l > l
max
. When the stack of pillboxes crosses the edge, a
smoothed image B(x,y) results. In computing B(x,y), we distinguish two
situations: l
max
< x _ 0 and 0 < x < l
max
. (cf. figure 3.2). Extension of eq.(3.1)
leads to a sum of overlap areas belonging to pillboxes of different radii. For an
x
=
(x,0)
l
max
< x < 0
0 < x < l
max

(x,0)



48 SECOND DERIVATIVE FILTERS
infinite number of pillboxes the sum of overlap area per pillbox becomes an
integral. B(x,y) expressed in the radius distribution l(h) is (cf. figure 3.3).
( )
( ) ( )
( )
( )
( ) ( ) ( )
( )
( )
( )
( )
max
max max
max
2
max
0
, for 0
,
, for 0< <
l
x
l h l
h x
O x l d l x
B x y
l d O x l d x l

<

'


h
h
h
h
h h
h h h h
(3.7)

h
l 0
l
max
O(x, l(h))
|x|
h(0)
=
O(x, l(h))

Figure 3.3: Cross section of a stack of pillboxes partially overlapping a straight step
edge. The result B(x,y) equals the sum of the overlap area per pillbox.

or, expressed in the derivative h
l
of the stack shape h(l) (cf. figure 3.4, eq. (3.8)).
For an infinite number of pillboxes, the sum of overlap area per pillbox becomes
an integral over filter radius. The overlap area per radius is weighed by the
derivative of the stack shape h
l

( )
( )
( )
max
max max
max
2
max
0
, for 0
,
, for 0< <
l
l
x
l l
l l
x
O x l dl l x
B x y
l dl O x l dl x l

<

'


h
h
h
(3.8)

SECOND DERIVATIVE FILTERS 49

0
l
max
l
h
h(0)
|x|
O(x, l)
=
O(x, l)

Figure 3.4: Cross section of a stack of pillboxes partially overlapping a straight step
edge. The result B(x,y) equals the sum of the overlap area per pillbox.

Analogous to the extension of eq.(3.1) to eq.(3.8), the SDGD and Laplace of
eq.(3.5) can be extended from a single pillbox to a stack of pillboxes. The SDGD
and Laplace of a straight step edge (A(x,y) = u(x)) for l
max
< x < l
max
is given by

( )
max ,
l
l
x
c l x l
SDGD Laplace dl
x

h (3.9)
Both SDGD and Laplace have zero crossings on-edge like all constituents
F(l+x,l)/[.

The SDGD of the stack could be constructed from single pillbox results, as the
direction of grad O(x,l) is independent of l and the l-integrated gradient
( ) ( ) ( ) ( )
max
grad , grad ,
l
l
x
B x y O x l dl

h (3.10)
has that same direction.

3.3.2. Constant-curvature edge, circular object

3.3.2.1. Smoothing by a single pillbox
The location of a constant-curvature (circular) step edge is a 2D problem. For
didactic reasons we start our analysis in Cartesian coordinates. Later we switch to
cylindrical coordinates. Take a circular object with radius R and center (R, 0)
given by A(x, y) = u(R
2
(x R)
2
y
2
). Its edge goes through the origin.
Smoothing with a pillbox of radius l and height 1 gives a smoothed image B(x, y)
50 SECOND DERIVATIVE FILTERS
with rotational symmetry around (R, 0). Let r be the distance between the pillbox
center and the object center
r
2
= (x R)
2
+ y
2
(3.11)
then we have A(x, y) = u(R
2
r
2
) and B(x, y) = b(r); if r > R + l (pillbox in 0-
domain) b(r) = 0, if r < R l (pillbox in 1-domain) b(r) = l
2
(we assume the
object larger than the pillbox, R > l). If the pillbox lies over the edge (Rl < r <
R+l) the smoothed edge can again be written as an integrated chord length c(, l,
R) (cf. figure 3.5)
( ) ( )
0
, , ,
l R r
B x y c l R d
+

(3.12)
For the circular pillbox intersecting a circular object the chord length is given by
( )
( )
2
2 2 2
2
2
, , 4
r R l
c l R l
r

+
(3.13)

with r = l + R . A geometric sketch that shows how to derive an expression of
the chord length as a function of r, R, and l is given in figure 3.6.
l
r
(R,0)
A(x,y) = U(Rr)
B(x,y)
r=R
r
r
r > R+l =l+R-r r < Rl

Figure 3.5: Smoothing of a constantcurvature step edge by a single pillbox filter.
SECOND DERIVATIVE FILTERS 51

Figure 3.6: A geometric sketch of a pillbox intersecting a circular object. Using
2 2
2 2 2 2
2 2
c c
p l q R p q r
_ _
+ + +

, ,

we find an expression for the chord length as function of r, R, and l.

The gradient direction is independent of l and always points towards the object
center. The gradient magnitude of B(x, y) is the chord length
B
g
= b
r
= c(l+Rr, l, R) + c (3.14)
Hence the second derivative in the gradient direction (SDGD) is

( ) , ,
gg rr r
c l R r l R
SDGD B b c
r

+


(3.15)
The chord length c(, l, R) is maximal when the chord is a diameter. Hence c
r

crosses zero in that situation: the zero crossing of the SDGD is on the center of
the chord of length 2l and thus off-edge. The 2D Laplace is (D = 2)
Laplace = B
xx
+ B
yy
= b
rr
[(r
x
)
2
+ (r
y
)
2
] +b
r
[r
xx
+ r
yy
]
( ) 1
r
rr r
b c
b D c
r r
+ (3.16)
To find the zero crossing of Laplace we could insert eq. (3.13) for c(, l, R) and
solve for r, but it is simpler to use c
2
and r
2
instead. As
c/2
l
p
R
r
q
r = p+q


52 SECOND DERIVATIVE FILTERS

( )
( )
2
2
r
c
r
c
c
r


we have

( )
( )
( )
2
2 2 2 4
4
2
c R l r
r r
SDGD
c c r
r


(3.17)
and

( )
( )
( )
2 2 2 2 2
2
2 4
2
2 c r r R l
r c r
Laplace
c c r r
r

_
+ +

+

,
(3.18)
For finding the zero crossing consider the numerators of eqs. (3.17,3.18). The
SDGD crosses zero if r
2
= R
2
l
2
. The Laplace crosses zero for r
2
= R
2
+ l
2
, i.e.
when pillbox and circular object radii intersect at right angles (c.f. figure 3.7).
Hence the zero crossing of the SDGD is inside the object, on the center of the
chord of length 2l (c.f. figure 3.7), while the zero crossing of the Laplace is
outside the object, on the intersection of the tangents at the ends of that chord.
Both zero crossings are off-edge by a fraction of about (l
2
/2R
2
) but in opposite
directions.

The deviations from the actual edge position r = R can be seen as relative errors in
R of about (l
2
/2R
2
) + k; for infinite R the object is straight with zero error, as
discussed above; for a small object with, say R=2l, the relative errors are 0.134
and 0.118 still well described by k =
1
8
. Due to the equal and opposite errors, a
combination of SDGD and Laplace can be expected to give a more accurate
location of the edge. The values of SDGD and Laplace at the edge are
( )
4
1
r R
kR
SDGD k
c

(3.19)

4
r R
kR
Laplace
c

(3.20)
Consequently, the linear combination SDGD + (1k) Laplace crosses zero on-
edge. This is of little use in cases when R is not exactly known. We propose to
replace SDGD and Laplace by their sum, to be called PLUS

( ) 2 1 2
r
gg xx yy rr r
b c
PLUS B B B b D c
r r
+ + +

(with D = 2)

SECOND DERIVATIVE FILTERS 53


( ) ( )
2
4 2 2 4
3
3 2 1 2 1 2 r k R r k R
r c
+
(3.21)
We shall now show that PLUS locates the edge one order more accurately than its
constituents. PLUS crosses zero for

2
0
1 2 2 1 2 4
3
k k k
r r R
+ + +
(3.22)
Expanded to third order in k this gives

2 3 0 1 1
2 2
1
r
k k
R
+ + (3.23)


For a small object with R = 2l (k =
1
8
) PLUS crosses zero at r
0
/R = 1.00876, while
1+
1
2
k
2
+
1
2
k
3
= 1.00879 and 1+
1
2
k
2
= 1.00781. The error is under 1% of R and is
well described by
1
2
k
2
. This is one order more accurate than either SDGD or
Laplace, which give an error of k. The absolute errors are kR =
1
2
l
2
/R = 2 k l
for Laplace and SDGD and
1
2
k
2
R =
1
8
l
4
/R
3
=
3
8 k l for their sum PLUS (cf.
figure 3.7). For a straight object PLUS gives zero error, as expected from the
behavior of SDGD and Laplace.
SDGD
Laplace
l
R
c=2l
Figure 3.7: Edge shifts produced by single pillbox smoothing of a constantcurvature
step edge for k=1/8. The SDGD yields a zero-crossing when the chord is maximal. The
Laplace yields a zero-crossing when the pillbox and object boundary intersect at right
angles.
54 SECOND DERIVATIVE FILTERS

3.3.2.2. Smoothing by a stack of pillboxes
Due to PLUS eq.(3.21) and chord length eq.(3.13) the single pillbox result can be
written as
( )
( ) ( )
( )
2
4 2 2 2
2
3 2 2 2 2
3 2 1 1
, ,
4 1
s s
r l
PLUS P P s
R R
s s

+
_


,
+
(3.24)
with relative size
l
s
R
and relative position
r
R

Analogous to section 3.3.1.2 the gradient direction is independent of l and the
result for a stack of pillboxes is given by an integral of single pillbox results over
radius l. In order to allow estimation of the zero crossing position we expand the
integrand around r=R. At the same time we switch to relative coordinates and s
(relative to the edge radius R) rather than the absolute ones, r and l.
( ) ( ) ( )
max max
1
, 1, 1 1,
l s
l s
r R
r l
PLUS P dl h P s P s ds
R R


_
1 +

]
,

h (3.25)
with h(s) h(l), Taylor series coefficients
P(1,s) f s
3
/2 (3.25a)
and
P

(1,s) 4G s
1
(3.25b)
and with correction factors
f (1 s
2
/4)
1/2
(3.25c)

and
G (1 3s
2
/4 + 7s
4
/16 s
6
/16) f
3


(3.25d)

For 0 < s < 1 we have 1 < f < 1.15 and 0.88 < G < 1.

As the position of the zero crossing at =
0
lies outside the object,
0
> 1 and
0
is approximately given by
( ) ( ) ( )
max max
0 0
0
1 1
1, 1 1, 0
s s
s s
h P s ds h P s ds


+

(3.26)
Examining eq. (3.26) we notice that (as P

=O(s
1
) cf. eq. (3.25b)) the position of
the zero crossing depends strongly on the stack shape for small s.
For example, a cone filter of height h(0) and radius s
max
< 1 which has a sharp
summit with h(s)h(0) = O(s) gives for
0
the root of (
0
1)log(
0
1) = s
max
/32.
SECOND DERIVATIVE FILTERS 55

For a digital measurement, however, the filter h must contain a bandlimiting
component, which assures h(s) h(0) = O(s
2n
) with n _ 1 and makes the relative
error of the zero crossing position

3 1
1
0
2
0 0
1 4
s s
fh s ds Gh s ds



(3.27)
For a check we apply this method to the single pillbox case (h
s
~ (ss
max
)) and
reassuringly get again (cf. eq.(3.23))

4 4 2
2 3
1 1
0
2 2
1 1
8 8 4
fs s s
k k
G

_
+ +


,
(3.28)
Prediction of the zero crossing position requires bounding of the two integrals in
eq. (3.27). Under the condition h
s
_ 0 (monotonically decreasing filter shape) we
derive in Appendix I: Stack of Pillboxes

3 1
0
0 0
1
8
s s
M
h s ds h s ds



(3.29)
with 1 < M< 1.3, (one is free to set the upper integration boundary to s
max
). Some
filter shapes can only be expressed analytically in the spatial domain, others in the
Fourier domain. Appendix I: Stack of Pillboxes shows that eq. (3.29) can also be
expressed in the 2D Fourier transform H
2D
(u,v) of the pillbox stack

( )
( )
2 1 2
0 2
4
0 0
, 0 3
1 , 0
128
D
D
H u M
u du H u u du
u



(3.30)

3.3.2.3. Gaussian stack shape
In order to study the accuracy of PLUS for a simple example we take the Gaussian
filter and describe it as a stack of concentric pillboxes. When the stack is on-edge
the largest pillbox at the base must properly intersect the object. Therefore, the
Gaussian filter (actually of unlimited support) is truncated at a radius of a few
sigma (a) to become a finite impulse response filter (FIR).
( )
( ) ( )
( )
2 2 2
1 1
2 2
exp exp l l a u a l

1

]
h (3.31)
We take a < R to guarantee proper intersection.

( )
( )
2
2 2 2
1
2 2
exp 0
s
R
h s R s u a sR

(3.32)
The relative error in zero crossing position according to eq. (3.29) is then
(s
max
a/R)
56 SECOND DERIVATIVE FILTERS

( )
( )
4
0
4
4,
1
8 0,
M I a
R I a

(3.33)
with I(n,a) the n
th
moment of a truncated Gaussian (truncated at a)
( )
( )
1
2 2 2
1
2
0
, exp
n
a R
n
R
I n a R s s ds

_


,

(3.34)
and with 1 < M < 1.3, as long as a/R < 1 .

Hence, for a < R (cf. Appendix II: Gaussian Stack Shape)

( ) ( )
( )
3 2
1
4
2
0
4
3 exp
3
1
8
4 2 erf 2
a a a
M
R
a

_




,
(3.35)
with erf(z) the error function,
( )
2
2
0
exp
z
t dt


For truncation at 2 (a = 2) the relative error in edge location is

4 4
0
4 4
3
1 0.1980 0.177
8
M M
R R

_


,
(3.36)
To show how the size of a truncted Gaussian filter (a) is related to the size of
single pillbox filter we compare the relative location error produced by both
filters. For a single pillbox with radius l
eff
the error is

4
2
1
0
2 4
1
8
eff
l
k
R
(3.37)
The errors of eqs. (3.36,3.37) are equal if
l
eff
= 1.09M
0.25
(3.38)
with M
0.25
somewhere between 1 and 1.07.
The influence of a on l
eff
and therefore also on the position of the zero crossing
diminishes with increasing a, e.g. l
eff
(a=3) = 1.28M
0.25
and l
eff
(a=)
(3M)
0.25
1.32M
0.25
. For a=2 the condition R > a corresponds to R > 2l
eff

and to k <
1
8
, i.e. objects should not be smaller than those called small in the
single pillbox case.

3.3.2.4. Tepee filters
Gaussian filters that are large enough to give noise suppression are inefficient.
Instead, pillbox filters can exploit crescent updating (Verbeek et al. 1988) and are
to be preferred. Yet we cannot do without any Gaussian filtering. Lenses normally
provide the bandlimiting filter component needed for sampling. Although it can
SECOND DERIVATIVE FILTERS 57

range from an Airy pattern (in focus) to a small pillbox filter (out of focus) we
shall model it by a small Gaussian filter. In (Chapter 2) we found that
PSF
= 0.9
appears to be a good practical choice for the bandlimiting Gaussian.

Another small Gaussian filter is inserted in the digital derivative filter to reduce
the size of the derivative filter. For the analysis of edge position both filters can be
combined into one, still small, Gaussian filter. Explicit truncation of these small
Gaussian filters is irrelevant. For practical purposes we shall therefore study
smoothing by small Gaussian filtering combined with a-fold application of a
pillbox filter with radius l
0
(al
0
<R). We call such a combination a Tepee filter.

Tepee filters are best represented in the frequency domain. The cross section is
given by
( )
( )
( )
1 2 2 2
2 2
0
2 2
, 0 , 0 exp 2
2
a
D D
J
H u H
s

_ _


, ,
(3.39)
with s
0
l
0
/R, s
0
u and /l
0.

The relative error in zero crossing position is according to eq. (3.30)

4
1 2 0
0 2 2
4
0 0
0 0
3
1 , 0 , 0
128
D D
Ms
H d H d
s s

_ _


, ,

(3.40)
with 1 < M < 1.3, as long as as
0
< 1 and << s
0
R.

Table 3.1: Relative edge position error and effective radius of Tepee filters. The
intervals result from the uncertainty in M.

Remember that for a single pillbox with radius l
eff
the error is given by eq. (3.37).
Now we can find an expression for
0
1 and l
eff
as function of l
0
/R

for a given a
and (cf. table 3.1).

We notice that for a=2,
0
1 and l
eff
depend strongly on since the Gaussian
filter dominates the behavior of h near h(0) (cf. Appendix I: Stack of Pillboxes),
whereas for a _3 this no longer holds. For a = 2 and /l
0
= 0 the stack shape is
similar to a cone. After convolution with a Gaussian filter, the behavior near h(0)
a =
/l
0
=

<0,
1
0.15]
2
0
2
0.15

<0,
3
0.15]

<0,
4
0.15]

<0,
5
0.15]
|
0
1|
(
l
0
/R)
4

0.13 0.16 0.05 0.07 0.11 0.14 0.3 0.4 0.45 0.6 0.7 0.9
l
eff
/lo
1.00 1.07 0.80 0.86 0.96 1.03 1.22 1.31 1.38 1.48 1.53 1.64
58 SECOND DERIVATIVE FILTERS
is very sensitive to the size of the Gaussian filter . However, for a _3 and /l
0
=
0, h
s
=0 at s=0 and the behavior near h(0) does not depend on .
The frequency domain allows an even simpler interpretation of the effect. For
large the Bessel function J
1
(2) slowly converges to zero as O(
1/2
). The
integrand of the denominator in eq. (3.40), H
2D
(/s
0
,0)
2
= O(
1a
) exp(
2
2

2
), is for a=2 mainly governed by the Gaussian factor, but not so for a_3.

The condition R > al
0
corresponds to R > 2l
eff
and k <
1
8
, i.e. objects should not be
smaller than those called small in the single pillbox case.

3.3.3. Pillbox filtering of a varying-curvature edge, smooth object
For the general case of a varying-curvature edge we give a geometrical argument.

Second derivatives of the overlap area
We want to calculate the second derivatives of the overlap area at a given position
of the pillbox. Later we shall require the location to be a zero crossing location.
In order to generalize the results from constant-curvature edges to a larger class of
objects we consider edges where the edge curvature changes inside the pillbox
overlap. The contours of pillbox and object should intersect, however, at no more
than two points.
As the shape of the object is left unspecified we choose the chord between the
intersection points (note that these points change with varying pillbox position) as
our reference frame. The chord center is chosen as the origin, the chord direction
as the y-axis. This implies that the pillbox position is varied around a position
(x
1
,0). The following lemma prepares the calculation for the three operators
SDGD, Laplace and PLUS.

Lemma 3.1 (figure 3.8)
Let the pillbox circle (center P with coordinates (x
1
,0), radius l) intersect a curved
edge at two points P
1
and P
2
. Let the angle at P
1
between chord P
1
P
2
and the edge
curve be atan(), that at P
2
atan(), and let the angles PP
1
P
2
and PP
2
P
1
be atan().
Then the pillbox position is given by x
1
=(1+
2
)
1/2
l , uniquely described by .
We consider the overlap while moving the pillbox center position (x,y) around
(x
1
,0). Let B(x, y) be the overlap area, equal to the pillbox-smoothed image value.
Since the y-axis is defined parallel to the chord direction, gradB is parallel to the
x-axis. Now B
xx
and B
yy
can be written as functions of , , and as follows:

1 1
xx
B


+
+ +
(3.41)
SECOND DERIVATIVE FILTERS 59


1 1
yy
B



+ +
(3.42)


Proof 3.1
The geometric situation described above is sketched in figure 3.8. Being
interested in infinitesimal displacements we have approximated the curves by
their local tangents. First we prove that the component B
y
of the gradient parallel
to the chord is zero.
Figure 3.8b shows three stages (I, II, III with different y-positions) of displacing
the pillbox parallel to the chord. Position II is the actual situation, I and III are
variations. For the first derivative B
y
= O/y consider the stages I and III. The
difference
IIII
in overlap area between them is

I-III
=
I-II
+
II-III
= (O
3
O
1
) + (O
4
O
2
)

= (O
3
+O
4
) (O
1
+O
2
) = 0
The displacement 2y leaves the overlap area unaltered, which proves
B
y
=
I-III
/(2y ) = 0
Now we derive expressions for the second derivatives in the x and y-direction.
The second derivative in gradient direction (second derivative in x-direction) can
be described as a change in chord length c. Figures 3.8d and 3.8e show how to
calculate B
xx
with B
xx
= c/x and c = c
1
+ c
2
. From figure 3.8e we see that at
P
1
the displacement of the pillbox x can be written as x = c
1
( +
1
) and at P
2
x = c
2
( +
1
). Combining this we get eq. (3.41)

P1
P
P2
atan
atan
atan
l
x-axis
y-axis

Figure 3.8 a): A pillbox intersects a curved edge,
60 SECOND DERIVATIVE FILTERS

The second derivative along the edge B
yy
= (O/y)y

cannot be described by a
change in chord length, but needs direct calculation (cf. figures 3.8b and 3.8c).
We consider the three overlap stages I, II and III with different y positions at
intervals y. Figure 3.8b shows that O
I-II
= O
II
O
I
= O
3
O
1
and O
II-III
= O
III

O
II
= O
4
O
2
. Consequently O
I-II-III
= O
II-III
O
I-II
= (O
5
+ O
6
), where O
5

= O
2
O
1
and O
6
= O
3
O
4
are the areas of the hatched bow ties at P
1
and P
2

respectively. Figure 3.8c shows that y = h
1
(
1
+ ) such that O
5
= h
1
y =
(y)
2
/(
1
+ ). In the same way O
6
= h
2
y = (y)
2
/(
1
+). Combining this we get
eq. (3.42).


ydirection
y
P
atan
atan
O1
O2
O3
O4
P2
position I
position II
position III
P1
atan
O5
O6
y
chord
P1
P
acot
atan
y
h1
atan
acot

Figure 3.8 bc): displacing the pillbox parallel to the chord y-direction.
SECOND DERIVATIVE FILTERS 61



Zero crossing for SDGD, Laplace and PLUS.
We shall now consider the different zero crossing situations. Let the position of
the pillbox (center at P
0
, (x
0
, 0)) be such that one of the three operators SDGD,
Laplace and PLUS yields zero (the zero crossing values of variables are indicated
by subscripts 0; note, that the chords P
10
P
20
with lengths c
0
are different in the
different zero crossing cases).

Zero crossing of SDGD
Solving SDGD = B
xx
= 0 gives
0
= 0, x
0
=
1
2

0
c
0
= 0, P
0
on the chord,
independent of
0
and
0
, as expected. The zero crossings of Laplace and PLUS
depend on
0
and
0
.

c1
c2
xdirection
P1
P2
x
atan
atan
P
P1P2=c
atan acot
atan
P1
P
x
c1

Figure 3.8 de): displacing the pillbox perpendicular to the chord x-direction,
62 SECOND DERIVATIVE FILTERS
P
P 1
P 2

c
/2

c
/2

c
/2
c
y -axis
x -axis
object


P
P 1
P 2
c/2
c
y -axis
x -axis
object

Figure 3.9: Zero crossing situation for the Laplacian. The dashed curved line passing
through P
1
and P
2
is the object boundary. The solid curved line passing through P
1
and
P
2
is a circle segment that approximates the object boundary by setting ===
1
2
(+ )
hereby assuming that is small.
SECOND DERIVATIVE FILTERS 63

Zero crossing of Laplace
Using eqs. (3.41,3.42) we solve Laplace = B
xx
+ B
yy
= 0 or

0
2
+
1
2

0
[4(
0
+
0
)
2
(
0

0
)
2
]/(
0
+
0
) 1 = 0 (3.43)
with respect to
0
which gives

( ) ( )
( )
2
0 0 0 0 4 3 4
0 0 0 0 0
1 O , , ,
2 4


1
+
1 +
1
]
(3.44)
and
x
0
=
0
c
0
/2 =
0
(1+
0
2
)
1/2
l (3.45)
For slowly changing curvature
0

0
is small and
0

1
2
(
0
+
0
). Consequently
the case of Laplace zero crossing is characterized by the fact that P
0
lies at the
average tangent intersection (halfway the intersections of the tangents in P
10
and
P
20
) with the perpendicular from P
0
on P
10
P
20
(the x-axis, cf. figure 3.9).

Zero crossing of PLUS
Using eqs. (3.41,3.42) we solve PLUS = 2B
xx
+ B
yy
= 0 or
2
0
2
+
1
2

0
[8(
0
+
0
)
2
(
0

0
)
2
]/(
0
+
0
) 1 = 0 (3.46)
with respect to
0
which gives

( ) ( )
( )
2
0 0 0 0 4 3 4
0 0 0 0 0
1 O , , ,
4 8


1
+
1 +
1
]
(3.47)
and
x
0
=
0
c
0
/2 =
0
(1+
0
2
)
1/2
l (3.48)
For slowly changing curvature
0

0
is small and
0

1
4
(
0
+
0
). Consequently
the case of PLUS zero crossing is characterized by the fact that P
0
lies halfway
between the new average tangent intersection and the center of P
10
P
20
.

Example, the elliptic edge.
To demonstrate the superiority of PLUS versus Laplace and SDGD for slowly
varying edge curvature, we refer to figure 3.10 where the object is an ellipse. It
also clearly demonstrates that the edge shift increases with increasing curvature.
The following theoretical analysis applies to the zero crossing situations of
SDGD, Laplace and PLUS for an ellipse. Without loss of generality (results will
be in terms of dimensionless quantities) we assume that
1
2
c
0
= 1.
64 SECOND DERIVATIVE FILTERS
Figure 3.10: Edge shifts produced by PLUS, Laplace and SDGD on an ellipse, an object
with slowly varying edge curvature.

The general ellipse that goes through P
10
(0,1) and P
20
(0,1) is given by
b
2
(1+a
2
)x
2
+y
2
2abxy +2bdx 1 = 0
derived from the circle (x'+d)
2
+ y'
2
= 1 + d
2
by x-scaling and y-skewing (x=x'/b, y
= y'+ax'). Its tangents in P
10
and P
20
are y abx(bdx1) = 0, which cut the x-axis
with
0
1/(ab+bd) and
0
1/(ab+bd). The ellipse cuts the x-axis in P
e
at x
e
=
[1 + {1+ (1+a
2
)b
2
(bd)
2
}
1/2
] / [2(1+a
2
)b
2
(bd)
1
] .
To eliminate d we insert bd = 2(
0
+
0
)/[(
0
+
0
)
2
(
0

0
)
2
]. If x
e
_1. the circle
through P
10
, P
e
and P
20
has radius R
eff
= (x
e
2
+1)/(2x
e
), which we shall use as a
measure of local radius.
The zero crossing position is x
0
=
0
, where
0
=0 or satisfies eq. (3.43) or eq.
(3.46).
The pillbox radius l is related to the zero crossing position by l = (1+x
0
2
)
1/2
.
As a and b are the parameters that actually shape the ellipse we eliminate
0

0

using
ab = 2(
0

0
) /[(
0
+
0
)
2
(
0

0
)
2
]
and

0

0
= [1+{1+a
2
b
2
(
0
+
0
)
2
}
1/2
]/ab.
Now x
e
and x
0
are known as a functions of a, ab and (
0
+
0
).
The relative location error
0
1 = (x
0
x
e
)/R
eff
and the parameter k+l
2
/(2R
eff
2
) that
characterizes it, can be expressed in x
e
and x
0
.
Expanding in powers of (
0
+
0
)
2
we get

( )
( )
( )
( )
( )
4
2 2
2
0 0
6
0 0
0 0
3 6
1 5 1
O
2 2
a b
k



1
+ +
+
]
+ + (Laplace)

( )
( )
( )
( )
( )
4
2 2
1 2
0 0
2
6
0 0
0 0
3 6
1 5
O
2 2
a b
k



1
+ + +
+
]
+ + (PLUS)
PLUS
SDGD Laplace
PLUS


SECOND DERIVATIVE FILTERS 65

and

( )
( )
( )
( )
( )
4
2 2
2
0 0
6
0 0
0 0 0
3 7
1 5 1
1 O
2 2
a b


1
+ + +
+
]
+ + + (SDGD)

( ) ( )
( )
( )
2 4
6
0 0 0 0
0 0 0
3 7
1 O
2 2


+ +
+ + (Laplace)

( )
( )
( )
( )
4
2 2
0 0
6
0 0 0
7
1 5
1 O
2
a b

+ +
+ + (PLUS)
Expanding in powers of k
(for SDGD |
0
1| = 2[1k(12k)
1/2
] / [1(12k)
1/2
]) we can write

( )
2 3
1
0
2
1 O k k k + (SDGD)

( ) ( ) ( )
2 2 2 3
0
1 1 5 1.5 O k a b k k + + + (Laplace)

( ) ( )
2 2 2 3
1
0
2
1 1 5 O a b k k + + (PLUS)
The superiority of PLUS over SDGD and Laplace may thus be reduced by large a
or b. However, comparing the expansions in (
0
+
0
) of |
0 SDGD
1|,
0 Laplace
1 and

0 PLUS
1 to that of

( )
( )
( )
( )
( )
3
2 2
0 0
5
0 0
0 0
2 6
1 5
O
2 2
e
a b
x



+ +
+
+ + (3.49)
we find

( )
( )
( )
2
2 2
0 0
0 0
4
0 0 0 0
1 5
1 1 4
1
1 1 2
PLUS PLUS e
SDGD Laplace
a b
x



+ +


+

(3.50)

which guarantees that PLUS is at least as good as SDGD or Laplace.


3.4. Slope-Edge Objects
In contrast to industrial parts, biological objects have naturally smooth grey edges
(slope edges) even without analog smoothing for bandwidth limitation or digital
smoothing for noise reduction. Two questions arise:
How does smoothing influence the position measurement of slope edges?
What is the definition of position in a slope edge?
66 SECOND DERIVATIVE FILTERS
An answer to both questions is obtained for a simple model of slope edges, the
smoothed step-edge model.

3.4.1. Smoothed step-edge model
In section 3.3 the impact of smoothing on position measurements was analyzed
(and minimized) for a curved step edge. Smoothing could be due to analog
smoothing and to digital smoothing. We now introduce a third, virtual, smoothing
that precedes imaging and shapes the step edge into a slope edge. The position of
the slope edge thus generated is defined as that of the underlying step edge. The
impact of real smoothing can be found from section 3.3 when real and virtual
smoothing are combined into one total smoothing.

The model given is still too simple to be useful and must be refined. A given
biological object will show the following subtleties:
1. non-uniform grey value
2. different slopes around the perimeter
3. slope shape incompatible with an isotropic virtual smoothing filter
The first two features can be modeled through space-variant low-pass filtering.
For slow variation of grey value and slope the theory of section 3.3 will remain
valid. Slow must be read as changing little over the filter size. This implies
filters that are small compared to the object, a condition that restricts smoothing
for noise reduction.
The third feature is visible at straight edges when the edge profile is other than
inversion symmetric. At curved edges, an isotropic smoothing filter does not
produce a trully inversion symmetric edge profile. If the analog edge profile
cannot be modeled through filtering a step edge with an isotropic virtual
smoothing filter, we have adopt a different definition of edge location.

3.4.2. Slope length vs curvature: edge definability
Long slopes can only be modeled by large virtual low-pass filters. According to
section 3.3 edge position can only be determined when the underlying step-edge
object has local radii larger than the filter size. For local radii smaller than slope
length the edge position cannot be defined in this model. By the same token
noise-reducing filtering is limited. Local radii must therefore be larger than the
filter size determined by the combined effect of slope shaping, bandlimiting and
noise reduction. This means that, for the same radius, a slope edge may not be
smoothed as heavily as a step edge to reduce noise (for slope edges bandwidth
limitation is no issue).
For a pillbox-based slope model (i.e., the edge slope is formed by filtering a step
edge with a pillbox filter) the ratio of edge height and maximum slope is constant
SECOND DERIVATIVE FILTERS 67

and roughly independent of the edge radius if R > l. We shall call this ratio the
slope length. For other models the ratio depends on the edge radius.
For Gaussian smoothing and a Gaussian-based slope model the combined filter is
again Gaussian with width
eff
. Assuming that we may truncate at a (a 2) we
get

2
2 2 2
2
eff slope smooth
R
a
> + (3.51)
where the smoothing filter is used for noise reduction and the meaning of
slope

can be clarified by considering the slope length of a straight edge


2
max
slope
edge height
slope length
slope
(3.52)
For an edge of radius R the factor 2 must be replaced by a larger value, e.g.
for R = 2
slope
the enlargement is between 6% and 25% (cf. Appendix VII:
Gaussian Edge Slope). However, it is simple and safe to keep the straight edge
value 2 . The amount of noise reducing smoothing allowed is thus

2 2
2
2

2
smooth
R slope length
a

< (3.53)
Given a bent slope edge object, there exists a smallest edge radius R
min
that cannot
be smoothed any further without violating the intersection criterion between
object and filter (a < R). For a Gaussian slope model R
min
is


0.8
2
min
slope length
R a slope length

> (3.54)

Another example is Tepee smoothing and a Gaussian-based slope model. The
combined filter is a new Tepee filter with
eff
as defined by eq. (3.51) which
requires the extension of table 3.1 (giving
0
1 as a function of l
0
/R

for a given a
and
eff
) to
eff
/l
0
> 0.15 as given in table 3.2. Section 3.5 shows that similar
calculations can be made for the SDGD and Laplace. Their relative edge position
errors are given in table 3.3. If the original edge can be modeled by Gaussian
filtering of a step edge using
slope
, one can calculate
eff
, apply a Tepee filter and
still being able to predict the edge location error using table 2 and 3.

68 SECOND DERIVATIVE FILTERS
Table 3.2: Relative edge position error of the PLUS operator (|
0
1| (l0/R)
4
) for Tepee
filters and
eff
/l
0
in the interval 0.01 _
eff
/l
0
_ 1. The predicted error values have an
uncertainty of 15% caused by an uncertainty in M (eq. (3.40)).
Table 3.3: Relative edge position error of the Laplace (|
0
1| (l
0
/R)
2
) for Tepee filters
and
eff
/l
0
in the interval 0.01 _
eff
/l
0
_ 1. The predicted error values for Laplace have
an uncertainty of 28% caused by an uncertainty in M (cf. table 3.6). The error values
for the SDGD can only be be predicted to be 1 to 3 times those of Laplace.


3.5. Spherical Object in 3D and Higher Dimensions
3.5.1. Smoothing by a single pillball
We shall show that the argument of section 3.3.2.1 holds irrespective of
dimension: the sum of SDGD and Laplace is also the optimum for 3D and indeed
for any dimension. In dimension D the pillbox circle will be a sphere (D = 3) or
hypersphere (D > 3) of radius l, the pillball. The object is also assumed to be a
(hyper)sphere, of radius R. They intersect in a circle (D = 3), sphere (D = 4) or
hypersphere (D > 4) of diameter c. In all cases c is given by (c.f. figure 3.6)

( )
( )
2
2 2
2 2 2 2
2
2
R l
c r R l
r

+ + (3.55)
The argument of the chord length c determining the rate of overlap growth at
reduction of distance r can be directly replaced by one of chord plane area CPA(3)
(or Chord hyperPlane Area CPA(D)), as follows. (From now on we shall omit the
prefix hyper.) When the distance r between the centers is reduced by dr, the
overlap volume of the spheres grows by

a= 1 2 3 4 5

eff
/l
0
=
0.01 0.14 0.058 0.32 0.51 0.77
0.20 0.14 0.14 0.34 0.54 0.82
0.40 0.13 0.22 0.42 0.66 0.96
0.60 0.19 0.36 0.60 0.88 1.2
0.80 0.37 0.60 0.90 1.2 1.6
1.0 0.7 1.0 1.4 1.8 2.3


a= 1 2 3 4 5

eff
/l
0
=
0.01 0.45 0.11 0.42 0.51 0.62
0.20 0.41 0.25 0.43 0.52 0.64
0.40 0.30 0.34 0.47 0.58 0.69
0.60 0.32 0.43 0.54 0.66 0.77
0.80 0.42 0.54 0.66 0.78 0.89
1.00 0.58 0.70 0.82 0.93 1.0
SECOND DERIVATIVE FILTERS 69

( ) 2 CPA dr c dr (3.56)
( )
2
3
4
CPA dr c dr

(3.57)
and in general by
( ) ( )
1 1
2 1
D D
CPA D dr V D c dr

(3.58)
where V(D) is the (dimensionless) volume of the D-dimensional sphere of radius
1,
( )
( )
2
1
2
1
D
V D
D

+

(see Appendix VI: Pillball FT)
Now the SDGD is calculated as follows. The gradient direction is always towards
the object center. The gradient of the overlap volume B(x, y,) is the chord plane
area
B
g
= b
r
= CPA (3.59)
Hence the SDGD is
SDGD = B
gg
= b
rr
= CPA
r
(3.60)

The SDGD crosses zero when the area CPA is maximal, when the pillball center
lies in the chord plane, at its center, i.e. inside the object and thus off-edge. The
Laplace is
( ) ( ) ... 1 1
r
xx yy rr r
b CPA
Laplace B B b D CPA D
r r
+ + + (3.61)
From eqs. (3.56-3.58),
CPA
r
= 2
1D
(D 1) V(D 1) c
D2
c
r

we have
( ) ( )
( )
( )
2
1 3
2
2 1 1
D D
c
SDGD D V D rc
r


(3.62)
and
( ) ( )
( )
( )
2
2
1 3
2
2
2 1 1
D D
c
c
Laplace D V D rc
r
r


_

+

,
(3.63)
and their sum (PLUS = SDGD + Laplace)
70 SECOND DERIVATIVE FILTERS
( ) ( )
( )
( )
2
2
1 3
2
2
2 1 1 2
D D
c
c
PLUS D V D rc
r
r


_

+

,
(3.64)
The zero crossing behavior of these equations is governed by the factors between
brackets which are independent of dimension D (cf. eq. 3.55). The argument
given in section 3.3.2.1 for D=2 therefore holds for any dimension: for a single
pillbox PLUS leads to an edge detector that finds the edges one order more
accurate than its constituents.

3.5.2. Smoothing by a stack of pillballs
In section 3.3.2.2. we discussed the 2D case for the zero crossing of PLUS. Here
we discuss the D-dimensional case for SDGD, Laplace and PLUS at once. Due to
eqs. (3.55,3.56) the single pillball results of eqs.(3.62-3.64) can all be written as
2
1D
(D 1) V(D 1) P(p, q,
2
, s, R) (3.65)
with relative size s + l/R and relative position + r/R, with p and q according to
table 3.4 and

( )
( )
2
2 2
3
2 2
2
, , , ,
D
c
r l c
P p q R rc p q
R R r
r

_
_

+



,
,
(3.66)
Analogous to section 3.3.2.2 for a spherical object, the gradient direction is
independent of l and the result of SDGD, Laplace or PLUS for a stack of pillboxes
is given by an integral of single pillball results over radius l; in order to allow
estimation of the zero crossing position we expand the integrand around r=R
( ) ( ) ( )
max max
2
2
1
, , , , , ,1, , 1 , ,1, ,
l s
l s
r R
r l
P p q R dl h P p q s R P p q s R ds
R R


_
1 +

]
,

h (3.67)
where h(s) + h(l), with Taylor coefficients P(p,q,1,s,R) + 2
D
R
D2
g
1
f
3D
s
D1
and
P
(
p,q,1,s,R) + 2
D
R
D2
g f
5D
s
D3
(cf. Appendix III: Stack of Pillballs I) and with
correction factors f + (1 s
2
/4)
1/2
, g
1
+ (2qp)/4 + (pq) s
2
/8 and

2 4 2 4
2 4 6 2 4 6
1 4 3 2
2 8 16 8 16
2 2 3
8 16 32 8 16 32
s s s s
g p q
s s s s s s
Dp Dq
_ _
+ +


, ,
_ _
+ + + +


, ,

As the position of the zero crossing at =
0
lies outside the object for Laplace
and PLUS, but inside the object for SDGD, |
0
1| = (2q1)(
0
1) and
0
is the
root of
SECOND DERIVATIVE FILTERS 71

( )
( )( )
( ) ( )
( )( )
max max
0 0
0
2 1 1 2 1 1
, ,1, , 1 , ,1, , 0
s s
s s
q q
h P p q s R ds h P p q s R ds


+

(3.68)
Examining eq. (3.68) we notice that (as P

=O(s
D3
) (cf. Appendix III: Stack of
Pillballs I)) the cone filter anomaly may be encountered if h(s)h(0) = O(s
3D
); in
3D this implies h(s)=h(0), a flat-topped stack that behaves normally as it lacks any
small radius pillbox contribution; for D_4 the anomaly cannot occur either, as
continuity at s=0 of h(s)=h(0)+O(s
n
) requires n_0.
Again the necessary bandlimiting component of h assures h(s) h(0) = O(s
2n
)
with n _ 1 and makes the relative error of the zero crossing position

1 3
0
0 0
1
D E D
s s
C Fh s ds Gh s ds

+


(3.69)
with C, F, E and G defined according to table 3.4. One is (again) free to set the
upper integration boundary to s
max
(see section 3.3.2.2).

Table 3.4: Definitions

For a check we apply this method to the single pillball case and get for the
approximate relative location error

( )
( )
2
0
, ,1, ,
1
, ,1, ,
E
P p q s R F
Cs
P p q s R G

(3.70)
or, in both lowest orders in k the location errors given in table 3.5.
p q C Ff
D3
E Gf
D5

SDGD 1 0
1
2

2
1
2
s

0
( ) ( )
2 4
6
4 2 3
1
4 8 16
D s D s
Ds
+ +
+
Laplace 1 1
1
2

1 0
( ) ( )
2 4
2 2
1
4 8
D s D s
+ +
PLUS 2 1
1
8

1 2
( )
4
2 6
5
6
1
8 16 32
D s
s Ds
+
+ +
72 SECOND DERIVATIVE FILTERS
Table 3.5: Checking linear extrapolation for single pillball

The approximation is acceptable in this case.

Prediction of the zero crossing position requires bounding of the two integrals in
eq. (3.69) (cf. Appendix IV: Stack of Pillballs II)

max max
1 3
0
0 0
1
s s
D E D
s s
MC h s ds h s ds
+


(3.71)
with M
floor
< M< M
ceiling
, under the condition h
s
_ 0 . Ior D=2 and D=3 the
bounds M
floor
, M
ceiling
and their ratio are given in table 3.6. The ratio
M
ceiling
/M
floor
indicates that for PLUS our argument allows the most accurate
estimation of location error, both in 2D and in 3D, while for the SDGD the
integral bounding method followed seems hardly applicable to estimate the
behavior of the SDGD.

Table 3.6: Bounds for M if 0 < s < 1

relative location error
(lowest orders in s
2
or k)
k =
1
8
, D = 2
approximation
k =
1
8
, D = 2
exact
SDGD
( )
( )
2 2
2
1
1
1 1
2 4 2
D s
k
s k D
_
+
+ +

,
0.1484 0.1340
Laplace
( )
( )
2 2
2
1
1
1 1
2 4 2
D s
k
s k D
_
+
+ +

,
0.1172 0.1180
PLUS
2 2 3
4
1
1
8 2 2 2
s k k
s
_
+ +


,

0.00879 0.00876
D M
floor
M
ceiling

ceiling
floor
M
M

SDGD 2 0.58 2.60 4.5
Laplace 2 0.65 1.15 1.8
PLUS 2 1 1.31 1.3
SDGD 3 0.50 4 8
Laplace 3 0.67 1 1.5
PLUS 3 1 1.20 1.2
SECOND DERIVATIVE FILTERS 73

Due to the following equalities the integrals can also be expressed in the D-
dimensional Fourier transform H
DD
(u
1
,u
2
,,u
D
)

(c.f. Appendix V: Stack of Pillballs
III).

For SDGD and Laplace, D_2. in the numerator

( )
( )
1
D
0 0
2
, 0, , 0
1
D
s D
h s ds H u du
V D


3.72)
For PLUS, D_2. in the numerator

( )
( )
( )
D 1 1
2
0 0
1 , 0, , 0
2 1
D D
s
D H u
h s ds u du
u V D



+
+


(3.73)
For D=2 , in the denominator (cf. Appendix I: Stack of Pillboxes)
( )
1 2 2
2D
0 0
4 , 0
s
h s ds H u u du



(3.74)
For D=3 , in the denominator
( )
2
3D
0 0
4 , 0, 0
s
h ds H u u du



(3.75)
For D_4 . in the denominator

( )
( )
3 2
D
0 0
4
, 0, , 0
3
D
s D
h s ds H u u du
V D


(3.76)

3.5.3. Gaussian stack shape
We shall now apply eq. (3.71) to a Gaussian filter. Following eq. (3.31) in section
3.3.2.3 the Gaussian is truncated at a radius of a few sigma and the step
introduced by truncation is removed.
As h(l) (see eq.(3.31)) is monotonous decreasing the relative error in zero
crossing position is (cf. eq. (3.32)) s
max
+a /R)

( )
( )
2
0
,
1
2,
E
I D E a
MC
R I D a

+
+
_

,
(3.77)
with I(n,a) defined by eq.(3.34) and with M
floor
< M < M
ceiling
, as long as
a/R < 1. In Appendix II: Gaussian Stack Shape we derive the expressions for
I(0,a) to I(5,a)
I(0,a) = /2 erf(a/ 2 ) (3.78)
I(1,a) = 1 exp(
1
2
a
2
) (3.79)
74 SECOND DERIVATIVE FILTERS
I(2,a) = I(0) a exp(
1
2
a
2
) (3.80)
I(3,a) = 2 (a
2
+ 2) exp(
1
2
a
2
) (3.81)
I(4,a) = 3I(0) (a
3
+ 3a) exp(
1
2
a
2
) (3.82)
I(5,a) = 8 (a
4
+ 4a
2
+ 8) exp(
1
2
a
2
) (3.83)
For truncation at 2 (a=2) the relative error in edge location is given in table 3.7.

Table 3.7: The relative location error
0
1 for an edge of radius R due to low-pass
filtering by a Gaussian filter truncated at a < R (a = 2).

Comparing the relative location errors from table 3.7 and table 3.8 we can deduce
the sensitivity of the relative location error to the choice of the truncation factor a.
A larger truncation factor, however, results in better bandwidth limitation.
For a single pillbox with radius l
eff
the relative edge location error for
SDGD, Laplace and PLUS in any dimension is
SDGD:
2
0
2
1
2
eff
l
k
R
(3.84)
Laplace:


2
0
2
1
2
eff
l
k
R
(3.85)
PLUS:
4
2
0
4
1
2 8
eff
l
k
R
(3.86)
D M
floor
M
ceiling
C I(D+E)
(a2)
I(D2)
(a2)

0
1
eff
l


SDGD 2 0.58 2.6

1
2

I(0)
0.2707
1.196
(0.25 to 1.0)
2
2
R


1.0 40%
Laplace 2 0.65 1.15
1
2

I(0)
0.2707
1.196
(0.35 30%)
2
2
R


0.8 15%
PLUS 2 1 1.31
1
8

3I(0)
1.895
1.196
(0.21 14%)
4
4
R


1.13 3%
SDGD 3 0.5 4

1
2

1.188 0.865
(0.33 to 3.0)
2
2
R


1.6 50%
Laplace 3 0.67 1
1
2

1.188 0.865
(0.57 20%)
2
2
R


1.0510%
PLUS 3 1 1.2
1
8

2.587 0.865
(0.41 10%)
4
4
R


1.35 2%
SECOND DERIVATIVE FILTERS 75

Table 3.8: The relative location error
0
1 for an edge of radius R due to low-pass
filtering by a Gaussian filter truncated at a<R (a ).

The errors are equal if l
eff
/ has the value indicated in table 3.7 and table 3.8,
which is found to be roughly 1 in all cases. Hence, for a = 2 the condition R >
a corresponds to R > 2l
eff
and k < 1/8, i.e. objects should not be smaller than
those called small in the single pillbox case.

3.5.4. Tepee stack shape
Tepee filters (defined in section 3.3.2.4) are best represented in the frequency
domain. The cross section is given by (cf. Appendix VI: Pillball FT, s
0
l
0
/R,
s
0
u and /l
0
)
( )
( )
2 2 2
D D D
0 0
, , 0 , , 0 , 0, , 0 exp 2
a
ball
D D D
H u H H
s s


_ _ _



, , ,
(3.87)
where for odd D

( )
( )
( )
( )
1
2 2
D
2
0
2 1 sin 2
, 0, , 0 1
2
D
ball
D
V D
H
s V D
i

_
_



,
,
(3.88)
with
( )
( )
( ) ( ) ( )
1
2
1
2
2 1 2 !
1 !
D
V D D
V D
D

, =1 for D=1, =3/2 for D=3, = 15/8 for D=5


cf. section 3.5.1 and for even D (cf. Appendix VI: Pillball FT)
D M
floor
M
ceiling
C I(D+E)
(a)
I(D2)
(a)

0
1
eff
l


SDGD 2 0.58 2.6

1
2

I(0)
/2
(0.29 to 1.3)
2
2
R


1.0 40%
Laplace 2 0.65 1.15
1
2

I(0)
/2
(0.45 30%)
2
2
R


0.95 15%
PLUS 2 1 1.31
1
8

3I(0)
/2
(0.43 14%)
4
4
R


1.36 3%
SDGD 3 0.5 4

1
2

2 1
(0.5 to 4.0)
2
2
R


1.9 50%
Laplace 3 0.67 1
1
2

2 1
(0.83 20%)
2
2
R


1.29 10%
PLUS 3 1 1.2
1
8

8 1
(1.1 10%)
4
4
R


1.72 2%
76 SECOND DERIVATIVE FILTERS
( )
( )
( )
( )
( )
( )
( )
2
2 2
2 1
1
D
2 2 2
0
2 1 2
, 0, , 0 1 !
2
2
D
D
ball
D
D
J V D J
H D
s V D
i

_
_



,
,
(3.89)
with
( )
( )
( ) ( ) ( )
( )
2
1 1
2 2
2 2 ! !
1
2 1 !
D
D D
V D
V D D

, =1 for D=2, =4/3 for D=4


cf. section 3.5.1. The relative error in zero crossing position can now be calculated
according to eqs. (3.71-3.76).
As in 2D we expect a large influence of the Gaussian truncation factor for some
values of a and little for others. Again the frequency domain allows a simple
description of this effect. Evaluating eqs. (3.88,3.89) we get for large u (i.e.
u=/s
0
>>1/s
0
, cf. Appendix VI: Pillball FT)
H
DD
ball
(u,0,,0) = O(u
(D+1)/2
) cos(2s
0
u(D+1)/4) (3.90)
Hence the integrand of the right hand side in eqs. (3.74-3.76) is
H
DD
(
0
s

,0,,0)
2
= O(
2a(D+1)/2
)[cos(2(D+1)/4)]
a
exp(2
2

2
) (3.91)

Table 3.9: Relative edge position error and relative effective radius of Tepee filters.
D
a =
/l
0
=

<0,
1
.15]
2
0
2
.15

<0,
3
.15]

<0,
4
.15]

<0,
5
.15]
SDGD 2
2
0 0
| 1| s

0.3 1.3 0.07 0.3 0.15 0.7 0.3 1.2 0.3 1.5 0.4 1.8

l
eff
/lo
0.8 1.6 0.4 0.8 0.5 1.1 0.7 1.6 0.8 1.7 0.9 1.9
Laplace 2
2
0 0
| 1| s

0.3 0.6 0.08 0.14 0.16 0.3 0.3 0.5 0.4 0.6 0.5 0.8

l
eff
/lo
0.8 1.1 0.4 0.5 0.6 0.8 0.8 1.0 0.9 1.1 1.0 1.3
PLUS 2
4
0 0
| 1| s

0.13 0.16 0.05 0.07 0.11 0.14 0.3 0.4 0.45 0.6 0.7 0.9

l
eff
/lo
1.00 1.07 0.80 0.86 0.96 1.03 1.22 1.31 1.38 1.48 1.53 1.64
SDGD 3
2
0 0
| 1| s

0.25 2.0 0.2 1.6 0.24 1.9 0.4 2.8 0.5 3.6 0.6 4.4

l
eff
/lo
0.7 2.0 0.6 1.8 0.7 1.9 0.8 2.4 1.0 2.7 1.1 3.0
Laplace 3
2
0 0
| 1| s

0.3 0.5 0.3 0.4 0.3 0.5 0.5 0.7 0.6 0.9 0.7 1.1

l
eff
/lo
0.8 1.0 0.7 0.9 0.8 1.0 1.0 1.2 1.1 1.3 1.2 1.5
PLUS 3
4
0 0
| 1| s

0.13 0.15 0.17 0.20 0.21 0.25 0.45 0.54 0.75 0.9 1.1 1.4

l
eff
/lo
1.00 1.05 1.08 1.13 1.14 1.19 1.38 1.44 1.56 1.63 1.74 1.82

SECOND DERIVATIVE FILTERS 77

in which O(
2a(D+1)/2
) can be integrated if 2a(D+1)/2 < 1, such that for
a>6/(D+1)

the integral is almost independent

of the Gaussian factor.
For odd a_6/(D+1), a can only be 1 and we are back to the single pillball case
(handled in section 3.4.1) where no Gaussian factor is needed for convergence
(the convergence in this case must be a result of the cosine alternation).
For even a_6/(D+1), which can only be a=2 (for D=2), the integrand is non-
negative and the integral is mainly governed by the Gaussian factor (without
which it would not converge). This is the cone filter effect seen in 2D. We
conclude that it has no analogy in higher dimensions, which is in accordance with
our findings in section 3.5.2. Remember that for a single pillbox with radius l
eff

the error is given by eqs. (3.84-3.86). Now we can find
0
1 and l
eff
as functions
of l
0
,a and . The results are given in table 3.9. Due to uncertainty in M, intervals
are given rather than values.

As expected the values of
0
1 and l
eff
depend strongly on for D=2, a=2. For
the SDGD floor and ceiling values are too much apart to be useful. The condition
R > al
0
corresponds to R > 2l
eff
and k < 1/8, i.e. objects should not be smaller than
those called small in the single pillbox case.


3.6. Sampling
We shall establish sufficient conditions under which the position of a disc edge
can be determined from the smoothed image. Moreover, we shall give a recipe for
locating edges in the sampled image. The recipe exploits sampling-invariant
operations to produce the sampled version of a bandlimited image that allow
interpolation of the zero crossings at the edge positions of the original disk. The
step edges characteristic for industrial images are thus located. For the slope edges
of biomedical images the recipe embodies an edge definition, as defined in
section 3.4.
We shall consider continuous 2D (and 3D) signals (images) and the impact of
sampling on their analysis. The discretization of sample values to integers will not
be considered.

Sampling-Invariant Versions
While the sampling requirements for the applicability of discrete nonlinear
maximum/minimum filters are unknown, we restrict ourselves to the SDGD
which is nonlinear but analytic. The Laplace is linear and demands no special
requirements. Although the SDGD itself is not sampling invariant, the product of
the SDGD and the squared modulus of the gradient is sampling invariant (for an
oversampling factor of 3, (Verbeek 1985)). This product has the same zero
78 SECOND DERIVATIVE FILTERS
crossing positions as the SDGD. A similar argument holds for the sum of SDGD
and Laplace.

3.6.1. Edge location error and sampling density
Sampling at the Nyquist rate 2f
c
, where f
c
is the maximum frequency in the image,
allows reconstruction by interpolation. Some sampling invariant operations need a
higher sampling rate the new Nyquist rate f
N
*
to allow interpolation of their
results (oversampling). Applying the results described in (Verbeek 1985) to PLUS
and SDGD we find that the product |grad B|
2
PLUS(B) (like |grad B|
2
SDGD(B)) is
the result of a sampling invariant operation with oversampling factor f
N
*
/f
N
= 3. B
is the image result after low-pass filtering. Laplace is a sampling invariant
operator that needs no oversampling. A Gaussian filter with width in the spatial
domain corresponds to a Gaussian transfer function with width 1/(2) in the
frequency domain. We therefore assume that the truncated Gaussian causes
approximate bandwidth limitation at f
c
= b/2 where the amplitude of the
transfer function is down to exp(b
2
/2). For small b (b = 2) the approximation is
rough, for large b it becomes exact (apart from spatial truncation at a). For
optical imaging a 2D Gaussian with
PSF
=0.9 gives a good approximation of the
PSF in focus (Chapter 2). Notice that for
PSF
= 0.9 pixels and f
c
=0.5 (after
sampling) as shown in section 3.3.2.4, b = f
c
2
PSF
= 0.5 x 2
PSF
= 2.8.
The minimum sampling rate thus is 2f
0
= 2b/(2) for the Laplace, but f
N
*
=
6b/2 for calculation of |grad B|
2
PLUS (B). The maximum pixel size S is the
inverse of the minimum sampling rate. We assume these values to be chosen. We
may now compare the operations

2
6
PLUS S
b

(3.92)

2
6
Laplace S
b

(3.93)
For PLUS (and thus for |grad B|
2
PLUS (B), which has the same zero crossing) a
Gaussian of width gives a relative error in R (Gaussian truncation at a, a=2)

4
0
4
1 0.185M
R

(3.94)
with 1.0 < M < 1.3 or 0.185 < 0.185M < 0.24
For /R < 0.5 the relative error for PLUS is smaller than 1.5% of the edge radius.
Note that /R < 0.5 gives the maximum size of Gaussian smoothing for which
eq.(3.94) still holds.
For Laplace one can similarly derive
SECOND DERIVATIVE FILTERS 79


2
0
2

1 0.391 M
R

(3.95)
with 0.645 < M < 1.15 or 0.253 < 0.391M < 0.45
For /R < 0.5 the relative error for Laplace is smaller than 11% of the edge
radius. Again /R < 0.5 gives the maximum size of Gaussian smoothing for
which eq.(3.95) still holds.

Expressing the errors in pixel size using eqs.(3.92,3.93) gives

4
0
1 0.185 81
bS
PLUS M
R

_


,
(3.96)

2
0

1 0.391
b S
Laplace M
R

_


,
(3.97)
while /R < 0.5 bS/R < /6 and /R < 0.5 bS/R < /2.
On the basis of one pixel size S = S, different bandlimiting = 3 (=2.7 and
=0.9) and b = b, break-even occurs for

0 0
9
0.473 , 2 3

R b M
p b p b
S M
< < (3.98)
(bS/R < /6 also fulfilled)
where both relative errors equal

( )
2
0
0.391
1
0.185 81
M
M
(3.99)
i.e. between 0.33% and 1.35%.
In words: for objects with an edge radius of p
0
pixels, where p
0
is around 5b/2
(say 7), the relative error is on the order of 1%, say 0.07 pixel, for both methods.
Below p
0
pixels PLUS would deteriorate faster (~(R /S)
4
) than Laplace (~(R /S)
2
).
However, bS /R < /6 demands R/S > p
0
, so for a radius below p
0
pixels PLUS
does not work at all. Laplace needs bS /R < /2 or R/S > p
0
/3 and keeps working
down to p
0
/3 pixels. For a radius of p
0
/2 pixels (R = 3.5) Laplace would give 3%
error, say 0.1 pixel, for p
0
/3 pixels (R = 2.2) 7% (say 0.15 pixel). Above p
0
pixels
PLUS improves faster than Laplace. For 2p
0
pixels (R = 14) PLUS gives 0.03%,
say 0.003 pixel while Laplace gives 0.16% say 0.023 pixel.

The above predicted errors are supported by an experiment (see the next section)
where the radius of a disc is reduced from 10 pixels down to 2 pixels for Laplace
and down to 5.5 pixels for PLUS. The measurements shown in figure 3.12 are in
full agreement with the error calculations in this section.
80 SECOND DERIVATIVE FILTERS


3.7. Experiments
A series of experiments were performed to test the theory presented in previous
sections. In the following 2D (3D) experiments we have used a bandlimited disc
of radius 25.5 (a bandlimited sphere of radius 8.7) as a test image. We have
increased the resolution of the detection using cubic spline interpolation (Press et
al. 1990) to detect subpixel edge shifts. In all figures we have plotted the relative
absolute location error as a function of the relative size (l
0
/R for the Tepee filter
and /R for the Gaussian filter). The prediction bands show the theoretical
systematic error of Laplace and PLUS in noise free images. In experiment 1 and 3
all images were sampled at the Nyquist rate. The required three times
oversampling for SDGD and PLUS to prevent aliasing is achieved by digital low-
pass filtering of the sampled image (reduction of the bandwidth by a factor of
three).

3.7.1. Implementation
In the theory, we have only considered filters that can be implemented on a digital
computer. We have used Gaussian, pillbox, and derivative filters. The Gaussian
and all derivative filters are infinite impulse response filters (IIR) that can be
separated into 1D filters to reduce the number of computations and truncated to
obtain a finite impulse response filter (FIR). Deriche used recursive filters (IIR) to
implement well-known edge detectors such as the Marr-Hildreth operator
(Deriche 1987 b) and the Canny (Canny 1986) edge detector (Deriche 1987 a;
Deriche 1990). However, his implementation of Cannys edge detector uses a
different regularizing function, one that is not rotation invariant. Especially when
large smoothing is applied, the non-isotropic response is clearly noticeable
(Lacroix 1990).

Two times gradient filtering (derivative-of-Gaussian) yields a 2 times larger
Gaussian filter than a true second derivative filter. Especially when we combine
several first and second derivatives into a new filter (SDGD) we have taken
special care that all built-in low pass filters (Gaussian kernels) have the same size
(frequency response). If not, the new filter will be anisotropic.

experiment 1, noise free images (2D and 3D)
We have tested the predicted location error for Gaussian filters in 2D and 3D and
Tepee filters in 2D. The test image was sampled at the Nyquist frequency. Digital
low-pass filtering prevents aliasing when using SDGD and PLUS. Figure 3.11
shows that the measured errors are in agreement with our prediction. (The
SECOND DERIVATIVE FILTERS 81

calculations of the integrals needed for the prediction of the relative position error
of Tepee filters was done using Mathematica (Wolfram 1988))

0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 noise free
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

a)

0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 noise free
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Tepee-2 filter (l /R)
0

b)

82 SECOND DERIVATIVE FILTERS
0.25 0.3 0.35 0.4 0.45 0.5
0.001
0.005
0.01
0.05
0.1
0.5
3D R=8.7 noise free
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

c)

Figure 3.11: Relative location error as function of the relative filter size in noise free
images. The 2D (3D) test image was a disc (sphere) of radius 25.5 (8.7) pixels sampled
at the Nyquist rate.
a) Gaussian low-pass filter in 2D with relative size = /R,
b) Tepee (2-fold pillbox filtering of radius l
0
) low-pass filter in 2D with relative size =
l
0
/R,
c) Gaussian low-pass filter in 3D with relative size = /R.


experiment 2, break-even radius in 2D
We have tested our prediction concerning the break-even point in the radius of the
object where Laplace performs as well as PLUS (2D). Note that PLUS needs
three times oversampling when no digital low-pass filter is applied to combat
noise. Laplace is satisfied by sampling at the Nyquist rate. These results are
shown in figure 3.12 and confirm our prediction given in section 3.6.1.
SECOND DERIVATIVE FILTERS 83



experiment 3, robustness in the presence of noise (2D and 3D)
In order to test the robustness of the edge detectors in the presence of noise we
added independent Gaussian noise to the test images. From these results we want
to compare the effectivity of the Gaussian filter versus the Tepee filter as noise
suppressor. We prefer the filter that gives the smallest edge shift for a given SNR.
SNR has been defined as the ratio between edge height (contrast) and the standard
deviation of the noise in the image


Gaussian noise
edge height
SNR

(3.100)
An alternative definition in decibels is given by


20log
Gaussian noise
edge height
SNR


,
(3.101)
For noisy images the relative absolute location error has two components, a
systematic one and a stochastic one. The systematic error can be predicted as is
shown in experiment 1. The stochastic error is responsible for the discrepancy
between the measurements and the prediction bands in the figures 3.13, 3.14 and
3.15.
2 4 6 8 10
0.001
0.005
0.01
0.05
0.1
edge radius
2D noise free
Laplace
PLUS
Theory Exp.
1
0


Figure 3.12: Break-even point in performance between Laplace and PLUS for noise free
2D images. Laplace was sampled without oversampling , PLUS with three times
oversampling to avoid aliasing.
84 SECOND DERIVATIVE FILTERS


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=100 (40 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

a)


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=20 (26 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

b)

SECOND DERIVATIVE FILTERS 85



0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=5 (14 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

c)


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=2 (6 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

d)

86 SECOND DERIVATIVE FILTERS


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=1 (0 dB)
Laplace
SDGD
PLUS
Theory Exp.
1
0
relative size of Gaussian filter (/R)

e)

Figure 3.13: Relative location error as function of the relative filter size for various
SNRs with a Gaussian filter for noise reduction in 2D. The grey bands are the
theoretical errors in noise free images. The 2D test image was a disc of radius 25.5
pixels sampled at the Nyquist rate. The SNRs used are:
a) SNR=100 (40 dB),
b) SNR=20 (26 dB),
c) SNR=5 (14 dB),
d) SNR=2 (6 dB),
e) SNR=1 (0 dB).

SECOND DERIVATIVE FILTERS 87



0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=100 (40 dB)
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Tepee-2 filter (l /R)
0

a)


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=20 (26 dB)
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Tepee-2 filter (l /R)
0

b)

88 SECOND DERIVATIVE FILTERS


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=5 (14 dB)
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Tepee-2 filter (l /R)
0
c)


0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=2 (6 dB)
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Tepee-2 filter (l /R)
0

d)

SECOND DERIVATIVE FILTERS 89



0.1 0.2 0.3 0.4 0.5
0.0001
0.001
0.01
0.1
2D R=25.5 SNR=1 (0 dB)
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Tepee-2 filter (l /R)
0
e)

Figure 3.14: Relative location error as function of the relative filter size for various
SNRs with a Tepee (2-fold pillbox) filter for noise reduction in 2D. The grey bands are
the theoretical errors in noise free images. The 2D test image was a disc of radius 25.5
pixels sampled at the Nyquist rate. The SNRs used are:
a) SNR=100 (40 dB),
b) SNR=20 (26 dB),
c) SNR=5 (14 dB),
d) SNR=2 (6 dB),
e) SNR=1 (0 dB).


90 SECOND DERIVATIVE FILTERS


0.25 0.3 0.35 0.4 0.45 0.5
0.001
0.005
0.01
0.05
0.1
0.5
3D R=8.7 SNR=100 (40 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

a)


0.25 0.3 0.35 0.4 0.45 0.5
0.001
0.005
0.01
0.05
0.1
0.5
3D R=8.7 SNR=20 (26 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

b)

SECOND DERIVATIVE FILTERS 91



0.25 0.3 0.35 0.4 0.45 0.5
0.001
0.005
0.01
0.05
0.1
0.5
3D R=8.7 SNR=5 (14 dB)
1
0
Laplace
SDGD
PLUS
Theory Exp.
relative size of Gaussian filter (/R)

c)


0.25 0.3 0.35 0.4 0.45 0.5
0.001
0.005
0.01
0.05
0.1
0.5
3D R=8.7 SNR=2 (6 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

d)

92 SECOND DERIVATIVE FILTERS


0.25 0.3 0.35 0.4 0.45 0.5
0.001
0.005
0.01
0.05
0.1
0.5
3D R=8.7 SNR=1 (0 dB)
1
0
relative size of Gaussian filter (/R)
Laplace
SDGD
PLUS
Theory Exp.

e)

Figure 3.15:Relative location error as function of the relative filter size for various
SNRs with a Gaussian filter for noise reduction in 3D. The grey bands are the
theoretical errors in noise free images. The 3D test image was a ball of radius 8.7 pixels
sampled at the Nyquist rate. The SNRs used are:
a) SNR=100 (40 dB),
b) SNR=20 (26 dB),
c) SNR=5 (14 dB),
d) SNR=2 (6 dB),
e) SNR=1 (0 dB).


3.8. Conclusions
In this chapter we have shown that both analog and digital low-pass filters exert
an influence on the location of curved edges in any dimension. The second
derivative in the gradient direction produces a predictable bias in edge location
towards the centers of curvature while the linear Laplace filter produces a shift in
the opposite direction. We have shown that the sum of the above filters (PLUS =
Laplace + SDGD) leads to an edge detector that finds the edges one order more
accurately than its constituents.
SECOND DERIVATIVE FILTERS 93

The influence of commonly used low-pass filters has been studied such as the
PSF originated from diffraction limited optics using incoherent light (2D), the
Gaussian filter with variable cutoff point (DD), and Tepee filters or a-fold pillball
filtering (DD).

All isotropic, monotonically-decreasing low-pass filters can be modeled by a
concentric stack of pillballs and analyzed using the presented theory. This chapter
describes the systematic errors in edge location which cannot be avoided. In the
literature, mainly stochastic disturbances have been studied so far. (Optimal
detection schemes have been presented for a straight step edge which is in
principle a 1D problem.) Low-pass filtered curved edges in any dimension
produce a biased zero-crossing (i.e. edge location) in a way that cannot be
predicted from earlier results.

We have shown that PLUS (Laplace + SDGD) performs better than both its
constituents over a wide range of SNRs and for a wide range of edge curvatures.
The PLUS operator requires three fold oversampling when no digital smoothing is
applied. The PLUS operator is easy to implement using separable filters, is
isotropic, and allows interpolation. The latter is of extreme importance since it
allows us to increase the sampling density after sampling to achieve subpixel
accuracies. This is often the only way to increase sampling density since the pixel
size of a CCD camera has a smallest size and lenses with higher magnification are
sometimes not available (e.g. microscope objectives).

The applicability of PLUS depends on the SNR and the object size. In 2D, the
SNRs can be divided in three intervals:
high quality images SNR _ 20 (SNR _ 26 dB) require the smallest
possible low-pass filters that avoid aliasing using PLUS. Although the
location error for PLUS is larger than in the theoretical noise free case
(impossible to obtain due to quantization into a fixed number of bits, camera
readout noise, and Poisson noise) PLUS performs significantly better than
Laplace and SDGD.
medium quality images 3 _ SNR 20 (10 dB _ SNR 26 dB) require
small low-pass filters for Laplace and SDGD and slightly larger low-pass
filters for PLUS to achieve the best performance. PLUS gives a slightly
better performance in terms of location error, but limits the maximum
allowed curvature of the contour. Laplace is the better choice for high
curvature objects (radii smaller than 6 pixels) while PLUS is to be preferred
when the curvature becomes less.
low quality images 1 _ SNR 3 (0 dB _ SNR 10 dB) require large
low-pass filters to get better accuracy as well as precision. For small objects
94 SECOND DERIVATIVE FILTERS
the maximum allowed low-pass filter might not be sufficient in noise
suppression. The stochastic error will dominate the total position error and
there is no need for using PLUS. SDGD is less sensitive to nonlinear
illumination along the edge (low frequency noise) and performs better under
these conditions. When the objects become larger (radii larger than 20
pixels) and the curvature reduces, PLUS performs better than Laplace and
SDGD because large low-pass filters can be applied. Although the
difference is less than an order of magnitude, the edge displacement can
now be reduced from a few pixels to less than one pixel.


For objects where the size of the low-pass filter is larger than the edge radius, no
prediction with respect to edge location errors can be made. For contours having
radii smaller than the break-even radius (see section 3.6) Laplace performs better
than PLUS. For low SNRs the stochastic error dominates the total position error.
For radii larger than the break-even radius, the SNR is the most dominant feature
for choosing the proper edge detector. Small objects (radii smaller than 6 pixels)
heavily disturbed by noise cannot be localized using Laplace. Figure 3.16
SNR (dB)
edge radius (pixels)
0
0 2 6 15
R - 2
PSF
R - 6
PSF
20
Laplace
SDGD
PLUS
SDGD
or
PLUS
2D Gaussian LPF
10
20
terra incognita
PLUS
PLUS

Figure 3.16: Applicability domains of PLUS, Laplace, and SDGD as function of edge
radius and SNR in 2D.
SECOND DERIVATIVE FILTERS 95

indicates which edge detector gives the best performance as function of the edge
radius and the SNR in 2D. In 3D, small Gaussian filters are already very effective
in noise reduction. This extends the applicability of PLUS to objects with smaller
edge radii heavily disturbed by noise.

This technique is currently applied to find object boundaries both in 2D and 3D
originated from epi-illuminated fluorescence Microscopes and CLSM (Confocal
Laser Scanning Microscope). The SNR is very low due to a limited amount of
fluorophores attached to the biological target, photo bleaching of these
fluorophores, and the pinhole (or slit) in the light path of the CSLM.

96 SECOND DERIVATIVE FILTERS

You might also like