recursive implementation of log filtering

7
Introduction Marr and Hildreth’s [1] theory of Laplacian of a Gaussian (LoG) filtering with multiple scales has been extensively elaborated. LoG filters have been widely used as a second derivative filtering function. One problem with LoG filter- ing is that it is very time consuming, especially with a large size filter. Hildreth [2] implemented filtering by successive one-dimensional row and column convolutions, making use of the separability of the Gaussian function. Her implemen- tation reduced the total number of operations required at each pixel from M 2 to 2M in a M 3 M pixel filter. King [3] later found that the LoG operator itself is separable. He decomposed an LoG filter into two functions, so that it could be written as the sum of two separable filters, which could be implemented by row and column operations. Huertas and Medioni [4] reduced the multiplications by yet another factor of 2 by taking advantage of the even symme- try of the filter. Chen et al. [5] dramatically increased speed by convolving reduced images with a smaller size LoG fil- ter and interpolating the result to recover the original resolution. Despite the reduction of calculation in these algorithms, LoG filtering remains a time-consuming procedure as it is done in the spatial domain using convolution. Burt [6, 7] proposed a hierarchical model for generating a Gaussian- like windows. Deriche [8] developed an anisotropic recursive filter for a quadrangular pyramid windows. However, the former requires interlacing addressing, and the latter is not exactly an operator of LoG and produces aliasing in detecting zero-crossings (ZCs). Recursive convolution provides a good solution. It is extremely fast and the speed is independent of the size of the filter. However, it is very difficult to design a recursive filter for LoG filtering because the z-transform of LoG function is converged over the entire z-plane and cannot be 1077-2014/97/010059 + 07 $25.00/ri960045 © 1997 Academic Press Limited Recursive Implementation of LoG Filtering oG filters have been widely used as a second derivative filtering function. One problem with LoG filtering is that it is very time consuming, especially with a large size filter. We use an Lanalytical method to obtain the z-transform of LoG function in a rational function form and develop a recursive implementation. The structure of the recursive filters is defined by the order of rational functions. The algorithm gives a constant computation complexity per pixel. The computa- tional complexity of recursive filtering depends on the number of poles and zeros of the transfer function, i.e., on the structure of the recursive filter. It is independent of the size of the filter, and thus has a substantial saving in computation. A general method of designing high order recursive filters is also given. Recursive functions can be implemented in a number of shifting registers in hardware. The methodology will contribute to real-time image processing and robot vision. © 1997 Academic Press Limited Jesse S. Jin and Yan Gao School of Computer Science and Engineering, University of New South Wales, Sydney 2052 Australia E-mail: [email protected] Real-Time Imaging 3, 59–65 (1997)

Upload: jesse-s-jin

Post on 15-Jun-2016

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Recursive Implementation of LoG Filtering

Introduction

Marr and Hildreth’s [1] theory of Laplacian of a Gaussian(LoG) filtering with multiple scales has been extensivelyelaborated. LoG filters have been widely used as a secondderivative filtering function. One problem with LoG filter-ing is that it is very time consuming, especially with a largesize filter. Hildreth [2] implemented filtering by successiveone-dimensional row and column convolutions, making useof the separability of the Gaussian function. Her implemen-tation reduced the total number of operations required ateach pixel from M2 to 2M in a M 3 M pixel filter. King [3]later found that the LoG operator itself is separable. Hedecomposed an LoG filter into two functions, so that itcould be written as the sum of two separable filters, whichcould be implemented by row and column operations.Huertas and Medioni [4] reduced the multiplications by yetanother factor of 2 by taking advantage of the even symme-try of the filter. Chen et al. [5] dramatically increased speed

by convolving reduced images with a smaller size LoG fil-ter and interpolating the result to recover the originalresolution.

Despite the reduction of calculation in these algorithms,LoG filtering remains a time-consuming procedure as it isdone in the spatial domain using convolution. Burt [6, 7]proposed a hierarchical model for generating a Gaussian-like windows. Deriche [8] developed an anisotropicrecursive filter for a quadrangular pyramid windows.However, the former requires interlacing addressing, andthe latter is not exactly an operator of LoG and producesaliasing in detecting zero-crossings (ZCs).

Recursive convolution provides a good solution. It isextremely fast and the speed is independent of the size ofthe filter. However, it is very difficult to design a recursivefilter for LoG filtering because the z-transform of LoGfunction is converged over the entire z-plane and cannot be

1077-2014/97/010059 + 07 $25.00/ri960045 © 1997 Academic Press Limited

Recursive Implementation of LoGFiltering

oG filters have been widely used as a second derivative filtering function. One problem with LoG filtering is that it is very time consuming, especially with a large size filter. We use an Lanalytical method to obtain the z-transform of LoG function in a rational function form and

develop a recursive implementation. The structure of the recursive filters is defined by the order ofrational functions. The algorithm gives a constant computation complexity per pixel. The computa-tional complexity of recursive filtering depends on the number of poles and zeros of the transferfunction, i.e., on the structure of the recursive filter. It is independent of the size of the filter, and thushas a substantial saving in computation. A general method of designing high order recursive filters isalso given. Recursive functions can be implemented in a number of shifting registers in hardware. Themethodology will contribute to real-time image processing and robot vision.

© 1997 Academic Press Limited

Jesse S. Jin and Yan Gao

School of Computer Science and Engineering,University of New South Wales, Sydney 2052 Australia

E-mail: [email protected]

Real-Time Imaging 3, 59–65 (1997)

Page 2: Recursive Implementation of LoG Filtering

represented exactly in a ratio of two polynomials. Deriche[9,10] developed recursive implementations for Gaussianfunctions and their derivatives using Applied Analysis. Hismethod is a numerical approximation of LoG functions inspatial domain and has difficulty in extending to other filters.

We study the z-transform and its properties of the regionof convergence (ROC) of LoG functions, and propose amethod to design a recursive filter using the least-mean-square approximation in the z-domain. We use thecomparison principle to decide the coefficients of the poly-nomials and design a third-order recursive filter for LoGfiltering. The algorithm gives a constant computation com-plexity per pixel, independent of the filter size.Zero-crossings are detected simultaneously with filteringhence avoiding the need for an additional convolution andextra memory units. The algorithm can be implemented insix shifting registers and by a parallel hardware to achievevideo-rate filtering. Various images have been tested and ageneral method of designing high order recursive filters isalso given. The technique has been applied in the medicalimaging area, such as cell counting, contour detection andimage segmentation.

Deriche Filtering

One of the most useful techniques for representing andmanipulating sequences is the z-transform. Consider a filter-ing operation y(n) 5 ΣN21

i50 h(i)x(n 2 i), where h(n) is thefilter, x(n) is an input and y(n) is an output. The filteringprocess in z-domain is defined as Y(z) 5 H(z)X(z), whereY(z), H(z) and X(z) are z-transforms of y(n), h(n) and x(n),respectively with H(z) 5 h(n)z2n, where z is a complexvariable. If H(z) can be expressed as a rational polynomialin z21, i.e. ΣM21

i50 aiz2i/ΣN21

i51 biz2i, and b0 [ 1, then a dif-

ference equation relating y(n) and x(n) can be derived byinversing the z -transform to give:

Since b0 [ 1, we can rewrite equation (1) to solve for y(n)explicitly in a recursive format:

Deriche [8] applied recursive techniques in filtering andproposed a smooth function:

The function ss(m, n) is anisotropic. It gives a quadrangularpyramid weighting function, as shown in Figure 1(a). Itssecond derivative has sharp ridges in the x, y directions, asshown in Figure 1(b).

Later, Deriche [9, 10] developed recursive implementa-tions for Gaussian functions and their derivatives usingapplied analysis. He derived second-order, third-order andfourth-order recursive implementations. The fourth-orderrecursive implementation gives a very close approximationto the Gaussian and second derivative of Gaussian func-tions. Deriche’s method is a numerical approximation ofLoG functions in spatial domain and is difficult to extend toother filters.

Recursive LoG Filtering and Design Strategy

The Gaussian function is an isotropic function and has acircular radial weight. The Laplacian operator can be

ss m n k m e k n em n, . ( ) = +( ) +( )− −α αα α| | | || | | |1 1

y n a x n i b y n ii

N

i i

M

i( ) = −( ) − −( ) ( )=

=

−∑ ∑0

1

1

12

i

M

i i

N

ib y n i a x n i=

=

−∑ ∑−( ) = −( ) ( )0

1

0

11

60 J. S. JIN AND Y. GAO

1

(b)

–1

0

0–2

1

–10(a)

2x

y 0

–2

2

Figure 1. Deriche function, its second derivative and their section views

Page 3: Recursive Implementation of LoG Filtering

applied to the Gaussian function to form the LoG operatorwhich is decomposed into a sum of two separate functions:

Functions s(n) and l(n) are shown in Figure 2. Their sectionviews have a circular shape.

Functions s(n) and l(n) (n [ {x, y}) can be implementedby:

with z-transforms S(z) and L(z). We develop a recursivescheme for LoG filtering using approximation in the z-domain. The method consists of two steps. The first step isto choose the order of convergence, i.e., the order of a recur-sive function. The higher the order, the more accurate theapproximation but the more computation in realization. Afterchoosing the order of a recursive function, the number ofpoles will be known. Many useful properties of the region ofconvergence (ROC) can be obtained from the transform defi-nition. For 1-D signals, the ROC is typically bounded by twocircles in the z-plane whose origins are at |z| 5 0 with nopole inside the ROC. The stable sequence is equivalent toROC and includes the unit circle |z| 5 1 [11]. From theseproperties we can obtain that when all poles are on a circlecoincident with the origin, the function has the maximumregion of convergence (ROC) with a minimum spanningradius of poles. The denominator of the rational functionapproximation of a filter can be represented as (1 2 pz 2 1)k,

where p is the radius of ROC and k is the number of poles.The z-transform of a filter ΣN21

i50 h(i) can be approximatedas ΣN21

i50 h(i)z21 5 ΣKi50 aiz

2i/(1 2 pz2l)k. Expanding theright-hand side of the equation and comparing the coeffi-cients of z 2 i of both sides, we get a set of equations. Then,the least-mean-square approximation in the z-domain canbe obtained by solving these equations.

We use third-order recursive realization for LoG filter-ing. We know that the z-transform of a LoG function canonly be a real analytical function. Therefore, we have threepoles coincident and locating at the positive side of the realaxis, ie, S(z) and L(z) have a third order pole p in z-plan.We can implement S(z) 5 S1 (z) 1 S2 (z) by rational poly-nomial fractions:

mean-square approximation gives the set of coefficients(see Appendix for derivations):

Inversing z-transform into the time-domain n 5 1PN andtaking boundary conditions:

x x x y y y

x N x N x N y N y N

y N

0 1 2 0 1 2 0

1 2 3 1 2

3 0

1 1 1

2 2

2

( ) = −( ) = −( ) = ( ) = −( ) = −( ) =

+( ) = +( ) = +( ) = +( ) = +( )= +( ) =

a b

a b b

a b b b

a

a b

a b b

1 1

24

1 2

39 4

1 2 3

4

54

1

69 4

1 2

6

= +

= + +

= + + +

=

= + ( )= + +

α

α α

α α α

α

α α

α α α

and

s nn

l n

n n

( ) = −

( )

= −

( )

1

2 2

1

21

24

2

2

3

2

2

2

2

πσ σ

πσ σ σ

exp

exp

and

∇ ( ) = ( ) ⋅ ( ) + ( ) ⋅ ( )

= ( ) ⋅ ( ) + ( ) ⋅ ( ) ( )

22

2

2

2

3

G x ys x

xs y s x

s y

y

l x s y s x l y

, ∂

∂∂

RECURSIVE IMPLEMENTATION OF LOG FILTERING 61

20

–2

–22

0x (a)

y

(b)

6

0

–6

–60

6x

y

Figure 2. A Gaussian function and its second derivative; its section has a circular shape

S zY z

X zk

a z a z a z

b z b z b zS z

Y z

X zk

a z a z a z

b z b z b z

k

s

s

s

+ = =+ + ++ + +

= =+ +

+ + +

=

( ) ( )( )

( )

( )( )

( )

− − −

− − −1 1

12

23

3

11

22

33

2 41

52

63

11

22

33

1

1

15

1

2

and

where πσ

, The least -b p b p b p1 22

333 3= − = = −, , .

Page 4: Recursive Implementation of LoG Filtering

we have third-order difference equations:

This means that S1(z) works recursively from the left to the right or from the top to the bottom of an image.Combining y1(n) and y2(n), the results of filtering s(n) isys(n) 5 y1(n) 1 y2(n).

Similarly, we have yl(n) 5 y3(n) 1 y4(n) where

LoG filtering is done by successive one-dimensional rowand column calculations:

The filtering diagram is shown in Figure 3. It has a constantcomputational complexity per pixel similar to Deriche’salgorithm. The recursive filter can be easily implemented inhardware. For a third-order recursive function, a maximumof six shift registers are required in realization.

The method can be applied to design recursive realiza-tion for other filters. In obtaining the coefficients ai and bi

in Eqn (5) and by using the comparison method, we canuse more equations to improve the accuracy. We can alsouse different optimization criteria in solving the equa-tions [12].

Experimental Results and Discussions

The Deriche operator will produce ridges along the x- and y-axes, as shown in Figures 4 (a, b). LoG operators arerotation invariant and produces isotropic zero-crossings, asshown in Figures 4 (c, d). The grey colour is the originalimage with a disc and square pattern, respectively. Thewhite curve is the zero-crossings produced from filtering.We superimpose the ZCs on the original image to observethe spatial relation of ZCs.

Figure 5 compares Deriche filtering with LoG filteringon a chess board patten, where (a) is the original image, (b)is ZCs extracted from Deriche filtering and (c) is ZCsextracted from recursive LoG filtering.

Various images have been tested. Figure 6 shows recur-sive LoG filtering over Lena, where the size of the image is128 3 128, α 5 2.8 and the time is 0.042 s on a DEC5000/33 computer. Zero-crossings are extracted simultane-ously with LoG filtering.

Figure 7 shows filtering results over a microscope image.The images are taken from a rat brain with 400 magnifica-tion The size of the image is 128 3 128, α 5 3.5 andcomputation time is 0.042 s on the same machine as above.

We take the same image used by Deriche and filteredwith our recursive LoG filter, as shown in Figure 8. Thesize of the image is 256 3 256. It takes 0.117 s to do recur-sive LoG filtering and extract zero-crossings. It takes0.121 s to do second-order Deriche filtering. The time insaving is due to a fast algorithm we developed for extract-ing zero-crossings after filtering [13].

Conclusion

We provide a fast scheme for LoG filtering. Third-orderrational polynomials are used to approximate the z-trans-form of LoG functions. Recursive filtering is independentof the size of LoG filters. It is efficient in both time andmemory, and has less distortion in producing zero-crossings. The analytical approach also provides a methodfor designing other recursive filters.

∇ ( ) = ( ) ( ) + ( ) ( )2G m n l m s n s m l n, .

d b

d b b

d b b b

d

d

1 2 1

2 24

2 1 2

3 29

24

1 2 2 3

4

5

2

2

11

14

11

19

14

11

4

1

= −

+

= −

+ −

+

= −

+ −

+ −

+

=

= −−

σα

σα

σα

σα

σα

σα

α

σσ

+ ( )

= −−

+ −−

+

α α

σσ

α σσ

α α

41

6

2

29

2

24

1 2

11

9

1

4

1

b

d b b

y n k x n d x n d x n d x n

b y n b y n b y n

y n k d x n d x n d x n

b

l l

l

3 2 3

1 3 2 3 3 3

4 4 5 6

1

1 2 3

1 2 3 9

1 2 3

( ) = ( ) + −( ) + −( ) + −( )[ ]− −( ) − −( ) − −( ) ( )

( ) = +( ) + +( ) + +( )[ ]−

9

with and

y n b y n b y n

k kl l

4 2 4 3 4

3

2

5

1 2 3 10

1

2

1

2

+( ) − +( ) − +( ) ( )

= − = −

πσ

σ

πσ, 9

y n k a x n a x n a x n

b y n b y n b y n

y n k a x n a x n a x n

b y n

s

s

1 1 2 3

1 1 2 1 3 1

2 4 5 6

1 2

1 2 3

1 2 3 7

1 2 3

1

( ) = −( ) + −( ) + −( )[ ]− −( ) − −( ) − −( ) ( )

( ) = +( ) + +( ) + +( )[ ]− +

(( ) − +( ) − +( ) ( )b y n b y n2 2 3 22 3 8

62 J. S. JIN AND Y. GAO

Page 5: Recursive Implementation of LoG Filtering

References

1. Marr, D. & Hildreth, E. C. (1980) Theory of edge detection,Proc. of the Royal Society of London. B207, 187–217.

2. Hildreth, E. C. (1980) Implementation of a theory of edgedetection, MIT AI Memo 579, MIT: AI Lab.

3. King, D. (1982) Implementation of the Marr-Hildreth theoryof edge detection, Technical Report ISG 102, CA: Universityof Southern California.

4. Huertas, A. & Medioni, G. (1986) Detection of intensitychanges with subpixel accuracy using Laplacian-Gaussianmasks, IEEE Trans. PAMI, 8, 65l–664.

5. Chen, J. S., Huertas, A. & Medioni, G. (1987) Fast convolu-

tion with Laplacian-of-Gaussian masks, IEEE Trans. PAMI,9, 584–590.

6. Burt, P. J. (1981) Fast filter transforms for image processing,Computer Graphics and Image Processing, 16, 20–51.

7. Burt, P. J. (1983) Fast algorithm for estimating local imageproperties, Computer Vision, Graphics, and ImageProcessing, 21, 368–382.

RECURSIVE IMPLEMENTATION OF LOG FILTERING 63

Imageys(m, n)

Imageyl(m, n)

Inputimagex(m, n)

Imageprocessed

by LoG

l + (n)

l – (n)

s – (n)

s + (n)

+

+

l + (m)

l – (m)

s + (m)

s – (m)

+

+

Imageys.l(m, n)

Imageyl.s(m, n)

+

Figure 3. Diagram of implementing recursive LoG filtering

(a) (b) (c) (d)

Figure 4. Comparison of Deriche filtering and LoG filtering. (a), (b), Deriche filtering produces distortion at the x- and y-directions;(c), (d), LoG filtering produces consistent good results in all directions

(a) (b) (c)

Figure 5. Zero-crossings in Deriche filtering and LoG filtering.(a) original image; (b) Deriche filtering; (c) LoG filtering

(a) (b)

Figure 6. Zero-crossings extracted from Lenna. (a) originalimage; (b) zero-crossings

Page 6: Recursive Implementation of LoG Filtering

8. Deriche, R. (1990) Fast algorithm for low-level vision, IEEETrans. PAMI, 12, 78–87.

9. Deriche, R. (1992) Recursively implementing the Gaussianand its derivatives, Proc. Second International Conference onImage, Sept. Singapore, pp. 263–267.

10. Deriche, R. (1993) Recursively implementing the Gaussianand its derivatives, Research Report 1893, INRIA, France(available by ftp at ftp.inria.fr:INNRIA/tech-reports/RR/RR-1893.ps.gz).

11. Lim, J. S. (1990) Two-dimensional Signal and Image Pro-cessing, London: Prentice-Hall, Inc.

12. Jin, J. S., Yeap, W. K. & Cox, B. G. (1993) Multi-dimen-sional optimization and its applications in computer vision,Proc. Image & Vision Computing NZ, Auckland:IRL,pp. l89–l95.

13. Gao, Y. & Jin, J. S. (1995) Fast LoG filtering using recursivefilters, Proc. IEEE International Symposium on ComputerVision, Florida, pp. 89–92.

Appendix: Derivations of Coefficients

Applying the polynomial division over Eqn (5), we get theseries forms of S1(z) and S2(z):

Comparing Eqn (A.1) with Eqn (A.2), we get the followingset of equations:

64 J. S. JIN AND Y. GAO

(a) (b)

Figure 8. Zero-crossings extracted from Bureau (curtesy INRIA), (a) original image; (b) zero-crossings

Let exp and in Eqn 4

can be written as :

ασ πσ

α α α α

α α α α

= − =

= + + + + +

= + + + +

( ) ( )

( ) ( ) ( )

( ) ( ) ( )

+− − − −

1

2

1

2

1 1

2

2

1 4 2 9 3 16 4

1 4 2 9 3 16 4

k s n

S z k z z z z

S z k z z z z

s

s

s

,

.

.

L

L

A

A

(a) (b)

Figure 7. Zero-crossings extracted from a microscope image.(a) original image; (b) zero-crossings

S z k a b z a b a b b z

a b a b b

a b a b b b z

S z k a b z a b

s

s

+− −

( ) ( ) ( )( )(( )( )(

( )( ) ) ) ( )

( ) ( )

= + − + − − −

+ − − −

− − − − +

= + − + −−

1

3

1

1 11

2 2 1 1 12

3 3 1 1 2

2 2 1 1 1 13

4 41

5

L A.

22 4 1 12

6 3 4 1 2

5 2 4 1 1 13 4

− −

+ − − −

− − − − +

( )( )(( )( )(

( )( ) ) ) ( )

a b b z

a b a b b

a b a b b b z L A.

Page 7: Recursive Implementation of LoG Filtering

Solving the above equations we can get the coefficients of aa1, a2, b1, b2, b3, in Eqn (6).

Similarly, we can use the same method to obtain co-efficients a4, a5, a6, d1, d2, d3, d4, d5, and d6 in Eqn (6) andEqn (11). In obtaining the coefficients using comparisonmethod, we can use more equations to improve the accuracy.However, the computation cost will also increase.

RECURSIVE IMPLEMENTATION OF LOG FILTERING 65

a b

a b a b b

a b a b b a b a b b b

a b b a b a b b b a b a b b a b

1 1

2 2 1 1 14

3 3 1 1 2 2 2 1 1 1 19

1 1 3 2 2 1 1 1 2 3 3 1 1 2 2 2

− =

− − − =

− − − − − − − =

− − − − − − − − − − − − −

( )( ) ( )( )

( ) ( )( ) (( )

α

α

α

aa b b b b

a b a b b b a b a b b a b a b b b b a b b

a b a b b b a b

1 1 1 1 116

2 2 1 1 1 3 3 3 1 1 2 2 2 1 1 1 1 2 1 1 3

2 2 1 1 1 2 3

− =

− − − − − − − − − − − − − − −

− − − − − −

( )( ) )( )( ) (( ) ( )( ) ) (( )( )( )

α

33 1 1 2 2 2 1 1 1 1 1 125

3 3 1 1 2 2 2 1 1 1 1 3

1 1 3 2 2 1 1 1 2 3

− − − − − − =

− − − − − − − −

− − − − − − − −

(( ) ( )( ) ) )(( ) ( )( ) )

(( ) ( )( )

a b b a b a b b b b b

a b a b b a b a b b b b

a b b a b a b b b a

α

−− − − − − − −

− − − − − − − − − − − − −

− − − − −

(( ) ( )( ) ) )( )( ) (( ) ( )( ) )(

)

b a b b a b a b b b b b

a b a b b b a b a b b a b a b b b b

a b b a

3 1 1 2 2 2 1 1 1 1 1 2

2 2 1 1 1 3 3 3 1 1 2 2 2 1 1 1 1 2

1 1 3 2 bb a b b b a b a b b a b a b b b b b b2 1 1 1 2 3 3 1 1 2 2 2 1 1 1 1 1 1 136( (( ) ) ( ) ( )( ) )( ) )(

− − − − − − − − − − = α

(A.5)