Download presentation
Presentation is loading. Please wait.
1
Digital Image Processing Final Project Compression Using DFT, DCT, Hadamard and SVD Transforms Zvi Devir and Assaf Eden
2
The project’s criterions A.The Applied transform. B.The size of the blocks the image is divided to. C.The quality of the compression. D.Adaptive compression (later)
3
The DFT Transform n The 2D Discrete Fourier Transform (DFT) is defined by: n The 2D Discrete Fourier Transform (DFT) is defined by: n The transform is linear and separable. It maps a real function (matrix) f(x,y) into a complex phase plane u,v - denoted F(u,v). n The inverse transform is: n Can be calculated with O (n² log n).
4
The DCT Transform n The Discrete Cosine Transform (DCT) is defined as: N is the vector size n Unlike the DFT matrix, the DCT matrix is real and orthogonal. That is n The DCT transform can be calculated in O (n² log n). n The property of the DCT matrix together with the fact that it is a fast transform has made it useful substitute for the KL transform of highly correlated first order Markov sequences.
5
The Hadamard Transform n The Hadamard transform is defined by the sorted Hadamard matrix. n The Hadamard matrix has only binary values of ±1. n The Hadamard matrices are defined recursively: n The sorted Hadamard matrix can be calculated recursively too. n The Hadamard transform is real symmetric and orthogonal. That is n The transform can be calculated in O (n² log n).
6
Compression Using DCT, DFT and Hadamard n After transforming the image to the Phase plane, the significant data is given in a bounded area. n Our compression methods takes only the part that is significant and ignore the insignificant pixels (of the phase plane).
7
The SVD Transform (For Comparison) n The Single Value Decomposition (SVD) of a matrix is the factorization of Where U and V are orthogonal matrices and is a diagonal sorted real matrix. n No fast algorithm...
8
Compression using SVD n When we use SVD for compression we take the singular values and work with them in our matrix. n The importance of the SVD is that the solution it provides for an image approximation by separable basis images.
9
Implementation of DFT, DCT and Hadamard n Transforming the given image to the phase plane. n Sample a part of the transformed image: –DFT - Taking rectangles near the four corners. –DCT and Hadamard - Taking triangle from the top left corner. n Transforming the image back.
10
Discrete Fourier Transform Discrete Cosine Transform Hadamard Transform
11
Our Implementation for the Transformations n First we wrote a 1D version for each of the three transformation. n Then we implemented a 2D versions of the transforms using the 1D versions. n We also used a matrix multiplication for the transforms, since the original versions were too slow... n In the actual implementation we used Matlab’s fft2() and ifft2() functions for DFT, and pre-calculated matrices for DCT and Hadamard. n Using the pre-calcualated matrices is much faster since a 2D tranform is only a multiplication of three matrices.
12
Using Adaptive Compression n In this algorithm we will find out how much we should cut from each block so most of the image is maintained. n From Parseval theorem, We can measure the error in the phase plane.
13
Using Adaptive Compression n Using the MSE of each block for each ratio, we can decide how much to compress the block. n We increment the MSE wage for the first steps.
14
Conclusions n After making some tests we found out that the DCT transform work better, on equal ratio, then the other transforms. Works best for correlated data. n Hadamard is useful for small block sizes. n When using DFT, the blocks are noticeable. Therefore we might consider using larger blocks the overlaps. n DCT, Hadamard and SVD handle sharp borders better than DFT.
15
Conclusions (continued) n Adaptive compression with DFT or DCT does not handle well sharp edges. n The smaller the block size, the adaptive compression gives better results.
16
Additional Directions n Other methods for reducing image size –Quantization –Other masks n Testing results on blocks with adaptive size (Like quadtree subdivision). n Checking different methods that were not discussed here. –Haar, Slant, KL... –Actually any orthonormal base
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.