Circulant Matrix Representation of Feature Masks and Its Applications

Circulant Matrix Representation of Feature Masks and Its Applications

ADVANCES IN IMAGING AND ELECTRON PHYSICS, VOL. 134 Circulant Matrix Representation of Feature Masks and Its Applications RAE-HONG PARK AND BYUNG HO C...

939KB Sizes 6 Downloads 59 Views

ADVANCES IN IMAGING AND ELECTRON PHYSICS, VOL. 134

Circulant Matrix Representation of Feature Masks and Its Applications RAE-HONG PARK AND BYUNG HO CHA Department of Electronic Engineering, Sogang University, Seoul 100–611, Korea

I. Introduction . . . . . . . . . . . . . . . . . . II. Mathematical Preliminaries. . . . . . . . . . . . . A. Vector-Matrix Representation . . . . . . . . . . 1. Background of Vector-Matrix Representation . . . 2. Special Matrices . . . . . . . . . . . . . . B. DFT Domain Interpretation . . . . . . . . . . . 1. Circulant Matrix Interpretation in the DFT Domain 2. Eigenvalue Analysis in the DFT Domain . . . . . C. Orthogonal Transforms . . . . . . . . . . . . . D. Summary . . . . . . . . . . . . . . . . . . III. Edge and Feature Detection in the DFT Domain . . . . A. Edge Detection . . . . . . . . . . . . . . . . 1. Compass Gradient Edge Masks and Their Eigenvalue 2. Frei–Chen Edge Masks . . . . . . . . . . . . 3. Complex-Valued Edge Masks . . . . . . . . . B. Feature Detection . . . . . . . . . . . . . . . 1. Compass Roof Edge Masks . . . . . . . . . . 2. Frei–Chen Line Masks . . . . . . . . . . . . 3. Complex-Valued Feature Masks . . . . . . . . C. Summary . . . . . . . . . . . . . . . . . . IV. Advanced Topics . . . . . . . . . . . . . . . . A. Orthogonal Transform-Based Interpretation . . . . . 1. DCT and DST Interpretation . . . . . . . . . 2. DHT Interpretation . . . . . . . . . . . . . 3. KLT Interpretation . . . . . . . . . . . . . B. Application to Other Fields . . . . . . . . . . . 1. Optical Control System . . . . . . . . . . . . 2. Information System . . . . . . . . . . . . . C. Results and Discussions . . . . . . . . . . . . D. Summary . . . . . . . . . . . . . . . . . . V. Conclusions . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3 4 4 6 8 8 10 11 12 12 12 13 25 33 35 35 36 37 43 43 43 44 48 54 59 59 61 63 65 65 67

1 ISSN 1076-5670/05 DOI: 10.1016/S1076-5670(04)34001-2

Copyright 2005, Elsevier Inc. All rights reserved.

2

PARK AND CHA

I. Introduction In this article, we present a circulant matrix interpretation of the edge and feature detection of images in the frequency domain and its further applications in various fields. This article presents a unified framework of previously published papers on the circulant matrix representation of edge detection and feature detection. We have reviewed the literature and unified the contexts based on a common vector-matrix representation of the circulant matrix. The spatial-domain relationship between the circulant matrix and the convolution in the linear time invariant (LTI) system is presented as a key idea of this work. Using the input-output relationship, we have presented the LTI system in vector-matrix form using a circulant matrix. The circulant matrix has several useful properties in the discrete Fourier transform (DFT) domain and it is related to edge detection by compass gradient masks and Frei–Chen masks. We have presented the eigenvalue interpretation in the one-dimensional (1D) DFT domain, which makes the analysis of the compass gradient masks and Frei–Chen masks in the DFT domain simple. Similarly, feature masks are analyzed in the DFT domain. As an extension to the feature masks, the discrete cosine transform (DCT), discrete sine transform (DST), and discrete Hartley transform (DHT) masks are interpreted in the context of Frei–Chen masks. Also, the DHT interpretation using the singular value decomposition (SVD), based on the Karhunen–Loeve transform (KLT), is introduced by the circulant symmetric matrix. The rest of this article is structured as follows: Section II reviews the basic matrix theory, especially special matrices such as circulant and circulant symmetric matrices, and a general case of orthogonal transforms. We explain the relationship between the convolution operation in the LTI system and the Toeplitz matrix. According to the properties of a circulant matrix, we can use eigenvalue analysis and diagonalization property in the DFT domain (Davis, 1994; Gray, 2000; Park and Choi, 1989, 1992). The circulant symmetric matrix also is related to representation of covariance matrices (Lay, 2003; Uenohara and Kanade, 1998). In Section III, edge or line detection, one of fundamental steps in computer vision and pattern analysis, is presented, where edges or lines as features represent abrupt discontinuities in gray level, color, texture, motion, and so on (Gonzalez and Wintz, 1977; Jain, 1989; Rosenfeld and Kak, 1982). Twodimensional (2D) 3  3 compass gradient masks such as the Prewitt, Sobel, and Kirsch masks, each of which consists of a set of eight directional edge components, have been commonly used in edge detection for their simplicity (Park and Choi, 1989, 1992; Yu, 1983). For a given pixel, at which 3  3

CIRCULANT MATRIX REPRESENTATION OF MASKS

3

masks are centered, the relationship between eight intensity values of neighboring pixels and their kth (0  k  8) directional edge strength values are presented. The relationship can be expressed in vector-matrix form, where neighboring pixels are defined as the pixels covered by the 3  3 masks and diagonalized by the DFT matrix. In addition, edge detection by the orthogonal set of the 3  3 Frei–Chen masks is proposed based on a vector space approach (Frei and Chen, 1977; Park, 1990, 1998a; Park and Choi, 1990). Edge detection using the Frei–Chen masks is achieved by mapping the intensity vector using a linear transformation and then detecting edges based on the angle between the nine-dimensional (9D) intensity vector and its projection onto the edge subspace (Park, 1990). The 1D DFT domain interpretation of 3  3 compass gradient edge masks can be extended to complex-valued mask cases, making use of the circularity of the complexvalued weight matrix. Complex-valued compass gradient Prewitt and Sobel edge masks are expressed, in the 1D spatial and frequency domains, in terms of the two types of real-valued Frei–Chen masks (Park, 1998b, 1999a). The relationship between the compass roof masks and the Frei–Chen line masks also is presented (Park, 1998a). Generalization to analysis of N-directional complex-valued feature masks is presented (Park, 2002c). Simulation results with the synthetic image show the validity of the proposed interpretation of the edge and feature masks. In Section IV, we can interpret four edge masks derived from the eightpoint DHT. The DHT is real valued and computationally fast; thus it has been applied to various signal processing and interpretation applications. Basis functions of the eight-point DHT formulate the 3  3 DHT masks that are closely related to the Frei–Chen masks (Bracewell, 1986; Park et al., 1998). Similarly, the DCT and DST edge masks can be derived from the eight-point DCT and DST basis functions, respectively (Park, 1999b). We present DCT and DST basis functions first and then DHT basis functions. In addition, DHT basis functions are closely connected with KLT basis functions in advanced applications (Park, 2000, 2002a,b). Simulations with the synthetic and real (Lena) images show the validity of the proposed interpretation of various edge and feature masks. Section V concludes the work.

II. Mathematical Preliminaries This section reviews the matrix representation of a general matrix and special kinds of matrices such as circulant matrices and symmetric circulant matrices. Properties of diagonalization and orthogonality of these matrices

4

PARK AND CHA

in the DFT domain are explained in detail. Finally, we present N-point orthogonal transforms. A. Vector-Matrix Representation This section describes a general representation of a matrix and matrix properties, such as transpose, inverse, symmetry, diagonalization, and orthogonality. In addition, special matrices such as circulant matrices and symmetric circulant matrices are explained as mathematical tools for signal processing, especially related to the convolution in the LTI system. 1. Background of Vector-Matrix Representation A matrix is a concise and useful way of representing a linear transformation. The transformations given by the equations g1 ¼ a11 f1 þ a12 f2 þ a13 f3 þ . . . þ a1N fN g2 ¼ a21 f1 þ a22 f2 þ a23 f3 þ . . . þ a2N fN g3 ¼ a31 f1 þ a32 f2 þ a33 f3 þ . . . þ a3N fN .. . gN ¼ aN1 f1 þ aN2 f2 þ aN3 f3 þ . . . þ aNN fN are represented in vector-matrix form by 2 3 2 g1 a11 a12 a13 6 g2 7 6 a21 a22 a23 6 7 6 6 g3 7 6 a31 a32 a33 6 7¼6 6 .. 7 6 .. .. .. 4 . 5 4 . . . gN

aN1

aN2

aN3

... ... ...

a1N a2N a3N .. .

. . . aNN

32

f1 7 6 f2 76 7 6 f3 76 76 .. 54 .

ð1Þ

3 7 7 7 7: 7 5

ð2Þ

fN

Eq. (2) can be expressed simply by g ¼ Af;

ð3Þ

which represents the input-output relationship of the linear system that will be explained in detail in Section III. Note that A denotes the linear system transformation with f (g) denoting the input (output) of the linear system. In Eq. (3), the N  N matrix A has several useful properties under the proper constraints. The transpose of the N  N matrix A is denoted by At. The ith row of A is equal to the ith column of At, i.e., ðAt Þij ¼ Aji :

5

CIRCULANT MATRIX REPRESENTATION OF MASKS

2

a11 6 a21 6 6 A ¼ 6 a31 6 .. 4 .

a12 a22 a32 .. .

a13 a23 a33 .. .

... ... ...

a1N a2N a3N .. .

aN1

aN2

aN3

...

aNN

3

2

a11 7 6 a12 7 6 7 6 7 and At ¼ 6 a13 7 6 .. 5 4 .

a21 a22 a23 .. .

a31 a32 a33 .. .

... ... ...

aN1 aN2 aN3 .. .

a1N

a2N

a3N

...

aNN

3 7 7 7 7 7 5

ð4Þ where Aij signifies the (i, j)th element of matrix A. If the N  N matrix A satisfies At ¼ A, the matrix A is called a symmetric matrix. The inverse of the N  N matrix A is denoted by A1. If there exists an N  N matrix A1 such that A1 A ¼ IN and AA1 ¼ IN , the N  N matrix A is invertible, where IN denotes the N  N identity matrix. Let A ¼ ½a0 a1 . . . aN1 represent the N  N matrix, with the term in brackets denoting the component of the matrix. Then the orthonormal matrix A satisfies 2 t 3 2 3 a0 1 0 ... 0 6 at 7 60 1 ... 07 6 1 7 ¼ IN At A ¼ 6 . 7½ a0 a1 . . . aN1 ¼ 6 ð5Þ .. 7 4 ... ... 4 .. 5 .5 0 0 ... 1 atN1 where At A ¼ IN and At ¼ A1 , i.e., ( 1 for i ¼ j t : ai aj ¼ 0 otherwise

ð6Þ

The N  N matrix A is diagonalizable if and only if the matrix A has n linearly independent eigenvectors. In fact, A ¼ PDP1 , with a diagonal matrix D, if and only if the columns of P are n linearly independent eigenvectors of A. In this case, the diagonal entries of D are eigenvalues of A that correspond, respectively, to the eigenvectors in P. According to the eigenvalue decomposition theorem, the input-output equation g ¼ Af in Eq. (3) can be written by g ¼ PDP1 f: Multiplying both sides by P

1

ð7Þ

gives

P1 g ¼ DP1 f:

ð8Þ

0

With g0 ¼ P1 g and f ¼ P1 f, Eq. 8 can be rewritten as g0 ¼ Df 0

ð9Þ

where g0 and f0 are transforms of g and f, respectively. Transformation

6

PARK AND CHA

reduces the number of coeYcients, providing the simple representation of a system in the transform domain. 2. Special Matrices As shown in Figure 1, the input-output relationship is given by g ¼ Hf

ð10Þ

where f and g are N-dimensional (N-D) column vectors and the matrix H denotes a linear transformation of the LTI system. H is linear if H½k1 f 1 þ k2 f 2 ¼ k1 Hf 1 þ k2 Hf 2

ð11Þ

where k1 and k2 are constants and f1 and f2 are any two inputs. If we assume k1 ¼ k2 ¼ 1, we can write H½f 1 þ f 2 ¼ Hf 1 þ Hf 2 ;

ð12Þ

which is called the additivity. If we assume k2 ¼ 0, we can write H ½k1 f 1 ¼ k1 Hf 1 ;

ð13Þ

which is called the homogeneity. The input-output relationship is said to be position-invariant if gðx  x0 Þ ¼ H½ f ðx  x0 Þ

ð14Þ

where x represents an independent position variable, H[ ] denotes the linear input-output transformation, and x0 denotes a constant. In a positioninvariant system, the shifted input gives the shifted output. The discrete convolution formulation is based on the assumption that the sampled functions are periodic with a period N. Let f(x), g(x), and h(x) are an input, output, and impulse response of the linear position-invariant system with the length equal to Nf and Nh, respectively. Then overlap in the individual periods of the resulting convolution is avoided by choosing N Nf þ Nh  1, with the resulting length equal to N by zero-padding. Therefore its convolution is given by gðxÞ ¼

N 1 X

f ðnÞhðx  nÞ

n¼0

where x ¼ 0; 1; 2; . . . ; N  1.

Figure 1. Model of the linear system.

ð15Þ

7

CIRCULANT MATRIX REPRESENTATION OF MASKS

If Eq. (15) is interpreted as the linear position-invariant system, we define linear convolution. Then the matrix H is represented by 3 2 h1 h2 h3 h4 h5 . . . hNþ1 h0 6 h1 h0 h1 h2 h3 h4 . . . hNþ2 7 7 6 6 h2 h1 h0 h1 h2 h3 . . . hNþ3 7 7 6 6 h3 h2 h1 h0 h1 h2 . . . hNþ4 7 7 6 ð16Þ H ¼ 6 h4 h3 h2 h1 h0 h1 . . . hNþ5 7 7 6 7 6 h5 h4 h3 h2 h1 h0 . . . hNþ6 7 6 6 .. .. 7 .. .. .. .. .. 4 . . 5 . . . . . hN1

hN2

hN3

hN4

hN5

hN6

...

h0

where H is a Toeplitz matrix (constant value along each diagonal) and hi ; N þ 1  i  N  1, is an element of the Toeplitz matrix. The system is completely defined by the 2N  1 impulse response coeYcients. As an extension, if two convolving sequences are periodic, then their convolution is also periodic (i.e., circular convolution). In this case, we define circular convolution and the matrix H is represented by 3 2 h0 hN1 hN2 hN3 hN4 hN5 . . . h1 6 h1 h0 hN1 hN2 hN3 hN4 . . . h2 7 7 6 6 h2 h1 h0 hN1 hN2 hN3 . . . h3 7 7 6 6 h3 h2 h1 h0 hN1 hN2 . . . h4 7 7 6 ð17Þ H ¼ 6 h4 h3 h2 h1 h0 hN1 . . . h5 7 7 6 7 6 h5 h4 h3 h2 h1 h0 . . . h6 7 6 6 .. .. 7 .. .. .. .. .. 4 . . 5 . . . . . hN1

hN2

hN3

hN4

hN5

hN6

. . . h0

where H is a circulant matrix and hi ; 0  i  N  1, is an element of the circulant matrix. In the circulant matrix, each column is obtained by a circulant shift of the preceding column, and the first column is a circulant shift of the last column. That is, the elements of each row of H are identical to those of the previous row, but are moved one position to the right and wrapped around. The circulant matrix is evidently determined by the first row (or column) (Davis, 1994; Gray, 2000). Let the matrix X ¼ ½x0 x1 . . . xN1 be constructed by the column vector xi ; 0  i  N  1. Because of the circular nature of X and definition of the N  N inner product matrix, the matrix V defined by 2 t 3 x0 6 xt 7 6 1 7 6 t 7 t x 7 V¼XX¼6 6 2 7½ x0 x1 x2 . . . xN1 6 .. 7 4 . 5 xtN1

8

PARK AND CHA

2

xt0 x0 6 xt x 6 1 0 6 t x x ¼6 6 2 0 6 .. 4 . xtN1 x0

xt0 x1 xt1 x1 xt2 x1 .. . xtN1 x1

3 xt0 xN1 xt1 xN1 7 7 7 t x2 xN1 7 7 7 .. 5 . . . . xtN1 xN1

xt0 x2 xt1 x2 xt2 x2 .. . xtN1 x2

... ... ...

ð18Þ

has the following properties: (1) Toeplitz (constant value along each diagonal), (2) symmetric (V ¼ Vt ), (3) circulant (each row is a circular shift of the previous one), and (4) real. This matrix V is defined as the circulant symmetric matrix (Lay, 2003; Uenohara and Kanade, 1998). B. DFT Domain Interpretation In this section, first, we present the property of an N  N circulant matrix in the DFT domain. Second, we introduce eigenvalue computation of the N  N circulant matrix in the DFT domain. 1. Circulant Matrix Interpretation in the DFT Domain For the circulant matrix H, hi has the property of periodicity, that is, hi ¼< hNþi >N , where < >N denotes the modulo-N operation. According to the property of a circulant matrix, the matrix multiplication is satisfied (Gonzalez and Wintz, 1977): H wk ¼ rk wk

ð19Þ

where 2 6 6 6 6 6 6 6 H¼6 6 6 6 6 6 6 4

3

h0

hN1

hN2

hN3

hN4

hN5

. . . h1

h1 h2

h0 h1

hN1 h0

hN2 hN1

hN3 hN2

hN4 hN3

h3 h4

h2 h3

h1 h2

h0 h1

hN1 h0

hN2 hN1

h5 .. .

h4 .. .

h3 .. .

h2 .. .

h1 .. .

h0 .. .

. . . h2 7 7 7 . . . h3 7 7 . . . h4 7 7 7 . . . h5 7 7 . . . h6 7 7 7 .. 7 . 5

hN1

hN2

hN3

hN4

hN5

hN6

. . . h0







2p 2p 2p rk ¼ h0 þ hN1 exp j k þ hN2 exp j 2k þ . . . þ h1 exp j ðN  1Þk N N N

ð20Þ

CIRCULANT MATRIX REPRESENTATION OF MASKS





2p wk ¼ 1 exp j k N



9





t pffiffiffiffiffiffiffi 2p 2p exp j 2k . . . exp j ðN  1Þk ð j ¼ 1Þ: ð21Þ N N

This expression indicates that wk is an eigenvector of the circulant matrix H and rk is its corresponding eigenvalue. Suppose that we form an N  N matrix W by using the N eigenvectors of H as columns; that is, W ¼ ½ w0

w1

w2

. . . wN1

    exp j 2p ... exp j 2p N N 2  2p   2p  61 exp j N 2 exp j N 4 ... 6 ¼6 . . . 6. . . 4.  2p .   2p .  1 exp j N ðN  1Þ exp j N 2ðN  1Þ . . . 2

1

  3 exp j 2p N ðN  1Þ  7 exp j 2p N 2ðN  1Þ 7 7: .. 7 .  5 2 2p exp j N ðN  1Þ ð22Þ

The (k, i)th element of W, denoted as Wki ; 0  k; i  N  1, is given by

2p ð23Þ Wki ¼ exp j ki : N Due to the orthogonality property of the complex exponential, the (k, i)th element of the inverse matrix W1, is given by

1 2p 1 ð24Þ Wki ¼ exp j ki : N N It can be verified by using Eqs. (23) and (24): WW1 ¼ W1 W ¼ IN :

ð25Þ

Therefore, the circulant matrix H can be diagonalized by using W and W1, H ¼ WDW1 or D ¼ W1 HW

ð26Þ

where D is a diagonal matrix whose diagonal elements Dkk are the eigenvalues of H; i.e., Dkk ¼ rk . Accordingly, the diagonal elements of Dkk can be obtained from Eq. (21) by using expð jð2p=NÞðN  lÞkÞ ¼ expðjð2p=NÞlkÞ:



2p 2p Dkk ¼ rk ¼ h0 þ hN1 exp j k þ hN2 exp j 2k N N

2p þ . . . þ h1 exp j ðN  1Þk N

10

PARK AND CHA





2p 2p ¼ h0 þ h1 exp j k þ h2 exp j 2k N N

2p þ . . . þ hN1 exp j ðN  1Þk N

N 1 X 2p ¼ hi exp j ki : N i¼0

ð27Þ

According to Eq. (27), the eigenvalue rk, the (k, k)th element of a diagonal matrix D, is the kth coeYcient of the 1D DFT of the first column vector h ¼ ½h0 h1 h2 . . . hN1 t . 2. Eigenvalue Analysis in the DFT Domain In this section, we explain two methods for calculating eigenvalues of the circulant matrix H. First, any circulant matrix H of size N  N can be written as H ¼ c0 IN þ c1 J þ c2 J2 þ . . . þ cN1 JN1

ð28Þ

where the coeYcients (c0 ; c1 ; c2 ; . . . ; cN1 ) give the first row of the circulant matrix H, and J is the circulant matrix with first row given by (0, 1, 0, . . ., 0). Since JN ¼ IN , the Nth principal roots of unity are the eigenvalues of the permutation matrix J, i.e.,

2p ð29Þ Wk ¼ exp j k ; 0  n  N  1: N Then the eigenvalues of the circulant matrix H can be rewritten as (Deo and Krishnamoorthy, 1989) rk ¼ c0 þ c1 Wk þ c2 Wk2 þ . . . þ cN1 WkN1 :

ð30Þ

In other words, the eigenvalues of H could be obtained by the above polynomial from the principal roots of unity. The relationship given by Eq. (27) implies the fact that rk is the kth coeYcient of the 1D DFT of the first column of H. In a second method to calculate eigenvalue of the circulant matrix H, we should solve the characteristic equation detðsIN  HÞ ¼ 0

ð31Þ

where det( ) signifies the determinant of a matrix and s is the eigenvalue of a circulant matrix H. If a circulant matrix H is expressed as " # A D H¼ ð32Þ C B

CIRCULANT MATRIX REPRESENTATION OF MASKS

with a nonsingular matrix A, its determinant can be obtained as " # A D det ¼ det A det½B  CA1 D : C B

11

ð33Þ

C. Orthogonal Transforms A 1D signal can be represented by orthogonal series of basis functions. For a 1D sequence g(n), a general 1D N-point orthogonal transform is represented by f ðkÞ ¼

N 1 X

gðiÞaðk; iÞ;

0kN 1

i¼0

gðiÞ ¼

N 1 X

ð34Þ 

f ðkÞa ðk; iÞ;

0  i  N  1:

k¼0

Eq. (34) is rewritten in vector-matrix form: f ¼ Ag g ¼ ðA Þt f

ð35Þ

t

where A1 ¼ ðA Þ and this property is called unitary. We briefly explain the unitary property of orthogonal transforms such as the DFT, DCT, DST, and DHT and their interrelationships. General cases of the N-point transforms are presented, which will help the reader to understand better the next sections. For a real-valued sequence gðiÞ; 0  i  N  1, the N-point DCT C(k) and DST S(k) are defined by

N 1 X 2p CðkÞ ¼ ki ; 0  k  N  1 gðiÞcos N i¼0 ð36Þ

N1 X 2p SðkÞ ¼ ki ; 0  k  N  1 gðiÞsin N i¼0 respectively. The DCT and DST of a real-valued sequence are also real valued. Their computation does not involve complex-valued operations, which is a potential advantage if the transform is to be explicitly computed. The DHT and DFT are explicitly related to the DCT and DST. By definition, the DHT H(k) is a sum of the DCT C(k) and DST S(k) (Bracewell, 1986):

12

PARK AND CHA

HðkÞ ¼

N 1 X i¼0

gðiÞ cas

2p ki N

¼ CðkÞ þ SðkÞ;

0k N 1

ð37Þ

where casy ¼ cosy þ siny. The real and imaginary parts of the DFT F(k) are equal to the DCT C(k) and DST S(k):

N 1 X 2p FðkÞ ¼ gðiÞexp j ki ¼ CðkÞ  jSðkÞ; 0  k  N  1: ð38Þ N i¼0

D. Summary The material presented in this section is applied to edge and feature detection in Section III and to orthogonal transforms in Section IV. To unify various representations, we have introduced the circulant matrix that has been given by the input-output relationship in vector-matrix form. In the DFT domain, eigenvector and eigenvalue analysis has been presented through diagonalization of the circulant matrix. This approach is applied to the 1D DFT interpretation of compass gradient masks and Frei–Chen masks in Section III. The orthogonal transforms and circulant symmetric matrix, in the context of Frei–Chen masks, gives a new interpretation of feature masks, which is applied to various fields in Section IV.

III. Edge and Feature Detection in the DFT Domain In Section II, we reviewed the property of the circulant matrix in terms of the DFT. This section focuses on 1D DFT domain interpretation of edge and feature detection using compass gradient operators and Frei–Chen orthogonal masks, which provides a basis of understanding of the DCT, DST, and DHT masks in Section IV. A. Edge Detection We focus on the edge detection of compass gradient and Frei–Chen masks. In addition, making use of the circularity of the weight matrix, we generalize the interpretation in the context of compass gradient edge masks to complex-valued mask cases.

CIRCULANT MATRIX REPRESENTATION OF MASKS

13

1. Compass Gradient Edge Masks and Their Eigenvalue Interpretation 2D 3  3 Compass gradient masks, whose sums of the weights are zero, are commonly used in edge detection. They usually have eight directional components as shown in Figure 2 (Robinson, 1977). The neighboring pixels are defined as the pixels that are covered by a 3  3 mask except for the center

Figure 2. 3  3 Compass gradient masks (Sobel, Prewitt, and Kirsch masks).

14

PARK AND CHA

pixel (i, j). The intensity values of neighboring pixels are represented by p0 ; p1 ; . . . ; p7 in the clockwise direction from the top left pixel, as shown in Figure 3. Let hi ði ¼ 0; 1; . . . ; 7Þ be each weight of the north (N) directional mask of 2D Sobel, Prewitt, and Kirsch masks, as shown in Figure 4, except for the center weight, which is zero. Each weight of seven other directional (NW, W, SW, S, SE, E, and NE) masks can be obtained by rotating each mask in the counterclockwise direction (Park and Choi, 1989). The edge value of each directional mask, which is the sum of the multiplication of the weight of each directional mask and the intensity value of the corresponding neighboring pixel, can be represented by a matrix multiplication 32 3 2 3 2 h0 h7 h6 h5 h4 h3 h2 h1 p0 e0 6 e 1 7 6 h1 h0 h7 h6 h5 h4 h3 h2 7 6 p1 7 76 7 6 7 6 6 e 2 7 6 h2 h1 h0 h7 h6 h5 h4 h3 7 6 p2 7 76 7 6 7 6 6 e 3 7 6 h3 h2 h1 h0 h7 h6 h5 h4 7 6 p3 7 7 76 7 ¼ Hp 6 6 ð39Þ e¼6 7¼6 76 7 6 e 4 7 6 h4 h3 h2 h1 h0 h7 h6 h5 7 6 p4 7 6 e 5 7 6 h5 h4 h3 h2 h1 h0 h7 h6 7 6 p5 7 76 7 6 7 6 4 e 6 5 4 h6 h5 h4 h3 h2 h1 h0 h7 5 4 p6 5 e7 h7 h6 h5 h4 h3 h2 h1 h0 p7

Figure 3. Pixel values in a 3  3 mask.

Figure 4. 3  3 Mask in terms of hi’s.

CIRCULANT MATRIX REPRESENTATION OF MASKS

15

where e is a column vector consisting of edge values of eight-directional components (e0 ; e1 ; . . ., and e7 are the N, NW, . . ., and NE directional edge values, respectively); p is a column vector consisting of p0 ; p1 ; . . . ; p7 ; and H, in the form of a circulant matrix, is a mapping matrix from p into e. Eight-directional compass gradient masks are represented in matrix form, as shown in Figure 5. For example, each directional mask of Sobel masks can be expressed in the form of weights hi’s, which can be expressed in the form of the 8  8 matrix H, as shown in Figure 6. Figure 7 shows the edge detection results when each directional mask of N, NW, W, SW, NE, E, SE, and S Sobel masks is applied to a synthetic image, in which an original image, edge images detected by N, NW, W, SW, NE, E, SE, and S masks, and a final edge image by eight-directional masks are shown in the clockwise direction. The final edge map by eight-directional masks is obtained by combining eight-directional masking images in Figure 7(b)–7(i) with the thresholding value of 128. Similarly, each directional mask of a Prewitt (Kirsch) masks and its matrix representation in terms of hi’s are shown in Figure 8 (see Figure 10). In the same way, results by Prewitt (Kirsch) masks are illustrated in Figure 9 (see Figure 11). According to the property of the circulant matrix in the DFT domain, the circulant matrix H can be diagonalized by using W matrix and W1 matrix, H ¼ WDW1

or

D ¼ W1 HW

ð40Þ

where D is a diagonal matrix whose diagonal elements Dkk are the eigenvalues of H. The values of Dkk eigenvalues of H of Sobel, Prewitt, and Kirsch masks, are listed in Table 1. For the interpretation of compass gradient edge masks, Eq. (39) can be rewritten as e ¼ Hp ¼ WDW1 p:

ð41Þ

We can interpret Eq. (41) as follows. First, we start with discrete Fourier transforming the column vector p,

Figure 5. Eight-directional compass gradient mask in matrix form.

16

PARK AND CHA

Figure 6. Matrix representation of the Sobel masks in terms of hi’s.

pˆ ¼ W1 p ¼ FTfpg

ð42Þ

where FT is a 1D DFT operator. In the DFT domain, we multiply the transform coeYcient pˆ element by the constant vector where elements are the eigenvalues rk’s of the circulant matrix H and obtain Dpˆ. The eigenvalues rk’s depend only on the type of the compass gradient mask, as listed in Table 1. Finally, we do inverse DFT (IDFT) Dpˆ and derive the e vector. Figure 12 shows the block diagram of this interpretation in terms of the DFT and IDFT. This interpretation shows that Sobel, Prewitt, and Kirsch masks have a similar structure and the only diVerence is the eigenvalues rk’s, which correspond to the nonlinear filtering coeYcients. It is expected that a new edge mask can be found by changing the eigenvalues rk’s in the DFT domain. Other masks such as average smoothing can be interpreted similarly by rearranging the weights of masks in the form

CIRCULANT MATRIX REPRESENTATION OF MASKS

17

Figure 7. Edge detection results of Sobel masks. (a) Original image; (b–j) edge detection results by (b) N, (c) NW, (d) W, (e) SW, (f ) NE, (g) E, (h) SE, (i) S; ( j) final edge detection result.

of the circulant matrix. However, the redundancy among results may exist if the mask does not have directionality. The DFT used in this analysis requires complicated computation in the digital computer system, but this complicated transform can be performed simply in an optical system. The optical transform is faster and has more information capacity than transforms performed by means of electronic circuitry, and the optical spectrum analyzer can be modified to yield a multichannel 1D spectrum analyzer by adding a cylindrical lens (Yu, 1983). Therefore, if we arrange pixels in the form of p0, p1, . . ., p7 and assign them to each channel of a 1D spectrum analyzer, we can calculate edge values using optical systems based on the new interpretation of the compass gradient edge masks. To consider the 1D case, let p, h, and e be column vectors consisting of eight intensity values, eight weights of the edge mask, and eight directional edge values, respectively (Park, 1998a). Note that eight intensity values and the corresponding weights are scanned counterclockwise from the top left pixel of the 3  3 mask, centered at (i, j). For example, the intensity vector p and the kernel weight vector h of the compass gradient edge mask can be expressed as p ¼ ½ p0

p1

p2

p3

p4

p5

p6

p7 t

ð43Þ

h ¼ ½ h0

h1

h2

h3

h4

h5

h6

h7 t

ð44Þ

where pi and hi, 1  i  8, represent the ith intensity values and their corresponding weights of the mask, respectively. For example, weight

18

PARK AND CHA

Figure 8. Matrix representation of the Prewitt masks in terms of hi’s.

vectors hP, hS, and hK of the Prewitt, Sobel, and Kirsch masks, respectively, can be expressed as hP ¼ ½ 1

1

1

0 1

1 1

0 t

ð45Þ

hS ¼ ½ 1

2

1

0 1

2 1

0 t

ð46Þ

3

3 t :

ð47Þ

hk ¼ ½ 5

5

5

3

3

3

Eight compass gradient masks yield eight column vectors, each of which is a circularly shifted version of h. Thus these eight vectors form the 8  8 circulant matrix H, with the first column vector corresponding to h and each column representing each directional weight vector. Then edge detection by compass gradient edge masks can be expressed in vector-matrix form: e ¼ Hp. The circulant matrix can be diagonalized by the DFT matrix, and

CIRCULANT MATRIX REPRESENTATION OF MASKS

19

Figure 9. Edge detection results of Prewitt masks. (a) Original image; (b–j) edge detection results by (b) N, (c) NW, (d) W, (e) SW, (f ) NE, (g) E, (h) SE, (i) S; ( j) final edge detection result.

the corresponding eigenvalues rk ; 1  k  8, compose the eigenvalue vector r. Note that the eigenvalue vector r is expressed as the 1D DFT of h and that eigenvalue vectors rP, rS, and rK of the Prewitt, Sobel, and Kirsch masks, respectively, can be expressed as rP ¼ ½ 0 

rS ¼ 0

pffiffiffi 2u

rK ¼ ½ 0 4u

u 0

0 v 0 v  0 u t pffiffiffi pffiffiffi pffiffiffi t  2v 0  2v  0 2u 

j8

4v 8

4v

j8

4u t

ð48Þ ð49Þ ð50Þ

where the subscriptpffiffiffi denotes complex conjugate pffiffiffi and complex constants are given by u ¼ ð2 þ 2Þð1  jÞ and v ¼ ð2  2Þð1 þ jÞ. From Eqs. (48), (49), and (50), it is noted that the three compass gradient edge masks have the similar structure in the 1D frequency domain, with the only diVerence being the corresponding eigenvalues. In another method to calculate eigenvalues of the matrix H, we can solve the characteristic equation (Park and Choi, 1992): detðsI8  HÞ ¼ 0:

ð51Þ

By the way, when we calculate the eigenvalues of circulant matrices for Sobel and Prewitt masks, we may use the special structure of their circulant matrices. The 8  8 circulant matrices for Sobel and Prewitt masks are represented in the following form:

20

PARK AND CHA

Figure 10. Matrix representation of the Kirsch masks in terms of hi’s.



A H¼ A

A A



where 82 1 > > > 6 > > > 62 > > 6 > > 41 > > > < 0 A¼ 2 > 1 > > > > 6 >61 > > > 6 > > 41 > > : 0

0 1

1 0

3 2 1 7 7 7; for Sobel masks 05

2 1 1 2 1 3 0 1 1 1 0 1 7 7 7; for Kirsch masks: 1 1 05 1 1 1

ð52Þ

21

CIRCULANT MATRIX REPRESENTATION OF MASKS

(a)

(j)

(b)

(c)

(d)

(i)

(h)

(g)

(e)

(f )

Figure 11. Edge detection results of Kirsch masks. (a) Original image; (b–j) edge detection results by (b) N, (c) NW, (d) W, (e) SW, (f ) NE, (g) E, (h) SE, (i) S; ( j) final edge detection result. TABLE 1 Eigenvalues rk of Compass Gradient Edge Masks k

Sobel S

Prewitt P

Kirsch K

0 1 2 3 4 5 6 7

0pffiffiffi pffiffiffi 2ð2 þ 2Þð1  jÞ 0 pffiffiffi pffiffiffi  2ð2  2Þð1 þ jÞ 0 pffiffiffi pffiffiffi  2ð2  2Þð1  jÞ 0 ffiffiffi p pffiffiffi 2ð2 þ 2Þð1 þ jÞ

0 pffiffiffi ð2 þ 2Þð1  jÞ 0 pffiffiffi ð2  2Þð1 þ jÞ 0 pffiffiffi ð2  2Þð1  jÞ 0 pffiffiffi ð2 þ 2Þð1 þ jÞ

0 pffiffiffi 4ð2 þ 2Þð1  jÞ j8 pffiffiffi 4ð2  2Þð1 þ jÞ 8 pffiffiffi 4ð2  2Þð1  jÞ j8 pffiffiffi 4ð2 þ 2Þð1 þ jÞ

To determine the eigenvalues of the circulant matrix H, we solve the following characteristic equation using Eq. (33), A A sI4  A sI4 det ¼ det A sI4  A sI4 sI4  A ¼ detðsI4 Þ det½ðsI4  AÞ  sI4 ðsI4 Þ1 A ¼ detðsI4 Þ 2det

s 2

 I4  A ¼ 0:

ð53Þ

22

PARK AND CHA

Figure 12. Block diagram of the new interpretation of compass gradient edge masks in the DFT domain.

From the first term, we get four zero eigenvalues. From the second one, we obtain four eigenvalues of which values are twice as large as eigenvalues of A. Therefore we determine the eigenvalues of 8  8 circulant matrices H in the case of Sobel and Prewitt masks simply by adding four zeros, and calculating eigenvalues of the 4  4 matrix A and then multiplying their values by 2. In the case of the Kirsch masks, the 8  8 circulant matrix is represented in the following form: A B H¼ ð54Þ B A where 2

5 6 5 6 A¼4 5 3

3 5 5 5

3 3 5 5

3 2 3 3 6 3 7 7 and B ¼ 6 3 4 3 3 5 5 3

3 3 3 3

5 3 3 3

3 5 57 7: 3 5 3

To determine the eigenvalue of the circulant matrix H, we solve the following characteristic equation using Eq. (33): sI  A A A sI det 4 ¼ det 4 A sI4  A sI4 sI4  A ¼ detðsI4 Þ det½ðsI4  AÞ  sI4 ðsI4 Þ1 A s  ¼ detðsI4 Þ 2det I4  A ¼ 0: 2

ð55Þ

CIRCULANT MATRIX REPRESENTATION OF MASKS

23

From the first and second terms, eight eigenvalues are derived. In other words, we determine eight eigenvalues of the 8  8 circulant matrix H in the case of Kirsch masks simply by calculating eigenvalues of 4  4 matrices (A þ B) and (A  B). Generally, a square matrix can be decomposed into a symmetric matrix and a skew-symmetric matrix. Suppose that B is an M  M symmetric matrix and C is an M  M skew-symmetric matrix. If A is an arbitrary M  M square matrix, it can be represented as A¼BþC

ð56Þ

where B ¼ ðA þ At Þ=2 and C ¼ ðA ¼ At Þ=2. The circulant matrices of Sobel, Prewitt, and Kirsch masks are also decomposed into symmetric and skewsymmetric matrices as shown in Figure 13. Decomposed matrices are also the circulant matrices. In the 1D DFT domain, symmetric and skewsymmetric matrices give real and imaginary parts of the complex-valued eigenvalue, respectively, as listed in Table 2. Alternately, we calculate

Figure 13. Required matrix form of the compass gradient edge masks (h ¼ 0:5).

24

PARK AND CHA TABLE 2 Eigenvalues for Symmetric and Skew-Symmetric Matrices of Sobel, Prewitt, and Kirsch Masks Sobel S

Prewitt P

Kirsch K

k

Symmetric

Skewsymmetric

Symmetric

Skewsymmetric

Symmetric

Skewsymmetric

0 1 2 3 4 5 6 7

0 pffiffiffi pffiffiffi 2ð2 þ 2Þ 0 pffiffiffi pffiffiffi  2ð2  2Þ 0 pffiffiffi pffiffiffi  2ð2  2Þ 0 pffiffiffi pffiffiffi 2ð2 þ 2Þ

0 pffiffiffi pffiffiffi  2ð2 þ 2Þj 0 pffiffiffi pffiffiffi  2ð2  2Þj 0 ffiffiffi p pffiffiffi 2ð2  2Þj 0 ffiffiffi p pffiffiffi 2ð2 þ 2Þj

0 pffiffiffi ð2 þ 2Þ 0 pffiffiffi ð2  2Þ 0 pffiffiffi ð2  2Þ 0 pffiffiffi ð2 þ 2Þ

0 pffiffiffi ð2 þ 2Þj 0 pffiffiffi ð2  2Þj 0 pffiffiffi ð2  2Þj 0 pffiffiffi ð2 þ 2Þj

0 pffiffiffi 4ð2 þ 2Þ 0 pffiffiffi 4ð2  2Þ 8 pffiffiffi 4ð2  2Þ 0 pffiffiffi 4ð2 þ 2Þ

0 pffiffiffi 4ð2 þ 2Þj j8 pffiffiffi 4ð2  2Þj 0 pffiffiffi 4ð2  2Þj j8 pffiffiffi 4ð2 þ 2Þj

eigenvalues of the symmetric and skew-symmetric matrices of Sobel and Prewitt masks using Eq. (53) with corresponding 4  4 matrices, since their matrices are represented as in Eq. (52). Similarly, we obtain the eigenvalues of Kirsch masks by using Eq. (55) with corresponding 4  4 matrices. Let hS;k ; hP;k , and hK;k ; 0  k  7, be the first column of the circulant matrices of Sobel, Prewitt, and Kirsch masks, respectively; then corresponding eigenvalues, rS,k, rP,k, and rK,k are represented by rS;k ¼

N 1 X i¼0

rP;k ¼

N 1 X i¼0

rK;k ¼

N 1 X i¼0

 p  hS;i exp j ki 4

ð57Þ

 p  hP;i exp j ki 4

ð58Þ

 p  hK;i exp j ki : 4

ð59Þ

The kth row of the circulant matrix of the Sobel masks corresponds to the sum of < k  1 >8 th and < k þ 1 >8 th rows of the circulant matrix of the Prewitt masks: hS;k ¼ hP;8 þ hP;8 ;

0  k  7:

ð60Þ

We derive the relationship between the eigenvalues, r0S;k and r0P;k by using Eqs. (57), (58), and (60):

CIRCULANT MATRIX REPRESENTATION OF MASKS

 p   p  rS;k ¼ rP;8 þ rP;8 ¼ rP;k exp j k þ rP;k exp j k 4 p4  ¼ 2rP;k cos k : 4

25

ð61Þ

We also get the kth row of the circulant matrix of Prewitt masks by subtracting the < k þ 4 >8 th row from the kth row of the circulant matrix of the Kirsch masks and dividing it by 8. The Sobel masks are related to the Kirsch masks in a similar way: 1 hP;k ¼ ðhK;k  hK;8 Þ; 8

0  k  7:

ð62Þ

We drive the relationship between the eigenvalues rP,k and rK,k by using Eqs. (58), (59), and (62): 1 1 1 rP;k ¼ ðrK;k  rK;8 Þ ¼ rK;k ð1  expðjpkÞÞ ¼ rP;k cosð1  cosðpkÞÞ 8 8 8   1 ¼ rP;k cos 1  ð1Þk : 8

ð63Þ

We also derive the relationship between the eigenvalues rS,k and rK,k from Eqs. (61) and (63):   p  1 ð64Þ rS;k ¼ rK;k 1  ð1Þk cos k : 4 4 As shown in Table 2, for fixed k, the eigenvalues for three edge masks have the same structure except for the constant factors, which are explained in Eqs. (61), (63), and (64). 2. Frei–Chen Edge Masks The spiral scanning of the 2D intensity pattern in the clockwise direction from the top left pixel gives a 9D column vector, as shown in Figure 14. The Frei–Chen masks Fi ; 1  i  9, defined on a 3  3 window (Figure 15), span the edge, line, and average subspaces (Frei and Chen, 1977; Park and Choi, 1990). The four-dimensional (4D) edge subspace is spanned by the isotropic average gradient masks F1 and F2, and the ripple masks F3 and F4. The 4D line subspace is spanned by the directional masks F5 and F6, and the nondirectional Laplacian masks F7 and F8. The average mask F9 forms the average subspace. We can form the 9D column vector fi for each mask Fi. Then the nine vectors define the 9  9 Frei–Chen matrix F. To make the matrix F orthogonal, we should make the column vectors fi orthonormal.

26

PARK AND CHA

Figure 14. 9D Vector description of a 3  3 neighborhood.

Figure 15. Orthogonal set of the Frei–Chen masks (a ¼

pffiffiffi 2).

Since the vectors pffiffiffi fi are orthogonal, we just normalize them with normalization factors: 2 2 for F1, F2, F3, and F4; 2 for F5 and F6; 6 for F7 and F8; and 3 for F9. We denote the orthonormal Frei–Chen vector by vi and the orthogonal matrix V (Park, 1990):

CIRCULANT MATRIX REPRESENTATION OF MASKS

27

3 3 2 vt1 c d c 0 c d c 0 0 6 vt 7 6 27 6 c 0 c d c 0 c d 07 7 6 t7 6 6 v3 7 6 0 c d c 0 c d c 07 7 6 7 6 7 6 vt 7 6 6 4 7 6 d c 0 c d c 0 c 0 7 7 6 t7 6 v 7 6 ð65Þ d 0 d 0 d 0 d 0 7 V¼6 7 6 57¼6 0 7 6 vt 7 6 d 0 d 0 d 0 d 0 0 7 6 67 6 7 6 t7 6 6 v7 7 6 e f e f e f e f g 7 7 6 t7 6 6 v 7 4 f e f e f e f e g5 4 85 vt9 f f f f f f f f f pffiffiffi where c ¼ 1=2 2; d ¼ 1=2; e ¼ 1=6; f ¼ 1=3, and g ¼ 2=3. Edge detection using the Frei–Chen masks is done by mapping the intensity vector by the linear transformation V and then detecting edges based on the angle between the intensity vector and its projection onto the edge subspace. This can be done by thresholding the value of 2

4 P

ðvi p0 Þ2

i¼1

ðp0 p0 Þ2

ð66Þ

where vi p0 denotes the inner product of the vectors vi and p0 . The result of edge detection using the Frei–Chen masks is shown in Figure 16, in which the threshold value used in this experiment is 0.12. Determining the optimal thresholding for edge detection in noisy images is explained in Abdou and Pratt (1979).

Figure 16. Edge detection results by Frei–Chen masks. (a) Original image, (b) final result.

28

PARK AND CHA

We briefly explained the edge detection method by Frei–Chen masks. Hereafter, we consider the relationship between the Frei–Chen space and the eight-dimensional (8D) DFT space. We call hi (the noncenter weights in the 3  3 normalized Frei–Chen masks scanned in the clockwise direction with the length equal to 8, a power of 2) the modified version of the normalized Frei–Chen weight vector vi. The exclusion of the center pixel can be represented in vector-matrix form. The modified 8D intensity vector pM can be written as  t pM pM pM pM pM pM pM p M ¼ pM 5 7 0 1 2 3 4 6 2

1 60 6 60 6 60 ¼6 60 6 60 6 40 0

0 1 0 0 0 0 0 0

0 0 1 0 0 0 0 0

0 0 0 1 0 0 0 0

0 0 0 0 1 0 0 0

0 0 0 0 0 1 0 0

0 0 0 0 0 0 1 0

3 0 07 7 07 7 07 7p0 ¼ ½ I8 07 7 07 7 05 0

0 0 0 0 0 0 0 1

0 p0 ¼ IM p0

ð67Þ

where I8 and 0 are the 8  8 identity matrix and the 8D zero vector, respectively. IM is the 8  9 modification matrix that maps the nine pixel values into the 8D vector space by excluding the center pixel. ˜ t defined by the modified 8D weight vectors hi can Similarly, the matrix H be written as ˜ t ¼ ½ h1 H

h2

h3

h4

h5

h6 F

h7

h8

The 8D Fourier transform vector t of the data p

h9 ¼ IM Vt : M

ð68Þ

is defined by

tF ¼ TF pM

ð69Þ

where tFk ¼

N 1 X i¼0



1 ki ; pM exp j i N

0  k  N  1:

TF is the unitary matrix mapping into the 8D DFT space. Since pM is real valued, we have tFk ¼ ðtFNk Þ . We can relate the DFT vector Q of the 8D intensity vector pM to the 9D resulting convolution vector b of the normalized Frei–Chen masks by the linear transformation TA: tF ¼ TA b:

ð70Þ

29

CIRCULANT MATRIX REPRESENTATION OF MASKS

Using Eqs. (67) and (69), we can write TF IM p0 ¼ TA Vp0 :

ð71Þ

A

Then the linear transformation T is given by TA ¼ TF IM V1 :

ð72Þ t

Due to the orthonormality of V (i.e., V1 ¼ V ) and Eq. (68), we can write ˜t TA ¼ TF IM Vt ¼ TF H 2 0 0 0 6 a  ja a þ ja 0 6 6 6 0 0 0 6 6 0 0 j2 6 ¼6 6 0 0 0 6 6 0 0 j2 6 6 4 0 0 0

0 0

0 0

0 0

g 0

g 0

0

j2

2

0

0

2 0

0 0

0 0

0 2

0 2

2 0

0 j2

0 2

0 0

0 0

3 z 07 7 7 07 7 07 7 7 07 7 07 7 7 05

ð73Þ

a þ ja a  ja 0 0 0 0 0 0 0 pffiffiffi where a ¼ 2; g ¼ 2=3, and z ¼ 8=3. The transformation matrix TA is equal ˜ t, which can be expressed as to the DFT of the modified Frei–Chen matrix H t

˜ ¼ TF IM Vt ¼ ½TF TF H

0 Vt :

ð74Þ

Eq. (74) shows that the DFT of the given matrix with the center weight excluded is mathematically equivalent to the mapping of the original matrix with the mapping matrix determined by the DFT vectors and the zero vectors. Eq. (73) explains the relationship between the subspaces of the modified Frei–Chen basis vectors and their spatial frequency components. The h1 and h2 weight vectors give the fundamental frequency components only. The h3 and h4 weight vectors exhibit only the third harmonic components. In other words, the edge subspaces of the original/modified Frei–Chen weight vectors correspond to the fundamental and third harmonic components of the clockwise-scanned 8D intensity vectors. Note that the edge responses of the normalized edge masks are zero. Also the h5, h6, h7, and h8 weight vectors, spanning the line subspace, represent the second and fourth harmonic components. Note that the zero-frequency components of h7 and h8 are due to the zero center weights in the modified discrete Laplacian masks. The average mask h9 gives the zero-frequency component only.

30

PARK AND CHA

From Eq. (69), the complex-valued DFT matrix TF can be written as 3 2 1 1 1 1 1 1 1 1 61 t 0 t 1 t 0 t7 7 6 61 0 1 0 1 0 1 07 7 6 6 1 t 0 t 1 t 0 t 7 7 TF ¼ 6 6 1 1 1 1 1 1 1 1 7 7 6 6 1 t 0 t 1 t 0 t 7 7 6 41 0 1 0 1 0 1 05 1 t 0 t 1 t 0 t 3 2 0 0 0 0 0 0 0 0 6 0 t 1 t 0 t 1 t7 7 6 6 0 1 0 1 0 1 0 17 7 6 6 0 t 1 t 0 t 1 t7 7 ð75Þ þ j6 60 0 0 0 0 0 0 07 7 6 60 t 1 t 0 t 1 t 7 7 6 40 1 0 1 0 1 0 1 5 0 t 1 t 0 t 1 t pffiffiffi where t ¼ cosðp=4Þ ¼ 1= 2. Examination shows that the row vectors of TF are related to the weight vectors vti , i.e., 22 3 2 t 33 3vt9 0 66 2gt 7 6 2gt 77 7 66 7 1 6 2 77 66 7 77 6 66 2vt6 7 t 6 2v5 77 66 7 7 6 66 2vt 7 6 2vt 77 4 6 7 6 F 77 6 3 T ¼ 66 t 7 IM 7 þ j6 t 77 66 2v7  2vt8 7 7 6 0 66 7 77 6 66 2vt4 7 6 2vt 77 66 7 6 3 77 66 2vt 7 4 2vt 57 5 44 5 6 5

2gt2

2gt1

2

0 62 6 6 60 6 60 6 ¼6 60 6 60 6 60 4 2

0 j2 0 0 0 0 0 j2

0 0 0 j2 0 j2 0 0

0 0 0 0 0 j2 2 0 0 0 2 0 0 j2 0 0

0 0 2 0 0 0 2 0

0 0 0 0 2 0 0 0

2 3 3 vt1 0 3 6 t7 6 v2 7 0 07 76 t 7 76 v 7 0 0 76 3t 7 76 v 7 6 47 0 07 76 t 7 M v 7I ¼ QMIM 7 2 0 76 6 5t 7 76 v 7 0 0 76 6 7 76 vt 7 6 7 0 07 56 7t 7 4 v8 5 0 0 vt9

ð76Þ

CIRCULANT MATRIX REPRESENTATION OF MASKS

31

where g1 denotes the circularly shifted version of the weight vector v1 by 1 (i.e., g1k ¼ v1n with n ¼< k þ 1 >8 ) (note that the symbol < >8 denotes the modulo-8 operation). Q is the matrix defined by the normalized Frei–Chen weight vectors and their circular shifts. The matrix IM signifies the relationship between the DFT basis vector and the normalized Frei–Chen weight vectors. The weight vectors of the Frei–Chen masks and the 8D DFT basis vectors are closely related, as shown in Eq. (76). From our observations so far, we can design a set of eight orthogonal masks that span the edge, line, and average subspaces. From Eq. (69), we can express tF1 as tF1 ¼ ½1

t  jt

j

 t  jt

¼ ðd1 pM Þ þ jðd2 pM Þ:

1

 t þ jt

j

t þ jt pM

ð77Þ

The weight vectors d1 and d2 can be arranged into 2D masks. Note that, neglecting the constant factor, d1 and d2 are versions of v1 and v2 shifted circularly by 1. Similarly, to obtain the tF3 component, we need two mask vectors d3 and d4, which are equivalent to v4 and v3, respectively. Thus, a set of mask vectors d1, d2, d3, and d4 for the edge subspace can be obtained. In a similar way, a set of masks d5, d6, and d7 for the line subspace and d8 for the average subspace are obtained. The normalized set of eight designed mask vectors ni is shown in matrix form: 3 2 d c 0 c d c 0 c 6 0 c d c 0 c d c7 7 6 6 d c 0 c d c 0 c 7 7 6 6 0 c d c 0 c d c7 7 ð78Þ N¼6 6d 0 d 0 d 0 d 07 7 6 6 0 d 0 d 0 d 0 d7 7 6 4 c c c c c c c c 5 c c c c c c c c pffiffiffi where c ¼ 1=2 2 and d ¼ 1=2. The proposed eight masks are orthogonal masks and they are in the same category as the Frei–Chen masks. We observe that the intensity vector pM  1  1  1 0 t e ¼ ½1 1 1 0 or combinations of its circular shifts span the edge subspace and have only tF1 and tF3 components. Their ratio jtF1 =tF3 j is equal to ð1þtÞ=ð1  tÞ ¼ 5:38, where | | denotes the absolute value of a vector. Also, the input vector t pM l ¼ ½1 1 1 0 1 1 1 0 or combinations of its circular shift span the line subspace and have only tF2 and tF4 components, whose ratio jtF2 =tF4 j is equal to 1. Of course, the uniform pattern pM a ¼ ½1 1 1 1 1 1 1 1 t gives only the nonzero dc component. We can detect edges based on a decision rule similar to Eq. (66):

32

PARK AND CHA

   2  2  2  2  2  2 2 tF1  þ tF3  tF  þ tF  þ tF  þ tF  5 7 1 3 ¼ > Th 7   7   P P tF 2 tF 2 k k k¼0

ð79Þ

k¼0

where Th is an arbitrary threshold. In the previous section, we mentioned that the idea of new edge mask design was motivated by the fact that the compass gradient edge masks have a similar structure in the 1D frequency domain (Park, 1998a). The idea is to derive a new set of compass gradient edge masks that has a unifying property in terms of eigenvalues. The simplest but most meaningful processing in the frequency domain is multiplication—circular convolution operation in the spatial domain. We can easily specify corresponding mask operations in the 1D spatial domain, which is equivalent to multiplication operations in the 1D frequency domain. For example, element-by-element multiplication of rP by rP yields another eigenvalue vector represented by  t rnew ¼ 0 u2 0 v2 0 v 2 0 u 2 ð80Þ pffiffiffi pffiffiffi where u ¼ ð2 þ 2Þð1  jÞ and v ¼ ð2  2Þð1 þ jÞ. Eq. (80) corresponds to the new set of compass gradient edge masks hnew ¼ ½ 4

6

4 0

4

6

4

0 t

ð81Þ

obtained by circular convolution of two weight vectors of the Prewitt masks in the 1D spatial domain. From Eqs. (48), (49), and (50), it is noted that the second and eighth elements in the eigenvalue vector have the largest value, that is, the fundamental frequency component is the largest. Note that the first element corresponds to the zero-frequency value, which is zero. Hermitian property of the eigenvalue is obvious since the weights of the compass gradient edge masks are real valued. Thus, infinite element-by-element multiplication of the eigenvalue vector of the three compass gradient edge masks in the 1D frequency domain yields the same eigenvalue vector, in which only the second and eighth elements are nonzero and other elements are zero. The resulting eigenvalue vector is expressed as r0new ¼ ½ 0

w

0

0 0

0

0

w t

ð82Þ

where w is a nonzero normalization constant. This eigenvalue vector corresponds to a new set of compass gradient edge masks, expressed as  t pffiffiffi pffiffiffi h0new ¼ 1 ð83Þ 2 1 0 1  2 1 0 where w ¼ 4ð1jÞ for simplicity. The weight vector in Eq. (83) and its circularly shifted version correspond to the first-type Frei–Chen edge masks

33

CIRCULANT MATRIX REPRESENTATION OF MASKS

containing only the fundamental frequency component of the weight vector. The weight vector specified by  t pffiffiffi pffiffiffi 00 hnew ¼ 1  2 1 0 1 ð84Þ 2 1 0 and its circularly shifted version form the second-type Frei–Chen edge masks. The corresponding eigenvalue vector is expressed as 00

rnew ¼ ½ 0

0 0

w

0

w

0 0 t :

ð85Þ

Note that the second-type Frei–Chen edge masks contain only the third harmonic frequency component. The first-type and second-type Frei–Chen masks constitute the edge subspace described above. These two types of edge components lead to the decision rule of edge detection expressed in the 1D frequency domain in Eq. (79). Thus, four Frei–Chen edge masks and their corresponding weights can be interpreted by the 1D frequency domain analysis. 3. Complex-Valued Edge Masks We can generalize the 1D interpretation of the compass gradient edge masks to complex-valued cases. An optical implementation of real-time edge enhancement filters has been presented (Corecki and Trolard, 1998), in which, for example, the 3  3 complex-valued Sobel mask Sc can be approximated by the complex addition: 2 3 2 3 2 3 1 0 1 1 2 1 1  j j2 1  j Sc ¼ Sh þ jSv ¼ 4 2 0 2 5 þ j 4 0 0 0 5 ¼ 4 2 0 2 5 1 0 1 1 2 1 1 þ j j2 1þj ð86Þ where Sh and Sv denote the derivatives approximated by the Sobel masks along the horizontal and vertical directions, respectively. The optical realization of the complex-valued mask uses an optical correlator with a matched filter whose impulse response is a weighted sum of eight delta functions. With the kernel matrix Sc, we can construct the complex-valued kernel weight vector hcS of the complex-valued compass Sobel edge masks (Park, 1998b): hcS ¼ ½ 1  j

j2

1j

2

1þj

Then the corresponding eigenvalue vector

rcS

j2

1 þ j

2 t :

ð87Þ

is expressed as

¼ ½ 0 0 0 4ða  1Þð1 þ jÞ 0 0 0 4ða þ 1Þð1 þ jÞ t ð88Þ pffiffiffi where a ¼ 2. For example, the complex edge value at (i, j) is obtained from convolution of the complex-valued Sobel mask Sc with the 3  3 intensity mask, which is centered at (i, j). Also it yields the edge strength rcS

34

PARK AND CHA

qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Mði; jÞ ¼ ðReðhcS Þt pÞÞ2 þðImðhcS Þt pÞÞ2 and orientation of the edge normal c yði; jÞ ¼ tan1 ðImðhS Þt pÞ=ReðhcS Þt pÞÞ, where Re(x) and Im(x) denote real and imaginary parts of the complex edge value x, respectively. In a similar way, we can write the complex-valued kernel weight vector hcP of the complex-valued compass Prewitt edge masks as hcP ¼ ½ 1  j

j

1j

1þj

1

0

0 2ða  1Þð1 þ jÞ 0

1 þ j

rcP

expressed as

0

0

with the corresponding eigenvalue vector rcP ¼ ½ 0

j

1 t

2ða þ 1Þð1 þ jÞ t :

ð89Þ

ð90Þ

By the way, two types of the Frei–Chen edge masks, each of which consists of two masks, constitute the 4D edge subspace in the 9D Frei–Chen space. The same interpretation can be applied to each type of the complex-valued compass Frei–Chen edge masks: 0

hcF ¼ ½ 1  j 00

hcF ¼ ½ 1  j

ja 1  j ja 1  j

a 1þj a

1þj

ja 1 þ j ja

1 þ j

a t

ð91Þ

a t

ð92Þ

where the superscripts 0 and 00 denote two diVerent types of the complexvalued compass Frei–Chen edge masks. The corresponding eigenvalue vec0 00 tors rcF and rcF are expressed as 0

rcF ¼ ½ 0 00

rcF ¼ ½ 0

0

0

0 0

0

0

0

0 8ð1 þ jÞ 0

8ð1 þ jÞ t

ð93Þ

0 t :

ð94Þ

0

0

Note that both eigenvalue vectors of the complex-valued compass Frei– Chen edge masks have only one nonzero component, which represents the fact that each complex-valued kernel weight vector is the same as the specific vector component of the DFT weight matrix except for the constant factor, with each column/row vector of the DFT matrix orthogonal to each other. Thus, the eigenvalue vector of the complex-valued compass Prewitt and Sobel edge masks can be expressed as a weighted sum of the two types of complex-valued compass Frei–Chen eigenvalue vectors, in the frequency domain:   0 00 a ða þ 1ÞrcF þ ða  1ÞrcF rcP ¼ ð95Þ 4   0 00 ða þ 1ÞrcF  ða  1ÞrcF c : ð96Þ rS ¼ 2 Or equivalently, the complex-valued kernel weight vectors of the complexvalued compass Prewitt and Sobel edge masks can be represented as a linear

CIRCULANT MATRIX REPRESENTATION OF MASKS

35

combination of those of the complex-valued compass Frei–Chen edge masks, in the spatial domain:  0 00  a ða þ 1ÞhcF þ ða  1ÞhcF c ð97Þ hP ¼ 4  0 00  ða þ 1ÞhcF  ða  1ÞhcF c : ð98Þ hS ¼ 2 Note that all the eigenvalue vectors of the complex-valued compass Prewitt, Sobel, and Frei–Chen edge masks have (1 þ j) terms in common, which can be eliminated by shifting clockwise the kernel weight vectors by unity. The corresponding eigenvalue vectors are obtained using the circular shift property of the DFT. Then, the real eigenvalue vectors are constructed, in which the corresponding complex-valued compass kernel weight vectors satisfy the Hermitian property. In a similar way, we can interpret four edge masks derived from the eight-point DHT, since basis functions of the eightpoint DHT formulate the 3  3 DHT masks that are closely related to the Frei–Chen masks, which are explained in Section IV. B. Feature Detection We focus on the feature detection of compass roof edge masks and Frei–Chen line masks and extend to complex-valued feature mask cases of directional filtering. 1. Compass Roof Edge Masks Roof edge masks can be interpreted in the context of circularity of compass feature masks. For example, four roof edge masks are defined as follows (Lee et al., 1993): 2 3 2 3 1 1 1 1 1 3 1 6 1 6 7 7 Rv ¼ 4 3 0 3 5 Rld ¼ 4 1 0 1 5 12 12 1 1 1 3 1 1 2 2 3 3 ð99Þ 1 3 1 3 1 1 1 6 1 6 7 7 Rh ¼ 4 1 0 1 5 Rrd ¼ 4 1 0 1 5 12 12 1 3 1 1 1 3 where the subscripts v, ld, h, and rd denote vertical, left-diagonal, horizontal, and right-diagonal, respectively. By neglecting a constant factor, we will formulate the compass roof edge masks with the kernel matrix R:

36

PARK AND CHA

2

1 R¼4 3 1

1 0 1

3 1 3 5: 1

ð100Þ

We can construct the kernel weight vector hR of the compass roof edge masks (Park, 1999a): hR ¼ ½ 1

1

1

3 1

1 1

3 t :

ð101Þ

Then, the corresponding eigenvalue vector rR is expressed as rR ¼ ½ 0 0

j8

0 8

0

j8

0 t :

ð102Þ

Note that any matrix in Eq. (99) can be used to construct the kernel weight vector, with the corresponding eigenvalue vector obtained using the shift property of the DFT. 2. Frei–Chen Line Masks Two types of Frei–Chen line masks, each of which consists of two masks, constitute the 4D line subspace in the 9D Frei–Chen space (Frei and Chen, 1977). The same interpretation can be applied to one type of Frei–Chen line masks, consisting of two line masks L1 and L2: 2 3 2 3 1 0 1 0 1 0 L1 ¼ 4 0 0 0 5 L2 ¼ 4 1 0 1 5: ð103Þ 1 0 1 0 1 0 Similarly, we can construct the kernel weight vector hL of the Frei–Chen line masks, with the kernel matrix Li (Park, 1999a): hL ¼ ½ 1

0

1 0

1

0 1

0 t :

ð104Þ

Then, the corresponding eigenvalue vector rL is expressed as rL ¼ ½ 0

0

4 0

0

0

4

0 t :

ð105Þ

The other type of the Frei–Chen line masks, with nonzero center weights, is not suitable for this frequency domain analysis. Note that hi ¼ hiþ4 ; 0  i  3, for the compass gradient edge masks such as Sobel, Prewitt, and Kirsch masks in Section III.A.3, whereas hi ¼ hiþ4 ; 0  i  3, for the compass roof edge and Frei–Chen line masks. For the latter cases, the first four row vectors of the weight matrix H are the same as the next four row vectors. The third, fifth, and seventh elements of the eigenvalue vectors of the compass roof edge masks are nonzero, whereas the third and seventh elements of the compass Frei–Chen line masks are nonzero. Note that dc and

CIRCULANT MATRIX REPRESENTATION OF MASKS

37

odd-order harmonic components are zero, because of the periodicity inherent in the weight vector. In this case, we can construct the vector-matrix relationships with the reduced data size, i.e., h# R ¼ ½ 1

1

1

h# L ¼ ½ 1 0

1

3 t

ð106Þ

0 t

ð107Þ

where the superscript # denotes the reduced vector-matrix representation, and the subscripts R and L signify the compass roof masks and Frei–Chen line masks, respectively. The corresponding intensity kernel vector is given by p# 4 ¼ ½ p0 þ p4

p1 þ p5

p 2 þ p6

p3 þ p7 t :

ð108Þ

Then, we have the corresponding eigenvalue vectors: r# R ¼ ½0

j4

r# L ¼ ½0

2 0

4

j4 t

ð109Þ

2 t :

ð110Þ

Note that the eigenvalue vectors of Eqs. (109) and (110) in reduced vector representation are subsampled versions of Eqs. (102) and (105), respectively by a factor of two neglecting the normalization constant. By the unified eigenvalue analysis of compass feature masks in the 1D frequency domain, the compass roof edge and Frei–Chen line masks are investigated. 3. Complex-Valued Feature Masks Let pðxÞ and gcn ðxÞ denote the original image and the nth conjugate image filtered (convolved) by the nth mask un ðxÞ, respectively, 1  n  N (Paplinski, 1998). Then the complex-valued edge strength ec ðxÞ can be regarded as a vector addition of conjugate images: ec ðxÞ ¼

N X

gcn ðxÞ expð jan Þ

ð111Þ

n¼1

with its magnitude and direction corresponding to a standard edge magnitude and orientation, respectively (Abdou and Pratt, 1979). The edge strength ec ðxÞ can be rewritten as a convolution of the original image pðxÞ and the complex-valued edge filter uc ðxÞ, which is specified by uc ðxÞ ¼

N X

un ðxÞ expð jan Þ:

ð112Þ

n¼1

Note that uc ðxÞ is a sum of appropriately rotated filter components. The complex-valued mask U c ðxÞ can be constructed by a pair of real-valued

38

PARK AND CHA

masks U r ðxÞ and U i ðxÞ, where U r ðxÞ and U i ðxÞ correspond to the real and imaginary parts of U c ðxÞ, respectively, regardless of the number of filtering directions N. A simple example of defining a gradient magnitude and orientation in two orthogonal directions is based on the estimation of horizontal (real) and vertical (imaginary) components of the intensity gradient vector using horizontal and vertical Sobel masks. For 3  3 masks with zero center weights, the 8D weight vector un is formulated by scanning eight weights counterclockwise from the center right weight of the mask, with u1 denoting the kernel weight vector for compass feature mask formulation. Similarly, p and g are defined. Complex-valued ec ðxÞ and uc ðxÞ yield complex-valued vectors ec and uc, respectively. Equivalently, we can express the complex-valued edge mask Uc in matrix form (Park, 2002c): Uc ¼

N X

Un expð jan Þ ¼ Ur þ jUi

ð113Þ

n¼1

where an is assumed to be 2pðn  1Þ=N for the nth feature mask Un. The 3  3 masks Uc and Un with zero center weights correspond to 8D weight vectors uc and un, respectively. Thus, N real-valued directional masks Un, 1  n  N, are combined to yield one complex-valued mask Uc ¼ Ur þ jUi , where Ur and Ui represent real and imaginary masks of Uc, or equivalently, correspond to 8D weight vectors ur and ui, respectively. For simplicity, 3  3 Ndirectional feature masks are analyzed, with N ¼ 8; 4; and 2, in which an is assumed to be 2pðn  1Þ=N; 1  n  N. a. N ¼ 8 Cases. Figure 17 shows 3  3 real-valued compass gradient edge masks Gn, with G1 representing the kernel mask, where the constant b specifies the type p offfiffiffiedge masks: b ¼ 1 for Prewitt masks, b ¼ 2 for Sobel masks, and b ¼ 2 for Frei–Chen isotropic average gradient masks. Figure 18 shows 3  3 Frei–Chen kernel masks: FRP1 for the ripple edge

Figure 17. 3  3 Compass gradient edge masks.

CIRCULANT MATRIX REPRESENTATION OF MASKS

Figure 18. 3  3 Frei–Chen kernel masks (a ¼

39

pffiffiffi 2).

Figure 19. 3  3 Kirsch and roof kernel masks.

mask and FL1 for the directional line mask. Note that a set of compass feature masks can be constructed by rotating the kernel mask by an incremental angle of p/4 as shown in Figure 17, where eight compass gradient edge masks Gn ; 1  n  N ¼ 8, are constructed from the kernel mask Gl. Similarly, Figure 19 shows the 3  3 Kirsch kernel mask K1 and the roof kernel mask R1. Let hc, kc, and rc be 8D complex-valued weight vectors corresponding to the complex-valued edge mask Gc, Kirsch mask Kc, and roof edge mask Rc, respectively. Similarly, let f cRP and f cL be complex-valued weight vectors corresponding to the complex-valued Frei–Chen ripple edge mask FcRP and line mask FcL , respectively. Then 8D complex-valued weight vectors, with an equal to pðn  1Þ=4; 1  n  N ¼ 8, can be written as hc ¼ 2ða þ bÞ½ q0

q1

q2

q3

q4

q5

q6

t

q7 ¼ 2ða þ bÞw

ð114Þ

f cRP ¼ f cL ¼ rc ¼ 0

ð115Þ

kc ¼ 8ð1 þ aÞw

ð116Þ

where b specifies the mask type, and the complex-valued phase term q is pffiffiffi equal to q ¼ expð jp=4Þ ¼ ða=2Þð1þjÞ with a ¼ 2. w is a 1D DFT column vector consisting of Nth roots of unity, and 0 is an 8D zero column vector whose elements are all equal to zero. Note the periodicity of the mask weights: odd symmetry Un;i ¼ Un;iþ4 for G1 and FRP1 masks, and even symmetry Un;i ¼ Un;iþ4 for FL1 and R1

40

PARK AND CHA

masks. The evenness or oddness can be understood in the context of the 3  3 masks. For FL1 and R1 masks, the corresponding complex-valued vectors are zero due to even symmetry of the mask weights. For the FRP1 mask, the complex-valued weight vector f cRP is a zero vector due to the fact that the mask weight is closely related to the irrational factor in the complex-valued phase term q. Note that the weight magnitude of the complex-valued masks Gc and Kc at each neighboring pixel is the same (nonzero constant), with the phase angle increased by the same amount of pn/4, if we scan the weights counterclockwise from the center right weight. The complex-valued masks Gc and Kc show the same magnitude for all neighboring pixels—eight peaks along all directions: horizontal, vertical, diagonal, and anti-diagonal directions. With b ¼ 1, the resulting complex-valued Prewitt and Kirsch weight vectors are the same, neglecting the constant term. For better understanding, we give a numeric example, in which compass gradient edge masks shown in Figure 17 are considered. Figure 20 shows a 3  3 image containing a vertical edge. Edge values computed using masks Un ¼ Gn ; 1  n  N ¼ 8 with b ¼ 1 (Prewitt masks), at the center of the image mask are given by 300, 200, 0, 200, 300, 200, 0, and 200, respectively. The mask G1 yields the maximum value, representing the edge orientation. Using Eq. (113), p weffiffiffi can obtain the real edge value of 600 þ 400a, as expected, where a ¼ 2. Or equivalently, we can obtain the edge value using the complex-valued edge mask Gc ¼ Gr þ jGi , where Gr and Gi denote real and imaginary parts of the mask Gc, respectively. Figure 21 shows Gr and Gi of the compass gradient edge masks, respectively (note the constant factor (a þ b) ), corresponding to Frei–Chen masks if the normalization constant is neglected. Convolving the image in Figure 20 with masks (with b ¼ 1) in Figure 21 gives the same numerical results: Gr ¼ 600 þ 400a and Gi ¼ 0. b. N ¼ 4 Cases. With pðn  1Þ=2; 1  n  N ¼ 4, we can write the corresponding complex-valued weight vectors as hc ¼ ½ ba0

aq1

f 0RP ¼ ½ q0

ba2 q5

q2

aq3

ba4

aq5

q7

q4

q1

ba6 q6

aq7

q3

t

aq1

a2

aq3

a4

ð117Þ ð118Þ

f cL ¼ rc ¼ 0 k c ¼ ½ a0

t

ð119Þ aq5

a6

t

aq7

ð120Þ

where q ¼ expð jp=4Þ ¼ ða=2Þð1þjÞ and hc and kc give two weight magnitude values depending on the direction from the center pixel to the neighboring

CIRCULANT MATRIX REPRESENTATION OF MASKS

41

Figure 20. Example of a 3  3 image containing a vertical edge.

Figure 21. 3  3 Real and imaginary masks (a ¼

pffiffiffi 2).

pixel considered: horizontal/vertical or diagonal/anti-diagonal. pffiffiffi For the Frei– Chen isotropic average gradient masks Hn with b ¼ a ¼ 2, hc gives the same weight magnitude at all neighboring pixels, that is, isotropic characteristics of weights. The Frei–Chen ripple edge weight vector fRP also has the same weight magnitude at all neighboring pixels, with the phase angle increased by the same amount of 5 pn/4, if we scan the weights counterclockwise from the center right weight. Note that the resulting complex-valued weight vectors f c1 and rc are trivial. Also, if b ¼ 1, two complex-valued masks Gc and Kc are the same (i.e., the Prewitt gradient masks Pn and the Kirsch edge masks Kn yield the same complex-valued weight vector, neglecting the constant factor). Note the periodicity of the mask weights: odd symmetry Un;i ¼ Un;iþ4 for G1 and FRP1 masks, and even symmetry Un;i ¼ Un;iþ4 for FL1 and R1 masks. For even symmetry cases such as in compass gradient edge masks Hn, defining a gradient magnitude and orientation in two orthogonal directions is based on the estimation of horizontal and vertical components of the intensity gradient vector using two (horizontal and vertical) edge masks. Using the periodicity inherent in the weight vector, for example, for odd symmetry, we can construct the vector-matrix formulation with the reduced data size, that is, the 8D weight vector un is reduced to the 4D weight vector u# n u# n ¼ ½ un;0

un;1

un;2

un;3 t

ð121Þ

where the superscript # denotes the reduced vector representation, and the corresponding intensity vector is given by p# odd ¼ ½ p0  p4

p1  p5

p2  p6

p3  p7 t :

ð122Þ

42

PARK AND CHA

Note that the weight vector of Eq. (121) and the intensity vector of Eq. (122) in reduced vector representation are obtained by taking the first four elements of the original weight vector representation, respectively. The reduced complexvalued weight vectors hc# and f c# RP with odd symmetry yield hc# ¼ 2½ bq0

aq1

0 f c# RP ¼ 2½ q

t

bq2

q5

q2

aq3

ð123Þ

t

ð124Þ

q7 ;

which are constructed by taking the first four elements of hc and f cR , respectively. Similarly, for even symmetry, the corresponding intensity vector is given by p# even ¼ ½ p0 þ p4

p1 þ p5

p2 þ p6

The reduced complex-valued weight vectors yield c# f c# ¼ ½0 0 L ¼r

p3 þ p7 t :

ð125Þ

f c# L

and rc# with even symmetry

0

0 t ;

ð126Þ

which are formulated by taking the first four elements of respectively.

f cL

and rc,

c. N ¼ 2 Cases. With an ¼ pðn  1Þ; 1  n  N ¼ 2, we can write the corresponding complex-valued weight vectors as hc ¼ 2hc1

ð127Þ

f cRP ¼ 2f cRP1

ð128Þ

f cL kc ¼ 8½ 1

1

¼ rc ¼ 0

0 1

1 1

ð129Þ 0

t

1 :

ð130Þ

For N ¼ 2 cases, the corresponding complex-valued weight vectors are degenerate, resulting in real-valued ones (e.g., the kernel weight vector itself, neglecting the constant factor, vertical Prewitt weight vector, or zero weight vector). Note the symmetry of the mask weights: Un;i ¼ Un;iþ4 for G1 and FRP1 masks, in which the formulated complex-valued edge vector is the realvalued kernel edge vector mask itself, and Un;i ¼ Un;iþ4 for FL1 and R1 masks, in which the combined edge weight vector is a zero vector due to the symmetry of the mask weight. The complex-valued feature mask for the compass Kirsch masks corresponds to the vertical Prewitt mask, neglecting the constant factor. Also note that h with b ¼ 1 is equivalent to kc, neglecting the constant factor. Tridirectional filters with three directions are described for gradient calculation, in which tridirectional filtering involves a vector sum of three halves of

CIRCULANT MATRIX REPRESENTATION OF MASKS

43

such filters (Paplinski, 1998). The filters are described by the 4  4 complexvalued matrix and applied to posterior eye capsule images and an ordinary image for edge detection. Also, the concept of directional filtering can be applied to finding edges of various orientations in fingerprint images (Jain et al., 1999). An optical implementation of real-time edge enhancement filters has been presented (Corecki and Trolard, 1998), in which, for example, the 3  3 complex-valued Sobel mask Sc with b ¼ 2 is used. The optical realization of the complex-valued mask uses an optical correlator with a matched filter whose impulse response is a weighted sum of eight delta functions. The complexvalued gradient edge masks are analyzed in the 1D frequency domain. C. Summary This section focuses on edge detection and feature detection, where the feature detection is represented by the extended form of edge detection. We have interpreted compass gradient masks and Frei–Chen masks in the case of N ¼ 8. This case also has been extended to complex-valued mask cases. Most interpretations are related to the circulant matrix and eigenvalue analysis in the DFT domain. In addition, it has been shown that Frei–Chen masks introduced as orthogonal masks have a similar structure as the compass gradient masks in the DFT domain. Compass gradient masks and Frei–Chen masks are closely related to orthogonal DCT, DST, and DHT masks, which are presented in Section IV. IV. Advanced Topics This section describes the DCT, DST, and DHT masks in terms of Frei– Chen orthogonal masks and presents their properties of edge detection. We focus especially on the DHT masks and show the relationship between DHT masks and KLT using the properties of the circulant symmetric matrix through SVD. Finally, their relationship is applied to the optical control system and information system. A. Orthogonal Transform-Based Interpretation We describe the DCT, DST, and DHT masks in terms of Frei–Chen masks and present the similarity between these orthogonal masks and Frei–Chen masks. Interpretation of the DCT, DST, and DHT masks is followed by the presentation of the relationship between the DHT and KLT.

44

PARK AND CHA

1. DCT and DST Interpretation The N-point for DCT and DST are defined in Section II. Especially, the case S of N ¼ 8 is presented here (Park, 1999b). Let TC k and Tk be the kth 3  3 DCT and DST masks, 0  k  7, formulated by circularly scanning along the clockwise direction, with eight DCT weights cosð2pkn=NÞ and DST weights sinð2pkn=NÞ, respectively, from the top left position (n ¼ 0) of a 3  3 window and its center weight equal to zero. Note that the orthogonal Frei–Chen masks span the 9D space, whereas the orthogonal DCT and DST masks form the 8D space. Figure 22 shows five 3  3 orthogonal DCT masks generated by the eight-point even DCT basis functions, with the center weight equal to zero. We can express the relationship between the DCT masks TC k and the Frei–Chen masks Fk as M TC 0 ¼ F9

1 1 C TC 1 ¼ T7 ¼ F1qccw ¼ F2qcw a a C C T2 ¼ T6 ¼ F5qcw ¼ F6 1 C TC 3 ¼ T5 ¼ F4 a 1 C T4 ¼ ðF7  F8 Þ 3

ð131Þ

pffiffiffi where a ¼ 2; FM 9 is the modified average mask generated by setting the center weight of F9 to zero, and F1qccw (F2qcw) denotes the mask obtained by  rotating F1 (F2) by 45 in the counterclockwise (clockwise) direction. Figure 23 shows four 3  3 orthogonal DST masks generated by the eight-point odd DST basis functions, with the center weight equal to zero. Similarly, we can express the relationship between the DST masks TSk and the Frei–Chen masks Fk as 1 1 TS1 ¼ TS7 ¼ F1qcw ¼  F2qccw a a TS2 ¼ TS6 ¼ F5 1 TS3 ¼ TS5 ¼  F3 a S S T0 ¼ T4 ¼ 0:

ð132Þ

According to Eqs. (131) and (132), the DCT/DST masks span the edge, line, and average subspaces as the Frei–Chen masks do. Weight masks C C C S S S S TC 1 ¼ T7 and T3 ¼ T5 ðT1 ¼ T7 and T3 ¼ T5 ) form the edge subspace, S C C S with T1 ¼ T7 ðT1 ¼ T7 ) representing the isotropic average gradient

CIRCULANT MATRIX REPRESENTATION OF MASKS

Figure 22. 3  3 Orthogonal DCT masks (a ¼

pffiffiffi 2).

Figure 23. 3  3 Orthogonal DST masks (a ¼

pffiffiffi 2).

45

46

PARK AND CHA

S C S mask and with TC 3 ¼ T5 ðT3 ¼ T5 Þ denoting the ripple mask. Similarly, S C C C weight masks T2 ¼ T6 and T4 ðT2 ¼ T6 S Þ form the line subspace, with S C S C TC 2 ¼ T6 ðT2 ¼ T6 ) signifying the directional mask and with T4 S C corresponding to the nondirectional Laplacian mask. Note that T0 ðT0 ¼ TS4 Þ represents the modified average (zero) subspace by setting the center pixel of the 3  3 window to zero. The proposed DCT/DST masks (constructed by selecting DCT and DST masks) are similar to the Frei–Chen masks, in the sense that they are similar to each other, except for the exclusion of the center weight, normalization factor, circular shift, and linear combination of masks. Note that the average subspace is defined in the 8D and 9D spaces for the DCT masks and the Frei–Chen masks, respectively, and that the zero subspace is defined in the 8D space for the DST masks. The 3  3 complex-valued DFT masks can be constructed by combining 3  3 DCT and DST masks, based on the property given by Eq. (38). Let us investigate on edge detection using 3  3 edge masks. We can define the 8D column vector fk and the input intensity column vector p ¼ ½ p0 p1 p2 p3 p4 p5 p6 p7 t by circularly scanning eight weights of the 3  3 Frei–Chen masks Fk and eight graylevel values of the 3  3 window in the clockwise direction from the top left position, respectively. For the Frei–Chen masks, edge detection is performed by the angle yf defined between the 8D intensity vector p and its projection to the edge subspace: vffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi uP u ðf pÞ2 uk2E k F ð133Þ yf ¼ cos1 u uP t 7 2 ðf k pÞ k¼0

where fk p represents the inner product of fk and p, and EF ¼ f1; 3; 5; 7g denotes a set of indices forming the edge subspace, that is, F1, F3, F5, and F7 form the edge subspace. S Similarly, we can define the 8D column vector tC k (tk ) by circularly scanC ning eight weights of the 3  3 DCT (DST) mask Tk (TSk ) in the clockwise direction from the top left position. From Eqs. (131) and (132), we can write ! 7 7  7  X X   1 X 2 C 2 S 2 ðpn Þ ¼ T þ Tk ð134Þ 8 k¼0 k n¼0 k¼0 by Parseval’s theorem of the DFT. With eight hybrid masks TCS k ; 0  k  7, selected from among the 3  3 DCT/DST masks, we can construct the C C CS C C CS 8D orthogonal space: four masks (TCS 1 ¼ T1 ¼ T7 ; T3 ¼ T3 ¼ T5 ; T5 S S CS S S ¼ T5 ¼ T3 , and T7 ¼ T7 ¼ T1 ) form the edge subspace; three masks C C CS C CS S S (TCS 2 ¼ T2 ¼ T6 ; T4 ¼ T4 , and T6 ¼ T6 ¼ T2 ) form the line subspace;

CIRCULANT MATRIX REPRESENTATION OF MASKS

47

C and TCS 0 ¼ T0 form the average subspace. In Figures 22 and 23, notations for eight orthogonal DCT/DST masks are also listed. Similar to cases for the Frei–Chen masks, edge detection by the proposed DCT/DST masks TCS k is performed by the angle ycs defined between the 8D intensity vector p and its projection to the edge subspace: vffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi u P CS u ðt pÞ2 uk2E k CS ð135Þ ycs ¼ cos1 u u P t 7 CS ðtk pÞ2 k¼0

CS CS where tCS k p represents the inner product of tk and p, with tk signifying CS the vector notation corresponding to the mask Tk , and ECS ¼ f1; 3; 5; 7g CS CS CS denotes a set of indices forming the edge subspace (i.e., tCS 1 ; t3 ; t5 , and t7 form the edge subspace). Computer simulations with several test images show that edge detection performance of the 3  3 orthogonal hybrid DCT/DST masks is similar to that of the Frei–Chen edge masks in Figure 24. Our experiments include a

CS Figure 24. Result of hybrid DCT/DST masks. (a) Original image, (b) (TCS 1 ; T7 ), CS CS CS CS CS CS CS CS (c) (T1 ; T7 ; T3 ; T5 ), (d) (T1 ; T7 ; T2 ; T6 ).

48

PARK AND CHA

CS CS CS CS CS half of an edge subspace (TCS 1 ; T7 ), edge subspace (T1 ; T7 ; T3 ; T5 ), CS CS CS CS and half of edge subspace plus line subspace (T1 ; T7 ; T2 ; T6 ).

2. DHT Interpretation The N-point DHT is described in Section II. The case of N ¼ 8 is considered here (Park et al., 1998). Let TH k ; 0  k  N  1, be the kth DHT mask, formulated by circularly scanned (in the clockwise direction) eight DHT weights, casð2pki=NÞ, of TH k from the top left position of a 3  3 window, with its center weight equal to zero. Note that the orthogonal Frei–Chen edge masks span the 9D space, whereas the orthogonal DHT masks form the 8D space. We can express the relationship between the DHT masks and Frei–Chen masks as M H H H TH 0 ¼ F7þ8 ; T1 ¼ F1 ; T2 ¼ F56 ; T3 ¼ F3qcw 1 H H H TH 4 ¼ F78 ; T5 ¼ F4qcw ; T6 ¼ F56qccw ; T7 ¼ F2 3

ð136Þ

M M where FM 7þ8 and F78 ðF56 ) denote F7 þ F8 and F7  F8 ðF5  F6 ), respecM M tively, with masks F7 and F8 being generated by setting center weights of F7 and F8 to zero, respectively. Masks F3qcw (F4qcw) and F56qccw represent the  modified masks of F3 (F4) and F5  F6 by rotating by 45 in the clockwise and counterclockwise directions, respectively. According to Eq. (136), the DHT masks span the edge, line, and average subspaces similar to those of Frei–Chen masks. The 8D DHT masks can be used as proper measures explaining the local properties of the 3  3 neighH H borhood: ‘‘edginess,’’ ‘‘lineness,’’ and ‘‘uniformity.’’ Weight masks TH 1 ; T3 ; T5 , H H H and T7 form the edge subspace, with T1 and T7 representing isotropic H average gradient masks, and with TH 3 and T5 denoting ripple masks. SimiH H H H larly, weight masks T2 , T4 , and T6 form the line subspace, with TH 2 and T6 H signifying directional masks, and with T4 corresponding to the nondirectional Laplacian mask. Note that TH 0 represents the modified average subspace excluding the center pixel of the 3  3 neighborhood. The proposed DHT masks are similar to the Frei–Chen masks, in the sense that two sets of masks are similar except for the exclusion of the center weight, normalization factor, circular shift, and linear combination of operators. Note that the average subspaces are defined in the 8D and 9D spaces for the DHT masks and Frei–Chen masks, respectively. Figure 25 shows the result of an isotopic H average gradient edge (TH 1 ; T7 ), isotopic average gradient edge plus ripple H H H H edge (T1 ; T7 ; T3 ; T5 ), and isotropic average gradient edge plus line edge H H H (TH 1 ; T7 ; T2 ; T6 ). We can define the 8D column vector tH k and the input intensity vector p by circularly scanning eight weights of the 3  3 DHT mask TH k and eight

CIRCULANT MATRIX REPRESENTATION OF MASKS

49

H H H H H Figure 25. Result of DHT masks. (a) Original image, (b) (TH 1 ; T7 ), (c) (T1 ; T7 ; T3 ; T5 ), H H H (d) (TH ; T ; T ; T ). 1 7 2 6

graylevel values of the 3  3 window in the clockwise direction from the top left position, respectively. Similar to the Frei–Chen masks, edge detection by the proposed DHT masks is determined by the angle yh defined between the 8D intensity vector p and its projection to the edge subspace: vffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi uP H 2 u uk2E ðtk pÞ H ð137Þ yh ¼ cos1 u uP t 7 H 2 ðtk pÞ k¼0

H where tH k p represents the inner product of tk and p, and EH denotes a set of H H indices forming the edge subspace; EH ¼ f1; 3; 5; 7g, that is, tH 1 ; t3 ; t5 , and tH form the edge subspace. 7 Let p, un (0  n  7), and g be 8D column vectors consisting of intensity values of neighboring pixels, weights of the nth feature mask, and feature strength values detected by eight feature masks, respectively. The subscript 0 in feature mask notation u0 represents the kernel weight vector from which other compass weight vectors un, 1  n  7, are constructed by circularly

50

PARK AND CHA

Figure 26. 3  3 Image (left) and its corresponding kernel mask (right).

shifting the weights n times. Note that eight neighboring intensity values pi and their corresponding weights ui are scanned counterclockwise from the center right pixel of the 3  3 mask. Figure 26 shows a 3  3 image represented by the intensity vector p and the 3  3 compass feature mask U0 corresponding to the kernel weight vector u0: p ¼ ½ p0 u0 ¼ ½ u0

p1 u1

p2 u2

P3

P4

P5

p6

p7 t

ð138Þ

u3

u4

u5

u6

u7 t

ð139Þ

where pi and ui, 0  i  7, represent the intensity value of the ith neighboring pixel and its corresponding weight of the kernel feature mask U0, respectively. The feature strength vector g can be defined by g ¼ ½ g0

g1

g2

g3

g4

g5

g6

g7 t :

ð140Þ

Eight 3  3 compass feature masks Un, 1  n  7, generate eight 8D column vectors un, each of which is a circularly shifted version of the kernel weight vector u0. Thus, these transposed vectors form the 8  8 circulant weight matrix Hu with the first row vector corresponding to the transposed kernel weight vector ut0 and each row representing each transposed directional weight vector: Hu ¼ ½u0 u1 u2 u3 u4 u5 u6 u7 t . Then feature detection by compass feature masks can be expressed in vector-matrix form: 32 3 2 3 2 p0 g0 u0 u7 u6 u5 u4 u3 u2 u1 6 g1 7 6 u1 u0 u7 u6 u5 u4 u3 u2 76 p1 7 76 7 6 7 6 6 g2 7 6 u2 u1 u0 u7 u6 u5 u4 u3 76 p2 7 76 7 6 7 6 76 7 6 g3 7 6 7 ¼ Hu p ¼ 6 u3 u2 u1 u0 u7 u6 u5 u4 76 p3 7: ð141Þ g¼6 6 g4 7 6 u4 u3 u2 u1 u0 u7 u6 u5 76 p4 7 76 7 6 7 6 6 g5 7 6 u5 u4 u3 u2 u1 u0 u7 u6 76 p5 7 76 7 6 7 6 4 g6 5 4 u6 u5 u4 u3 u2 u1 u0 u7 54 p6 5 g7 u7 u6 u5 u4 u3 u2 u1 u0 p7 The circulant matrix Hu can be diagonalized by the DFT matrix, and the corresponding eigenvalues rk, 0  k  7, construct the eigenvalue vector r.

CIRCULANT MATRIX REPRESENTATION OF MASKS

51

The eigenvalue vector r is expressed as the eight-point DFT of the first column of the matrix U, or equivalently, as the eight-point inverse DFT of u0. The eigenvectors of the circulant matrix are always the same regardless of the specific forms of the matrix. The only characteristics distinguishing one circulant matrix from another are its eigenvalues. If we generate the kernel masks as in Figures 27 and 28, with ui ¼ uNi, 0  i  N  1 ¼ 7, the formulated matrix Hu becomes a symmetric circulant matrix: 3 2 u0 u1 u2 u 3 u4 u3 u2 u1 6 u1 u0 u1 u 2 u3 u4 u3 u2 7 7 6 6 u2 u1 u0 u 1 u2 u3 u4 u3 7 7 6 6 u3 u2 u1 u 0 u1 u2 u3 u4 7 7 ¼ Ht : 6 Hu ¼ 6 ð142Þ u 7 6 u4 u3 u2 u 1 u0 u1 u2 u3 7 6 u3 u4 u3 u 2 u1 u0 u1 u2 7 7 6 4 u2 u3 u4 u 3 u2 u1 u0 u1 5 u1 u2 u3 u 4 u3 u2 u1 u0 Figure 27 shows the 3  3 compass gradient edge masks, such as Prewitt (P0), Sobel (S0), Kirsch (K0), and roof (R0) masks, where the subscript 0 signifies the kernel masks. Compass feature masks Un can be generated by counterclockwise rotating the kernel mask U0 by np/4, where 1  n  7. Similarly, Figure 28 shows 3  3 Frei–Chen kernel masks, with FG0, FRP0, and FL0 representing the gradient edge mask, the ripple edge mask, and the directional line mask, respectively. The real-valued column vectors fk ¼ ½cosð2pki=NÞ , 0  k; i  N  1, can be formulated, where the term in brackets denotes the component of the column vector. To diagonalize the circulant matrix Hu, the complex-valued

Figure 27. 3  3 Gradient edge kernel masks.

Figure 28. 3  3 Frei–Chen kernel masks (a ¼

pffiffiffi 2).

52

PARK AND CHA

eigenvectors wk ¼ ½expð j2pki=NÞ ; 0  k; i  N1, are required (Gonzalez and Woods, 1992). In this case, a new interpretation of the 3  3 compass feature masks can be obtained in the real-valued DHT domain, rather than in the complex-valued DFT domain. For eYcient computation, the realvalued basis vectors for the DHT can be used because of the symmetry property of the weights. With the symmetry property of the weights ui ¼ uNi ; 0  i  N  1 ¼ 7, the corresponding eigenvalues rk are real valued and given by

N

N 1 1 X X 2p 2p ki : ð143Þ rk ¼ rNk ¼ ui exp j ki ¼ ui cos N N i¼0 i¼0 With N ¼ 8 for our compass feature masks, we can explicitly write realvalued eigenvalues as r0 ¼ ðu0 þ u4 Þ þ 2ðu1 þ u2 þ u3 Þ pffiffiffi r1 ¼ ðu0  u4 Þ þ 2ðu1  u3 Þ ¼ r7 r2 ¼ ðu0 þ u4 Þ  2u2 ¼ r6 pffiffiffi r3 ¼ ðu0  u4 Þ  2ðu1  u3 Þ ¼ r5 r4 ¼ ðu0 þ u4 Þ  2ðu1  u2 þ u3 Þ:

ð144Þ

Table 3 lists the real-valued eigenvalues for various 3  3 feature masks, such as Prewitt (P), Sobel (S), Kirsch (K), roof (R), Frei–Chen gradient edge (FG), Frei–Chen ripple edge (FRP), and Frei–Chen line (FL) masks. These compass feature masks have the same eigenvectors, with the only diVerence being their eigenvalues. From Table 3, it is noted that the three Frei–Chen masks (FG, FRP, and FL) and the roof edge mask R can be regarded as the fundamental masks, in the sense that other feature masks are expressed as linear combinations of these masks. For example, the Prewitt and Sobel masks can be expressed in terms of FG and FRP. Similarly, the Kirsch masks can be expressed as a linear combination of masks FG, FRP, FL, and R. TABLE 3 Real-Valued Eigenvalues of Various 3  3 Compass Feature Masks Mask Eigenvalue

P

S

K

R

FG

FRP

FL

r0 r1 ¼ r7 r2 ¼ r6 r3 ¼ r5 r4

0 pffiffiffi 2þ 2 0 pffiffiffi 2 2 0

0 pffiffiffi 4þ2 2 0 pffiffiffi 42 2 0

0 pffiffiffi 8þ8 2 0 pffiffiffi 88 2 8

0 0 8 0 8

0pffiffiffi 4 2 0 0 0

0 0 0pffiffiffi 4 2 0

0 0 4 0 0

53

CIRCULANT MATRIX REPRESENTATION OF MASKS

The structure of Prewitt and Sobel masks are the same in the sense that their eigenvalues are the same, neglecting the constant factor. Four zeros are resulted from the dependency of edge strength: gn ¼ gnþ4 ; 0  n  3. Eigenvalues and eigenvectors of Frei–Chen gradient edge and ripple edge masks (FG and FRP) are diVerent from those of Prewitt masks. It is noted that r0 denotes the average value of the weights, which is equal to zero. Also note that edge masks (Prewitt, Sobel, Kirsch, Frei–Chen gradient edge, and Frei-Chen ripple edge masks) give nonzero r1 ¼ r7 and/or r3 ¼ r5, whereas the Kirsch, roof, and Frei–Chen line masks yield nonzero r2 ¼ r6 and/or r4. Similarly, the basis vectors of other orthonormal masks (e.g., masks derived from the DCT, DST, and DHT basis functions) can be obtained in terms of those listed in Table 3 (e.g., using the relationships between the masks and Frei–Chen masks). The eigenvalues of the complex-valued masks also can be expressed in terms of the real-valued eigenvalues listed in Table 3. The circulant matrix Hu can be written as Hu ¼ WDW1

ð145Þ

where D is a diagonal matrix whose main diagonal elements are equal to rk. The complex-valued DFT matrix W1 is constructed by columnwise stacking of eight eigenvectors wk ; 0  k  7. Similarly, we can construct the realvalued DCT matrix TC and the DST matrix TS by columnwise stacking of fk ¼ ½cosð2pki=NÞ and j k ¼ ½cosð2pki=NÞ ; 1  k; i  8, respectively. It is easy to show that the DCT matrix TC alone, constructed by fk, does not diagonalize Hu. For the symmetric circulant matrix Hu with real-valued eigenvalues rk, we can write D ¼ W1 Hu W ¼ TC Hu TC þ TS Hu TS 1

C

S

C

S

C

S

ð146Þ S

C

using W ¼ T  jT ; W ¼ T þ jT , and T Hu T þ T Hu T ¼ 0. Both the real-valued column vectors fk and jk are required to diagonalize Hu: the complex-valued eigenvectors wk or the real-valued column vectors lk ¼ fk þ jk. For eYcient computation, real-valued column vectors can be derived. From Eq. (146), we can rewrite the diagonal matrix D as D ¼ TC Hu TC þ TS Hu TS ¼ ðTH Þ1 Hu TH

ð147Þ

where TH ¼ ðTH Þ1 ¼ TC þ TS, neglecting the normalization constant N. The DHT matrix TH is obtained by columnwise stacking of lk ¼ fk þ j k :





2p 2p 2p ki þ sin ki ¼ cas ki ð148Þ lk ¼ fk þ j k ¼ cos N N N

54

PARK AND CHA

with the same corresponding eigenvalues rk in Eq. (143), where casy ¼ cosy þ siny. The corresponding column vectors are the basis functions for the DHT. With Eqs. (142) and (147), feature detection can be considered as a series of real-valued operations: DHT of the intensity vector p, multiplication of the eigenvalues rk in the DHT domain, and then the inverse DHT: g ¼ Hu p ¼ ðTH DðTH Þ1 Þp ¼ ðTH Þ1 DðTH pÞ

ð149Þ

where the eigenvalues for various types of feature masks are listed in Table 3. The real-valued DHT domain interpretation is applied to various 3  3 compass feature masks, such as edge, line, and roof masks, by using the symmetry property of the weight vector components. This interpretation can be eYciently applied to real-time processing of real-valued signals. Future research will focus on the extension of the DHT domain interpretation to various filters and directional filtering. 3. KLT Interpretation The orthonormal basis functions can be derived using the SVD (Jain, 1989). SVD analysis is used to correctly present the real-valued eigenvectors for diagonalization of the inner product matrix. Assume that X is the M  N matrix with its rank (g) satisfying the inequality g  M, N. The matrices XtX and XXt are symmetric and have the identical eigenvalues rk, 0  k  g  1. Then wv,k and wu,k satisfying Xt Xwv;k ¼ rk wv;k ; 0  k  g  1

ð150Þ

XXt wu;k ¼ rk wu;k ; 0  k  g  1

ð151Þ

can be obtained, where wv,k and wu,k are the kth orthonormal eigenvectors of XtX and XXt, respectively, with the same corresponding eigenvalues rk. Using the SVD on X, the matrix X can be written as pffiffiffiffi X ¼ Wu LWtv ð152Þ g ffiffiffiffi matrices, in which wv,k and wu,k where Wv and Wu denote N  g and M p pffiffiffiffi signify the kth columns, respectively, and L ¼ diagf rk g is a g  g diagonal matrix. The N  N vector inner product matrix V ¼ Xt X can be expressed as Wv LWtv , from which Wv and L can be directly determined, noting that Wv contains eigenvectors of V and that L has eigenvalues of V. pffiffiffiffi Next, we can get Wu ¼ XWv = L. Note that the covariance matrix of images is represented as C ¼ XXt ¼ Wu LWtu . The eigenvectors of the matrix with nondegenerate (i.e., distinct) eigenvalues are complete and orthonormal, spanning the entire vector space. For the

CIRCULANT MATRIX REPRESENTATION OF MASKS

55

matrix with degenerate eigenvalues, we have the freedom of replacing the eigenvectors corresponding to degenerate eigenvalues by a linear combination of themselves. Then, we can always perform orthogonalization and obtain a set of eigenvectors that are complete and orthonormal. This section presents two real-valued eigenvector matrix representations derived from the DFT matrix (Park, 2002b). Let the matrix X ¼ ½x0 x1 . . . xN1 be constructed by columnwise stacking of N uniformly rotated images xi, 0  i  N 1, where the term in brackets denotes the component (column vector) of the matrix. Because of the nature of X and definition of the N  N inner product matrix V ¼ Xt X, V has several properties, as shown in Section II. From properties (2) symmetric (V ¼ Vt ), and (3) circulant, the elements in the first row ½b0 b1 . . . bN1 are such that bm ¼ bNm ; 0  m  N  1, where the matrix elements bm are defined by bm ¼ xti xim . Because V is real and symmetric, its eigenvalues are real. Eigenvectors of any circulant matrix can be taken as wk ¼ ½expð j2pkm=NÞ ; 0  k; m  N  1, where wk represent basis column vectors of the DFT matrix. Their conjugate vectors wk ¼ ½expðj2pkm=NÞ ; 0  k; m  N  1, are similarly defined, where  denotes complex conjugation. The real-valued vectors, the sampled cosines, fk ¼ ½cosð2pkm=NÞ ; 0  k; m  N  1, are defined by taking real parts of wk . With the symmetry property of bm ¼ bNm , the corresponding eigenvalues rk for wk are given by

N

N 1 1 X X 2p 2p km : ð153Þ bm exp j km ¼ bm cos rk ¼ rNk ¼ N N m¼0 m¼0 In general, the eigenvalues of a circulant matrix are complex, whereas those of a real symmetric circulant matrix (which we have here) are real. The real-valued eigenvalues rk for the real symmetric circulant matrix V are given by the DFT of the first column (row) of the matrix V, the autocorrelation element vector bm ¼ ½bm ; 0  m  N  1 (Jain et al., 1999), or equivalently, by the inner products of bm and fk. The matrix V can be written as V ¼ WLW1

ð154Þ

where L is the diagonal matrix with the eigenvalues rk along the diagonal. The DFT matrix W1 is constructed by columnwise stacking of N eigenvectors wk ; 0  k  N  1, and its inverse DFT matrix is given by W/N. Similarly, we can construct the matrices TC and TS by columnwise stacking of fk ¼ ½cosð2pkm=NÞ and j k ¼ ½sinð2pkm=NÞ ; 0  k  N  1, respectively. Note that vectors fk (jk) correspond to the real (imaginary) parts of the complex-valued DFT vectors wk , that is, TC ¼ ReðW1 Þ and TS ¼ ImðW1 ). It is easy to show that the matrix TC, constructed by fk,

56

PARK AND CHA

does not diagonalize V because of interdependency of fk vectors (fk ¼ fNk ). With distinct eigenvalues, eigenvectors corresponding to eigenvalues span the orthonormal space. With the repeated eigenvalue rk ¼ rNk, we can construct a new pair of orthonormal and complete eigenvectors. Each pair of eigenvectors having the duplicated eigenvalue rk ¼ rNk can be transformed by 1 1 1 ð155Þ TV ¼ 2 j j with the complex-valued matrix ½wk wNk t converted into the real-valued matrix ½fk j k t , where the real-valued eigenvectors fk and jk can be obtained from the SVD of Xt X ¼ Wv LWtv . With rk ¼ rNk , the eigenvector matrix consisting of the N real-valued eigenvectors is given by Wv ¼ ½ wv;0 wv;1 . . . wv;N1 " ½f0 f1 . . . fN=2 j 1 j 2 . . . j N=21 for even N ¼ ½f0 f1 . . . fðN1Þ=2 j 1 j 2 . . . j ðN1Þ=2 for odd N

ð156Þ

where it can be constructed by the SVD, neglecting the normalization constants. Note that the transformation TV is not unique. For the symmetric circulant matrix V with the real-valued rk, we can write L ¼ W1 VW ¼

1 C ðT VTC þ TS VTS Þ N

ð157Þ

using W1 ¼ TC  jTS ; W ¼ ð1=NÞðTC þ jTS Þ, and TC VTS ¼ TS VTC ¼ 0. Both fk and jk are needed to diagonalize V. Optimal representation should be made with the complex-valued eigenvectors wk , or equivalently with both the real-valued eigenvectors fk and jk, by which the diagonal matrix L is constructed. The corresponding eigenvectors wu,k of the covariance matrix V ¼ XXt are represented as the linear combinations of the input image xi: 1 X 1 N ðwv;k Þi xi wu;k ¼ pffiffiffiffi rk i¼0

ð158Þ

where (wv,k)i signifies the ith element of the eigenvector wv,k. As mentioned previously, for the repeated eigenvalue cases, construction of the eigenvector matrix is not unique. The transformation TU " # 1 1þj 1j U T ¼ ð159Þ 2 1j 1þj

CIRCULANT MATRIX REPRESENTATION OF MASKS

converts the complex-valued matrix ½wk ½ fk þ j k

57

wNk t into the real-valued matrix:

fNk þ j Nk t ¼ ½ lk

lNk t ;

ð160Þ

which leads to the DHT interpretation. The DHT is the real part minus the imaginary part of the DFT (Bracewell, 1986). It is real valued and computationally fast; thus, the DHT has been applied to various signal processing and interpretation applications. It is shown that basis functions of the eightpoint DHT construct the 3  3 DHT masks that are closely related to the Frei–Chen masks. From Eq. (157), we can rewrite the diagonal matrix L as L¼

1 C ðT VTC þ TS VTS Þ ¼ TH VðTH Þ1 N

ð161Þ

where (TH Þ1 ¼ ð1=NÞTH ¼ ð1=NÞðTC þ TS ). The DHT matrix TH is obtained by columnwise stacking of lk. The eigenvectors lk can be expressed as



2p 2p km þ sin km lk ¼ fk þ j k ¼ cos N N



ð162Þ pffiffiffi 2p 2p p ¼ cas km ¼ 2 cas km  N N 4 with the corresponding eigenvalues rk. Neglecting the constant factor and with Dk ¼ p=4, the derived eigenvectors lk are equal to the real parts of the DFT basis functions with some oVset phase Dk. Then the corresponding eigenvectors of the covariance matrix V can be represented as the DHT of the input image xi, or equivalently as the inner products of xi and the real parts fk of the DFT basis functions with some oVset phase: sffiffiffiffi



1 1 X X 1 N 2p 2N 2p p ki xi ¼ ki  wu;k ¼ pffiffiffiffi cas cos ð163Þ xi : rk i¼0 N rk i¼0 N 4 Due to the repeated eigenvalues, the eigenvector matrix of V is not unique. Instead of the complex-valued eigenvector matrix W1, we can construct the real-valued eigenvector matrix Wv by the SVD or TH from the DHT, in which both real-valued eigenvector matrices are interrelated by a linear transformation. The L basis vector calculations for approximation of N uniformly rotated images are summarized as follows. (1) Compute the autocorrelation um of the rotated images. (2) Compute rk using Eq. (153). Order rk by decreasing order of magnitude. (3) Construct the real-valued eigenvectors wu,k using Eq. (158) or Eq. (163), whose corresponding rk are the largest k. Note that two sets of basis vectors obtained from Eqs. (158) and (163) are related by a simple linear transformation.

58

PARK AND CHA

As an example, for N ¼ 4 we show that fk ; 0  k  3, are not linearly independent and cannot diagonalize V. Let V be given by 2 3 b0 b1 b2 b1 6 b1 b0 b1 b2 7 7 V¼6 ð164Þ 4 b2 b1 b0 b1 5 b1 b2 b1 b0 where bm ¼ b4m ; 0  m  3, denote autocorrelation elements. Then TC and TS constructed by eigenvectors fk and j k ; 0  k  3, are expressed as 2 3 1 1 1 1 61 0 1 07 7 TC ¼ ½ f0 f1 f2 f3 ¼ 6 4 1 1 1 1 5 1 0 1 0 and 2

TS ¼ ½ j 0

j1

j2

0 60 j3 ¼ 6 40 0

0 1 0 1

3 0 0 0 1 7 7; 0 05 0 1

ð165Þ

respectively. Note that TS TC ¼ TC TS ¼ 0 and TC VTS ¼ TS VTC ¼ 0. The columns of both matrices are not linearly independent, thus either TC or TS cannot diagonalize V. However, the matrices 2 3 1 1 1 0 61 0 1 17 7 T Q ¼ ½ tQ ¼ ½ f0 f1 f2 j 1 ¼ 6 tQ tQ tQ 4 1 1 0 1 2 1 1 05 1 0 1 1 and T H ¼ ½ l0

l1

l2

l3 ¼ ½ f0 þ j 0 f1 þ j 1 f2 þ j 2 2 3 1 1 1 1 61 1 1 1 7 7 ¼6 4 1 1 1 1 5 1 1 1 1

f3 þ j 3

diagonalize V, that is 1 V ¼ ðTQ Þ1 LTQ ¼ TH RðTH Þ1 ¼ ðTC RTC þ TS RTS Þ 4 ¼ diag fr0 ¼ b0 þ 2b1 þ b2 ; r1 ¼ b0  b2 ;

ð166Þ

CIRCULANT MATRIX REPRESENTATION OF MASKS

r2 ¼ b0  2b1 þ b2 ; r3 ¼ r1 ¼ b0  b2 g:

59 ð167Þ

Note that 2

1 ðTH Þ1 ¼ TH 4

and ðTQ Þ1

1 16 2 ¼ 6 441 0

1 0 1 2

1 2 1 0

3 1 07 7: 1 5 2

ð168Þ

The eigenvector matrix of V with repeated eigenvalues is not unique. Two representations for constructing it are explained: TQ and TH. The matrix TH can be constructed from the matrix TQ, or vice versa (i.e., Q Q Q Q Q l0 ¼ tQ 0 ; l1 ¼ t0 þ t3 ; l2 ¼ t2 , and l3 ¼ t1  t3 ). The two eigenvectors l1 and l3 in TH having the same eigenvalue r1 ¼ r3 can be related to the two Q Q eigenvectors tQ 1 and t3 in T by the 2  2 transformation matrix: 1 1 T¼ ð169Þ 1 1 which is the two-point DHT matrix. Pairs of basis vectors obtained from two conventions, corresponding to the degenerate eigenvalues, are related by T. B. Application to Other Fields In this section, we discuss advanced topics that are related to circulant systems and DHT masks. We introduce two examples—optical control system and information system. The primary goal of this section is to show that our previous interpretation can be applied to various fields. 1. Optical Control System Exploiting the circularity of the mirror and a suitable model of atmospheric distortion, the control system is divided into a number of smaller decoupled control problems (Miller and Grocott, 1999). The decoupled nature of the control problem permits significant computation reduction when implementing the control system for real-time applications. A system is represented by the cross-interactions between a particular system and the remaining subsystems, and the self-interactions. A system is circular if all of the subsystems are identical, having the same self-dynamics and crossinteractions. In such a system, the origin of the system is arbitrary, invariant to the circular ordering of the subsystems. This property inherent in a circular system allows a high degree of decoupling in the adaptive optics control design and implementation.

60

PARK AND CHA

In general, 2 y0 6 y1 6 6 y ¼ 6 y2 6 .. 4 .

adaptive optics systems can 3 2 a0 aN1 aN2 7 6 a1 a0 aN1 7 6 7 6 a2 a a0 1 ¼ 7 6 7 6 .. .. .. 5 4 . . .

yN1

aN1

aN2

aN3

be described by 32 x0 a1 6 x1 a2 7 76 6 a3 7 76 x2 .. 76 .. .. . 54 . . a0

the relationship 3 7 7 7 7 ¼ Ax; 7 5

ð170Þ

xN1

where x and y represent the input and output vectors, respectively; N signifies the size of the vectors; and A denotes the circulant matrix showing the circularity of the subsystems. The circulant matrix is diagonalized by the DFT matrix; thus, the analysis can be done in the frequency domain and used to reduce the computation time in real-time implementations. The objective of this section is to point out that the further real-valued symmetry assumption of A ¼ At makes it possible to analyze the control system in the real-valued DHT domain rather than in the complex-valued DFT domain (Park, 2000). Note that the orthonormal DFT basis vectors are used for diagonalization of the symmetric circulant matrix A. Or equivalently, for eYcient computation, the real-valued basis vectors for the DHT can be used, utilizing the symmetry of the real-valued matrix A. Note that the following mathematical formulation is valid for the realvalued symmetric circulant matrix A. The matrix A is constructed by columnwise stacking of N vectors ai ; 0  i  N  1. In the N  N circulant matrix A ¼ [aki], the (k, i)th element depends only on | k  i |, where the term in brackets denotes the component of the matrix. To diagonalize the circulant matrix, the complex-valued eigenvectors wk ¼ ½expð j2pki=NÞ , 0  k; i  N  1, are used, where the term in brackets denotes the component of the column vector. Their conjugate vectors wk ¼ ½expðj2pki=NÞ , 0  k; i  N  1, are similarly defined. The complex-valued basis vectors wk for the DFT are the orthonormal eigenvectors. The real-valued vectors fi ¼ ½cosð2pki=NÞ ; 0  k; i  N  1, are defined by taking the real parts of wk . For the symmetric matrix A ¼ At, the corresponding eigenvalues rk for wk ; 0  k  N  1, are given by rk ¼ rNk ¼

N 1 X

ai expðj2pki=NÞ ¼

i¼0

N 1 X

ai cosð2pki=NÞ:

i¼0

The matrix A can be written as previously stated: A ¼ WDW1 : The DFT matrix W1 ¼ ½w0 w1 . . . wN1 ] (inverse DFT matrix W) is constructed by columnwise stacking of N eigenvectors wk ðwk Þ; 0  k  N  1. It

61

CIRCULANT MATRIX REPRESENTATION OF MASKS

is noted that W1 ¼ WZ, where the superscript Z signifies the Hermitian, or complex conjugate, transpose. Similarly, we can construct the modified DCT matrix TC and the modified DST matrix TS by columnwise stacking of fk ¼ ½cosð2pki=NÞ and j k ¼ ½sinð2pki=NÞ ; 0  k; i  N  1, respectively. We can write D ¼ W1 AW ¼ TC ATC þ TS ATS :

ð171Þ

Note that the real-valued matrix W given by Eq. (156): ( ½f0 f1 fN=2 j 1 j 2 j N=21 for even N W¼ ½f0 f1 fðN1Þ=2 j 1 j 2 j ðN1Þ=2 for odd N consisting of the N real-valued vectors, diagonalizes A (i.e., W1 AW is a diagonal matrix). For eYcient computation, real-valued eigenvectors diagonalizing A can be constructed. From Eq. (171), we can rewrite the diagonal matrix D as D ¼ TC ATC þ TS ATS ¼ ðTH Þ1 ATH

ð172Þ

H 1

where TH ¼ ðT Þ ¼ TC þ TS neglecting the normalization constant N. Note that the diagonal matrix D is real valued for the real-valued matrix A. The DHT matrix TH is formulated by columnwise stacking of the realvalued eigenvectors li. Using Eq. (172) and neglecting the normalization constant N, the symmetric circulant matrix A can be expressed as A ¼ ðTH Þ1 DTH :

ð173Þ

Thus y can be obtained by first computing the DHT of x, multiplying eigenvalues rk representing the decoupled scalar constants in the DHT domain, and finally performing the IDHT. For real-valued x, y, and A, the fast computations are possible in the real-valued DHT domain. Equivalently, the relationship between individual terms in x and y can be expressed as a circular convolution. Noting that a0 is even since A is a symmetric circulant matrix and using Eq. (173), the multiplication relationship in the DHT domain for each decoupled subsystem is explained. 2. Information System The circulant Gaussian channel was presented as an example to compute canonical correlations and directional cosines and to derive Shannon’s capacity theorem (Scharf and Mullis, 2000). In the circulant Gaussian channel, the DFT representations are employed using the property of the circulant matrix, in which the unitary DFT basis vectors are used for

62

PARK AND CHA

diagonalization of the circulant covariance matrices. This section presents a simpler real-valued representation by the DHT, in place of the complexvalued representation by the DFT (Park, 2002b). In other words, the real-valued basis vectors for the DHT can be used, further utilizing the symmetry property of real-valued covariance matrices. This simple representation by the DHT can be applied to various applications, such as adaptive filtering and filter design, if the matrix is real, symmetric, and circulant. As an example in edge detection, utilizing the special structure of 3  3 realvalued compass gradient edge masks, the relationship between the DFT interpretation and the DHT interpretation was investigated. The N  N covariance matrix is real valued, circulant, and symmetric (i.e., K ¼ Kt ). The matrix K ¼ ½k0 k1 . . . kN1 ] can be expressed in terms of the covariance element vectors ki ¼< kðk  iÞ >N ; 0  i; k  N  1, where the terms in brackets denote the elements of the column vectors ki and the subscript ‘mod’ signifies the modulo operation. To diagonalize any circulant matrix, the complex-valued eigenvectors, wk ¼ ½expð j2pki=NÞ ; 0  k; i  N  1, are required. Their conjugate vectors wk ¼ ½expðj2pki=NÞ are similarly defined. The real-valued vectors, the sampled cosines, fi ¼ ½cosð2pki=NÞ ; 0  i; k  N  1, are defined by taking real parts of wk , with the corresponding eigenvalues rk given by the DFT of the first column of the matrix K. The covariance matrix K can be written as K ¼ WDW1

ð174Þ

where D is the diagonal matrix with the eigenvalues rk along the diagonal. The N eigenvectors wk ; 0  k  N  1, are the columns (basis vectors) of the unitary DFT matrix W1, that is, W1 ¼ ½w0 w1 . . . wN1 ], and its inverse W is given by W ¼ ð1=NÞ½w0 w1 . . . wN1 ]. In the same way in the previous section, fk ¼ ½cosð2pki=NÞ and j k ¼ ½sinð2pki=NÞ , 0  k; i  N  1, construct the N  N matrices. For the symmetric circulant matrix K, we can write D ¼ W1 KW:

ð175Þ

According to the analysis with Section IV.A.3, we can rewrite Eq. (175) as  1 1 C C T KT þ TS KTS D ¼ W1 KW ¼ TH KðTH Þ1 ¼ ð176Þ N N where TH ¼ TC þ TS denotes the real-valued DHT matrix, ðTH Þ1 ¼ ð1=NÞTH , and TC KTS ¼ TS KTC ¼ 0. The equalities TC KTS ¼ TS KTC ¼ 0 can be verified using the facts that TC TS ¼ TS TC ¼ 0, and the matrices D ¼ W1 KW; TC KTS , and TS KTC are real valued.

CIRCULANT MATRIX REPRESENTATION OF MASKS

63

The symmetric circulant Gaussian channel leads to simpler representations, compared with the DFT representations, for computation of canonical correlations and the related quantities. Let the measurement y ¼ x þ n be the sum of the signal x and the channel noise n. Assume that the real-valued covariance matrices Kxx ¼ ½k00 k01 . . . k0N1 and Knn ¼ ½k000 k001 . . . k00N1 are symmetric and circulant, and Kyy ¼ Kxx þ Knn , where Kxx ; Knn , and Kyy are covariance matrices of x, n, and y, respectively. Also assume that the cross-covariance matrix Kxy is equal to Kxx . These real-valued symmetric circulant matrices have rather simpler DHT representations (Park, 2002b): 1 H 1 T Mxx TH ¼ ðTC Mxx TC þ TS Mxx TS Þ N N 1 H 1 H 1 H H ¼ ðT Þ Mnn T ¼ T Mnn T ¼ ðTC Mnn TC þ TS Mnn TS Þ N N 1 H 1 H 1 H H ¼ ðT Þ Mxx T ¼ T Mxx T ¼ ðTC Mxx TC þ TS Mxx TS Þ ð177Þ N N 1 ¼ ðTH Þ1 ðMxx þ Mnn ÞTH ¼ TH ðMxx þ Mnn ÞTH N 1 ¼ fTC ðMxx þ Mnn ÞTC þ TS ðMxx þ Mnn ÞTS g; N

Kxx ¼ ðTH Þ1 Mxx TH ¼ Knn Kxy Kyy

where Mxx (Mnn) represents the diagonal line spectrum matrix of x (n): ( ) N 1 X 2p 0 ki cos ki and Mxx ¼ diagfMxx ðkÞg ¼ diag N i¼0 ( ) N 1 X 2p 00 Mnn ¼ diagfMnn ðkÞg ¼ diag ki cos ki ; 0  i; k  N  1: N i¼0 The coherence matrix is also symmetric circulant and the canonical correlation matrix consists of ratios that might loosely be called voltage ratios. With these matrix representations by the DHT, we follow the same derivation steps for various interesting quantities, such as the direction cosines/sines, the error covariance matrix, and the channel capacity. C. Results and Discussions This section shows experimental results of various masks such as edge masks, feature masks, and orthogonal masks presented in this article. We have applied masks to a synthetic image to show the validity of the proposed interpretation. Also, we have applied masks to a real image, in which 256  256 Lena image quantized to 8 bits is used as a test image as shown in Figure 29. Resulting images are obtained by using diVerent

64

PARK AND CHA

Figure 29. Original Lena image (256  256, 256 levels).

Figure 30. Resulting images by edge masks. (a) Prewitt masks, (b) Sobel masks, (c) Kirsch masks, (d) Frei–Chen masks.

threshold values, in which the threshold values are selected experimentally to obtain the optimal edge detection results. Figure 30 shows resulting images by edge masks: Prewitt, Sobel, Kirsch, and Frei–Chen. In the case of Prewitt, Sobel, and Kirsch masks, all eight-directional results are combined and displayed using the same threshold value of 128. Results of Frei–Chen masks in edge subspace are displayed with the threshold value of 0.03. Figure 31 displays resulting images by feature masks: roof and line masks. Resulting images are obtained using the same threshold value of 20. They can be interpreted in the context of compass feature masks in the DFT domain. Figure 32 shows resulting images by orthogonal masks: DCT, DST, DCT/ DST, and DHT masks. All results consist of isotopic average gradient edge plus ripple edge and processed by the threshold value of 1.55. They are similar to each other and especially, results of the DHT masks are very similar to those of Frei–Chen masks shown in Figure 30.

CIRCULANT MATRIX REPRESENTATION OF MASKS

65

Figure 31. Resulting images by feature masks. (a) Roof masks, (b) line masks.

Figure 32. Resulting images by orthogonal masks. (a) DCT masks, (b) DST masks, (c) DCT/DST masks, (d) DHT masks.

D. Summary This section asserts that DCT, DST, and DHT masks can be used for edge and feature detection, and their relationships can be applied to various advanced applications. We have derived the relationship between the 3  3 DCT/DST masks and the Frei–Chen masks. In addition, we have shown that the real-valued DHT domain interpretation has been applied to various 3  3 compass feature masks. The relationship between DHT masks and KLT has been illustrated and it has been successfully applied to other fields such as the optical control system and information system.

V. Conclusions The properties of special matrices such as the circulant and circulant symmetric matrices are fundamental to understanding the overall context of this article. The input-output relationship represented by a matrix is related to

66

PARK AND CHA

the convolution equation in LTI systems. In addition, the transform matrix between input and output has been expressed by the circulant matrix or circulant symmetric matrix. It is important to note that those matrices are related to 3  3 edge and feature detection masks, such as compass gradient masks and orthogonal masks, which can be generalized to the N  N matrix cases. We have focused on the diagonalization property and eigenvalue analysis of the N  N circulant matrix in the DFT domain. In addition, we have briefly introduced the N-point DCT, DST, and DHT masks, from which we have unified the mathematical background for interpretation of edge and feature detection. The circulant matrix and its frequency domain interpretation have been used to explain useful properties of 3  3 compass gradient edge masks such as Sobel, Prewitt, and Kirsch masks. This interpretation has been extended to a simple eigenvalue computation method of the circulant matrices of Sobel, Prewitt, and Kirsch masks. It is related to the interpretation of the Frei–Chen masks in terms of the 8D DFT basis vectors. We have shown that compass gradient edge masks have a similar structure in the 1D frequency domain. By unifying eigenvalue analysis in the 1D frequency domain, the Frei–Chen edge masks and their irrational weights are well explained. In addition, the complex-valued compass gradient edge masks have been analyzed in the 1D frequency domain. The complex-valued compass Prewitt and Sobel masks have been represented in terms of the two types of complexvalued compass Frei–Chen edge masks, in the spatial and frequency domains. By the unified eigenvalue analysis of compass feature masks in the 1D frequency domain, the compass roof edge and Frei–Chen line masks have been investigated. The directional filter formulation has been applied to various 3  3 compass feature masks, such as edge, line, and roof masks, with the diVerent number of directions N. Interpretation of the 3  3 compass gradient masks and Frei–Chen masks in the DFT domain is the framework of this work. We have derived the relationships between the 3  3 DCT/DST masks and the Frei–Chen masks. In addition, the real-valued DHT domain interpretation has been applied to various 3  3 compass feature masks, such as edge, line, and roof masks, by using the symmetric property of the weight vector components. The connection between the DHT masks and the KLT has been discussed and it has been successfully applied to other advanced fields. In summary, we have presented a circulant matrix interpretation of the edge and feature detection in the frequency domain and its further applications. The key contexts of the review article include the relationship between the circulant matrix and the convolution operation in the LTI system, the properties of the circulant matrix in the DFT domain, the relationship

CIRCULANT MATRIX REPRESENTATION OF MASKS

67

between compass gradient masks and Frei–Chen masks, the relationship between the DCT, DST, DHT masks and compass gradient masks or Frei–Chen masks, and the relationship between the DHT masks and the KLT. Further research will focus on the development of adaptive signal processing algorithms and their application to various filtering problems.

References Abdou, I. E., and Pratt, W. K. (1979). Quantitative design and evaluation of enhancement/ thresholding edge detectors. Proc. IEEE 67, 753–763. Bracewell, R. N. (1986). The Hartley Transform. New York: Oxford University Press. Corecki, C., and Trolard, B. (1998). Optoelectronic implementation of adaptive image preprocessing using hybrid modulations of Epson liquid crystal television: Applications to smoothing and edge enhancement. Optical Engineering 37, 924–930. Davis, P. J. (1994). Circulant Matrices. New York: Chelsea Publishing. Deo, N., and Krishnamoorthy, M. S. (1989). Toeplitz networks and their properties. IEEE Trans. Circuits and Systems 36, 1089–1092. Frei, W., and Chen, C. (1977). Fast boundary detection: A generalization and a new algorithm. IEEE Trans. Computer 26, 988–998. Gonzalez, R. C., and Wintz, P. (1977). Digital Image Processing. Reading, MA: AddisonWesley. Gonzalez, R. C., and Woods, R. E. (1992). Digital Image Processing. Reading, MA: AddisonWesley. Gray, R. M. (2000). Toeplitz and circulant matrices: A review [online]. Available at: http:// www-ee.stanford.edu/gray/toeplitz.pdf. Jain, A. K. (1989). Fundamentals of Digital Image Processing. Englewood CliVs, NJ: PrenticeHall. Jain, A., Prabhakar, K. S., and Hong, L. (1999). A multi-channel approach to fingerprint classification. IEEE Trans. Pattern Analysis and Machine Intelligence 21, 348–395. Lay, D. C. (2003). Linear Algebra and Its Application. 3rd ed. New York: Addison-Wesley. Lee, X., Zhang, Y.-Q., and Leon-Garcia, A. (1993). Information loss recovery for block-based image coding techniques: A fuzzy logic approach. IEEE Trans. Image Processing 4, 259–273. Miller, D. W., and Grocott, S. C. O. (1999). Robust control of the multiple mirror telescope adaptive secondary mirror. Optical Engineering 38, 1276–1289. Paplinski, A. P. (1998). Directional filtering in edge detection. IEEE Trans. Image Processing 7, 611–615. Park, R.-H. (1990). A Fourier interpretation of the Frei-Chen masks. Pattern Recognition Letters 11, 631–636. Park, R.-H. (1998a). 1-D frequency domain analysis of the Frei-Chen edge masks. Electronics Letters 34, 535–537. Park, R.-H. (1998b). 1-D frequency domain interpretation of complex compass gradient edge masks. Electronics Letters 34, 2021–2022. Park, R.-H. (1999a). 1-D frequency domain interpretation of compass roof edge and Frei-Chen line masks. Pattern Recognition Letters 20, 281–284.

68

PARK AND CHA

Park, R.-H. (1999b). Interpretation of eight-point discrete cosine and sine transforms as 3  3 orthogonal edge masks in terms of the Frei-Chen masks. Pattern Recognition Letters 20, 807–811. Park, R.-H. (2000). Comments on ‘Robust control of the multiple mirror telescope adaptive secondary mirror.’ Optical Engineering 39, 3321–3322. Park, R.-H. (2002a). Comments on ‘Optimal approximation of uniformly rotated images: Relationship between Karhunen-Loeve expansion and discrete cosine transform.’ IEEE Trans. Image Processing 11, 322–324. Park, R.-H. (2002b). Comments on ‘Canonical coordinates and the geometry of inference, rate, and capacity.’ IEEE Trans. Signal Processing 50, 1248–1249. Park, R.-H. (2002c). Complex-valued feature masks by directional filtering of 3  3 compass feature masks. Pattern Analysis and Applications 5, 363–368. Park, R.-H., and Choi, W.-Y. (1989). A new interpretation of the compass gradient edge operators. Computer Vision, Graphics, Image Processing 47, 259–265. Park, R.-H., and Choi, W.-Y. (1990). Comments on ‘A three-module strategy for edge detection.’ IEEE Trans. Pattern Analysis and Machine Intelligence 12, 223–224. Park, R.-H., and Choi, W.-Y. (1992). Eigenvalue analysis of compass gradient edge operators in Fourier domain. J. Circuits Systems Computers 2, 67–74. Park, R.-H., Yoon, K.-S., and Choi, W.-Y. (1998). Eight-point discrete Hartley transform as an edge operator and its interpretation in the frequency domain. Pattern Recognition Letters 19, 569–574. Robinson, G. S. (1977). Edge detection by compass gradient masks. Computer Graphics and Image Processing 6, 492–501. Rosenfeld, A., and Kak, A. C. (1982). Digital Picture Processing. 2nd ed., Vol. 2. New York: Academic Press. Scharf, L. L., and Mullis, C. T. (2000). Canonical coordinates and the geometry of inference, rate, and capacity. IEEE Trans. Signal Processing 48, 824–831. Uenohara, M., and Kanade, T. (1998). Optimal approximation of uniformly rotated images: Relationship between Karhunen-Loeve expansion and discrete cosine transform. IEEE Trans. Image Processing 7, 116–119. Yu, F. T. S. (1983). Optical Information Processing. New York: Addison-Wesley.