You are on page 1of 3

Bieu dien anh thanh anh bien do va pha: Code :

% ShowMagPhaseRecon % find magnitude-only and phae-only reconstructions function y=imrawread(filename,width,height) % Ns=[Nv Nh] fid=fopen('Lena.raw ','r'); y=(fread(fid,[256 256],'short'))'; fclose(fid); subplot(1,3,1);title('anh goc'); imshow(y);TITLE('ANH GOC ');pause(0.1); % Find DFT spectrum V=fft2(y); subplot(1,3,2); title('DFT Mag'); imshow(log(abs(fftshift(V)))+1,[]); title('DFT Mag'); pause(0.1); subplot(1,3,3); imshow(angle(fftshift(V)),[]); title('DFT Phase'); pause(0.1); % Find magnitude-only reconstruction U_mag=real(ifft2(abs(V))); figure; imshow(normalization(U_mag,80,50),[0 255]); title('Magnitude-Only Reconstruction'); % Find phase-only reconstruction U_pha =real(ifft2(exp(j*angle(V)))); figure; imshow(normalization(U_pha,80,50),[0 255]); title('Phase-Only Reconstruction');

ket qua: 1.phan tich anh thanh 2 thanh phan bien do va pha:

2. khoi phuc anh theo bien do va pha: A.theo bien do:

b.khoi phuc anh theo pha :

Nhn xt: thnh phn pha cha gn nh dy thng tin ca nh ,con thnh phn pha mang t thng tin ca nh.

You might also like