[go: up one dir, main page]

0% found this document useful (0 votes)
158 views4 pages

Discrete Cosine Transform: A General Algorithim For DCT Compression With This Class

1) The DCT transforms a signal from the spatial domain to the frequency domain, allowing for image compression by removing spatial redundancies. 2) It separates images into differing frequency components, quantizing and discarding less important frequencies to concentrate data. 3) Reconstruction involves dequantization by multiplying quantized DCT coefficients with the quantization matrix, followed by inverse DCT to retrieve the original image with some possible distortion.

Uploaded by

deddy_ariesandy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views4 pages

Discrete Cosine Transform: A General Algorithim For DCT Compression With This Class

1) The DCT transforms a signal from the spatial domain to the frequency domain, allowing for image compression by removing spatial redundancies. 2) It separates images into differing frequency components, quantizing and discarding less important frequencies to concentrate data. 3) Reconstruction involves dequantization by multiplying quantized DCT coefficients with the quantization matrix, followed by inverse DCT to retrieve the original image with some possible distortion.

Uploaded by

deddy_ariesandy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Discrete Cosine Transform

The DCT is a mathematical transformation that takes a signal and transforms it from spatial domain
into frequency domain. Many digital image and video compression schemes use a block-based DCT,
because this algorithm minimizes the amount of data needed to recreate a digitized image. In
particular, JPEG and MPEG use the DCT to concentrate image information by removing spatial data
redundancies in two-dimensional images.

The DCT works by separating images into parts of differing frequencies. During a step called
quantization, where part of compression actually occurs, the less important frequencies are
discarded. Then, only the most important freqencies that remain are used to retrieve the image in
the decompression process. As a result, reconstructed images may contain some distortion.

A general algorithim for DCT compression with this class:

1) Create a DCT Object.


2) Set up your program to read pixel information in 8*8 blocks.
3) Run the forwardDCT() on all blocks, working from left to right, top to bottom.
4) Run the quantitizeImage() on all blocks (the compression).
5) (optional) Run entropy encoder to see how much compression is obtained.
6) The array of compressed blocks that constitute the image is stored.

The Process in General

Original Image Image Division in DCT


8 x 8 blocks

Compressed Image Entropy Encoder Quantizer


Doing the DCT on 8x8 block

DCT is designed to work on pixel values ranging from


-128 to 127, so we need to substract 128 from each
entry. Then now we can perform Discrete Cosine
Transform which is accomplished by matrix multiplication D = TMT’. Matrix D is the result or we can
say the DCT coefficients.

Quantization

Quantization is achieved by dividing each element in the transformed image matrix D by the
corresponding element in the quantization matrix, and then rounding to the nearest integer value.
As for quantization, we can choose the quality range from 1 (the poorest quality, best compression)
to 100 (best quality, worst compression). In here i use quality 50.

Di , j
Ci , j =round
( )
Qi, j
A general algorithim for DCT decompression with this class:

1) Create a DCT Object.


2) Set up the program to convert compressed data in 8*8 blocks. (if compressed)
3) Run the data through dequantitizeImage().
4) Run the data through inverseDCT().

Reconstruction begins by decoding the bit stream representing the quantized matrix C and multiply
with the corresponding element of quantization matrix originally used. This is what we call
dequantitize process.

Ri, j=Qi , j ×Ci , j

After that we apply the Inverse DCT to matrix R, round the to the nearest integer and add 128 to
each element.

N=round (T ' RT ) +128

Original Image Compressed using DCT

You might also like