Documente Academic
Documente Profesional
Documente Cultură
DCT
We take some data, image data, we try to represent is as the SUM of lots of these
waves.
Cosine waves can have higher/lower frequencies (based on w)
We weight two different waves at two different frequencies together and this results
in a more complex shaped wave. We are weighting an average.
Increasing the number of cosines, we can increase the number of possible shapes of
waves.
We could change the weighting procedure. We can have different shaped waves.
The higher the frequency of the wave, the higher frequencies were dealing with.
We can get rid of the higher frequency signals, and the general gest of the image
will still be there.
The maths works like this: if we have a signal thats 8 long, we can represent this
with 8 cosine waves of different frequencies.
For an image we do the same, we split each image in 8x8 pixel groups. Each of
those groups is separately encoded with its own DCT. Each of these groups can be
replicated by (64) 8x8 cosine waves.
DCT calculates the coefficients for these waves.
Calculate the contribution of the cosine waves to the image.
Which bits of cosine waves do we need to add together to get the image?
Center all of the values around zero. We take away 128 of every intensity of the
pixel to get [-128,128] instead of [0,255]
Now we can use this in the DCT to calculate the coefficients.
The low frequency DCT will have a much bigger effect than the high frequency data.
AND we see them better. Thats how we compress JPEG.
The coefficients that we calculate are an indication of the weight of every cosine
wave.
We have DC (Dirrect current) coefficient, AC coefficients.
Has the highest coefficient.
In practice, DC coefficients are stored seperately.
The high freq cosine waves dont really contribute to the image.
So what we see is that the high freq components have a lower coefficient, they have
a really low impact on the eventual image.
Thats what we do in JPEG. We take away the high frequency components.
Removing this is done through quantization.
We have a standard JPEG quantization table that we use.
This represents a quality of 50%.
We divide everyone of the coefficients by the corresponding quantization values and
round it to the nearest integer.
Almost all of over frequency coefficients are now set to zero, except the lower
frequency ones on the top left.