1、外文翻译利用离散余弦变换进行图像压缩中文4500字Image Compression Using the Discrete Cosine TransformAbstractThe discrete cosine transform (DCT) is a technique for converting a signal into elementary frequency components. It is widely used in image compression. Here we develop some simple functions to compute the DCT and
2、to compress images. These functions illustrate the power of Mathematica in the prototyping of image processing algorithms.The rapid growth of digital imaging applications, including desktop publishing, multimedia, teleconferencing, and high-definition television (HDTV) has increased the need for eff
3、ective and standardized image compression techniques. Among the emerging standards are JPEG, for compression of still images Wallace 1991; MPEG, for compression of motion video Puri 1992; and CCITT H.261 (also known as Px64), for compression of video telephony and teleconferencing.All three of these
4、 standards employ a basic technique known as the discrete cosine transform (DCT). Developed by Ahmed, Natarajan, and Rao 1974, the DCT is a close relative of the discrete Fourier transform (DFT). Its application to image compression was pioneered by Chen and Pratt 1984. In this article, I will devel
5、op some simple functions to compute the DCT and show how it is used for image compression. We have used these functions in our laboratory to explore methods of optimizing image compression for the human viewer, using information about the human visual system Watson 1993. The goal of this paper is to
6、 illustrate the use of Mathematica in image processing and to provide the reader with the basic tools for further exploration of this subject.The One-Dimensional Discrete Cosine TransformThe discrete cosine transform of a list of n real numbers s(x), x = 0, ., n-1, is the list of length n given by:s
7、(u)= C(u) u=0,nwhere for u=0 =1 otherwiseEach element of the transformed list S(u) is the inner (dot) product of the input list s(x) and basis vector. The constant factors are chosen so that the basis vectors are orthogonal and normalized. The eight basis vectors for n = 8 are shown in Figure 1. The
8、 DCT can be writthe product of a vector (the input list) and the n x n orthogonal matrix whose rows are the vectors. This matrix, for n = 8, can be computed as follows:DCTMatrix =Table If k=0,Sqrt1/8,Sqrt2/8 CosPi (2j+1) k/16 ,k,0,7,j,0,7 / N;We can check that the matrix is orthogonal:DCTMatrix . Tr
9、ansposeDCTMatrix / Chop / MatrixForm1. 0 0 0 0 0 0 00 1. 0 0 0 0 0 00 0 1. 0 0 0 0 00 0 0 1. 0 0 0 00 0 0 0 1. 0 0 00 0 0 0 0 1. 0 00 0 0 0 0 0 1. 00 0 0 0 0 0 0 1.Each basis vector corresponds to a sinusoid of a certain frequency:ShowGraphicsArrayPartitionListPlot#, PlotRange - -.5, .5, PlotJoined
10、- True, DisplayFunction - Identity& / DCTMatrix, 2 ;Figure 1. The eight basis vectors for the discrete cosine transform of length eight.The list s(x) can be recovered from its transform S(u) by applying the inverse cosine transform (IDCT):= x=0,nwhere for u=0 =1 otherwiseThis equation expresses s as
11、 a linear combination of the basis vectors. The coefficients are the elements of the transform S, which may be regarded as reflecting the amount of each frequency present in the inputs.We generate a list of random numbers to serve as a test input:input1 = TableRandomReal, -1, 1, 80.203056, 0.980407,
12、 0.35312, -0.106651, 0.0399382, 0.871475, -0.648355, 0.501067The DCT is computed by matrix multiplication:output1 = DCTMatrix . input10.775716, 0.3727, 0.185299, 0.0121461, -0.325, -0.993021, 0.559794, -0.625127As noted above, the DCT is closely related to the discrete Fourier transform (DFT). In fa
13、ct, it is possible to compute the DCT via the DFT (see Jain 1989, p. 152): First create a new list by extracting the even elements, followed by the reversed odd elements. Then multiply the DFT of this re-ordered list by so-called twiddle factors and take the real part. We can carry out this process
14、for n = 8 using Mathematicas DFT function.DCTTwiddleFactors = N Join1, TableSqrt2 Exp-I Pi k /16, k, 71., 1.38704 - 0.275899 I, 1.30656 - 0.541196 I, 1.17588 - 0.785695 I, 1. - 1. I, 0.785695 - 1.17588 I, 0.541196 - 1.30656 I, 0.275899 - 1.38704 IThe function to compute the DCT of a list of length n
15、 = 8 is then:DCTlist_ := Re DCTTwiddleFactors *InverseFourierNlist1, 3, 5, 7, 8, 6, 4, 2Note that we use the function InverseFourier to implement what is usually in engineering called the forward DFT. Likewise, we use Fourier to implement what is usually called the inverse DFT. The function N is used to convert integers to reals because (in Version 2.2) Fourier and InverseFourier are not evaluated numerically when their arguments are all integers. The special case of a list of zeros needs to be handled separately by overloading the functions, since N of the integer 0
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1