File:Phalaenopsis fft dct.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(792 × 2,436 pixels, file size: 999 KB, MIME type: image/png)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

I used Image:Phalaenopsis_(aka).jpg to create this image. I wanted to show clearly the different behavior between the DFT and the DCT in the frequency domain.

The pictures are made of three other figures. The first one is just the original image: I used its gray-scale version. The second one is the modulus of the DFT; the third one the modulus of the DCT.

I just wanted to give an idea of how they work, so I introduced some modifications in the code to make the differences clearer. I normalized both transforms using the same scale (the one related to the DCT), so that they could be easily compared. That is why I had to cut out some out-of-range values in the DFT. Moreover I calculated the square of each term in both the transforms: this way the dark pixels look darker and the bright ones look brighter. This way it is easy to see how the energy in the DCT is more concentrated in the lower frequency than the DFT.

Here is the Matlab code I used to create the three images:

% read the image
RGB = imread('Phalaenopsis_(aka).jpg');
% convert pixels to the [0 1] range
RGB = im2double(RGB);
% convert to grayscale
I = rgb2gray(RGB);
% evaluate DFT (using log scale)
F = log(abs(fft2(I)));
% evaluate DCT (using log scale)
C = log(abs(dct2(I)));
% normalize C:
immin = min(C(:));
immax = max(C(:));
C = (C - immin)/(immax - immin);
% normalize F using the same scale as C 
F = (F - immin)/(immax - immin);
F(find(F>immax)) = 1;
F(find(F<immin)) = 0;
% evaluate the square of each term
% (to make dark darker and bright brighter)
F = F.*F;
C = C.*C;
% save outputs
imwrite(I,'flower_original.png');
imwrite(F,'flower_fft.png');
imwrite(C,'flower_dct.png');

Then I put the three output images all together using Gimp.

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
This licensing tag was added to this file as part of the GFDL licensing update.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 2.5 Generic, 2.0 Generic and 1.0 Generic license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
You may select the license of your choice.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:39, 18 November 2005Thumbnail for version as of 11:39, 18 November 2005792 × 2,436 (999 KB)Alejo2083 (talk | contribs) I used Image:Phalaenopsis_(aka).jpg to create this image. I wanted to show clearly the different behavior between the DFT and the DCT in the frequency domain. The pictures is made of three other figures. The first one is just the original image: I

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: