View Single Post
  #30  
Old 08-08-07, 00:52
robski robski is offline
Senior Member
 
Join Date: Dec 2005
Location: Kent UK
Posts: 3,739
Default

The first 3 attachments show the effect of the Discrete Cosine Transform (DCT) on 3 different samples of 8 x 8 pixel image data. Each attachment shows 3 tables. The upper table is the original 8 x 8 image data. The middle table shows the DCT terms after the transform. Note quantization has not been applied. The lower table show the results of the reverse DCT which is used to restore the image data. For the purposes of producing a compact table I have only displayed the results to one decimal place. Very small errors of 0.001 are seen when between original and restored if displayed to 3 decimal places. Which goes to show that Forward and Reverse DCT does produce faithful results if quantization is not applied. The positive terms in the DCT table are the addition of a frequency component and the negative terms are the subtraction of a frequency component. The first term is the DC component.

The fourth attachment shows the zig-zag collection of the AC terms after quantization. With small magnitudes at higher frequencies the greater chance of getting longer runs of zeros with zig-zag scanning for the run length compression.

The first attachment uses an image with a vertical grey bar. Looking at the DCT terms we can see that only horizontal frequency terms (components) are produced. No terms are seen down the table. Which follows as the vertical brightness levels in the image are constant.

The second attachment uses an image with a horizontal grey bar. Looking at the DCT terms we can see that only vertical frequency terms (components) are produced. No terms across the table. Which follows as the horizontal brightness levels in the image are constant.

It is worth noting that after the zig-zag collection of terms there is a long sequence of zero which will be ideal for good run length compression.

The third attachment uses an image with a diagonal grey bar. The DCT table shows both vertical and horizontal frequency terms. Many of the terms are small and after quantization will reduce to zero. It is also worth noting that after the zig-zag collection there are less zero terms.

So the DCT process favours images with strong vertical and horizontal elements over diagonal elements when producing figures for compression. The DCT process does not perform any compression in itself.
__________________
Rob

-----------------------------------------------------
Solar powered Box Brownie Mk2

Captain Sunshine, to be such a man as he, and walk so pure between the earth and the sea.

WPF Gallery
Birdforum Gallery
http://www.robertstocker.co.uk updated

Last edited by robski; 26-07-11 at 22:34.
Reply With Quote