This document discusses image compression using the discrete cosine transform (DCT). It introduces the 1D and 2D DCT, showing how the 1D transform can be applied row-wise and column-wise to create the 2D version. Code examples are provided to compute the DCT of an image, set low-value coefficients to zero for compression, and reconstruct the image using the inverse DCT. The document demonstrates how the DCT decomposes an image into frequency components and how most visual information can be retained by keeping only the most significant coefficients.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online from Scribd
(Typological Studies in Language 66) Maya Hickmann (Ed.), Stéphane Robert (Ed.) - Space in Languages - Linguistic Systems and Cognitive Categories-John Benjamins Publishing Company (2006)
This document discusses image compression using the discrete cosine transform (DCT). It introduces the 1D and 2D DCT, showing how the 1D transform can be applied row-wise and column-wise to create the 2D version. Code examples are provided to compute the DCT of an image, set low-value coefficients to zero for compression, and reconstruct the image using the inverse DCT. The document demonstrates how the DCT decomposes an image into frequency components and how most visual information can be retained by keeping only the most significant coefficients.
This document discusses image compression using the discrete cosine transform (DCT). It introduces the 1D and 2D DCT, showing how the 1D transform can be applied row-wise and column-wise to create the 2D version. Code examples are provided to compute the DCT of an image, set low-value coefficients to zero for compression, and reconstruct the image using the inverse DCT. The document demonstrates how the DCT decomposes an image into frequency components and how most visual information can be retained by keeping only the most significant coefficients.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online from Scribd
This document discusses image compression using the discrete cosine transform (DCT). It introduces the 1D and 2D DCT, showing how the 1D transform can be applied row-wise and column-wise to create the 2D version. Code examples are provided to compute the DCT of an image, set low-value coefficients to zero for compression, and reconstruct the image using the inverse DCT. The document demonstrates how the DCT decomposes an image into frequency components and how most visual information can be retained by keeping only the most significant coefficients.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online from Scribd
Nguyen Duy Tien Ngo Duc Thanh Image Compression Using the DCT Image Compression Using the Discrete Cosine Transform • Abstract The discrete cosine transform (DTC) is a technique for converting a signal into elementary frequency components. It is widely used image compression. Here we develop some simple functions to compute the DCT and compress images. These functions illustrate the power of Matlab in the prototyping of image processing algorithms
Image Compression Using the DCT
The one-Dimensional Discrete Cosine Transform • The One-Dimensional Discrete Cosine Transform The Discrete Cosine Transform of a list of n real number x(n), n=1…N, is the list of length N given by: N (2n 1)(k 1) y(k) w(k) x(n)cos( ) (k 1...N) n1 2N where: 1 if k 0 N w(k ) 2 otherwise N Image Compression Using the DCT The one-Dimensional Discrete Cosine Transform • The example x=50sin(2pi*t/40); X=dct(x); plot(t,x,t,X);legend('x(t)',DCt(x));
Image Compression Using the DCT
The one-Dimensional Discrete Cosine Transform • The example Find how many DCT coefficients represent 99% of the energy in a sequence: x = (1:100) + 50*cos((1:100)*2*pi/40); X = dct(x); [XX,ind] = sort(abs(X)); ind = fliplr(ind); i = 1; while (norm([X(ind(1:i)) zeros(1,100-i)])/norm(X)<.99) i = i + 1; end % i = 3
Image Compression Using the DCT
The Two-Dimensional Discrete Cosine Transform • The One-Dimensional DCT is useful in processing on dimensional signals such as speech waveforms. For analysis of two- dimensional (2D) signal such as images, we need a 2D version of the DCT. for an matrix. The DCT-2D is computed in a simply way: The DCT-1D is applied to each row of x and the to each column of the result.
Image Compression Using the DCT
The Two-Dimensional Discrete Cosine Transform • Thus, the transform of x given by: (2m 1) p M 1 N 1 (2n 1)q 0 p M 1 Bpq pq Amn cos( )cos( ) m0 n0 2M 2N 0 q N 1 where: 1 1 , p0 ,q 0 M N p and q 2 2 ,1 p M 1 ,1 q M 1 M N
Image Compression Using the DCT
The Two-Dimensional Discrete Cosine Transform • The example RGB = imread(‘hnen.bmp'); I = rgb2gray(RGB); J = dct2(I); imshow(log(abs(J)),[]), colormap(jet(64)), colorbar;
Image Compression Using the DCT
The Two-Dimensional Discrete Cosine Transform Now set values less than magnitude 10 in the DCT matrix to zero, and then reconstruct the image using the inverse DCT function idct2. J(abs(J) < 10) = 0; K = idct2(J); imshow(I) figure, imshow(K,[0 255]);
(Typological Studies in Language 66) Maya Hickmann (Ed.), Stéphane Robert (Ed.) - Space in Languages - Linguistic Systems and Cognitive Categories-John Benjamins Publishing Company (2006)