• 沒有找到結果。

An efficient algorithm for the Fourier transform on a compressed image in restricted quadtree and shading format

N/A
N/A
Protected

Academic year: 2021

Share "An efficient algorithm for the Fourier transform on a compressed image in restricted quadtree and shading format"

Copied!
5
0
0

加載中.... (立即查看全文)

全文

(1)

An efficient algorithm for the Fourier transform on a compressed

image in restricted quadtree and shading format

Kuo-Liang Chung

a,

, Wen-Ming Yan

b,1

aDepartment of Information Management, Institute of Computer Science and Information Engineering, National Taiwan University of Science and Technology, No. 43, Section 4, Keelung Road, Taipei, Taiwan 10672

bDepartment of Computer Science and Information Engineering, National Taiwan University, No. 1, Section 4, Roosevelt Road, Taipei, Taiwan 106

Received 9 October 2000; received in revised form 23 October 2000 Communicated by L. Boasson

Abstract

Given a compressed image in restricted quadtree and shading format, this paper presents an efficient algorithm for the Fourier transform on the compressed image directly. The proposed algorithm takes O(K2log K+ N2) time, where the decompressed

grey image is of size N× N and K denotes the number of nodes in the restricted quadtree. The proposed algorithm is more general than the previous results of Anguh [IEEE Trans. Signal Processing 45 (1997) 2896] and Philips [IEEE Trans. Signal Processing 47 (1999) 2059] since in their restricted quadtree format, each quadrant is of constant grey value.2001 Elsevier Science B.V. All rights reserved.

Keywords: Algorithms; Fourier transform; Gouraud shading; Quadtree; Compressed image

1. Introduction

Suppose we have one grey image with size 2n× 2n (= N × N). In [2,6], the Fourier transform on the image can be performed in O(N2log N ) time. In [1, 5], the N× N image is first partitioned into 2s× 2s (= S × S) squares, s  n, where each square is of size 2n−s× 2n−s and each pixel within the square has the same grey level. Using the subsampling technique, the subsampled image with size 2s×2sis called the image in the restricted quadtree format [1,5]. Although both authors present two different algorithms for Fourier *Corresponding author, supported by NSC89-2213-E011-062.

E-mail addresses: klchung@cs.ntust.edu.tw (K.-L. Chung),

ganboon@csie.ntu.edu.tw (W.-M. Yan). 1Supported by NSC87-2119-M002-006.

transform, their efficient algorithms have the same time complexity, say O(S2log S+ N2). In their

com-pressed image domain, the constructed quadtree is re-stricted and is a complete quadtree. The experimental results [3] reveal that combining the quadtree struc-ture and Gouraud shading technique [4] has a better compression effect. That is, given the same grey image of size N× N, we have K  S when comparing the compressed image with size K× K in the restricted quadtree and shading format and the compressed im-age with size S× S in the restricted quadtree format. The motivation of this research is to design an efficient algorithm for performing the Fourier transform on the compressed image in the restricted quadtree and shad-ing format. Since the compressed domain considered in this research is different from that in the previous 0020-0190/01/$ – see front matter 2001 Elsevier Science B.V. All rights reserved.

(2)

algorithms [1,5], our proposed algorithm is different from the previous algorithms.

Under the compressed image in restricted quadtree and shading format, this paper presents an efficient algorithm for the Fourier transform and the proposed algorithm takes O(K2log K+N2) time. The proposed

algorithm has the same time complexity as that in the previous algorithms [1,5], but the compressed image domain is more general than in the previous algorithms. However, the compressed image in the restricted quadtree and shading format considered in this paper is a special case of the one in quadtree and shading format [3]. In [3], the constructed quadtree may be incomplete and it is still an open problem to design an efficient algorithm for Fourier transform on such a compressed image.

2. The compressed image in restricted quadtree and shading format

Following the shading concept used in [3], the given image is first augmented by duplicating the original last column and the original last row to become of size (N+ 1) × (N + 1). Then the augmented image is partitioned into 2k× 2k= K × K overlapping ho-mogeneous squares, i.e. subimages, as few as possible, where each square is of size (2n−k+1)×(2n−k+1) =

(M + 1) × (M + 1). Here, N = K × M. For each

square, we only save the grey levels of its four cor-ners. Each corner’s grey level of one square is shared by the neighboring three corners in the neighboring squares. Thus, any homogeneous square shares its top edge with the northern homogeneous square’s bottom edge, and so on. The formal definition of a homoge-neous square [3] will be given in next paragraph. Us-ing Gouraud shadUs-ing method [4], the grey levels of the pixels within one square can be interpolated using the the four corners’ grey levels of that square. When compared to the compressed image in quadtree for-mat [1,5], the purpose of making the blocks overlap can alleviate the blockiness effect [3] when employ-ing the shademploy-ing technique and leads to better image quality. Throughout this paper, the subsampled image in the restricted quadtree and shading format is called the subsampled image without confusion.

In one subimage, we know that there are four corners, namely, the left-bottom corner, the

bottom corner, the left-upper corner, and the right-upper corner. The grey levels of the pixels within one square can be interpolated using the the four corners’ grey values at positions (x1, y1), (x2, y1), (x1, y2), and (x2, y2) associated with four grey levels are g1,

g2, g3, and g4, respectively. Here, x2= x1+ M and

y2= y1+ M. The estimated grey level of the pixel at

(x, y) within the subimage is calculated as f (x, y)= g5+ g6− g5 y2− y1 (y− y1), (1) where g5= g1+ g2− g1 x2− x1 (x− x1) and g6= g3+ g4− g3 x2− x1 (x− x1).

Given a specified error tolerance ε, if the image quality condition

g(x, y)− f (x, y) ε

holds for all the estimated pixels at position (x, y) in the subimage, x1 x < x2and y1 y < y2, then the subimage, i.e., square, is homogeneous. Here, g(x, y) denotes the real grey level of the pixel at position

(x, y). The resulting subsampled image consists of all

these homogeneous squares. From Eq. (1), we have

f (x, y)= c0+ c1(x− x1)+ c2(y− y1) + c3(x− x1)(y− y1), (2) where c0 = g1, c1 = g2− g1 x2− x1 , c2 = g3− g1 y2− y1 , and c3 = g4− g3− g2+ g1 (x2− x1)(y2− y1) .

Using the above restricted quadtree and shading approach to compress the given image with size N×

N , we obtain the compressed subsampled image with

size K× K. Among these K × K squares, for each square, only four corners’ grey values are required to be stored. Totally there are 4K2 grey values to be stored and these 4K2 grey values will be used as the input of our proposed algorithm for the Fourier

(3)

transform. Following the same assumption in [1,5], we omit the preprocessing time for preparing the subsampled image.

3. The proposed algorithm

For convenience, we let 0 kx, ky< 2k, x1= kxM,

x2= kxM + M, y1 = kyM, and y2 = kyM + M.

According to the Gouraud shading method mentioned in Eq. (1), the grey level f (x1+ lx, y1+ ly), 0

lx, ly< M, at position (x1+ lx, y1+ ly) is interpolated

using the four corners’ grey levels, g1= g(x1, y1),

g2= g(x2, y1), g3= g(x1, y2), and g4= g(x2, y2). Since x2− x1= y2− y1= M, by (2) if we let c0(kx, ky)= g1= g(x1, y1), c1(kx, ky)= g2− g1 x2− x1 = g(x2, y1)− g(x1, y1) M , (3) c2(kx, ky)= g3− g1 y2− y1 = g(x1, y2)− g(x1, y1) M , c3(kx, ky)= g4− g3− g2+ g1 (y2− y1)(x2− x1) = g4− g3− g2+ g1 M2 , then we have f (kxM+ lx, kyM+ ly) = f (x1+ lx, y1+ ly) = c0(kx, ky)+ c1(kx, ky)lx + c2(kx, ky)ly+ c3(kx, ky)lxly

for 0 lx, ly < M. Instead of using the original

given image with grey levels g(x, y), the approximate image with grey levels f (x, y) is used to help the computation of the N× N 2D Fourier transform and we have F (u, v)= N−1 x=0 N−1 y=0 f (x, y) exp −2πj(ux + vy) N  .

Associated with the resulting subsampled image, we have F (u, v) = K−1 kx=0 M−1 lx=0 K−1 ky=0 M−1 ly=0 f (kxM+ lx, kyM+ ly) × exp  −2πj[u(kxM+ lx)+ v(kyM+ ly)] N  = K−1 kx=0 K−1 ky=0 M−1 lx=0 M−1 ly=0 f (kxM+ lx, kyM+ ly) × exp  −2πj[u(kxM+ lx)+ v(kyM+ ly)] N  . Let h(kx, ky)= M−1 lx=0 M−1 ly=0 f (kxM+ lx, kyM+ ly) × exp  −2πj[ulx+ vly] N  , then we have F (u, v)= K−1 kx=0 K−1 ky=0 h(kx, ky) × exp  −2πj[ukxM+ vkyM] N  = K−1 kx=0 K−1 ky=0 h(kx, ky) × exp −2πj[uk x+ vky] K  . (4)

Previously, we know that

f (kxM+ lx, kyM+ ly) = c0(kx, ky)+ c1(kx, ky)lx + c2(kx, ky)ly+ c3(kx, ky)lxly. We thus have h(kx, ky) = M−1 lx=0 M−1 ly=0  c0(kx, ky)+ c1(kx, ky)lx + c2(kx, ky)ly+ c3(kx, ky)lxly  × exp  −2πj[ulx+ vly] N  = c0(kx, ky)S0(u, v)+ c1(kx, ky)S1(u, v) + c2(kx, ky)S2(u, v)+ c3(kx, ky)S3(u, v), (5) where S0(u, v) = M−1 lx=0 M−1 ly=0 exp  −2πj[ulx+ vly] N  = M−1 lx=0 exp  −2πjulx N M−1  ly=0 exp  −2πjvly N  ,

(4)

S1(u, v) = M−1 lx=0 M−1 ly=0 lxexp  −2πj[ulx+ vly] N  = M−1 lx=0 lxexp  −2πjulx N M−1  ly=0 exp  −2πjvly N  , S2(u, v) = M−1 lx=0 M−1 ly=0 lyexp  −2πj[ulx+ vly] N  = M−1 lx=0 exp(−2πjulx N ) M−1 ly=0 lyexp  −2πjvly N  , S3(u, v) = M−1 lx=0 M−1 ly=0 lxlyexp  −2πj[ulx+ vly] N  = M−1 lx=0 lxexp  −2πjulx N  × M−1 ly=0 lyexp  −2πjvly N  . Further, let A(t) = M−1 x=0 exp  −2πjtx N  and B(t) = M−1 x=0 x exp −2πjtx N  , then we have S0(u, v) = A(u)A(v), S1(u, v) = B(u)A(v), (6) S2(u, v) = A(u)B(v), S3(u, v) = B(u)B(v).

We now need the following two straightforward and well-known identities to derive the proposed algorithm. Lemma 1. S(r)= M−1 x=0 rx=    1−rM 1−r when r= 1; M when r= 1. Lemma 2. T (r)= M−1 x=0 xrx=      r(1−rM) (1−r)2 − MrM 1−r when r= 1; M(M−1) 2 when r= 1.

From Lemmas 1 and 2, let r= exp(−2πjtN ), then we

have A(t)= S(r) = S  exp −2πjt N  and B(t)= T (r) = T  exp  −2πjt N  .

From Eqs. (5) and (6), we have

h(kx, ky)= c0(kx, ky)S0(u, v)+ c1(kx, ky)S1(u, v) + c2(kx, ky)S2(u, v)+ c3(kx, ky)S3(u, v) = c0(kx, ky)A(u)A(v)+ c1(kx, ky)B(u)A(v)

+ c2(kx, ky)A(u)B(v)+ c3(kx, ky)B(u)B(v).

From Eq. (4), it yields to

F (u, v) = K−1 kx=0 K−1 ky=0 h(kx, ky) exp  −2πj[ukx+ vky] K  = A(u)A(v) K−1 kx=0 K−1 ky=0 c0(kx, ky) exp  −2πj[ukx+ vky] K  + B(u)A(v) K−1 kx=0 K−1 ky=0 c1(kx, ky) exp  −2πj[ukx+ vky] K  + A(u)B(v) K−1 kx=0 K−1 ky=0 c2(kx, ky) exp  −2πj[ukx+ vky] K  + B(u)B(v) K−1 kx=0 K−1 ky=0 c3(kx, ky) exp  −2πj[ukx+ vky] K  . (7) Let C0(u, v) = K−1 kx=0 K−1 ky=0 c0(kx, ky) exp  −2πj[ukx+ vky] K  , C1(u, v) = K−1 kx=0 K−1 ky=0 c1(kx, ky) exp −2πj[uk x+ vky] K  ,

(5)

C2(u, v) = K−1 kx=0 K−1 ky=0 c2(kx, ky) exp −2πj[uk x+ vky] K  , C3(u, v) = K−1 kx=0 K−1 ky=0 c3(kx, ky) exp −2πj[uk x+ vky] K  ,

then from (7), it yields to

F (u, v) = A(v) A(u)C0(u, v)+ B(u)C1(u, v)

 + B(v) A(u)C2(u, v)+ B(u)C3(u, v)

 .

(8) Our proposed algorithm for the Fourier transform as-sociated with the compressed image consists of the following four steps:

Step 1. By Eq. (3), we compute c1(kx, ky), c2(kx, ky),

c3(kx, ky), and c4(kx, ky) for 0 kx, ky< K, this

step takes O(K2) time.

Step 2. We compute the four K× K FFTs, namely,

C0(u, v), C1(u, v), C2(u, v), and C3(u, v) for 0

u, v < K. Applying the conventional K× K FFT

algorithm [2,6] four times, this step takes O(K2log K) time.

Step 3. Compute A(u) and B(u) for 0 u, v < N. From Lemmas 1 and 2, this step takes O(N ) time. In fact, A(v) (B(v)) can be obtained from the value of A(u) (B(u)) directly.

Step 4. From Eq. (8), the Fourier transform

F (u, v) = A(v) A(u)C0(u, v)+ B(u)C1(u, v)

 + B(v) A(u)C2(u, v)+ B(u)C3(u, v)



for 0 u, v < N can be obtained in O(N2) time.

From Step 1 to Step 4, the total time complexity required in the proposed algorithm is O(K2log K+

N2) (= O(K2+ K2log K+ N + N2)). We thus have

the main result.

Theorem 1. On the compressed image in the re-stricted quadtree and shading format, the proposed

al-gorithm can perform the Fourier transform in O(K2log K+ N2) time, where the decompressed grey

image is of size N× N and K denotes the number of nodes in the restricted quadtree.

The proposed algorithm is more general than the previous results [1,5] since in their restricted quadtree format with size S× S, each quadrant is of constant grey value. The experimental results in [3] reveal

K S. This better compression effect implies that the

proposed algorithm may have a computation-saving effect. However, in [3], the constructed quadtree may be incomplete, so it is still an open problem to design an efficient algorithm for the Fourier transform on such a compressed image.

Acknowledgement

We appreciate the referees and the Editor Professor Luc Boasson for their valuable comments that lead to the improved representation of the paper.

References

[1] M. Anguh, Quadtree and symmetry in FFT computation of digital images, IEEE Trans. Signal Processing 45 (12) (1997) 2896–2899.

[2] E.O. Brigham, The Fast Fourier Transform, Prentice-Hall, Englewood Cliffs, NJ, 1974.

[3] K.L. Chung, J.G. Wu, Improved image compression using S-tree and shading approach, IEEE Trans. Commun. 48 (5) (2000) 748–751.

[4] J.D. Foley, A.V. Dam, S.K. Feiner, J.F. Hughes, Computer Graphics, Principle, and Practice, 2nd edn., Addison-Wesley, Reading, MA, 1990.

[5] W. Philips, On computing the FFT of digital images in quadtree format, IEEE Trans. Signal Processing 47 (7) (1999) 2059– 2060.

[6] C. van Loan, Computational Frameworks for the Fast Fourier Transform, SIAM Press, Philadelphia, PA, 1992.

參考文獻

相關文件

• Consider an algorithm that runs C for time kT (n) and rejects the input if C does not stop within the time bound.. • By Markov’s inequality, this new algorithm runs in time kT (n)

• Consider an algorithm that runs C for time kT (n) and rejects the input if C does not stop within the time bound.. • By Markov’s inequality, this new algorithm runs in time kT (n)

Breu and Kirk- patrick [35] (see [4]) improved this by giving O(nm 2 )-time algorithms for the domination and the total domination problems and an O(n 2.376 )-time algorithm for

Although we have obtained the global and superlinear convergence properties of Algorithm 3.1 under mild conditions, this does not mean that Algorithm 3.1 is practi- cally efficient,

In summary, the main contribution of this paper is to propose a new family of smoothing functions and correct a flaw in an algorithm studied in [13], which is used to guarantee

For the proposed algorithm, we establish a global convergence estimate in terms of the objective value, and moreover present a dual application to the standard SCLP, which leads to

For the proposed algorithm, we establish its convergence properties, and also present a dual application to the SCLP, leading to an exponential multiplier method which is shown

Like the proximal point algorithm using D-function [5, 8], we under some mild assumptions es- tablish the global convergence of the algorithm expressed in terms of function values,