Edge Detections Using Box Spline Tight Frames Ming-Jun Lai 1) Abstract. We present a piece of numerical evidence that box spline tight frames are very useful for edge detection of images. Comparsion with standard wavelet and Laplace methods for edge detection is given to demonstrate the effectiveness of box spline tight frames. 1. Introduction There are many wavelet-frames available in the literature. See, e.g., [Ron and Shen 98a], [Ron and Shen 98b], [Chui, Jetter, and Stöckler 98], [Chui and He 01], [Chui and He 02], [Chui, He and Stöckler 02], and [Daubechies, Han, Ron and Shen 03]. It is interesting to see how well wavelet frames can help for image processing. We choose to study the nonseparable tight frames based on box splines which are recently constructed in [Lai and Stöckler 06]. In their paper, Lai and Stöckler provided a simple recipe for constructing multivariate tight frames. Also, they show that tight frames based on three and four direction box splines can be easily constructed. Several examples of tight frames based on box splines were constructed. More examples of box spline tight frames can be found in [Nam 05]. We implement some of these examples of box spline tight frames and use them for edge detection of images. The purpose of this paper is to report that the box spline tight frames are excellent for edge detection. Comparison with the standard wavelet method and a traditional Laplace method for edge detection is given. The comparison shows the box spline tight frames detect edges much more effectively. We shall use many examples to demonstrate the advantage although we do not know how to prove the phenomenon. One of heuristic arguments is that the filter length of box spline tight framelets is shortest among all refinable functions which have the same regularity as the box spline. Also, the box spline tight frames work well for image denoising. We shall report the advantages elsewhere (cf. [Nam 05]). The paper is organized as follows. We first review the concept of tight-frames and construction of tight frames in the multivariate setting. Especially, we present in detail tight framelets associated with one of box spline functions. These consist of Section 2. In 3, we present our edge detection experiments using the wavelet and wavelet-frame method. The method can be described as follows. At first we 1) Department of Mathematics, The University of Georgia, Athens, GA 30602, mjlai@math.uga.edu. This research is partly supported by the National Scicence Foundation under grant EAR-0327577 and DMS-731807 1
decompose an image into several levels of subimages consisting of a low-pass part and many high-pass parts. Then we set the low-pass part of the image into zero block, and reconstruct the image using the zero block and other high-pass parts at all levels. The reconstructed image is the edges of the image. In addition to our box spline tight frames, we use the tensor products of the well-known Haar wavelet, Daubechies D4 wavelet, and biorthogonal 9/7 wavelets for edge detection. Also, we use a traditional edge detection method called the Laplace method (cf. [Lim 90]) for the comparsion of the effectiveness of all these methods. Many sets of numerical examples are shown. From these experiments, we can conclude that the box spline tight frames work very well. Finally we note that there are many edge detection methods available in the literature and/or on the internet. We have no resoures to compare them all. Interested reader may compare their favorable method against the method of box spline tight frame to see which one works better. 2. Box spline Tight-Frames We begin with the definition of tight-frames based on multiresolution approximation of L 2 (IR 2 ). Given a function ψ L 2 (IR 2 ), we set Let Ψ be a finite subset of L 2 (IR 2 ) and ψ j,k (y) = 2 j ψ(2 j y k). Λ(Ψ) := {ψ j,k, ψ Ψ, j Z, k Z 2 }. Definition 2.1. We say that Λ(Ψ) is a frame if there exist two positive numbers A and B such that A f 2 L 2 (IR 2 ) f, g 2 B f 2 L 2 (IR 2 ) for all f L 2 (IR 2 ). g Λ(Ψ) Definition 2.2. Λ(Ψ) is a tight frame if it is a frame with A = B. In this case, after a renormalization of the g s in Ψ, we have f, g 2 = f 2 L 2 (IR 2 ) for all f L 2 (IR 2 ). g Λ(Ψ) It is known (cf. [Daubechies 92]) that when Λ(Ψ) is a tight frame, any f L 2 (IR 2 ) can be recovered from g Λ(Ψ), i.e. f = g Λ(Ψ) f, g g, f L 2 (IR 2 ). 2
Let φ L 2 (IR 2 ) be a compactly supported refinable function, i.e., ˆφ(ω) = P(ω/2)ˆφ(ω/2) where P(ω) is a trigonometric polynomial in e iω. P is often called the mask of refinable function φ. We look for Q i (trigonometric polynomial) such that P(ω)P(ω + l) + r Q i (ω)q i (ω + l) = i=0 { 1, if l = 0, 0, l {0, 1} 2 π\{0}. (2.1) The conditions (2.1) are called the Unitary Extension Principle (UEP) in [Daubechies, Han, Ron and Shen 03]. With these Q i s we can define wavelet frame generators or framelets ψ (i) defined in terms of the Fourier transform by ˆψ (i) (ω) = Q i (ω/2)ˆφ(ω/2), i = 1,..., r. (2.2) Then, if φ belongs to Lip α with α > 0, Ψ = {ψ (i), i = 1,..., r} generates a tight frame, i.e., Λ(Ψ) is a tight wavelet frame (cf. [Lai and Stöckler 06]). Furthermore, letting Q be a rectangular matrix defined by Q 1 (ξ, η) Q 1 (ξ + π, η) Q 1 (ξ, η + π) Q 1 (ξ + π, η + π) Q Q = 2 (ξ, η) Q 2 (ξ + π, η) Q 2 (ξ, η + π) Q 2 (ξ + π, η + π), Q 3 (ξ, η) Q 3 (ξ + π, η) Q 3 (ξ + π, η) Q 3 (ξ + π, η + π) Q 4 (ξ, η) Q 4 (ξ + π, η) Q 4 (ξ + π, η) Q 4 (ξ + π, η + π) and P = (P(ξ, η), P(ξ + π, η), P(ξ, η + π), P(ξ + π, η + π)) T, (2.1) is simply Q Q = I 4 4 PP T. (2.3) The construction of tight wavelet frames is to find Q satisfying (2.3). It is observed in [Lai and Stöckler 06] that Q can be easily found if P satisfies the QMF condition, i.e., P T P = 1. In this case, Q has a very simple expression. (See [Lai and Stöckler 06] for detail.) Next we note that the mask P of many refinable functions φ satisfies the following sub-qmf condition l {0,1} 2 π P(ω + l) 2 1. (2.4) In particular, for bivariate box splines on three or four direction mesh, the mask will satisfy (2.4). We now borrow a theorem from [Lai and Stöckler 06] to construct tigth framelets. 3
Theorem 2.3. Suppose that P satisfies the sub-qmf condition (2.4). Suppose that there exists Laurent polynomials P 1,..., P N such that m {0,1} 2 P m (ω) 2 + N P i (ω) 2 = 1. (2.5) Then there exist 4 + N compactly supported tight frame generators with wavelet masks Q m, m = 1,..., 4 + N such that P, Q m, m = 1,..., 4 + N satisfy (2.3). Note that the proof of Theorem 2.3 is constructive. In fact, let us include it here for convenience. Proof: We define the combined column vector P = ( P m (2ω); m {0, 1} d, Pi (2ω);, 1 i N) T of size (2 d + N) and the matrix i=1 Q := I (2d +N) (2 d +N) P P. Note that all entries of P and Q are π-periodic. Identity (3.6) implies that Q Q = Q, and this gives P P + Q Q = I (2d +N) (2 d +N). Restricting to the first principle 2 d 2 d blocks in the above matrices, we have P P + Q Q = I 2 d 2d, (3.7) where P = M P was already defined before and Q denotes the first 2 d (2 d + N) block matrix of Q. By (3.2), we have P = M P, and (3.7) yields which is (2.4). Thus we let PP + M Q(M Q) = I 2 d 2 d, Q = M Q. Then the first row [Q 1,..., Q 2 d +N] of Q gives the desired trigonometric functions for compactly supported tight wavelet frame generators. The form Q = [Q i (ω +l)] is inherited from M, since the entries of Q are π-periodic. This completes the proof. The method in the proof leads us to the construction of Q m and hence, tight framelets ψ (m), m = 1,, 4+N. Let us use bivariate box splines to illustrate how to construct ψ (m) s. We first recall the definition of bivariate box spline functions on four direction mesh. Set e 1 = (1, 0), e 2 = (0, 1), e 3 = e 1 + e 2, e 4 = e 1 e 2 to be direction vectors and let D be a set of these vectors with some repetitions. The box spline φ D associated with direction set D may be defined in terms of refinable equation by ˆφ D (ω) = P D ( ω 2 )ˆφ D ( ω 2 ) 4
where P D is the mask associated with φ defined by P D (ω) = 1 + e iξ ω. 2 ξ D See [Chui 88] and [de Boor, Höllig, and Riemenschneider 93] for many properties of box splines. For explicit polynomial representation of bivariate box splines, see [Lai 92]. Note that the mask P D satisfies (2.4). Using the constructive method, we construct these Q m and their associated tight framelets ψ m for many box spline functions on three and four direction meshes. In this paper we mainly present an example of tight framelets based on box spline φ 2211. See [Nam 05] for tight framelets associated with other box spline functions. Example 1. Consider the three directional box spline φ 1,1,1. It is easy to see that 1 l {0,1} 2 π Thus, we let P 1,1,1 (ω + l) 2 = 3 8 1 8 cos(2ω 1) 1 8 cos(2ω 2) 1 8 cos(2ω 1 + 2ω 2 ). P 1 (ω) = 6 8 (1 eiω 1 ), and P 2 (ω) = 2 8 (2 eiω 2 e i(ω 1+ω 2 ) ). Clearly, we have l {0,1} 2 π P 1,1,1 (ω + l) 2 + 2 P i (2ω) 2 = 1. Thus, we can apply the constructive steps in the proof of Theorem 2. to get 6 tight frame masks Q i, i = 1,, 6. We have implemented the constructive steps in a symbolic algebra software Maple and found these Q i s. We note that the constructive procedure in [Chui and He 01] yields 7 tight frame generators. For box spline φ 2211 with D = {e 1, e 1, e 2, e 2, e 3, e 4 }, the graph of φ 2211 is shown in Fig. 1. we have It is easy to check that i=1 ( ) 2 ( ) 2 ( ) ( 1 + e1 1 + e2 1 + e3 1 + e4 P 2211 (ω) = 2 2 2 2 ). 1 l {0,1} 2 π P 2211 (ω + l) 2 = 4 P i (ω) 2, i=1 5
Fig. 1. Box spline φ 2211 where P 1 (ω) = 1886 224 (1 e4iω 1 ), P 2 (ω) = 3 14 64 + 40531922 25472 ( + 3 14 32 e2iω 2 3 14 + 64 ) 40531922 25472 e 4iω 2 P 3 (ω) = 7 2 64 + 7 2 64 e4iω 2 2 224 ei(4ω 1+2ω 2 ) 3 2 14 e2i(ω 1+ω 2 ), and P 4 (ω) = 398 398 112 + 112 e4iω 1 3135 398 178304 e2iω 1 7 398 25472 ei(2ω 1+4ω 2 ). Hence, we will have 8 tight frame generators using the constructive steps in the proof of Theorem 2.3. These 8 tight frames ψ m which can be expressed in terms of Fourier transform by ψ m (ω) = Q m (ω/2) φ 2211 (ω/2), where Q m, m = 1,, 8 are given in terms of coefficient matrix as follows: Q 1 = 6
8 6 c jk e ijω e ikξ with j=0 k=0 [c jk ] 0 j 8 0 k 6 = 1 2048 0 1 2 2 2 1 0 1 4 7 8 7 4 1 2 12 22 24 22 12 2 7 28 49 56 49 28 7 12 38 64 948 64 38 12 7 28 49 56 49 28 7 2 12 22 24 22 12 2 1 4 7 8 7 4 1 0 1 2 2 2 1 0, 6 6 Q 2 = c jk e ijω e ikξ with j=0 k=0 [c jk ] 0 j 6 0 k 6 0 1 2 2 2 1 0 1 4 7 8 7 4 1 = 1 2 7 12 14 12 7 2 2 8 14 240 14 8 2, 512 2 7 12 14 12 7 2 1 4 7 8 7 4 1 0 1 2 2 2 1 0 8 8 Q 3 = c jk e ijω e ikξ with j=0 k=0 [c jk ] 0 j 8 0 k 8 0 0 0 1 2 1 0 0 0 0 0 1 4 6 4 1 0 0 0 1 4 11 16 11 4 1 0 = 1 1 4 11 24 32 24 11 4 1 2 6 16 32 472 32 16 6 2, 1024 1 4 11 24 32 24 11 4 1 0 1 4 11 16 11 4 1 0 0 0 1 4 6 4 1 0 0 0 0 0 1 2 1 0 0 0 7
Q 4 = Q 5 = 6 j=0 k=0 8 j=0 k=0 [c jk ] 0 j 8 0 k 8 and Q 6 = 8 c jk e ijω e ikξ with [c jk ] 0 j 6 0 k 8 0 1 2 7 12 7 2 1 0 1 4 12 28 38 28 12 4 1 = 1 2 7 22 49 64 49 22 7 2 2 8 24 56 948 56 24 8 2, 2048 2 7 22 49 64 49 22 7 2 1 4 12 28 38 28 12 4 1 0 1 2 7 12 7 2 1 0 8 c jk e ijω e ikξ with 0 49 98 49 0 49 98 49 0 49 196 294 196 98 196 294 196 49 98 294 392 198 4 198 392 294 98 = 2 49 196 198 188 478 188 198 196 49 0 49 94 529 772 529 94 49 0, 28672 0 0 98 392 588 392 98 0 0 0 0 4 108 208 108 4 0 0 0 0 2 8 12 8 2 0 0 0 0 0 2 4 2 0 0 0 8 j=0 k=0 8 c jk e ijω e ikξ with [c jk ] 0 j 8 = 398 0 k 8 11411456 0 1592 3184 1592 0 0 0 0 0 1592 6368 9552 6368 1592 0 0 0 0 3184 6417 6466 6417 3184 49 98 49 0 1543 6172 9258 6172 1592 196 294 196 49 6270 15626 18712 15626 6368 294 392 294 98. 1543 6172 9258 6172 1592 196 294 196 49 3184 6417 6466 6417 3184 49 98 49 0 1592 6368 9552 6368 1592 0 0 0 0 0 1592 3184 1592 0 0 0 0 0 Q 7 has a complicated expression which is omitted here just for simplicity. (The authors are willing to provide its numerical values upon request.) Finally, we have 8
Q 8 = 8 j=0 k=0 5 c jk e ijω e ikξ with [c jk ] 0 j 8 0 k 5 = 1886 14336 0 1 2 1 0 1 4 6 4 1 2 6 8 6 2 1 4 6 4 1 0 0 0 0 0. 1 4 6 4 1 2 6 8 6 2 1 4 6 4 1 0 1 2 1 0 These coefficient matrices are high-pass filters associated with low-pass filter P 2211. They satisfy (2.3) which is an exact reconstruction condition. The graphs of these eight tight framelets are as shown in Fig. 2 5. Fig. 2. Box spline tight framelet ψ 1 and ψ 2 3. Numerical Experiments We shall use the tight frame based on box spline B 2211 for edge detection in the following experiments. Many other box spline tight frames have the similar effectiveness. To comparison for the effectiveness of edge detection, we also use tensor products of Haar wavelet, Daubechies D4 wavelet, and biorthogonal 9/7 wavelet which is famous for its application in FBI finger print compression. In addition, we use the so-called Laplace method (cf. [Lim 92, p.486]), a traditional method for edge detection. The wavelet method for edge detection can described as follows. We use 9
Fig. 3. Box spline tight framelet ψ3 and ψ4 Fig. 4. Box spline tight framelet ψ5 and ψ6 a wavelet or wavelet-frame to decompose an image into many levels of subimages which consist of a low-pass part and several high-pass parts of the image. Setting the low-pass part to be zero submatrix and using the high-pass parts, we reconstruct the image back. The reconstructed image is the edges of the image. For box spline tight-frame, we only do one level of decomposition. For other standard wavelets (Haar, Daubechies, biorthogonal 9/7 wavelets), we do 1, 2, 3 levels of decomposition dependent on the images. For some images, e.g. the finger print image, we must do 3 levels of decomposition while for many other images, one or two levels of decomposition are enough. We choose the best edge representation among three levels of decompositions to present in the report. To present the edges clearly, we normalize the reconstructed image into the standard grey level between 0 to 255 and use two thresholds 245 and 250 to divide 10
Fig. 5. Box spline tight framelet ψ 7 and ψ 8 the pixel values into two major groups. That is, if a pixel value is bigger than 250, it is set to be 255. If a pixel value is less than 245, it is set to be zero. Narrowing the two thresholds would either loss many detailed edges or thicken the edges. Also, all reconstructed edges have been treated for isolated dots. That is, any isolated nonzero pixel value is removed. The experiments consist of ten different images. For each image, we use 3 standard wavelets, box spline tight frame based on φ 2211, and the Laplace method to detect edges. The edges are shown in Figs 6 35. Among the ten images, box spline tight frame detects edge more effectively in all images, comparing to the edges detected by tensor products of three wavelets. It detects edge better than the Laplace method in many images, especially when edges are curve. References 1. C. de Boor, K. Hölig, S. Riememschneider, Box Splines, Springer Verlag, New York, 1993. 2. C. K. Chui, Multivariate Splines, SIAM Publications, Philedalphia, 1988. 3. C. K. Chui and W. He, Construction of multivariate tight frames via Kronecter products, Appl. Comp. Harmonic Anal. 11(2001), 305 312. 4. C. K. Chui and W. He, Compactly supported tight frames associated with refinable functions, Appl. Comp. Harmonic Anal. 8(2000), 293 319. 5. C. K. Chui and W. He, Construction of multivariate tight fra mes via Kronecker products, Appl. Comp. Harmonic Anal. 11(2001), 305 312. 6. C. K. Chui, W. He, and J. Stöckler, Compactly supported tight and sibling frames with maximum vanishing moments, Appl. Comp. Harmonic Anal., 13 (2002), 224 262 7. C. K. Chui, K. Jetter, J. Stöckler, Wavelets and frames on the four-directional 11
mesh. in Wavelets: theory, algorithms, and applications, Academic Press, San Diego, CA, 1994, pp. 213 230. 8. I. Daubechies, Ten Lectures on Wavelets, SIAM Publications, Philedalphia, 1992. 9. I. Daubechies, B. Han, A. Ron, Z. W. Shen, Framelets: MRA-based constructions of wavelet frames, Appl. Comp. Harmonic Anal., 14 (2003), 1 46. 10. M. J. Lai, Fortran subroutines for B-nets of box splines on three and four directional meshes, Numerical Algorithm, 2(1992), 33 38. 11. M. J. Lai and K. Nam, Image de-noising by using box spline tight-frames, manuscript, 2004. 12. M. J. Lai and J. Stöckler, Construction of Compactly Supported Tight Frames, Applied Comput. Harm. Analysis 2006. See www.math.uga.edu/ mjlai/pub.html for a copy. 13. J. S. Lim, Two-dimension Signal and Image Processing, Prentice Hall, New Jersey, 1990. 14. K. Nam, Box Spline Tight Framelets for Image Processing, Ph.D. Dissertation, University of Georgia, under preparation, 2005. 15. A. Ron and Z. W. Shen, Compactly supported tight affine spline frames in L 2 (R d ), Math. Comp. 67(1998), 191 207. 16. A. Ron and Z. W. Shen, Construction of compactly supported affine frames in L 2 (R d ), in Advances in Wavelets, K. S. Lau (ed.), Springer-Verlag, New York, 1998, 27 49. 12
Fig. 6. The original image and edges detected using Haar wavelet Fig. 7. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 8. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 13
Fig. 9. The original image and edges detected using Haar wavelet Fig. 10. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 11. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 14
Fig. 12. The original image and edges detected using Haar wavelet Fig. 13. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 14. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 15
Fig. 15. The original image and edges detected using Haar wavelet Fig. 16. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 17. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 16
Fig. 18. The original image and edges detected using Haar wavelet Fig. 19. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 20. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 17
Fig. 21. The original image and edges detected using Haar wavelet Fig. 22. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 23. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 18
Fig. 24. The original image and edges detected using Haar wavelet Fig. 25. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 26. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 19
Fig. 27. The original image and edges detected using Haar wavelet Fig. 28. The edges detected using box spline tight frame (left) and Daubechies wavelet (right) Fig. 29. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 20
Fig. 30. The original image and edges detected using Haar wavelet Fig. 31. The edges detected using box spline tight frame(left) and Daubechies wavelet(right) Fig. 32. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 21
Fig. 33. The original image and edges detected using Haar wavelet Fig. 34. The edges detected using box spline tight frame(left) and Daubechies wavelet(right) Fig. 35. The edges detected by the Laplace method (left) and the biorthogonal 9/7 wavelet(right) 22