0

I have a image and in my homework I must calculate fourier transform of it and recover it by 3 different value

  • with min of magnitude values
  • with median of magnitude values with 25%
  • percentage of magnitude values

my main picture is

enter image description here

and after run my script

enter image description here

I=imread('image number one.bmp');
gI=rgb2gray(I);
imafft = fft2(single(gI));
% Gets magnitude and phase.
 mag = abs(imafft);
 phi = angle(imafft);
 % Generates the modified spectrum
 magvector=mag(:);
 myones=ones(size(mag));
 percent25 = prctile(magvector,25);
 minfft = min(magvector).*exp(i*phi);
 medianfft = myones .* median(magvector).*exp(i*phi);
 percentfft = myones.*percent25.*exp(i*phi);
 figure;
 subplot(131);
 imagesc(abs(ifft2(minfft)));
 title('with min of magnitude');
 subplot(132);
 imagesc(abs(ifft2(medianfft)));
 title('with median of magnitude');
 subplot(133);
 imagesc(abs(ifft2(percentfft)));
  colormap(gray);
 title('with 25 percentage of magnitude');

Is my result correct and recovering image with min and median and 25% of magnitude are similar each other?

my main question and problem is really how I calculate median of magnitude?

apreciate any help

Yuseferi
  • 7,931
  • 11
  • 67
  • 103
  • I think you may try some benefit from this thread: http://stackoverflow.com/questions/9342602/calculate-median-image-in-matlab – fpe May 17 '13 at 15:06
  • @fpe I need implement of it exactly, do u know How can I achieve this job? – Yuseferi May 17 '13 at 16:17

0 Answers0