二维分数阶Fouirer变换matlab程序

二维分数阶Fouirer变换

1.

作为一位分数阶Fouirer变换的推广,它在图像处理领域有广泛的应用。

它因为其变换核是可分离的,即其二维分数阶的程序可写为:

functionF2D=fracF2D(f2D,ac,ar)

 

[M,N] = size(f2D);

F2D = zeros(M,N);

 

if ac == 0

   F2D = f2D;

else

   for k = 1:N

     F2D(:,k) = frft(f2D(:,k),ac);

   end;

end;

 

 

F2D = conj(F2D');

 

if ar ~= 0

    for k = 1:M

    F2D(:,k) = frft(F2D(:,k),ar);

    end;

end;

 

F2D = conj(F2D');


此方法适用于二维的DFT。

 

 

2.图像的二维分数阶Fourier变换

clear;

close all;

clc;

%s=imread('******.jpg');

tu_bmp=imread('water.jpg','jpg'); 

figure(1);

imshow(tu_bmp); 

 

tu_gray=rgb2gray(tu_bmp); 

map=double(gray(256));  %%数据类型的转换

%host=imread('Lena.bmp');

host=tu_gray;

[M,N]=size(host); 

 

f2D=double(host);

figure(2);

clf;

%%指定灰度值的范围

imshow(abs(f2D),[]); 

 

% step = 0.5;

% max_ar = 1;min_ar = 0;

% max_ac = 1;min_ac = 0;

% AR = (max_ar - min_ar)/step;

% AC = (max_ac - min_ac)/step;

%

% m = sqrt(M);

% n = sqrt(N);

% F2D = m*n*fracF2D(f2D,ac,ar);

% figure(3);

% imshow(abs(F2D)/255);

%

% FFT2 = fftshift(fft2(f2D));

% figure(4);

% imshow(abs(FFT2)/255);

 

F2D = fracF2D(f2D,ac,ar);

%�D1 = 0.5*log10(abs(F2D)+1);

F2D_ph = angle(F2D);

 

figure(3);

imshow(abs(F2D),[]);

figure(4);

imshow(F2D1);

figure(5);

imshow(F2D_ph);

你可能感兴趣的:(分数阶Fourier变换)