그림:Phalaenopsis fft dct.png - 위키백과

# 그림:Phalaenopsis fft dct.png

### 위키백과 ― 우리 모두의 백과사전.

- 그림
- 파일 역사
- 그림 고리

고해상도 버전 보기 (792x2436, 999 KB)

이 자료는 위키미디어 공용에 있습니다. 해당 문서의 자료에 대한 설명이 아래에 있습니다.

## [edit] Summary

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.

## [edit] Licensing

I, the author of this work, hereby publish it under the following licenses:

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".

العربية | Deutsch | English | Español | Français | Italiano | 日本語 | 한국어 | Nederlands | Polski | Português | Slovenčina | Svenska | עברית +/-

| This file is licensed under the Creative Commons Attribution ShareAlike license versions 2.5, 2.0, and 1.0

You may select the license of your choice.

## 그림 고리

다음 문서들이 이 그림을 사용하고 있습니다:

- 이산 코사인 변환

원본 주소 "http://ko.wikipedia.org../../../p/h/a/%EA%B7%B8%EB%A6%BC%7EPhalaenopsis_fft_dct.png_1218.html"

##### Views

- 그림
- 토론
- 현재 버전

##### 찾기