Created
May 15, 2012 21:09
-
-
Save semihozkoroglu/2705163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [compres, J] = four(image,oran) | |
I = imread(image); | |
J = I; | |
[R C L] = size(I); | |
for i = 1:L | |
inversF = zeros(R,C); | |
imF = fftshift(fft2(double(I(:,:,i)))); | |
compres(:,:,i) = imF(oran:(R-oran),oran:(C-oran)); | |
inversF(oran:(R-oran),oran:(C-oran),1) = compres(:,:,i); | |
inversF = real(ifft2(ifftshift(inversF))); | |
J(:,:,i) = uint8(inversF); | |
end | |
%% Kullanımı | |
% ---------- | |
% [compres, J] = four('football.jpg',110); | |
% whos compres --> fourier'i alınmış bir kesit'in boyunu öğrenmek için. | |
% imshow(J,[]) --> fourier çözümlemesinden geçmiş olan resim. | |
% whos J --> çözümlenmiş resmin boyu girdi resmi ile aynı boyuta sahip. | |
% | |
%% Açıklama | |
% --------- | |
% Resmin fourier'i alınır ve girilen oran ölçüsünde dc bileşeni orta nokta olacak şekilde bir kesit alınır. | |
% bu durumda yüksek frekanslı kısımlar göz ardı edilir buda bizim sıkıştırma işlemimize denk gelmektedir. | |
% çözümleme aşamasında compres değişkeni girdi resmi boyutuna tekrar oturtulup ters fourier'i alınır. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment