<<

Image Compression, Comparison between Discrete Cosine Transform and Fast Fourier Transform and the problems associated with DCT

Imdad Ali Ismaili 1, Sander Ali Khowaja 2, Waseem Javed Soomro 3 1Institute of Information and Communication Technology, University of Sindh, Jamshoro, Sindh, Pakistan 2Institute of Information and Communication Technology, University of Sindh, Jamshoro, Sindh, Pakistan

Abstract - The article focuses on the Image much higher than the calculations mentioned above; this Compression techniques such as. Discrete Cosine Transform increases the bandwidth requirement of the channel which is (DCT) and Fast Fourier Transform (FFT). These techniques very costly. This is the challenging part for the researchers to are chosen because of their vast use in image processing field, transmit theses digital signals through limited bandwidth JPEG (Joint Photographic Experts Group) is one of the communication channel, most of the times the way is found to examples of compression technique which uses DCT. The overcome this obstacle but sometimes it is impossible to send Research compares the two compression techniques based on these digital signals in its raw form. Though there has been a DCT and FFT and compare their results using MATLAB revolution in the increased capacity and decreased cost of software, (GUI). These results are storage over the past years but the requirement of data storage based on two compression techniques with different rates of and data processing applications is growing explosively to out compression i.e. Compression rates are 90%, 60%, 30% and space this achievement.[8] 5%. The technique allows compressing any picture format to JPG format. The result shows that DCT is better technique 2 Fourier Theory than FFT; however the compression results are same as that of Conversion of Time domain or spatial description 30% compression to 5% compression reflecting not i.e. pixel by pixel description of an image into frequency significant change in visual results excepting the file size domain which applies to the entire image is called the Fourier varying to small fraction. The compression technique works Transform. The conversion of frequency domain to the real fine with the images having little noise but the compression space description is called its inverse Fourier Transform. We technique due to its lossy nature don’t work very well in can easily study the function as it is represented as the series medical images such as CT, X-ray etc. of sum of Sines and Cosines but it has a disadvantage of very

complex computation. [4] Keywords: Image Compression, JPEG, Discrete Cosine

Transform, Fast Fourier Transform, Image Processing 3 Discrete Fourier Transform The Discrete Fourier Transform (DFT) is the study 1 Introduction of Fourier analysis of finite-domain discrete time signals. The DFT is central to many kinds of signal processing, including As we can analyze that demand for the analysis of compression of and sound information. data through the mobile network and conveniently accessing DFT requires large number of multiplications and additions the concerned data through mobile services is growing day by for the calculation. For example a 8-point DFT, there are 8 day. In order to make the multimedia data usage efficient and complex multiplications and 7 complex additions, that’s why insidious it is essential that the data representation and DFT is computed efficiently using a Fast Fourier Transform techniques for encoding the data at different platforms or in (FFT) algorithm. [4] all applications should follow the same standard. In all multimedia data categories image data has got the highest 4 Fast Fourier Transform preference because of its usage and lion’s share in terms of the bandwidth consumption for multimedia communication. Due To find the N-DFT of a given sequence, we only to this it is very necessary as well as a challenge for the need to compute the N/2 complex coefficients, while the researchers to develop efficient methods for image second N/2 complex coefficients can be achieved by compression for effective and efficient use of bandwidth. manipulating the data from the first calculation. Hence N- point DFT requires N2 additions. But with Decimation in In spite of many disadvantages of analog Time algorithms, it requires computing two times N/2-point representation of signals compared to digital counterpart, they DFT. Therefore, number of additions required is need smaller number of bits for storage and transmission. For example, a low-resolution quality color video of 36 frames/sec where each frame comprises of 800 x 600 pixels need more than 240 Mbps for storage, so the digitized color (1) video for the duration of 1 hour will almost require 96 Gbps for storage. Similarly, the requirement for the HDTV will be Therefore, the complexity is halved. This is how 8 JPEG Algorithm FFT uses Decimation in Time algorithm to reduce the computational time for DFT computation. So, we can say that Discrete Cosine Transform is the real transform FFT is a faster version of DFT. which makes it more attractive then Fourier Transform. The DCT has excellent energy compaction properties. For a Most of the information is contained in low typical image, most of the visually significant information is frequency components as they are associated with the pattern present in just a few coefficients of the DCT. For this reason, in the image. Details in the image are provided by high the DCT is often used in image compression applications. frequency components, but they are very susceptible to noise DCT is defined for 1-D as well as 2-D signals as shown in which causes spurious effects, it is easier to remove the noise below equations 1 & 4 respectively. in frequency domain by just applying the masks to the image within the frequency domain. Many filters in image processing are based on FFT. (2) 5 Discrete Cosine Transform The transformation of two-dimensional matrix of pixel values into an equivalent matrix of spatial frequency Whereas (3) components can be carried out using a mathematical technique known as the discrete cosine transform (DCT). The transformation operation itself is lossless, apart from some small rounding errors in but once the equivalent matrix of spatial frequency components, known as (4) coefficients, has been derived then any threshold can be dropped. It is only at this point that the operation becomes lossy. (5) 6 Methodology (6) One of the most popular standards used for compression is JPEG standard. It is also known as baseline Where as a(u) is defined as above in equation (3) & (4) and mode or lossy sequential mode which is based on DCT and is u,v=0,1,…..,N-1 adequate for most compression applications, the input and output images are limited to eight bits, while the quantized DCT coefficient values are restricted to 11 bits. The DCT is a mathematical function that transforms image data from the 9 Quantization spatial (pixel by pixel processing) to the frequency domain. In theory, providing the forward DCT is For an M x N image, the spatial domain represents the color computed to a high precision using say, floating point value of each pixel. The frequency domain considers the arithmetic, there is a very little loss of information during the image data as 2-dimensional waveform and represents the DCT phase. Although in practice small losses occur owing to wave form in terms of its frequency components. use of fixed point arithmetic, the main source of information loss occurs during the quantization and entropy encoding 7 Image Processing stages, where the compression takes place.

Image processing is the field in which an image is The sensitivity of the eye varies with spatial processed to extract some of the information or features frequency, which implies that the amplitude threshold below embedded in it. These features or information can be fetched which the eye will detect a particular spatial frequency also by processing photographs or video frames. Digital Image varies. In practice, therefore, the threshold values used vary processing refers to the processing applied on to the digital for each of the 64 DCT coefficients. These are held in a 2- image which contains finite number of elements at a particular dimensional matrix known as the quantization table with the location and value and are referred as Pixel or Picture threshold value to be used with a particular DCT coefficient in elements. Pixel is said to be the smallest element in the image. the corresponding position in the matrix, so the threshold Monochrome images varies in intensity from black to white value is important and in practice it is compromise between and the color image stores 3 numbers for each pixel which are the level of compression that is required and the resulting red, green and blue. amount of information loss that is acceptable.

13 Results Results are shown below in the following figures using DCT and FFT Respectively.

(7)

10 Need for Compression The importance of these compression techniques are discussed above. However there are always preferences to these applications. Bandwidth availability is not the same everywhere, sometimes it is very difficult to arrange the facility or establish a communication network in an area where the infrastructure is not meeting our needs. By allowing such rates of compression we are giving flexibility as to what extent they can bear the loss of information. These areas may include Flood affected areas, areas which are recently struck by a storm etc.

11 Applications Following are the applications in which these Fig. 1 Image Compression using DCT and FFT compression techniques can be used. 1. E-Health Systems 2. Telemedicine 3. Video Conferencing 4. Monitoring and Surveillance These are the major applications where these compression techniques can be used and the need for using is a compulsion because remote areas have limited resources, bandwidth limitation is one of the limited resources which need more financial requirements.

12 Tools To show the results for this compression technique MATLAB i.e. Matrix Laboratory is used. Reason for using this tool is that MATLAB is very popular nowadays in every educational institution and is very sophisticated in use of and design purposes. Results of this research paper uses MATLAB Guide (Graphical user interface) so that is should be user friendly. Fig. 2 Gray Scale Compression using DCT and FFT

TABLE I tolerated in the normal image but in medical imaging loss of information at this extent have no forbearance. So our future Shows the comparison for both techniques with respect to the work is to develop an algorithm for compressing the medical file size images minimal losses or no losses as well as the encryption technique which can be implied to the images.

S. Color Technique Compr- Origi- Compres- N Type ession nal sed Size 15 References o Rate Size [1] Gonzales Rafael C., Woods Richard E. & Eddins Steven L. [Digital Image Processing] 1 RGB DCT 90% 10KB 1.8KB [2] Ahmed, N., Natarajan,T., and Rao, K.R. “Discrete Cosine Transform”, IEEE Trans. , 90-93, Jan1974 2 RGB DCT 60% 10KB 2.94KB

[3] Rao, K.R. and Yip,P. “ Discrete Cosine Transform: 3 RGB DCT 30% 10KB 3.26KB Algorithms, Advantages, Applications” Academic Press, Boston, 1990 4 RGB DCT 5% 10KB 3.27KB [4] Martucci, S.A. “Symmetric convolution and the discrete sine and cosine transforms”, IEEE Trans. Signal Processing 5 RGB FFT 90% 10KB 1.77KB SP-42, 1038-1051(1994).

6 RGB FFT 60% 10KB 2.23KB [5] An anonymous FTP site for more JPEG documentation is : ftp.uu.net/graphics/jpeg/.

7 RGB FFT 30% 10KB 2.97KB [6] Feig,E., Winograd,S., “Fast algorithms for the discrete cosine transform”, IEEE Transactions on Signal Processing 8 RGB FFT 5% 10KB 3.21KB 40 (9), 2174-2193 (1992).

[7] Halsall Fred, [Multimedia Communication], Pearson 9 Grayscale DCT 90% 12KB 1.70KB Publications

10 Grayscale DCT 60% 12KB 2.24KB [8] Acharya, Tinku and Ray, Ajoy K., [Image Processing, Principles and Applications], Wiley Publications 11 Grayscale DCT 30% 12KB 2.32KB [9] Chowdhry,Z.M., Ismaili,I.A. and Baloch,A.K. “Compression Algorithm for Low and High Spatial 12 Grayscale DCT 5% 12KB 2.33KB Frequency Images” Mehran University Research Journal of & Technology, Vol.23, No.3, (July 2004) 13 Grayscale FFT 90% 12KB 1.67KB

14 Grayscale FFT 60% 12KB 1.87KB

15 Grayscale FFT 30% 12KB 2.16KB

16 Grayscale FFT 5% 12KB 2.28KB

14 Conclusion This paper shows the results for JPEG Compression using FFT and DCT implemented in MATLAB Graphical User Interface (GUIDE). This interface has been tested on all types of images but one of the main problems associated with the compression techniques is the blocking technique which breaks the image into block of 8 x 8, 16 x 16 or bigger. The higher the compression ratio is applied these blocks start to become visible which is also said the blocking effect. It can be